/* Layout: одна колонка как карточка словаря. Сверху фраза «штука, которая…» с полем ввода, ниже статья-ответ, затем похожие слова. */
:root {
  --bg: #F4F4F8;
  --surface: #FFFFFF;
  --ink: #16151F;
  --muted: #666476;
  --line: #DEDCE8;
  --accent: #5B34E8;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECE7FD;
  --mark: #FFE45C;
  --mark-ink: #1A1500;
  --good: #17703F;
  --good-soft: #DCF2E5;
  --bad: #B3261E;
  --bad-soft: #FBE4E2;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0E15; --surface: #181722; --ink: #EFEEF6; --muted: #9D9BB0; --line: #2A2838;
    --accent: #A38BFF; --accent-ink: #12101C; --accent-soft: #2A2250;
    --good: #7FDCA2; --good-soft: #14301F; --bad: #FF9D96; --bad-soft: #3B1C1A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0E15; --surface: #181722; --ink: #EFEEF6; --muted: #9D9BB0; --line: #2A2838;
  --accent: #A38BFF; --accent-ink: #12101C; --accent-soft: #2A2250;
  --good: #7FDCA2; --good-soft: #14301F; --bad: #FF9D96; --bad-soft: #3B1C1A; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  padding-block: 24px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.eyebrow a { color: inherit; text-decoration: none; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.45rem, 6.2vw, 2.25rem); line-height: 1.18; margin: 6px 0 0; text-wrap: balance; overflow-wrap: anywhere; }
h1 span { background: var(--mark); color: var(--mark-ink); padding: 0 0.18em; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.intro { margin: 10px 0 0; color: var(--muted); max-width: 60ch; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { font: inherit; font-weight: 500; font-size: 0.95rem; background: none; color: var(--muted); border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; margin-bottom: -1px; cursor: pointer; min-height: 44px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; gap: 10px; flex-wrap: wrap; }
.field input { flex: 1 1 240px; min-width: 0; font: inherit; font-size: 1.05rem; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.field input:focus { border-color: var(--accent); }
.lbl { font-size: 0.86rem; color: var(--muted); margin: 0 0 6px; display: block; }
h2.lbl { font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font: inherit; font-size: 0.86rem; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 36px; }
.chip:hover { border-color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.tag { margin: 0; font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.word { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.45rem, 6.5vw, 2.2rem); line-height: 1.15; margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
.folk { margin: 0; color: var(--muted); font-size: 0.95rem; }
.folk mark { background: var(--mark); color: var(--mark-ink); padding: 0 0.2em; border-radius: 3px; }
.what { margin: 0; }
.shops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shops .t { font-size: 0.84rem; color: var(--muted); width: 100%; }
a.shop, button.btn, a.btn { font: inherit; font-size: 0.92rem; font-weight: 500; text-decoration: none; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--accent); color: var(--accent); background: transparent; cursor: pointer; min-height: 42px; display: inline-flex; align-items: center; }
a.shop.first, button.btn.solid { background: var(--accent); color: var(--accent-ink); }
button.btn.plain, a.btn.plain { border-color: var(--line); color: var(--ink); }
button.btn.danger { border-color: var(--bad); color: var(--bad); }
.more { display: flex; flex-direction: column; gap: 8px; }
.more h3 { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.alt { text-align: left; font: inherit; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.alt:hover { border-color: var(--accent); }
.alt b { font-weight: 600; }
.alt small { color: var(--muted); font-size: 0.85rem; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--muted); }
.quiz-q { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.15rem, 5vw, 1.6rem); line-height: 1.25; margin: 0; text-wrap: balance; }
.opts { display: grid; gap: 10px; }
.opt { font: inherit; text-align: left; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 48px; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { cursor: default; }
.score { font-size: 0.9rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
details.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
details.entry summary { cursor: pointer; padding: 12px 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
details.entry summary::-webkit-details-marker { display: none; }
details.entry[open] summary { padding-bottom: 6px; }
details.entry .in { padding: 4px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.form { display: grid; gap: 12px; }
.form label { font-size: 0.85rem; color: var(--muted); display: grid; gap: 4px; }
.form input, .form textarea { width: 100%; font: inherit; color: var(--ink); padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); }
.form textarea { min-height: 72px; resize: vertical; }
.form .hintline { font-size: 0.8rem; color: var(--muted); }
.admin-row { display: flex; gap: 10px; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; flex-wrap: wrap; }
.admin-row .nm { min-width: 0; flex: 1 1 200px; display: flex; flex-direction: column; }
.admin-row .nm small { color: var(--muted); overflow-wrap: anywhere; }
.admin-row .ops { display: flex; gap: 8px; }
.admin-row .ops button { min-height: 36px; padding: 6px 12px; }
.msg { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 0.9rem; }
.msg.bad { background: var(--bad-soft); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.seoall ul { margin: 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 20px; font-size: 0.88rem; }
.seoall li { break-inside: avoid; padding: 2px 0; }
.seoall a { color: var(--muted); text-decoration: none; }
.seoall a:hover { color: var(--accent); text-decoration: underline; }
.form select { width: 100%; font: inherit; color: var(--ink); padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); }
.topnav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.92rem; margin-top: 10px; }
.topnav a { color: var(--accent); text-decoration: none; font-weight: 500; }
.topnav a:hover { text-decoration: underline; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.deal .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.deal h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.deal .adv, .deal .until, .deal .terms, .deal .ad { font-size: 0.82rem; color: var(--muted); }
.deal .hd { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dlogo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.dlogo.ph { display: flex; align-items: center; justify-content: center; background: var(--accent-soft, rgba(91,52,232,.12)); color: var(--accent); font-weight: 700; font-size: 1.1rem; }
.deal .until.soon { color: var(--bad); font-weight: 600; }
.deal p { margin: 0; }
.codebox { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600; letter-spacing: 0.06em; padding: 10px 14px; border: 2px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); user-select: all; overflow-wrap: anywhere; }
.foot { font-size: 0.84rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.foot p { margin: 0; max-width: 62ch; }
.foot a { color: var(--accent); }
.community { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.community .lbl { margin: 0; }
.community nav, .legal { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.fine { font-size: 0.8rem; color: var(--muted); }
.legaldoc h3 { margin: 18px 0 6px; font-size: 1rem; }
.legaldoc p, .legaldoc li { font-size: 0.92rem; line-height: 1.55; margin: 0 0 8px; }
.legaldoc ul { margin: 0 0 8px; padding-left: 20px; }
.todo { background: #fff3a0; color: #000; padding: 0 3px; border-radius: 3px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; margin: 14px 0 4px; }
.chk input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.ckbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 0.88rem; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.ckbar p { margin: 0; flex: 1 1 260px; }
.ckbar div { display: flex; gap: 8px; }
.ckbar button { font: inherit; padding: 8px 14px; border-radius: 10px; border: 2px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; font-weight: 600; }
.ckbar button[data-ck="1"] { background: var(--accent); color: #fff; }
.rec { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: #16a34a; color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; vertical-align: middle; }
.bnrs { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 0 0 16px; }
.bnr-item { display: flex; flex-direction: column; gap: 3px; max-width: 100%; }
.bnr-item .ad { font-size: 0.72rem; color: var(--muted); }
.bnr img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.dpic { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0; pointer-events: none; user-select: none }
.bpreview { max-width: 100%; max-height: 140px; border-radius: 8px; border: 1px solid var(--line); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.4rem; }
.kpi span { font-size: 0.78rem; color: var(--muted); }
.stbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
.stbox h4 { margin: 0 0 8px; font-size: 0.95rem; }
.strow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 0.85rem; padding: 3px 0; }
.strow .nm { overflow-wrap: anywhere; }
.strow .bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.strow .bar i { display: block; height: 100%; background: var(--accent); }
.stchart { width: 100%; height: 90px; display: block; }
.stchart rect { fill: var(--accent); }
.hp { position: absolute !important; left: -9999px; width: 1px !important; height: 1px; opacity: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
