/* Стенограф: дизайн-система из stenograf/site/DESIGN.md. Системные шрифты, без внешних ресурсов. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #566070;
  --accent: #1d58b8;
  --accent-h: #174693;
  --on-accent: #ffffff;
  --accent-soft: #e8effa;
  --err: #b3261e;
  --ok: #1b7040;
  --line: #d9d6cc;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%);
  --radius: 12px;
  --radius-sm: 10px;
  --gutter: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --surface: #1d2126;
    --text: #eceef1;
    --muted: #a3acb8;
    --accent: #7da8f0;
    --accent-h: #9bbdf5;
    --on-accent: #14171b;
    --accent-soft: #232d3d;
    --err: #ff8a80;
    --ok: #6fd197;
    --line: #343a42;
    --shadow: none;
  }
  .btn { background: #5a8fe6; }
  .btn:active { background: #5a8fe6; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; outline: none; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; font-weight: 680; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p, ul, ol { margin: 0 0 16px; }
p, li { max-width: 68ch; }
ul, ol { padding-left: 22px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-h); }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: 8px; top: -64px; z-index: 30; background: var(--surface); color: var(--text);
  padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* шапка и подвал */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.logo-mark { color: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 500; transition: color 140ms ease; }
.nav a[aria-current="page"] { color: var(--accent); }
.site-footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.site-footer p { margin: 0 0 8px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* секции */
.section { padding-block: 40px; }
.section-tight { padding-block: 24px; }
.hero { padding: 40px 0 32px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 8px; }
.page-head { padding: 32px 0 8px; }
.prose { padding-bottom: 16px; }
.prose h2 { margin-top: 32px; }
.prose h3 { margin-top: 24px; }

/* кнопки */
.btn, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: var(--radius-sm); font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; touch-action: manipulation;
  transition: transform 140ms ease-out, background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn { background: var(--accent); color: var(--on-accent); }
.btn:hover { color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { color: var(--text); }
.btn-danger { background: var(--surface); color: var(--err); border-color: var(--err); }
.btn-danger:hover { color: var(--err); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn:active, .btn-secondary:active, .btn-danger:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-h); }
  .btn-secondary:hover { border-color: var(--accent); }
  .btn-danger:hover { background: var(--err); color: var(--surface); }
}
button:disabled, [aria-busy="true"] { opacity: 0.55; cursor: not-allowed; }

/* формы */
.form { display: grid; gap: 16px; max-width: 420px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field input {
  min-height: 48px; padding: 0 14px; font: 400 16px/1.2 var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--muted); border-radius: var(--radius-sm); width: 100%;
}
.field input.code { font-family: var(--mono); font-size: 22px; letter-spacing: 0.3em; text-align: center; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.error { color: var(--err); font-size: 15px; margin: 0; }
.notice { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* сетка и карточки */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 4px; }
.card .price { font-size: 32px; font-weight: 700; line-height: 1.1; margin: 8px 0; font-variant-numeric: tabular-nums; }
.card .price small { font-size: 18px; font-weight: 600; }
.card dl { margin: 12px 0 0; display: grid; gap: 4px; font-size: 15px; }
.card dt { color: var(--muted); }
.card dd { margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 60px; position: relative; max-width: none; }
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center;
}
.features { list-style: none; padding: 0; display: grid; gap: 12px; }
.features li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: none; }
.features strong { display: block; margin-bottom: 2px; }

/* пример результата */
.sample { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.sample-label { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; margin-bottom: 12px; }
.sample-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; }
.sample-row:last-child { margin-bottom: 0; }
.sample-time { font-family: var(--mono); font-size: 14px; color: var(--muted); padding-top: 2px; }
.sample-who { font-weight: 600; }
.sample-text { grid-column: 2; margin: 0; }

/* FAQ */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.faq summary { cursor: pointer; padding: 14px 16px; min-height: 48px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--accent); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 16px 14px; }
.faq .answer p { margin: 0; }

/* таблица */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { font-weight: 600; font-size: 14px; color: var(--muted); }

/* кабинет */
.cabinet { padding-top: 16px; padding-bottom: 32px; display: grid; gap: 16px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.balance { font-weight: 600; font-variant-numeric: tabular-nums; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 24px 16px; text-align: center; display: grid; gap: 12px; justify-items: center; transition: border-color 140ms ease, background-color 140ms ease; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone p { margin: 0; }
progress { width: 100%; height: 12px; border-radius: 6px; overflow: hidden; border: 0; background: var(--accent-soft); accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--accent-soft); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.upload-status { font-size: 14px; color: var(--muted); margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form .field { flex: 1 1 240px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.feed { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 160px; max-height: 60dvh; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.feed-empty { color: var(--muted); margin: 0; align-self: center; text-align: center; }
.msg { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; max-width: 640px; animation: msg-in 200ms var(--ease-out); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-file { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; }
.net { color: var(--muted); font-size: 14px; margin: 0; min-height: 20px; }
.toast {
  position: fixed; left: 50%; bottom: 16px; z-index: 20; max-width: min(92vw, 420px); background: var(--text); color: var(--bg);
  padding: 12px 16px; border-radius: var(--radius-sm); opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.toast.is-alert { background: var(--err); color: var(--surface); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .grid-2, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: 56px; }
  .hero { padding: 64px 0 40px; }
}
@media (min-width: 960px) {
  body { font-size: 17px; }
  h1 { font-size: 40px; line-height: 1.1; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .cabinet { grid-template-columns: 340px 1fr; align-items: start; }
  .cabinet .side { display: grid; gap: 16px; }
  .feed { max-height: 70dvh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
  .btn:active, .btn-secondary:active, .btn-danger:active { transform: none; }
  .toast, .toast.is-visible { transform: translate(-50%, 0); transition: opacity 140ms ease; }
}

/* дополнения: списки-ссылки и фокус скрытого поля файла */
.toolbar { list-style: none; padding: 0; }
.toolbar li { max-width: none; }
.platform-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; font-weight: 600; }
.visually-hidden:focus-visible + .btn { outline: 2px solid var(--accent); outline-offset: 2px; }

/* вход: карточка по центру */
.auth-card { max-width: 420px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.auth-card h1 { font-size: 24px; margin: 0; }
.auth-card .form { max-width: none; }
.auth-card p { margin: 0; }
.auth-card .btn, .auth-card .btn-secondary { width: 100%; }

/* пакеты: компактные карточки */
.packs { gap: 12px; }
.packs .card { padding: 16px; position: relative; }
.packs .card h3 { font-size: 16px; color: var(--muted); font-weight: 600; margin: 0; }
.packs .card .price { font-size: 32px; margin: 4px 0; }
.card-meta { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-badge { position: absolute; top: -10px; left: 12px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.packs + .hint { margin-top: 12px; }
.packs { grid-template-columns: repeat(2, 1fr); }
.only-wide { display: none; }

/* герой с макетом результата */
.hero-grid { display: grid; gap: 32px; }
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg); }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-body { padding: 16px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 0; margin: 4px 0 0; border-top: 1px solid var(--line); }
.chips li { margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 13px/1.6 var(--mono); max-width: none; }

/* лента: пустое состояние */
.feed-empty { padding: 24px 8px; }

@media (min-width: 640px) {
  .only-wide { display: block; }
}
@media (min-width: 960px) {
  .packs { grid-template-columns: repeat(4, 1fr); }
  .hero-grid { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px; }
}
.cabinet .side { display: grid; gap: 16px; }

/* покупка минут в кабинете */
.pack-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.pack-list li { max-width: none; }
.pack-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.pack-price { font-weight: 700; }
#buy { transition: border-color 200ms var(--ease-out); }
#buy.is-target { border-color: var(--accent); }
#buy:focus { outline: none; }
