/* ============================================================
   Портал ТСН — тема «Дом вечером»
   Дизайн-система: сумеречный чернильный + янтарный свет окон.
   Глубина: 3 уровня elevation, стеклянный header, тёмная hero-панель.
   Шрифты: Unbounded (дисплей), Onest (текст), JetBrains Mono (метки).
   ============================================================ */
@import url('/static/css/fonts.css');

:root {
  --ink: #1d2735;
  --ink-2: #2a3850;
  --ink-3: #38507a;
  --bg: #edf0f5;
  --surface: #ffffff;
  --surface-dim: #f6f8fb;
  --line: #dde3ec;
  --muted: #64748b;
  --amber: #f5a83c;
  --amber-soft: #ffe3b3;
  --amber-deep: #b06f0e;
  --blue: #33557f;
  --blue-deep: #26405f;
  --green: #2f855a;
  --red: #c0392b;
  --violet: #6b57c9;

  --font-display: 'Unbounded', 'Onest', sans-serif;
  --font-body: 'Onest', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --shadow-1: 0 1px 2px rgba(29, 39, 53, .05), 0 4px 14px rgba(29, 39, 53, .07);
  --shadow-2: 0 2px 4px rgba(29, 39, 53, .06), 0 14px 34px rgba(29, 39, 53, .12);
  --shadow-3: 0 4px 8px rgba(29, 39, 53, .08), 0 28px 60px rgba(29, 39, 53, .18);
  --shadow-amber: 0 6px 24px rgba(245, 168, 60, .35);

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
}

/* Тёмная тема — автоматически по системной настройке. Дизайн «Дом вечером»
   и так тёмный в hero; здесь темнеет остальная страница. Токены построены
   так, что компоненты не знают о теме. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8edf5;
    --ink-2: #c4cede;
    --ink-3: #9fb3d1;
    --bg: #131a24;
    --surface: #1b2431;
    --surface-dim: #232e3f;
    --line: #33405494;
    --muted: #8b99ad;
    --amber-soft: #4a3a1c;
    --amber-deep: #f0b667;
    --blue: #8ab1e0;
    --blue-deep: #a9c6ea;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .5);
    --shadow-3: 0 4px 8px rgba(0, 0, 0, .4), 0 28px 60px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(51, 85, 127, .07), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
h3 { font-size: 1.05rem; font-weight: 500; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(245, 168, 60, .6);
  outline-offset: 2px;
  border-radius: 4px;
}

.text-muted { color: var(--muted); }

/* ---------- Header: стекло поверх страницы ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(237, 240, 245, .8);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(29, 39, 53, .08);
}
.site-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.site-header__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.site-header__brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  /* Константы, не токены: это «тёмная панель» в обеих темах */
  background: linear-gradient(145deg, #2a3850, #1d2735);
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 6px;
  box-shadow: var(--shadow-1);
  flex: none;
}
.brand-mark i {
  border-radius: 1.5px;
  background: rgba(255, 255, 255, .28);
}
.brand-mark i:nth-child(2) { background: var(--amber); }
.site-header__address {
  color: var(--muted);
  font-size: .82rem;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.site-header__nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* min-width:0 обязателен: у flex-элемента дефолт min-width:auto —
     он не сжимается ниже контента, и overflow-x:auto не срабатывает,
     а распирается ВЕСЬ документ (горизонтальный скролл страницы). */
  min-width: 0;
  max-width: 100%;
}
.site-header__nav::-webkit-scrollbar { display: none; }
.site-header__nav a {
  color: var(--ink-2);
  font-weight: 500;
  font-size: .9rem;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.site-header__nav a:hover {
  background: rgba(29, 39, 53, .07);
  text-decoration: none;
}
.site-header__nav a.nav-cta {
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-amber);
}
.site-header__nav a.nav-cta:hover { background: #ffb54a; }

/* ---------- Контент ---------- */
.content {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  flex: 1;
}
.content--narrow { max-width: 720px; }

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap; /* узкий экран: кнопка переносится под заголовок */
  margin: 36px 0 16px;
}
.page-header h2 { margin: 0; }
.page-header a {
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber-deep);
  display: block;
  margin-bottom: 10px;
}

/* ---------- Hero: тёмная панель с фасадом ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 24px;
  align-items: center;
  /* Константы, не токены: hero — тёмная панель в ОБЕИХ темах (в dark токены
     --ink/--ink-2 становятся светлым текстом и инвертировали бы панель) */
  background:
    radial-gradient(600px 280px at 85% 20%, rgba(245, 168, 60, .16), transparent 65%),
    linear-gradient(150deg, #2a3850 0%, #1d2735 70%);
  border-radius: var(--r-l);
  padding: 44px 44px 40px;
  color: #eef2f8;
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.hero .eyebrow { color: var(--amber); }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero p {
  color: rgba(238, 242, 248, .75);
  max-width: 46ch;
  margin: 0 0 22px;
}
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Signature: фасад дома — окна, часть горит янтарным */
.facade {
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(6, 30px);
  grid-auto-rows: 38px;
  gap: 9px;
  padding: 18px 16px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .1);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  transform: translateY(40px);
}
.facade .win {
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.facade .win.lit {
  background: linear-gradient(180deg, #ffd489, var(--amber));
  box-shadow: 0 0 18px rgba(245, 168, 60, .55);
  animation: window-glow 6s ease-in-out infinite;
}
.facade .win.lit:nth-child(3n) { animation-delay: -2.1s; }
.facade .win.lit:nth-child(5n) { animation-delay: -4.4s; }
@keyframes window-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--amber);
  color: var(--ink);
  box-shadow: var(--shadow-amber);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover {
  background: #ffb54a;
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(245, 168, 60, .45);
}
.btn:active { transform: translateY(0); }
.btn--ghost {
  background: transparent;
  color: #eef2f8;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55);
}
.btn--quiet {
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.btn--quiet:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}

/* ---------- Карточки ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-m);
  padding: 26px 28px;
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(29, 39, 53, .04);
}
.card + .card { margin-top: 18px; }

/* Ряды карточек: грид на десктопе, горизонтальный скролл на мобиле */
.ticket-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.ticket-card {
  background: var(--surface);
  border-radius: var(--r-m);
  padding: 20px 22px;
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(29, 39, 53, .04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ticket-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
.ticket-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ticket-card__type {
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-2);
}
.ticket-card__text {
  margin: 0;
  font-size: .93rem;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Ответ правления в карточке заявки кабинета (режим раннего этапа):
   вместо статуса жилец видит, что ему ответили. */
.ticket-card__reply {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: .88rem;
  background: var(--surface-dim);
  border-left: 2px solid var(--amber);
  border-radius: 0 var(--r-s) var(--r-s) 0;
}
.ticket-card__meta {
  margin-top: auto;
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}

/* Шаги «как это работает» */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.step {
  background: var(--surface);
  border-radius: var(--r-m);
  padding: 22px;
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(29, 39, 53, .04);
  position: relative;
}
.step__num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .78rem;
  color: var(--amber-deep);
  background: var(--amber-soft);
  border-radius: 999px;
  padding: 3px 10px;
  display: inline-block;
  margin-bottom: 12px;
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; font-size: .9rem; color: var(--muted); }

/* Чипы инструкций */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(29, 39, 53, .05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  text-decoration: none;
  color: var(--ink);
}

/* ---------- Бейджи статусов (домовые таблички) ---------- */
.badge {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex: none;
}
.badge--new       { background: #e8edf5; color: var(--ink-3); }
.badge--accepted  { background: #dcebff; color: #29578f; }
.badge--in_progress { background: var(--amber-soft); color: var(--amber-deep); }
.badge--waiting   { background: #ece7fb; color: var(--violet); }
.badge--resolved  { background: #d9f2e3; color: var(--green); }
.badge--rejected  { background: #fbe0dc; color: var(--red); }
.badge--duplicate { background: #e6e8ec; color: var(--muted); }

/* ---------- Формы ---------- */
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.form-field input[type="text"],
.form-field input[type="tel"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface-dim);
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--amber);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(245, 168, 60, .18);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
/* Поле есть в базе, но не читается текущим ключом (SECRETS_KEY сменился) —
   тот же красный, что у обязательной звёздочки: молчание здесь дороже. */
.form-field .hint--warn { color: var(--red); }
.form-field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.form-field--checkbox label { font-weight: 400; margin: 0; }
.form-field--checkbox input { margin-top: 3px; accent-color: var(--amber-deep); }

/* Звёздочка обязательного поля. Отдельный класс, а не inline-стиль: CSP
   запрещает style="" (default-src 'self'), и звёздочка тихо осталась бы
   цветом обычного текста. */
.req { color: var(--red); margin-left: 3px; }

/* Honeypot: невидим для людей, доступен ботам */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Флеши ---------- */
.flashes { margin-bottom: 18px; }
.flash {
  padding: 13px 18px;
  border-radius: var(--r-s);
  font-size: .92rem;
  font-weight: 500;
  box-shadow: var(--shadow-1);
  margin-bottom: 8px;
}
.flash--success { background: #d9f2e3; color: var(--green); }
.flash--error   { background: #fbe0dc; color: var(--red); }
.flash--info    { background: #dcebff; color: #29578f; }

/* ---------- Детали заявки / события ---------- */
.ticket-detail dt {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}
.ticket-detail dd { margin: 2px 0 0; }

.ticket-events { list-style: none; padding: 0; margin: 0; }
.ticket-events li {
  position: relative;
  padding: 12px 0 12px 26px;
  border-left: 2px solid var(--line);
  margin-left: 8px;
}
.ticket-events li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 18px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}
.ticket-events .event-date {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  display: block;
}

.verify-code {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .12em;
  background: #1d2735;   /* константа: янтарь на тёмном в обеих темах */
  color: var(--amber);
  padding: 12px 22px;
  border-radius: var(--r-s);
  display: inline-block;
  box-shadow: var(--shadow-2);
}

/* Номер заявки */
.ticket-no {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--amber-deep);
}

/* ---------- Markdown-контент ---------- */
.markdown-body { max-width: 68ch; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin-top: 1.2em; }
.markdown-body img { max-width: 100%; border-radius: var(--r-s); }
.markdown-body code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--surface-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- ЛК ---------- */
.lk-logout-form { display: inline; }
.lk-inline-form { display: inline; margin-left: .5rem; }
.lk-logout-form button {
  background: none;
  border: none;
  padding: 7px 12px;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
}
.lk-logout-form button:hover { background: rgba(29, 39, 53, .07); color: var(--ink); }

/* ---------- Футер ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(238, 242, 248, .65);
  margin-top: auto;
}
.site-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: .85rem;
}
.site-footer a { color: rgba(238, 242, 248, .85); }
.site-footer .site-footer__brand {
  font-family: var(--font-display);
  font-weight: 500;
  color: #fff;
  font-size: .92rem;
}

/* ---------- Экстренный баннер ---------- */
.alert-banner {
  background: linear-gradient(90deg, #b3261e, #d64545);
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 11px 20px;
  box-shadow: var(--shadow-1);
}

/* ---------- Опросы ---------- */
.poll-card h2 { margin-bottom: .2em; }
.poll-card + .poll-card { margin-top: 18px; }
.poll-vote { margin-top: 14px; }
.poll-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.poll-option input[type="radio"] { accent-color: var(--amber-deep); flex: none; }
.poll-option__text { font-weight: 500; flex: 0 0 175px; }
.poll-option progress { flex: 1; min-width: 60px; }
@media (max-width: 560px) {
  .poll-option { flex-wrap: wrap; }
  .poll-option__text { flex: 1 1 auto; }
  .poll-option progress { flex: 1 1 100%; order: 3; }
}
.poll-option__count {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
}
/* Второе измерение опроса — люди. Мельче и тише метров: метры основные.
   Абсолютный rem, не em: .poll-option своего font-size не задаёт, и em
   отсюда считался бы от body (16px) — крупнее, чем .75rem у метров. */
.poll-option__area {
  font-size: .68rem;
  color: var(--muted);
}
/* Бар результата — нативный progress: CSP запрещает inline width */
.poll-option progress {
  width: 100%;
  height: 10px;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-dim);
}
.poll-option progress::-webkit-progress-bar { background: var(--surface-dim); }
.poll-option progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--amber-soft), var(--amber));
  border-radius: 999px;
}
.poll-option progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--amber-soft), var(--amber));
  border-radius: 999px;
}
.poll-vote .btn { margin-top: 10px; }
.poll-total { margin: 10px 0 0; font-size: .82rem; }

/* ---------- Фильтры ленты и пейджер ---------- */
.feed-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.feed-filters select {
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
}
.pager {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

/* ---------- Появление при загрузке ---------- */
.rise {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .55s ease forwards;
}
.rise-2 { animation-delay: .1s; }
.rise-3 { animation-delay: .2s; }
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 32px 24px 0;
  }
  .facade {
    justify-self: center;
    transform: translateY(0);
    margin-top: 8px;
    grid-template-columns: repeat(8, 26px);
    grid-auto-rows: 30px;
  }
  .steps { grid-template-columns: 1fr; }
  /* горизонтальная лента карточек */
  .ticket-cards--scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 10px;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .ticket-cards--scroll .ticket-card {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
  .site-header__address { display: none; }
  /* Навигация — второй строкой на всю ширину, скроллится внутри себя */
  .site-header__nav { flex: 1 1 100%; margin-left: 0; }
  /* Главное действие — первым в полосе: скроллбар скрыт, и «Подать
     обращение» в хвосте девятисотпиксельной ленты никто бы не нашёл */
  .site-header__nav a.nav-cta { order: -1; }
  /* Блок согласия: текст и «Подробнее…» друг под другом. Без wrap флекс
     давил их в колонки 190+92px — юридический текст по 5 слов в строке */
  .form-field--checkbox { flex-wrap: wrap; }
  .form-field--checkbox small { flex-basis: 100%; }
}

/* Тёмная тема: компоненты с константными цветами */
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(19, 26, 36, .78);
    border-bottom-color: rgba(255, 255, 255, .08);
  }
  .site-header__brand { color: var(--ink); }
  .site-header__nav a:hover { background: rgba(255, 255, 255, .08); }
  /* Янтарные кнопки всегда с тёмным текстом — независимо от темы */
  .btn, .btn:hover,
  .site-header__nav a.nav-cta { color: #1d2735; }
  .btn--ghost, .btn--ghost:hover { color: #eef2f8; background: transparent; }
  .btn--ghost:hover { background: rgba(255, 255, 255, .08); }
  .btn--quiet, .btn--quiet:hover { color: var(--ink); background: var(--surface); }
  .lk-logout-form button:hover { background: rgba(255, 255, 255, .08); }
  .site-footer { background: #0d1219; }
  /* --red не переопределяется в тёмной теме намеренно: он живёт на светлых
     плашках flash--error и badge--rejected, чьи фоны константны. Звёздочка
     же стоит прямо на тёмной карточке, где #c0392b почти не виден. */
  .req { color: #ff8f80; }
  .form-field .hint--warn { color: #ff8f80; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .facade .win.lit { animation: none; }
  .rise { animation: none; opacity: 1; transform: none; }
  .ticket-card, .chip, .btn { transition: none; }
}


/* ЛК: таблица настроек уведомлений */
.prefs-table { border-collapse: collapse; margin-bottom: 1rem; }
.prefs-table th, .prefs-table td { padding: .4rem .9rem; text-align: center; }
.prefs-table td:first-child, .prefs-table th:first-child { text-align: left; }
.prefs-table thead th { font-size: .85rem; color: var(--muted, #6b7a90); }
