/* ===== Шрифты (локальные, без внешних запросов) ===== */
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/golos-text-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/golos-text-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/golos-text-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/golos-text-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/golos-text-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/golos-text-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/golos-text-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/golos-text-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plate'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/roboto-condensed-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Plate'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/roboto-condensed-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plate'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/roboto-condensed-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Plate'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/roboto-condensed-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

/* ===== Цвета и токены ===== */
:root {
  --bg: #E7EBEF;          /* светлый бетон */
  --surface: #FFFFFF;
  --surface-2: #F3F5F7;
  --ink: #1B2129;          /* графит */
  --ink-soft: #5A6573;
  --line: #CDD4DC;
  --accent: #1D5BBF;       /* синий дорожного знака */
  --accent-ink: #FFFFFF;
  --marking: #F2C230;      /* жёлтая разметка */
  --good: #22804F;
  --bad: #C2392E;
  --plate-bg: #FFFFFF;
  --plate-ink: #15191F;
  --plate-edge: #15191F;
  --shadow: 0 1px 0 rgba(27, 33, 41, .06), 0 6px 18px -8px rgba(27, 33, 41, .18);

  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-plate: 'Plate', 'Roboto Condensed', 'Arial Narrow', sans-serif;

  --r-s: 8px;
  --r-m: 14px;
  --gap: clamp(14px, 3vw, 22px);
  --col: 34rem;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #1C2025;           /* мокрый асфальт */
  --surface: #262B32;
  --surface-2: #2E343C;
  --ink: #E6EAEE;
  --ink-soft: #9AA5B1;
  --line: #3A424C;
  --accent: #6A9BFF;
  --accent-ink: #0F1C33;
  --marking: #E9B925;
  --good: #4CC285;
  --bad: #FF7A6E;
  --plate-bg: #F1F3F5;     /* номер остаётся светлым, как в жизни */
  --plate-ink: #15191F;
  --plate-edge: #0A0C0F;
  --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 22px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--surface); padding: 8px 12px; border-radius: var(--r-s);
}
.skip-link:focus { top: 8px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.noscript { text-align: center; padding: 2rem; }

/* Плавная смена темы (запасной вариант, если нет View Transitions) */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease, stroke .45s ease, box-shadow .45s ease !important;
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* ===== Верхняя панель ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 60rem; margin: 0 auto; padding: 14px var(--gap);
}
.topbar__home { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.topbar__name { font-weight: 600; letter-spacing: -.01em; }
.mini-plate {
  font-family: var(--font-plate); font-weight: 700; font-size: .95rem; line-height: 1;
  background: var(--plate-bg); color: var(--plate-ink);
  border: 2px solid var(--plate-edge); border-radius: 5px; padding: 3px 6px 2px;
}
.mini-plate i { font-style: normal; display: inline-block; transform: translateY(.18em); margin: 0 1px; }
.topbar__right { display: flex; align-items: center; gap: 8px; }
.topbar__user {
  font-size: .9rem; color: var(--ink-soft); max-width: 9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.theme-toggle {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
}
.theme-toggle:hover { border-color: var(--ink-soft); }
.theme-toggle__icon { width: 22px; height: 22px; overflow: visible; }
.theme-toggle__core { fill: var(--ink); transform-origin: 12px 12px; transition: transform .5s cubic-bezier(.5, 1.5, .5, 1); }
.theme-toggle__cut { transition: transform .5s ease; }
.theme-toggle__rays { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; transform-origin: 12px 12px; transition: transform .5s ease, opacity .3s ease; }
:root[data-theme='dark'] .theme-toggle__core { transform: scale(1.65); }
:root[data-theme='dark'] .theme-toggle__cut { transform: translate(-7px, 3.5px); }
:root[data-theme='dark'] .theme-toggle__rays { transform: rotate(-35deg) scale(.6); opacity: 0; }

/* ===== Каркас ===== */
.app { max-width: var(--col); margin: 0 auto; padding: 4px var(--gap) 48px; outline: none; }
.view { animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.loader {
  width: 28px; height: 28px; margin: 25vh auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Госномер ===== */
.plate {
  --h: 1em;
  font-size: var(--plate-size, clamp(44px, 15vw, 84px));
  display: inline-flex; align-items: stretch;
  height: 1.26em;
  background: var(--plate-bg); color: var(--plate-ink);
  border: .055em solid var(--plate-edge);
  border-radius: .12em;
  box-shadow: inset 0 0 0 .03em var(--plate-bg), inset 0 0 0 .045em rgba(0, 0, 0, .55), var(--shadow);
  font-family: var(--font-plate); font-weight: 500;
  line-height: 1; user-select: none;
  position: relative;
}
.plate::before, .plate::after {   /* винты крепления */
  content: ''; position: absolute; top: 50%; width: .07em; height: .07em; border-radius: 50%;
  background: #9AA1A9; transform: translateY(-50%);
}
.plate::before { left: .12em; }
.plate::after { right: .12em; }
.plate__main {
  display: flex; align-items: baseline; justify-content: center;
  gap: .04em; padding: .1em .26em 0 .3em;
}
.plate__letter { font-size: .8em; }
.plate__digit {
  font-size: 1em; width: .52em; text-align: center;
  display: inline-block; position: relative; color: transparent;
}
.plate__digit::after {   /* цифры заменены звёздочками */
  content: '*'; color: var(--plate-ink); position: absolute; left: 0; right: 0; top: .2em;
  font-size: 1.15em; line-height: 1;
}
.plate__region {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  border-left: .045em solid var(--plate-edge);
  padding: .1em .14em .1em .12em; min-width: 1.15em;
}
.plate__code { font-size: .64em; line-height: 1; letter-spacing: -.01em; margin-top: .02em; }
.plate__rus { display: flex; align-items: center; gap: .05em; font-size: .2em; font-weight: 700; letter-spacing: .02em; margin-bottom: .02em; }
.plate__flag {
  width: 1.5em; height: .95em; border: 1px solid rgba(0, 0, 0, .5);
  background: linear-gradient(#fff 0 33.3%, #1C57A5 33.3% 66.6%, #D52B1E 66.6%);
}
.plate.is-changing { animation: plate-swap .32s ease; }
@keyframes plate-swap {
  0% { transform: rotateX(0); }
  45% { transform: rotateX(90deg); }
  55% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0); }
}

/* ===== Логотип ===== */
.logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: clamp(16px, 6vh, 56px) 0 clamp(24px, 6vh, 48px); }
.logo .plate { --plate-size: clamp(48px, 15vw, 96px); }
.logo__word {
  font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 700; letter-spacing: -.02em;
}
.logo__hint { color: var(--ink-soft); font-size: .95rem; text-align: center; margin: -12px auto 28px; max-width: 24rem; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r-s);
  font-weight: 600; text-decoration: none; text-align: center;
  background: var(--surface); color: var(--ink); border-color: var(--line);
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn--ghost:hover { color: var(--ink); border-color: var(--line); }
.btn--block { width: 100%; }

.menu { display: grid; gap: 12px; }
.menu__item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 16px 18px; min-height: 72px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.menu__item:hover { border-color: var(--accent); }
.menu__item:active { transform: scale(.99); }
.menu__title { font-size: 1.15rem; font-weight: 600; }
.menu__desc { grid-column: 1; color: var(--ink-soft); font-size: .9rem; }
.menu__side { grid-row: 1 / span 2; grid-column: 2; color: var(--ink-soft); font-family: var(--font-plate); font-size: 1.1rem; }
.menu__item--main { border-left: 6px solid var(--accent); }
.menu__item--timed .menu__side { color: var(--ink); background: var(--marking); padding: 2px 8px; border-radius: 4px; font-weight: 700; }
.menu__footer { display: flex; justify-content: center; margin-top: 20px; }

/* ===== Формы ===== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: clamp(18px, 4vw, 26px); box-shadow: var(--shadow);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-s); margin-bottom: 20px; }
.tab {
  border: 0; background: transparent; border-radius: 6px; min-height: 40px; font-weight: 600; color: var(--ink-soft);
}
.tab[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 500; font-size: .95rem; }
.field__hint { color: var(--ink-soft); font-size: .85rem; }
.input {
  width: 100%; min-height: 50px; padding: 0 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-s);
  font-size: 1.05rem; /* ≥16px — iOS не масштабирует поле */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.is-error { border-color: var(--bad); }
.form-error { color: var(--bad); font-size: .92rem; min-height: 1.4em; margin: 2px 0 10px; }

/* ===== Игровой экран ===== */
.game-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.game-head__mode { color: var(--ink-soft); font-size: .95rem; }
.score { display: flex; align-items: baseline; gap: 6px; }
.score__label { color: var(--ink-soft); font-size: .9rem; }
.score__value { font-family: var(--font-plate); font-weight: 700; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.score__value.is-bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18); color: var(--good); } }
.score__value.is-drop { animation: drop .4s ease; }
@keyframes drop { 40% { transform: translateY(3px); color: var(--bad); } }

.timer { margin-bottom: 14px; }
.timer__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.timer__value { font-family: var(--font-plate); font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.timer__value.is-low { color: var(--bad); }
.timer__track { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.timer__bar { height: 100%; width: 100%; background: var(--marking); transform-origin: left; }
.timer__bar.is-low { background: var(--bad); }

.stage { display: flex; flex-direction: column; align-items: center; perspective: 600px; padding: 8px 0 4px; }
.stage__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 12px; color: var(--ink-soft); font-size: .92rem; text-align: center; }
.stage__meta strong { color: var(--ink); font-weight: 600; }

.word-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 18px; }
.word-form .input { font-size: 1.2rem; text-transform: lowercase; }
.word-form .btn { min-width: 56px; padding: 0 16px; }
.word-form.is-shake { animation: shake .35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.feedback { min-height: 1.5em; margin: 8px 2px 0; font-size: .95rem; }
.feedback.is-bad { color: var(--bad); }
.feedback.is-good { color: var(--good); }

.game-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

/* Список слов: новое крупно, предыдущие уходят вниз и уменьшаются */
.words { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 2px; }
.words__item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 4px 4px; font-size: 1rem; color: var(--ink-soft);
  border-bottom: 1px dashed var(--line);
  transition: font-size .3s ease, color .3s ease, padding .3s ease;
}
.words__item:first-child {
  font-size: 1.6rem; font-weight: 600; color: var(--ink); padding: 8px 4px; border-bottom-style: solid;
}
.words__item.is-new { animation: word-in .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes word-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
.words__word { overflow-wrap: anywhere; }
.words__hl { color: var(--accent); font-weight: 700; }
.words__item:not(:first-child) .words__hl { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.words__pts { font-family: var(--font-plate); font-weight: 700; color: var(--good); white-space: nowrap; font-size: .9em; }
.words__plate { font-family: var(--font-plate); font-size: .8rem; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 8px; }
.words__empty { color: var(--ink-soft); text-align: center; padding: 18px 0; border: 0; font-size: .95rem; }

/* Перед стартом игры на время */
.intro { text-align: center; }
.intro .plate { --plate-size: clamp(44px, 14vw, 72px); margin-bottom: 18px; }
.intro__rules { text-align: left; margin: 0 0 20px; padding-left: 1.2em; color: var(--ink-soft); }
.intro__rules li { margin-bottom: 4px; }
.intro__rules strong { color: var(--ink); }

/* ===== Итоги ===== */
.result { text-align: center; }
.result__score { font-family: var(--font-plate); font-weight: 700; font-size: clamp(3.5rem, 18vw, 5rem); line-height: 1; margin: 10px 0 4px; }
.result__label { color: var(--ink-soft); }
.result__record { display: inline-block; margin-top: 12px; background: var(--marking); color: #1B2129; font-weight: 700; padding: 4px 12px; border-radius: 4px; }
.result__stats { display: flex; justify-content: center; gap: 24px; margin: 18px 0 22px; color: var(--ink-soft); }
.result__stats strong { display: block; color: var(--ink); font-size: 1.3rem; }
.result__actions { display: grid; gap: 8px; }

/* ===== Топ игроков ===== */
.page-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 16px; }
.board { list-style: none; margin: 0; padding: 0; }
.board__row {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.board__row:last-child { border-bottom: 0; }
.board__rank { font-family: var(--font-plate); font-weight: 700; color: var(--ink-soft); text-align: center; }
.board__row:nth-child(1) .board__rank { color: #1B2129; background: var(--marking); border-radius: 4px; }
.board__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__games { color: var(--ink-soft); font-size: .82rem; font-weight: 400; margin-left: 6px; }
.board__score { font-family: var(--font-plate); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.board__row.is-me { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: var(--r-s); }
.board-card { padding: 6px; }
.board__empty { text-align: center; color: var(--ink-soft); padding: 28px 12px; }
.my-rank { margin-top: 14px; text-align: center; color: var(--ink-soft); }
.my-rank strong { color: var(--ink); }

/* ===== Уведомления ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-s);
  font-size: .95rem; box-shadow: var(--shadow); z-index: 40; max-width: calc(100% - 32px);
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ===== Адаптив ===== */
@media (max-width: 420px) {
  .topbar__name { display: none; }
  .game-actions { grid-template-columns: 1fr; }
  .words__item:first-child { font-size: 1.35rem; }
}
@media (max-height: 640px) and (max-width: 520px) {
  .stage .plate { --plate-size: 12vw; }
  .logo { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.word-form .input::placeholder { text-transform: none; }
.intro .btn + .btn { margin-top: 8px; }

/* ===== Навигация в шапке и подвал ===== */
.topbar__nav { display: flex; gap: 2px; margin-right: 4px; }
.topbar__nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 8px 10px; border-radius: var(--r-s);
}
.topbar__nav a:hover { color: var(--ink); background: var(--surface); }
.footer {
  max-width: var(--col); margin: 0 auto; padding: 24px var(--gap) calc(32px + env(safe-area-inset-bottom));
  text-align: center; color: var(--ink-soft); font-size: .9rem; border-top: 1px solid var(--line);
}
.footer a { color: var(--ink-soft); }
.footer a:hover { color: var(--accent); }
.footer p { margin: 8px 0 0; font-size: .85rem; }

/* ===== Главная для гостей ===== */
.landing .logo { margin-bottom: 18px; }
.landing__lead { text-align: center; font-size: 1.08rem; margin: 0 auto 22px; max-width: 28rem; }
.landing__cta { display: grid; gap: 8px; margin-bottom: 32px; }
.landing__h2 { font-size: 1.2rem; font-weight: 700; margin: 26px 0 12px; letter-spacing: -.01em; }
.landing__grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.landing__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; }
.landing__card h3 { font-size: 1rem; margin-bottom: 6px; }
.landing__card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.landing__steps { padding-left: 1.3em; margin: 0; }
.landing__steps li { margin-bottom: 6px; }
.landing__example { color: var(--ink-soft); margin: 12px 0 0; }
.landing__example b, .landing__lead b { color: var(--accent); }

/* ===== Статья (правила) ===== */
.app--article { max-width: 42rem; }
.article { line-height: 1.65; }
.article h2 { font-size: 1.35rem; margin: 32px 0 10px; letter-spacing: -.01em; }
.article h3 { font-size: 1.08rem; margin: 20px 0 6px; }
.article p { margin: 0 0 12px; }
.article ul { padding-left: 1.3em; margin: 0 0 12px; }
.article li { margin-bottom: 4px; }
.article b { font-weight: 600; }
.article__lead { font-size: 1.08rem; color: var(--ink-soft); }
.article__plate { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 22px 0 8px; }
.article__plate .plate { --plate-size: clamp(40px, 12vw, 64px); }
.article__plate p { font-family: var(--font-plate); font-size: 1.3rem; margin: 6px 0 0; }
.article__plate b { color: var(--accent); }
.breadcrumbs { font-size: .9rem; color: var(--ink-soft); margin: 4px 0 10px; }
.breadcrumbs a { color: var(--ink-soft); }
.table-wrap { overflow-x: auto; margin: 0 0 12px; }
.article__table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-m); overflow: hidden; }
.article__table th, .article__table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.article__table th { font-size: .9rem; color: var(--ink-soft); font-weight: 600; background: var(--surface-2); }
.article__table td:first-child { font-family: var(--font-plate); font-weight: 700; white-space: nowrap; }
.article__table tr:last-child td { border-bottom: 0; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style-position: inside; }
.faq details p { padding: 0 16px 12px; margin: 0; color: var(--ink-soft); }
.article__cta { display: grid; gap: 8px; margin: 30px 0 10px; }

@media (max-width: 420px) {
  .topbar__user { display: none; }
  .topbar__nav a { padding: 8px 7px; }
  .landing__grid { grid-template-columns: 1fr; }
}
