/* Antri Sehat — общие стили. Светлая и тёмная тема, телефон в первую очередь. */
:root {
  --bg: #f4f7f5; --surface: #ffffff; --surface-2: #eef3f0; --line: #dbe4df;
  --ink: #12261e; --ink-2: #3f5a4e; --muted: #6b8479;
  --brand: #0e7c5a; --brand-ink: #ffffff; --brand-soft: #dff2ea; --brand-deep: #0a5c43;
  --accent: #f2a516; --accent-soft: #fff3d6;
  --danger: #c2412d; --danger-soft: #fde7e2; --info: #2563a8; --info-soft: #e1ecf8;
  --shadow: 0 1px 2px rgba(18, 38, 30, .06), 0 6px 20px rgba(18, 38, 30, .06);
  --r: 14px; --r-s: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1713; --surface: #13211b; --surface-2: #192b23; --line: #26392f;
    --ink: #e8f2ed; --ink-2: #b3c7bd; --muted: #84998f;
    --brand: #2bb685; --brand-ink: #04140d; --brand-soft: #173a2d; --brand-deep: #5fd3a8;
    --accent: #f5b941; --accent-soft: #3a2f14;
    --danger: #f0765f; --danger-soft: #3c1f19; --info: #7fb2ec; --info-soft: #182b40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1713; --surface: #13211b; --surface-2: #192b23; --line: #26392f;
  --ink: #e8f2ed; --ink-2: #b3c7bd; --muted: #84998f;
  --brand: #2bb685; --brand-ink: #04140d; --brand-soft: #173a2d; --brand-deep: #5fd3a8;
  --accent: #f5b941; --accent-soft: #3a2f14;
  --danger: #f0765f; --danger-soft: #3c1f19; --info: #7fb2ec; --info-soft: #182b40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }

/* шапка */
.top {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; }
.logo img { width: 34px; height: 34px; border-radius: 9px; }
.logo small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; margin-top: -2px; }
.top .sp { flex: 1; }
.pill-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.pill-btn:hover { border-color: var(--brand); color: var(--brand); }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 16px 32px; }
.narrow { max-width: 620px; }

/* карточки и кнопки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .06s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.line { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.wa { background: #1fa855; color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }

label.f { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--ink-2); }
.in {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); outline: none;
}
.in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.err { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 1.2em; margin-top: 8px; }

/* выбор вариантов (сетка кнопок) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice {
  text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; min-height: 56px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.choice:hover { border-color: var(--brand); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice b { font-weight: 700; }
.choice small { color: var(--muted); font-size: 13px; }
.choice[disabled] { opacity: .45; cursor: not-allowed; background: var(--surface-2); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: var(--brand-soft); color: var(--brand-deep); }
.tag.warn { background: var(--accent-soft); color: #8a5a00; }
:root[data-theme="dark"] .tag.warn { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.warn { color: var(--accent); } }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.tag.info { background: var(--info-soft); color: var(--info); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }
.hide { display: none !important; }

/* шаги записи */
.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps i { flex: 1; height: 5px; border-radius: 5px; background: var(--line); }
.steps i.on { background: var(--brand); }

/* подвал с подписью */
.foot { text-align: center; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--muted); }
.foot a { color: var(--muted); }
.foot .made { margin-top: 6px; }

.toast {
  position: fixed; right: 16px; top: 70px; z-index: 50; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px;
  font-weight: 600; box-shadow: var(--shadow); max-width: min(360px, calc(100vw - 32px)); animation: tin .2s ease-out;
}
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

.dialog-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--surface); border-radius: var(--r); max-width: 720px; width: 100%; max-height: 86vh; overflow: auto; padding: 20px; box-shadow: var(--shadow); }
pre.code { background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: 12px; overflow: auto; white-space: pre; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
