/* =========================================================================
   Кладовая 38 — стили мини-приложения
   Палитра: тёплая бумага, тёмная зелень, амбарный акцент.
   ========================================================================= */

:root {
  --bg: #f7f4ee;
  --bg-2: #f1ece2;
  --card: #ffffff;
  --card-2: #fbf9f4;
  --text: #1d1c19;
  --muted: #78736a;
  --line: #e6e0d4;
  --line-strong: #d7cfc0;

  --brand: #1f5c45;
  --brand-2: #174634;
  --brand-soft: #e7f1eb;
  --brand-ink: #fffdf8;

  --accent: #c9772a;
  --accent-soft: #fbefdd;

  --warn: #9c651a;
  --warn-soft: #fbf0dc;
  --danger: #ad3a26;
  --danger-soft: #fbe9e4;
  --ok: #2c7a50;
  --ok-soft: #e6f2ea;
  --link: #2a6fd0;

  --shadow-sm: 0 1px 2px rgba(30, 28, 24, .05);
  --shadow: 0 2px 4px rgba(30, 28, 24, .04), 0 14px 34px -20px rgba(30, 28, 24, .35);
  --radius: 20px;
  --radius-sm: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131512;
    --bg-2: #1a1d19;
    --card: #1d211c;
    --card-2: #232821;
    --text: #eeebe4;
    --muted: #a29c92;
    --line: #2f352e;
    --line-strong: #414a3f;

    --brand: #7cc0a0;
    --brand-2: #5fa584;
    --brand-soft: #1f2f27;
    --brand-ink: #08150e;

    --accent: #e2a45c;
    --accent-soft: #33271a;

    --warn: #e2b06a;
    --warn-soft: #342818;
    --danger: #f09a86;
    --danger-soft: #3a1f1a;
    --ok: #8ed0a8;
    --ok-soft: #1c2f24;
    --link: #84b6ff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 18px 40px -24px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(31, 92, 69, .10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, p { margin-top: 0; }

a { color: var(--link); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Каркас ---------- */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background .2s, border-color .2s;
}

@supports (backdrop-filter: blur(10px)) {
  .topbar {
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
    border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent);
  }
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px -8px rgba(23, 70, 52, .9);
}

.brand-mark svg { width: 21px; height: 21px; }

.brand-text { min-width: 0; line-height: 1.2; }
.brand-text b { display: block; font-size: 15px; letter-spacing: .005em; }
.brand-text i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}

.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn[hidden] { display: none; }

.screen {
  flex: 1;
  padding: 18px 16px calc(118px + env(safe-area-inset-bottom));
}

.wrap { max-width: 640px; margin: 0 auto; }
.form-wrap { max-width: 640px; margin: 0 auto; }

/* ---------- Нижняя навигация ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  width: min(440px, calc(100vw - 24px));
  display: flex;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 12px 34px -14px rgba(20, 25, 20, .4);
  transition: opacity .2s, transform .2s;
}

body.sheet-open .tabbar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(14px);
}

@supports (backdrop-filter: blur(10px)) {
  .tabbar {
    background: var(--card);
    background: color-mix(in srgb, var(--card) 86%, transparent);
    backdrop-filter: blur(18px);
  }
}

.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px 6px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.tab svg { width: 21px; height: 21px; }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--brand-soft); color: var(--brand); }

.tab-icon-wrap { position: relative; display: grid; place-items: center; }

.tab-badge {
  position: absolute;
  top: -4px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}

.btn:active { transform: scale(.985); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 12px 24px -14px rgba(23, 70, 52, .9);
}
.btn-primary:hover { background: var(--brand-2); }

.btn-lg { min-height: 56px; padding: 15px 22px; border-radius: 16px; font-size: 17px; }
.btn-sm { min-height: 38px; padding: 8px 13px; border-radius: 11px; font-size: 13.5px; }
.btn-block { width: 100%; }

.btn-subtle {
  background: var(--bg-2);
  border-color: var(--line);
}
.btn-subtle:hover { background: var(--card-2); border-color: var(--line-strong); }

.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-2); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ---------- Главная ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 22px 22px;
  border-radius: 24px;
  color: #f6f1e6;
  background: linear-gradient(155deg, #26684e 0%, #1b4d39 46%, #123526 100%);
  box-shadow: 0 26px 54px -30px rgba(18, 53, 38, .95);
}

.hero::before {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(214, 168, 92, .38), transparent 66%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(246, 241, 230, .16);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(246, 241, 230, .68);
  margin-bottom: 10px;
}

.hero h1 {
  max-width: 15ch;
  margin: 0 0 10px;
  font-size: clamp(25px, 6.4vw, 32px);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.hero p {
  max-width: 34ch;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(246, 241, 230, .78);
}

.hero .btn {
  width: 100%;
  background: #f7f2e7;
  color: #143a2a;
  box-shadow: 0 14px 26px -16px rgba(0, 0, 0, .8);
}
.hero .btn:hover { background: #fffdf8; }

.hero-stats {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 12px;
  color: rgba(246, 241, 230, .68);
}

.hero-stats b { color: #fff; font-weight: 700; }

.draft-card {
  margin-top: 18px;
  padding: 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.draft-card-head { display: flex; align-items: center; gap: 10px; }

.draft-card-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}
.draft-card-icon svg { width: 20px; height: 20px; }

.draft-card-title { display: block; font-size: 15px; line-height: 1.3; }
.draft-card-time { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }

.draft-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 12px 0 4px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
}

.draft-meta { font-size: 12px; color: var(--muted); }

.draft-actions { display: grid; gap: 6px; margin-top: 12px; }
.draft-discard { margin: 0 auto; }

.note {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 16px;
  background: var(--accent-soft);
}

.note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--accent); }
.note b { font-size: 13.5px; }
.note p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.commercial-note { margin: 0 0 14px; }
.commercial-note > div { min-width: 0; }

.commercial-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.commercial-link:hover { text-decoration: underline; }

.link-btn {
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }

/* ---------- Заголовки и карточки ---------- */

.page-head { margin: 4px 0 18px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(23px, 5.5vw, 27px); letter-spacing: -.02em; }
.page-head p { max-width: 48ch; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

.page-head p.page-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: none;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--brand) 24%, transparent);
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.page-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand); }
.page-note span { display: block; }

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

/* ---------- Форма ---------- */

.form-grid { display: grid; gap: 16px; }
.form-main { display: grid; gap: 14px; min-width: 0; }

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.group-head h2 { margin: 0; font-size: 15.5px; letter-spacing: .01em; }

.hint { font-size: 12px; color: var(--muted); }

.label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.label .opt { font-weight: 400; color: var(--muted); }

.input,
.textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--card-2);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.textarea { min-height: 122px; resize: vertical; }

.input:disabled {
  opacity: .55;
  background: var(--bg-2);
  cursor: not-allowed;
}

.input:focus,
.textarea:focus {
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input::placeholder,
.textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }

.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-soft) !important;
}

.field-error { display: block; margin-top: 6px; color: var(--danger); font-size: 12.5px; line-height: 1.35; }
.field-error:empty { display: none; }

.field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.counter { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.field-row { display: grid; gap: 14px; }
@media (min-width: 560px) {
  .field-row--2 { grid-template-columns: 1fr 1fr; }
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.desc-hint {
  margin: 0 0 9px;
}

.desc-hint b {
  color: var(--accent);
  font-weight: 700;
}

.multi-hint b {
  color: var(--accent);
  font-weight: 700;
}

.auto-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--ok);
  font-size: 12.5px;
  line-height: 1.4;
}

.auto-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.contact-field { margin-top: 14px; }

.choice {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}

.choice-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.choice-btn:hover { color: var(--text); }
.choice-btn.is-active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Крупный выбор способа связи — для аудитории 40+ */
.contact-choice {
  display: grid;
  gap: 8px;
}

@media (min-width: 560px) {
  .contact-choice { grid-template-columns: 1fr 1fr; }
}

.contact-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  background: var(--card-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.contact-option:hover { background: var(--card); }

.contact-option.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

.co-radio {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
  transition: border-color .15s, background .15s;
}

.co-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--card);
  transform: scale(0);
  transition: transform .15s;
}

.contact-option.is-active .co-radio {
  border-color: var(--brand);
  background: var(--brand);
}

.contact-option.is-active .co-radio::after { transform: scale(1); }

.co-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-title { font-size: 15.5px; font-weight: 650; line-height: 1.25; }
.co-sub { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.contact-option.is-active .co-sub { color: var(--brand); }

.contact-field { margin-top: 14px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-2);
}

.profile-avatar {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  font-size: 18px;
  font-weight: 700;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.profile-text b { font-size: 14.5px; line-height: 1.3; }
.profile-text span { font-size: 12.5px; color: var(--muted); }

.profile-ok {
  width: 26px;
  height: 26px;
  flex: none;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}
.profile-ok svg { width: 15px; height: 15px; }

.profile-change { display: block; margin: 6px auto 0; }

.setup-box {
  padding: 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--card-2);
}

.setup-box > b { display: block; font-size: 15px; }
.setup-box > p { margin: 4px 0 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.setup-box .label { margin-top: 2px; }

.setup-actions { display: grid; gap: 8px; margin-top: 12px; }

.phone-request { margin-bottom: 12px; }

.how-steps { display: grid; gap: 8px; margin: 14px 0; }

.how-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
}

.how-num {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 700;
}

.how-step b { display: block; font-size: 14.5px; line-height: 1.3; }
.how-step > div > span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }

.sheet-tip {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-2);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.input-affix { position: relative; flex: 1 1 150px; display: flex; align-items: center; }
.input-affix .input { padding-right: 34px; }
.input-affix > span {
  position: absolute;
  right: 13px;
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }

.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.is-active {
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

/* ---------- Фото ---------- */

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 430px) {
  .photo-grid { grid-template-columns: repeat(5, 1fr); }
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ph-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 20, 17, .62);
  color: #fff;
  cursor: pointer;
}
.ph-del svg { width: 13px; height: 13px; }

.ph-cover {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(18, 20, 17, .62);
  color: #fff;
  font-size: 9.5px;
  letter-spacing: .02em;
}

.photo-add {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.photo-add svg { width: 22px; height: 22px; }
.photo-add:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.no-photo-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.no-photo-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.no-photo-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.no-photo-choice input {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.no-photo-choice span { display: flex; flex-direction: column; gap: 1px; }
.no-photo-choice b { font-size: 14px; line-height: 1.3; }
.no-photo-choice i { font-style: normal; font-size: 12.5px; line-height: 1.35; color: var(--muted); }

.no-photo-choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ---------- Отправка ---------- */

.submit-box { display: grid; gap: 8px; }
.form-note { margin: 0; padding: 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }

/* ---------- Пост в стиле канала ---------- */

.post {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }

.post-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #2e7457, #173f2d);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.post-head-text { min-width: 0; line-height: 1.25; }
.post-head-text b { display: block; font-size: 14px; }
.post-head-text span { font-size: 11.5px; color: var(--muted); }
.post-dots { margin-left: auto; color: var(--muted); font-size: 18px; letter-spacing: 1px; line-height: 1; }

.post-photos { display: grid; grid-template-columns: 1fr; gap: 2px; background: var(--line); position: relative; }
.post-photos img {
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
  background: var(--bg-2);
}
.post-photos[data-n="2"] { grid-template-columns: 1fr 1fr; }
.post-photos[data-n="2"] img { aspect-ratio: 1; max-height: none; }
.post-photos[data-n="3"],
.post-photos[data-n="4"] { grid-template-columns: 1fr 1fr; }
.post-photos[data-n="3"] img,
.post-photos[data-n="4"] img { aspect-ratio: 1; max-height: none; }
.post-photos[data-n="3"] img:first-child { grid-row: span 2; aspect-ratio: auto; }

.post-photo-more {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 100px;
  background: rgba(18, 20, 17, .68);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.post-photos--empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 12.5px;
}
.post-photos--empty svg { width: 18px; height: 18px; }

.post-text {
  padding: 12px 14px 4px;
  font-size: 14.5px;
  line-height: 1.52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-text a { color: var(--link); text-decoration: none; }
.post-text a:hover { text-decoration: underline; }

.post-links { display: grid; gap: 5px; padding: 8px 14px 14px; }
.post-links a { color: var(--link); font-size: 13.5px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.post-links a:hover { text-decoration: underline; }

.post--compact .post-text { font-size: 13.5px; }
.post--compact .post-photos img { max-height: 250px; }

/* ---------- Мои объявления ---------- */

.listing-list { display: grid; gap: 10px; }

.listing {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .12s;
}
.listing:hover { border-color: var(--line-strong); }
.listing:active { transform: scale(.995); }

.listing-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.listing-card .listing {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.listing-card .listing:hover { border-color: transparent; }
.listing-card .listing:active { transform: none; }

.listing-actions {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.listing-sold-btn { justify-self: center; }
.listing-archive-btn { justify-self: center; }

.listing-archived {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.repeat-hint {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

.repeat-hint svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }

.listing-thumb {
  width: 62px;
  height: 62px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--muted);
}
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-thumb svg { width: 22px; height: 22px; }

.listing-body { flex: 1; min-width: 0; display: block; }
.listing-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}
.listing-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.listing-chev { width: 18px; height: 18px; flex: none; color: var(--muted); }
.listing-reason { display: flex; gap: 5px; margin-top: 5px; color: var(--danger); font-size: 11.5px; line-height: 1.35; }

.listing-schedule {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--warn);
  font-size: 11.5px;
  line-height: 1.35;
}
.listing-schedule svg { width: 12px; height: 12px; flex: none; }

.listing-pending-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1.35;
}
.listing-pending-edit svg { width: 12px; height: 12px; flex: none; }

/* ---------- Статусы ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-scheduled { background: var(--accent-soft); color: var(--accent); }
.status-published { background: var(--ok-soft); color: var(--ok); }
.status-sold { background: var(--card-2); color: var(--muted); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }

/* ---------- Сегменты ---------- */

.mod-search { margin-bottom: 12px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search-box > svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.search-box input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.search-box input::placeholder { color: var(--muted); }
.search-clear {
  width: 24px;
  height: 24px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.search-clear:hover { color: var(--text); }

.search-info {
  display: block;
  margin-top: 5px;
  padding-left: 2px;
  color: var(--muted);
  font-size: 11.5px;
}
.search-info:empty { display: none; }

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}
.segmented button {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.segmented button.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .count { color: var(--brand); font-weight: 700; }

.my-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.my-filters::-webkit-scrollbar { display: none; }
.my-filters .chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.my-filters .count { color: var(--brand); font-weight: 700; }

.mod-archived {
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

/* ---------- Модерация ---------- */

.mod-list { display: grid; gap: 14px; }

.mod-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.mod-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 0 2px; }
.mod-date { color: var(--muted); font-size: 11.5px; }

.mod-card .post { border-radius: 14px; box-shadow: none; }

.mod-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 11.5px;
}
.mod-meta a { color: var(--text); font-weight: 600; text-decoration: none; }
.mod-meta a:hover { text-decoration: underline; }

.checks { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 2px 0; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 100px;
  font-size: 11.5px;
}
.check svg { width: 12px; height: 12px; }
.check-ok { background: var(--ok-soft); color: var(--ok); }
.check-warn { background: var(--warn-soft); color: var(--warn); }
.check-bad { background: var(--danger-soft); color: var(--danger); }

.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.mod-actions .btn { flex: 1 1 auto; }

.mod-slot-hint {
  flex-basis: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.queue-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(150deg, #26684e, #174634);
  color: #f6f1e6;
  box-shadow: 0 18px 32px -22px rgba(18, 53, 38, .9);
}

.queue-banner-text b { display: block; font-size: 14.5px; line-height: 1.3; }
.queue-banner-text span { display: block; margin-top: 2px; color: rgba(246, 241, 230, .7); font-size: 11.5px; }

.queue-banner-next { text-align: right; }
.queue-banner-next span {
  display: block;
  color: rgba(246, 241, 230, .62);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.queue-banner-next b { display: block; margin-top: 2px; font-size: 15px; }

.queue-window {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: -4px 0 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
}
.queue-window svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

.pace-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.pace-text b { display: block; font-size: 13.5px; line-height: 1.3; }
.pace-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.pace-chips { display: flex; gap: 6px; }

.pace-chips .chip {
  padding: 7px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.mod-schedule {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}
.mod-schedule svg { width: 15px; height: 15px; flex: none; }

/* ---------- Лист снизу ---------- */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-layer[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 15, .5);
  opacity: 0;
  transition: opacity .22s;
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 88dvh;
  overflow: hidden;
  border-radius: 22px 22px 0 0;
  background: var(--card);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .28);
  transform: translateY(102%);
  opacity: 1;
  transition: transform .26s cubic-bezier(.22, 1, .36, 1), opacity .2s;
}

.sheet-layer.is-open .sheet { transform: none; }
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }

.sheet-grip {
  width: 38px;
  height: 4px;
  flex: none;
  margin: 8px auto 0;
  border-radius: 2px;
  background: var(--line-strong);
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
}

.sheet-body h2 { margin: 4px 0 6px; font-size: 18px; letter-spacing: -.01em; }
.sheet-body > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.sheet-body .post { margin: 12px 0; }

.sheet-body .post-photos img { max-height: 260px; }

.sheet-body:has(.sheet-actions) { padding-bottom: 0; }

.sheet-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 14px -18px 0;
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}

.sheet-actions .row-actions { margin-top: 0; }

.sheet-edit { margin-bottom: 8px; }

.sheet-sold { margin-bottom: 8px; }

.sheet-edit-hint {
  display: block;
  margin-top: 6px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

.sold-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12.5px;
  line-height: 1.4;
}
.sold-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.scheduled-lock {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  line-height: 1.4;
}
.scheduled-lock svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.pending-edit-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  line-height: 1.4;
}
.pending-edit-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

body.sheet-open { overflow: hidden; }

@media (min-width: 720px) {
  .sheet-layer { align-items: center; }
  .sheet {
    max-height: 86dvh;
    border-radius: 22px;
    transform: translateY(14px);
    opacity: 0;
  }
  .sheet-layer.is-open .sheet { transform: none; opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: 18px; }
}

/* ---------- Причины отказа ---------- */

.reason-list { display: grid; gap: 8px; margin: 14px 0; }

.reason {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  font-size: 13.5px;
  cursor: pointer;
}
.reason input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.reason:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Пустые состояния и успех ---------- */

.empty {
  padding: 42px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: var(--card-2);
  text-align: center;
}

.empty-ico {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
}
.empty-ico svg { width: 24px; height: 24px; }

.empty h2 { margin: 0 0 6px; font-size: 16px; }
.empty p { max-width: 34ch; margin: 0 auto 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.success { padding: 24px 10px 20px; text-align: center; }

.success-ico {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
.success-ico svg { width: 34px; height: 34px; }

.success h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.02em; }
.success p { max-width: 38ch; margin: 0 auto; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

.success-summary {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.success-summary-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.success-summary-meta { font-size: 12.5px; color: var(--muted); }

@keyframes pop {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.row-actions { display: flex; gap: 10px; margin-top: 18px; }
.row-actions .btn { flex: 1; }

/* ---------- Тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 100px;
  background: #1f241f;
  color: #f4f1e8;
  font-size: 12.5px;
  text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .3);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Разное ---------- */

.noscript {
  margin: 24px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
