/* Стенограф. Чернила по бумаге, маркер для звучащей фразы. */

/* Шрифты лежат на своём хостинге: быстрее в РФ и без передачи данных в Google */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/onest-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: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/onest-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+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/onest-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: "Onest"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/onest-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+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/onest-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: "Onest"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/onest-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+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/literata-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: "Literata"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/literata-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+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/literata-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: "Literata"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/literata-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+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }


:root {
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --ink: #1B2463;
  --ink-soft: #4B5378;
  --muted: #747B9C;
  --rule: #D9DDEB;
  --accent: #2F44D8;
  --accent-hover: #2435B4;
  --accent-ink: #FFFFFF;
  --mark: #FFE45C;
  --mark-soft: #FFF4B8;
  --danger: #B42318;
  --danger-bg: #FDECEA;

  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-read: "Literata", Georgia, "Times New Roman", serif;

  --r-lg: 18px;
  --r-md: 10px;
  --r-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1330;
    --surface: #171C42;
    --ink: #E7EAFB;
    --ink-soft: #B3B9DA;
    --muted: #868CB0;
    --rule: #2B3165;
    --accent: #8E9DFF;
    --accent-hover: #A9B5FF;
    --accent-ink: #0F1330;
    --mark: #FFE45C;
    --mark-soft: rgba(255, 228, 92, .2);
    --danger: #FF9C8F;
    --danger-bg: rgba(255, 120, 100, .12);
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-ui);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Шапка ---------- */

.site-header { padding-top: env(safe-area-inset-top, 0px); }
.header-row {
  max-width: 1080px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 18px; padding-bottom: 18px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 32px; height: 32px; flex: none; }


.logo-word { font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); }
.logo-tld { color: var(--muted); font-weight: 500; }

/* Меню */
.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  font-size: .95rem; padding: 8px 12px; border-radius: var(--r-sm);
}
.main-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.main-nav a[aria-current] { color: var(--ink); font-weight: 500; }
@media (max-width: 640px) {
  .header-row { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 6px; }
  .main-nav { width: calc(100% + 24px); margin-left: -12px; }
  .main-nav a { font-size: .9rem; padding: 6px 12px; }
}

/* ---------- Заголовок страницы ---------- */

.hero { padding-top: 36px; padding-bottom: 28px; max-width: 1080px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

h1, h2, h3 { font-family: var(--font-read); font-weight: 600; color: var(--ink); }
h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  max-width: 22ch;
  text-wrap: balance;
}
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 58ch; margin: 0; }

/* ---------- Инструмент ---------- */

.tool { margin-bottom: 64px; }

.tool-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  .tool-grid { grid-template-columns: 1.45fr 1fr; }
}

.drop { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.drop-target {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 6px;
  min-height: 230px;
  padding: 32px;
  background: var(--surface);
  border: 1.5px dashed var(--rule);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.drop-target:hover, .drop.is-over .drop-target { border-color: var(--accent); }
.drop.is-over .drop-target { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.drop.has-file .drop-target { border-style: solid; }
.drop.is-busy .drop-target { cursor: progress; pointer-events: none; }

.drop-art { width: min(260px, 100%); height: auto; margin-bottom: 18px; overflow: visible; }
.drop-art .wave path { stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; }
.drop-art .lines path { stroke: var(--rule); stroke-width: 6; stroke-linecap: round; }
.drop-art .arrow { stroke: var(--muted); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.drop.has-file .drop-art .lines path { stroke: var(--mark); }

.drop.is-busy .drop-art .wave path { animation: pulse 1.1s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.drop.is-busy .drop-art .wave path:nth-child(3n) { animation-delay: -.35s; }
.drop.is-busy .drop-art .wave path:nth-child(3n+1) { animation-delay: -.7s; }
@keyframes pulse { 50% { transform: scaleY(.45); } }

.drop-title { font-weight: 600; font-size: 1.2rem; word-break: break-word; }
.drop-sub { color: var(--muted); font-size: .95rem; }

.settings {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
  border: 1px solid var(--rule);
}

.field { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: .9rem; font-weight: 500; color: var(--ink-soft); padding: 0; }

select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: 10px 12px; width: 100%;
}

.models { display: flex; flex-direction: column; gap: 6px; }
.model {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--rule); cursor: pointer;
}
.model:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.model input { grid-row: span 2; margin: 4px 0 0; accent-color: var(--accent); }
.model-name { font-weight: 500; }
.model-hint { font-size: .85rem; color: var(--muted); line-height: 1.35; }
.nowrap { white-space: nowrap; }

.check { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: .95rem; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }

.btn {
  font: 500 1rem/1 var(--font-ui);
  border-radius: var(--r-md);
  padding: 14px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); flex: 1; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-small { padding: 9px 14px; font-size: .9rem; border-color: var(--rule); background: var(--surface); }
.btn-small:hover { border-color: var(--accent); color: var(--accent); }
.btn-small.btn-primary { flex: none; background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-small.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }

/* Предупреждение: сайт открыт без HTTPS */
.insecure {
  margin-bottom: 16px; padding: 14px 18px; border-radius: var(--r-md);
  background: var(--danger-bg); color: var(--ink); font-size: .93rem; line-height: 1.5;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}
.insecure strong { color: var(--danger); }

/* Статус фоновой загрузки нейросети */
.model-status { font-size: .84rem; line-height: 1.4; color: var(--muted); display: flex; flex-direction: column; gap: 6px; margin-top: -6px; }
.model-status[data-state="ready"] { color: #1F8A52; }
.model-status[data-state="ready"] #modelStatusText::before { content: "● "; }
.model-status[data-state="error"] { color: var(--danger); }
.model-bar { display: block; height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.model-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

/* Очередь файлов */
.queue { margin-top: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px 18px; }
.queue-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.queue-title { font-weight: 600; }
.queue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.queue-actions-label { font-size: .88rem; color: var(--ink-soft); }
.queue-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.queue-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: .93rem; }
.queue-item:first-child { border-top: 0; }
.queue-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; }
button.queue-name { cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.queue-status { flex: none; color: var(--muted); font-size: .85rem; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item.is-running .queue-status { color: var(--accent); font-weight: 500; }
.queue-item.is-done .queue-status { color: #1F8A52; }
.queue-item.is-error .queue-status { color: var(--danger); }

/* Найти и заменить */
.replace { margin-top: 12px; font-size: .92rem; }
.replace summary { cursor: pointer; color: var(--ink-soft); width: fit-content; }
.replace summary:hover { color: var(--accent); }
.replace-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.replace-row input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 8px 10px; flex: 1 1 180px; min-width: 0; }
.replace-info { color: var(--muted); font-size: .88rem; }

/* Запись с микрофона */
.mic {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  font: 500 .98rem/1.2 var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 13px 16px;
  cursor: pointer;
}
.mic svg { width: 20px; height: 20px; flex: none; }
.mic svg rect { fill: none; stroke: currentColor; stroke-width: 1.8; }
.mic svg path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mic:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mic:disabled { opacity: .5; cursor: not-allowed; }
.mic.is-featured { border-color: var(--accent); color: var(--accent); }
.mic.is-rec { background: #D92D20; border-color: #D92D20; color: #fff; }
.mic.is-rec svg rect { fill: #fff; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Статус */
.status { margin-top: 20px; }
.status-row { display: flex; justify-content: space-between; gap: 16px; font-size: .95rem; margin-bottom: 8px; flex-wrap: wrap; }
.status-meta { color: var(--muted); font-size: .85rem; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.status.is-indeterminate .bar-fill { width: 30% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.error {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--danger-bg); color: var(--danger); font-size: .95rem;
}

/* Результат */
.result { margin-top: 28px; }
.result-head { display: flex; flex-direction: column; gap: 12px; }
.media audio { width: 100%; }
.media video { width: 100%; max-height: 360px; border-radius: var(--r-md); background: #000; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-word { border-color: var(--accent); color: var(--accent); }
.check-small { font-size: .88rem; color: var(--ink-soft); margin-left: 6px; }
.check-small input { width: 16px; height: 16px; }
.result-hint { color: var(--muted); font-size: .88rem; margin: 12px 0; }

/* Лист стенограммы: таймкоды на полях, текст справа */
.sheet {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 20px 24px 24px 0;
  max-height: 70vh;
  overflow-y: auto;
  position: relative;
}
.sheet:empty { display: none; }
.seg {
  display: grid;
  grid-template-columns: 84px 1fr;
  column-gap: 18px;
  margin: 0;
  padding: 3px 0;
}
.tc {
  font: 500 .8rem/1.9 var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: none; border: 0; padding: 0 14px 0 0;
  text-align: right;
  border-right: 1.5px solid var(--rule);
  cursor: pointer;
  align-self: stretch;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 3px;
}
.tc:hover { color: var(--accent); }
.tx {
  font: 400 1.08rem/1.75 var(--font-read);
  color: var(--ink);
  max-width: 68ch;
  outline: none;
  border-radius: 3px;
  padding: 0 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.tx:focus { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.seg.is-playing .tc { color: var(--ink); border-right-color: var(--mark); }
.seg.is-playing .tx { background: var(--mark-soft); }

@media (max-width: 560px) {
  .sheet { padding: 12px 14px; }
  .seg { grid-template-columns: 1fr; }
  .tc { justify-content: flex-start; border-right: 0; padding: 0; line-height: 1.6; }
  .seg { padding: 6px 0; }
  .drop-target { min-height: 200px; padding: 24px; }
}

/* История */
.history { margin-top: 32px; }
.history-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.history-title { font: 600 1.15rem/1.3 var(--font-read); }
.history-note { color: var(--muted); font-size: .85rem; margin: 4px 0 12px; }
.link-btn { font: inherit; font-size: .88rem; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.link-btn:hover { color: var(--danger); }
.history-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.history-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.history-item.is-current { border-color: var(--accent); }
.history-open {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; text-align: left;
  font: inherit; color: var(--ink);
  background: none; border: 0; cursor: pointer;
  padding: 12px 40px 12px 14px;
}
.history-open:hover .history-name { color: var(--accent); }
.history-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { font-size: .8rem; color: var(--muted); }
.history-preview { font: .9rem/1.45 var(--font-read); color: var(--ink-soft); margin-top: 4px; }
.history-del {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 1.2rem; line-height: 1; color: var(--muted);
  background: none; border: 0; cursor: pointer;
}
.history-del:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------- Текстовые блоки ---------- */

.prose { margin-bottom: 48px; }
.prose > * { max-width: 720px; }
.prose h2 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 14px; }
.prose p { margin: 0 0 14px; color: var(--ink-soft); }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 14px; color: var(--ink-soft); }
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font: 600 .85rem/28px var(--font-ui); text-align: center;
}
.steps strong { color: var(--ink); font-weight: 600; }

.faq details { border-top: 1px solid var(--rule); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: -2px; font-size: 1.3rem; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; }

/* Преимущества под заголовком */
.usp { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.usp li { position: relative; padding-left: 24px; color: var(--ink); font-size: .95rem; font-weight: 500; }
.usp li::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 15px; height: 15px; border-radius: 50%;
  background: var(--mark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.2 2.2 4.8-5' stroke='%231B2463' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}

/* Текстовые элементы внутри статей и страниц */
.prose h3 { font-size: 1.15rem; margin: 22px 0 8px; }
.prose ul, .prose ol { color: var(--ink-soft); padding-left: 1.3em; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose li strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  margin: 0 0 16px; padding: 14px 18px; border-left: 3px solid var(--mark);
  background: var(--surface); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--ink);
  font: 1rem/1.6 var(--font-read);
}
.content .prose:first-child { margin-top: 8px; }
.how + .content { margin-top: 0; }

/* Таблицы */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.prose > .table-wrap { max-width: 860px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
thead th { font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 500; color: var(--ink); white-space: nowrap; }
td { color: var(--ink-soft); }
.compare td.yes { color: var(--ink); font-weight: 500; }
.compare thead th:nth-child(2), .compare td:nth-child(2) { background: color-mix(in srgb, var(--mark) 22%, var(--surface)); }
@media (max-width: 560px) { tbody th { white-space: normal; } }

.link-grid { list-style: none; padding: 0 !important; }
.link-grid li { padding-left: 18px; position: relative; }
.link-grid li::before { content: "→"; position: absolute; left: 0; color: var(--muted); }
.link-list li { margin-bottom: 6px; }

/* Каталог языков */
.lang-groups { display: grid; gap: 32px 48px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 48px; }
.lang-group h2 { font-size: 1.15rem; margin: 0 0 10px; }
.lang-group ul { list-style: none; margin: 0; padding: 0; columns: 150px 2; column-gap: 24px; }
.lang-group li { margin-bottom: 6px; break-inside: avoid; }
.lang-group a { color: var(--ink); text-decoration: none; }
.lang-group a:hover { color: var(--accent); text-decoration: underline; }

/* Статьи */
.article-meta { color: var(--muted); font-size: .9rem; margin: 14px 0 0; }
.article > p:first-child { font-size: 1.08rem; color: var(--ink); }
.cards { list-style: none; margin: 0 0 48px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card a {
  display: flex; flex-direction: column; gap: 8px; height: 100%;
  padding: 20px 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  text-decoration: none; color: var(--ink);
}
.card a:hover { border-color: var(--accent); }
.card-title { font: 600 1.2rem/1.3 var(--font-read); }
.card-text { color: var(--ink-soft); font-size: .95rem; }
.card-meta { color: var(--muted); font-size: .82rem; margin-top: auto; }
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  max-width: 860px; margin: 8px 0 48px; padding: 24px 28px;
  background: var(--ink); color: var(--bg); border-radius: var(--r-lg);
}
.cta-title { font: 600 1.3rem/1.3 var(--font-read); margin: 0 0 4px; color: var(--bg); }
.cta-text { margin: 0; opacity: .8; }
.cta .btn-primary { flex: none; background: var(--mark); color: #1B2463; text-decoration: none; }
.cta .btn-primary:hover { background: #FFEB85; color: #1B2463; }

/* Юридические страницы */
.legal { font-size: .97rem; }
.legal h2 { font-size: 1.25rem; margin-top: 28px; }
.legal-date { color: var(--muted); font-size: .9rem; }
.legal-summary { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--mark); border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 20px; }
.legal-summary p { margin: 0; color: var(--ink); }

/* Контакты и форма */
.contacts { display: grid; gap: 40px; grid-template-columns: 1fr; max-width: none !important; }
@media (min-width: 860px) { .contacts { grid-template-columns: 1fr 1fr; } }
.contacts h2 { margin-top: 0; }
.form { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 24px; }
.form input[type="text"], .form input[type="email"], .form textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: var(--r-md); padding: 10px 12px; width: 100%;
}
.form textarea { resize: vertical; min-height: 140px; }
.form .check { align-items: flex-start; font-size: .88rem; color: var(--ink-soft); }
.form .check input { margin-top: 2px; flex: none; }
.form .btn-primary { align-self: flex-start; flex: none; padding: 14px 28px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-ok { background: color-mix(in srgb, #2FB36F 14%, var(--surface)); border-radius: var(--r-md); padding: 16px; color: var(--ink) !important; }
.form-error { background: var(--danger-bg); color: var(--danger) !important; border-radius: var(--r-md); padding: 12px 16px; }

/* Cookie */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: 560px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: 0 10px 30px rgba(15, 19, 48, .18);
  font-size: .9rem;
}
.cookie p { margin: 0; flex: 1 1 280px; color: var(--ink-soft); }
.cookie-actions { display: flex; gap: 8px; }
.cookie .btn-primary { flex: none; }

/* Отзывы */
.reviews { margin-bottom: 56px; }
.reviews-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; max-width: 860px; }
.reviews-head h2 { font-size: 1.6rem; margin: 0 0 14px; }
.reviews-summary { margin: 0; color: var(--ink-soft); }
.reviews-summary strong { color: var(--ink); font-size: 1.1rem; }
.stars { color: #F5B400; letter-spacing: 1px; white-space: nowrap; }
.review-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin: 6px 0 16px; }
.review { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px 20px; }
.review header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.review-name { font-weight: 600; }
.review time { color: var(--muted); font-size: .85rem; margin-left: auto; }
.review p { margin: 0; color: var(--ink-soft); font: .98rem/1.6 var(--font-read); }
.review-reply { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); font-size: .92rem; color: var(--ink-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.review-reply span { font-weight: 600; color: var(--ink); }
.reviews-empty { color: var(--ink-soft); max-width: 720px; }
.review-form-wrap { max-width: 720px; margin-top: 8px; }
.review-form-wrap > summary { display: inline-block; list-style: none; cursor: pointer; }
.review-form-wrap > summary::-webkit-details-marker { display: none; }
.review-form-wrap[open] > summary { margin-bottom: 14px; }
.review-form-wrap .form-error div + div { margin-top: 4px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr auto; align-items: end; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.9rem; line-height: 1; color: var(--rule); cursor: pointer; padding: 2px; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #F5B400; }
.star-input input:focus-visible + label { outline: 3px solid var(--accent); border-radius: 4px; }
.captcha input { max-width: 200px; }
.form-note { margin: 0; font-size: .85rem; color: var(--muted); }
.form-ok.egg { background: #0F1330; color: #7CFC9A !important; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* HTML-карта сайта */
.sitemap-groups { display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 48px; }
.sitemap-group h2 { font-size: 1.15rem; margin: 0 0 10px; }
.sitemap-group ul { list-style: none; margin: 0; padding: 0; }
.sitemap-group li { margin-bottom: 6px; }

/* ---------- Админка ---------- */
.adm { background: var(--bg); }
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.adm-login .form { width: min(380px, 100%); }
.adm-login h1 { font-size: 1.5rem; margin: 0; }
.adm-logo { height: 30px; align-self: flex-start; }
.adm-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.adm-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.adm-nav a, .adm-tabs a { padding: 7px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-soft); font-size: .93rem; }
.adm-nav a:hover, .adm-tabs a:hover { background: var(--bg); color: var(--ink); }
.adm-nav a[aria-current], .adm-tabs a[aria-current] { background: var(--ink); color: var(--bg); }
.adm-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #D92D20; color: #fff; font-size: .78rem; text-align: center; }
.adm-top-right { font-size: .9rem; color: var(--muted); }
.adm-main { max-width: 980px; margin: 0 auto; padding: 28px 24px 60px; }
.adm-main h1 { font-size: 1.8rem; margin: 0 0 18px; }
.adm-main h2 { font-size: 1.2rem; margin: 26px 0 10px; }
.adm-main > .form-error, .adm-main > .form-ok { margin: 0 0 18px; }
.adm-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.adm-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); color: var(--ink-soft); text-decoration: none; font-size: .92rem; }
a.adm-card:hover { border-color: var(--accent); }
.adm-num { font: 600 2rem/1 var(--font-read); color: var(--ink); }
.adm-checklist { list-style: none; padding: 0; }
.adm-checklist li { padding: 8px 0 8px 28px; position: relative; border-bottom: 1px solid var(--rule); }
.adm-checklist li::before { position: absolute; left: 0; font-weight: 700; }
.adm-checklist li.ok::before { content: "✓"; color: #1F8A52; }
.adm-checklist li.warn::before { content: "!"; color: var(--danger); left: 6px; }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.adm-tabs span { opacity: .7; }
.adm-empty { color: var(--muted); }
.adm-review { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--rule); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 12px; }
.adm-review.is-pending { border-left-color: #F5B400; }
.adm-review.is-approved { border-left-color: #1F8A52; }
.adm-review.is-hidden { opacity: .7; }
.adm-review header { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.adm-meta, .adm-status { font-size: .85rem; color: var(--muted); }
.adm-status { margin-left: auto; }
.adm-review p { margin: 10px 0; }
.adm-reply textarea, .adm-form textarea, .adm-form input[type=text], .adm-form input[type=email], .adm-login input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 9px 11px; width: 100%; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adm-danger:hover { color: var(--danger) !important; border-color: var(--danger) !important; }
.adm-form { max-width: none; }
.adm-form h2 { margin-bottom: 0; }
.adm-hint { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace !important; font-size: .88rem !important; }
.adm-inline { margin: 12px 0 20px; }
.adm-pages { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); max-height: 420px; overflow-y: auto; padding: 8px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--bg); }
.adm-pages small { color: var(--muted); }

/* Админка: модели */
.adm-model { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; }
.adm-model header { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.adm-model code, .adm-hint code { font-size: .85rem; color: var(--muted); }
.adm-model-state { margin-left: auto; font-size: .88rem; }
.adm-model-state.ok { color: #1F8A52; }
.adm-model-state.part { color: #B7791F; }
.adm-model-state.none { color: var(--muted); }
.adm-model-progress { margin-top: 10px; }
.adm-model-progress .bar { margin-bottom: 6px; }
.adm-model-log { font-size: .85rem; color: var(--ink-soft); }
.adm-model .adm-actions form { display: inline; }

/* ---------- Подвал ---------- */

.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 32px; margin-top: 24px; }
.site-footer .wrap { max-width: 1080px; }
.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.footer-nav h3 { font-size: 1rem; margin: 0 0 10px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 6px; font-size: .92rem; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.footer-nav [aria-current] { color: var(--ink); font-weight: 500; }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
.footer-bottom p { margin: 0 0 8px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-legal a { color: var(--muted); }

/* ---------- Доступность ---------- */

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

[hidden] { display: none !important; }
