/* Көмекші — the corridor timetable board.
   Board felt ground, grooved rows, white slot capitals, one bell-red "today" ribbon, four subject tile colours. */
:root {
  --board: #142019;          /* felt, deep green-black */
  --board-2: #1b2a22;        /* raised felt */
  --board-3: #24372c;
  --groove: rgba(232, 240, 233, .09);
  --groove-strong: rgba(232, 240, 233, .16);
  --chalk: #eef2ec;          /* slot letters */
  --chalk-2: #b9c6bd;        /* secondary text on felt, ≥4.5:1 on --board */
  --chalk-3: #8fa497;        /* tertiary on felt (large text only) */
  --bell: #e2483d;           /* today ribbon, primary action */
  --bell-ink: #ffffff;
  --bell-deep: #b8352c;
  --ochre: #e0ad4a; --sky: #86bde0; --mint: #93d4b2; --rose: #eaa0aa;
  --paper: #f3f6f2;          /* work surface (chat, forms) */
  --paper-2: #e7ece6;
  --ink: #142019;
  --ink-2: #44554a;          /* ≥4.5:1 on paper */
  --line: #cfd8d1;
  --ok: #2f8a5b;
  --warn: #b7791f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 20, 14, .18), 0 10px 28px -14px rgba(10, 20, 14, .45);
  --display: 'Fira Sans Extra Condensed', 'Golos Text', sans-serif;
  --body: 'Golos Text', system-ui, sans-serif;
  --row: 64px;               /* groove pitch of the board */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--body); color: var(--chalk); background: var(--board); font-variant-numeric: tabular-nums; }
::selection { background: var(--bell); color: #fff; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--board-3) transparent; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- slot letters ---------- */
.slot { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: .95; color: var(--chalk); }
.slot .l { display: inline-block; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 5px; font: 700 13px/1 var(--display);
  letter-spacing: .06em; text-transform: uppercase; color: #142019; background: var(--ochre); white-space: nowrap; }
.tag.sky { background: var(--sky); } .tag.mint { background: var(--mint); } .tag.rose { background: var(--rose); }
.tag.chalk { background: var(--chalk); } .tag.ochre { background: var(--ochre); }
.tag.tile { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 7px; }
.tag svg { width: 20px; height: 20px; flex: none; } .tag.ghost { background: transparent; color: var(--chalk-2); box-shadow: inset 0 0 0 1.5px currentColor; }
.state { display: inline-flex; align-items: center; gap: 7px; font: 600 13px/1 var(--body); color: var(--chalk-2); white-space: nowrap; }
.state::before { content: ''; width: 22px; height: 0; border-top: 3px solid var(--mint); }
.state.planned::before { border-top: 3px dashed var(--chalk-3); }
.state.live::before { border-top-color: var(--bell); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius);
  font: 700 16px/1 var(--body); cursor: pointer; text-decoration: none; transition: transform .15s cubic-bezier(.2,.8,.2,1), background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--bell); color: var(--bell-ink); box-shadow: 0 1px 0 var(--bell-deep), 0 10px 24px -12px rgba(226, 72, 61, .8); }
.btn.primary:hover { background: #ec5448; }
.btn.chalk { background: var(--chalk); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 1.5px var(--groove-strong); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--chalk-2); }
.btn.quiet { background: var(--paper-2); color: var(--ink); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- board ---------- */
.board { position: relative; background: url(/static/img/felt.png) 0 0 / 256px 256px repeat,
    radial-gradient(1200px 600px at 20% -10%, #1d2e25 0, transparent 60%), var(--board); }
/* a groove = a pressed channel under a line of letters: dark cut + light lip */
.frame { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: var(--row); gap: 16px; border-bottom: 1.5px solid var(--groove); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark .slot { font-size: 30px; letter-spacing: .04em; }
.wordmark .mark { width: 28px; height: 28px; border-radius: 6px; background: var(--bell); display: grid; place-items: center; }
.wordmark .mark svg { width: 16px; height: 16px; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px var(--groove-strong); }
.lang a { padding: 6px 9px; border-radius: 6px; font: 700 13px/1 var(--display); letter-spacing: .06em; text-decoration: none; color: var(--chalk-2); }
.lang a.on { background: var(--chalk); color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 10px; }

/* hero */
.hero { display: flex; flex-direction: column; padding: calc(var(--row) * .5) 0 calc(var(--row) * 1); }
.hero h1 { --lh: clamp(64px, 9.6vw, 128px); margin: 0; font-size: clamp(54px, 8.4vw, 112px); line-height: var(--lh); }
/* each headline line sits in its own groove: letters' baseline rests on the channel */
.hero h1 .line { display: block; line-height: var(--lh);
  background: repeating-linear-gradient(180deg, transparent 0 calc(var(--lh) - 3.5px), var(--groove) calc(var(--lh) - 3.5px) calc(var(--lh) - 2px), rgba(0, 0, 0, .32) calc(var(--lh) - 2px) var(--lh));
  background-origin: border-box; }
.hero h1 .line + .line { color: var(--chalk-2); }
.hero p.lead { max-width: 56ch; margin: 22px 0 0; font-size: clamp(17px, 1.6vw, 20px); color: var(--chalk-2); }
.demo { margin-top: 34px; border-radius: 14px; background: var(--board-2); box-shadow: inset 0 0 0 1.5px var(--groove-strong), var(--shadow); overflow: hidden; }
.demo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-bottom: 1.5px solid var(--groove); }
.demo-head .slot { font-size: 26px; }
.demo-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid { padding: 14px 18px 18px; border-right: 1.5px solid var(--groove); }
.grid table { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { text-align: left; font: 600 12px/1 var(--body); color: var(--chalk-3); padding: 0 6px 8px; letter-spacing: .02em; }
.grid td { padding: 0 6px; height: 36px; border-top: 1px solid var(--groove); color: var(--chalk-2); transition: background .25s, color .25s; }
.grid tr.now td { background: var(--bell); color: #fff; border-top-color: var(--bell); }
.grid tr.now td.cell span { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55); }
.grid tr.now td.cell span.on { box-shadow: none; }
.grid td.cell { width: 52px; text-align: center; }
.grid td.cell span { display: inline-grid; place-items: center; width: 34px; height: 26px; border-radius: 5px; font: 800 17px/1 var(--display);
  color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--groove-strong); transition: background .25s, box-shadow .25s, color .25s; }
.grid td.cell span.on { background: var(--chalk); box-shadow: none; }

.chatdemo { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.bubble { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.bubble.me { align-self: flex-end; background: var(--chalk); color: var(--ink); border-bottom-right-radius: 4px; }
.bubble.it { align-self: flex-start; background: var(--board-3); color: var(--chalk); border-bottom-left-radius: 4px; }
.bubble.ask { background: #2c241a; box-shadow: inset 0 0 0 1.5px rgba(224, 173, 74, .45); }
.bubble .actions { display: flex; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 8px; font: 700 13px/1 var(--body); }
.chip.ok { background: var(--bell); color: #fff; } .chip.no { box-shadow: inset 0 0 0 1.5px var(--groove-strong); color: var(--chalk-2); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 30px; }
/* primary action = the bell-red "today" ribbon, one row tall, flat like the board strips */
.btn.ribbon { min-height: var(--row); padding: 0 30px; border-radius: 3px; box-shadow: inset 0 -3px 0 var(--bell-deep);
  font: 800 22px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.btn.ribbon:hover { background: #ec5448; }
.btn.ribbon svg { width: 22px; height: 22px; }
.bubble .chip.ok { position: relative; }
.bubble .cursor { position: absolute; right: -10px; bottom: -14px; width: 22px; height: 22px; color: var(--chalk); filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.state.ask { color: var(--ochre); }
.state.ask::before { border-top-color: var(--ochre); }
.cta-row .note { color: var(--chalk-2); font-size: 15px; }
.ribbon { position: relative; }

/* sections on the board: rows, not cards */
.sec { padding: calc(var(--row) * 1.25) 0 calc(var(--row) * .75); border-top: 1.5px solid var(--groove-strong); }
.sec h2 { margin: 0 0 calc(var(--row) * .5); font-size: clamp(40px, 5.6vw, 72px); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: var(--row);
  padding: 12px 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .32), inset 0 -3.5px 0 var(--groove); }
.rows .what { font: 700 21px/1.25 var(--body); color: var(--chalk); }
.rows .what small { display: block; margin-top: 4px; font: 400 15px/1.45 var(--body); color: var(--chalk-2); }
.rows .n { font: 800 44px/1 var(--display); color: var(--chalk-3); }
.safe li { grid-template-columns: 40px minmax(0, 1fr); }
.safe li svg { width: 26px; height: 26px; color: var(--mint); }
.price-row .sum { font: 800 40px/1 var(--display); color: var(--chalk); white-space: nowrap; }
.price-row .sum small { font: 600 16px/1 var(--body); color: var(--chalk-2); margin-left: 4px; }
details.faq { padding: 18px 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .32), inset 0 -3.5px 0 var(--groove); }
details.faq summary { cursor: pointer; font: 700 19px/1.35 var(--body); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary svg { width: 24px; height: 24px; flex: none; color: var(--chalk-2); }
details.faq summary .i-minus, details.faq[open] summary .i-plus { display: none; }
details.faq[open] summary .i-minus { display: block; }
details.faq p { margin: 10px 0 0; max-width: 70ch; color: var(--chalk-2); }
.final { padding: calc(var(--row) * 1.5) 0; text-align: left; }
.final h2 { font-size: clamp(48px, 7vw, 96px); margin: 0 0 26px; }
footer.foot { padding: 26px 0 40px; border-top: 1.5px solid var(--groove); color: var(--chalk-3); font-size: 14px; }

/* ---------- auth & simple pages on felt ---------- */
.narrow { max-width: 460px; margin: 0 auto; padding: calc(var(--row) * .75) 20px calc(var(--row) * 1.5); }
.panel { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 28px 26px; box-shadow: var(--shadow); }
.panel h1 { margin: 0 0 18px; font-size: 44px; color: var(--ink); }
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; margin-bottom: 6px; font: 600 14px/1.3 var(--body); color: var(--ink-2); }
.field small { display: block; margin-top: 6px; color: var(--ink-2); font-size: 13px; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font: 400 16px/1.4 var(--body); color: var(--ink); background: #fff; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(224, 173, 74, .45); }
.input::placeholder { color: #6b7a70; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 14px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--bell); flex: none; }
.err { margin: 0 0 16px; padding: 11px 14px; border-radius: var(--radius); background: #fde8e6; color: #8a2119; font-weight: 600; font-size: 14px; }
.ok-note { margin: 0 0 16px; padding: 11px 14px; border-radius: var(--radius); background: #e3f3ea; color: #1d5e3c; font-weight: 600; font-size: 14px; }
.alt { margin: 18px 0 0; text-align: center; color: var(--chalk-2); }

/* ---------- workspace ---------- */
.shell { display: grid; grid-template-rows: auto 1fr; height: 100dvh; }
.appbar { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 16px; border-bottom: 1.5px solid var(--groove-strong); background: var(--board); }
.appbar .wordmark .slot { font-size: 24px; }
.appbar nav { display: flex; gap: 4px; margin-left: 8px; }
.appbar nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font: 600 14px/1 var(--body); color: var(--chalk-2); }
.appbar nav a.on { color: var(--chalk); background: var(--board-3); }
.appbar .sp { flex: 1; }
.appbar .meta { font-size: 13px; color: var(--chalk-2); }
.work { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); min-height: 0; }
.chat { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; background: var(--paper); color: var(--ink); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head .status { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--body); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa9a0; }
.dot.running { background: var(--bell); animation: pulse 1.2s ease-in-out infinite; }
.dot.waiting { background: var(--warn); }
.dot.done { background: var(--ok); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(226, 72, 61, .18); } }
.chat-head .sp { flex: 1; }
.feed { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-color: var(--line) transparent; }
.msg { max-width: 94%; padding: 10px 13px; border-radius: 12px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--board); color: var(--chalk); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #fff; box-shadow: 0 1px 2px rgba(20, 32, 25, .12); border-bottom-left-radius: 4px; }
.msg.assistant.ask { box-shadow: inset 0 0 0 2px var(--ochre); }
.msg.step { align-self: stretch; max-width: none; padding: 4px 2px 4px 30px; background: transparent; color: var(--ink-2); font-size: 14px; position: relative; }
.msg.step::before { content: ''; position: absolute; left: 8px; top: 13px; width: 14px; border-top: 2px solid var(--ok); }
.msg.system { align-self: center; max-width: 100%; background: transparent; color: var(--ink-2); font-size: 13px; text-align: center; }
.msg .files { display: block; margin-top: 6px; font-size: 12px; opacity: .8; }
.msg.confirm { align-self: stretch; max-width: none; background: #fff6e8; box-shadow: inset 0 0 0 2px var(--ochre); }
.msg.confirm b { display: block; margin-bottom: 4px; font-size: 13px; color: #7a4d06; }
.msg.confirm .actions { display: flex; gap: 8px; margin-top: 12px; }
.msg.confirm.decided .actions { display: none; }
.msg.shot img { display: block; margin-top: 8px; border-radius: 8px; max-width: 100%; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--paper); }
.composer .files-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.composer .file { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 7px; background: var(--paper-2); font-size: 13px; }
.composer .file button { border: 0; background: none; cursor: pointer; padding: 0 2px; font-size: 15px; color: var(--ink-2); }
.composer textarea { width: 100%; min-height: 52px; max-height: 160px; resize: none; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font: 400 15px/1.45 var(--body); color: var(--ink); background: #fff; }
.composer textarea:focus { outline: none; border-color: var(--ink); }
.composer .tools { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.composer .tools .sp { flex: 1; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 11px; border: 0; border-radius: 9px; background: var(--paper-2);
  color: var(--ink); font: 600 13px/1 var(--body); cursor: pointer; }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn:hover { background: #dbe3dc; }
.screen { position: relative; min-height: 0; background: var(--board-2); }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.screen-bar { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; gap: 8px; }
.start { display: grid; place-items: center; min-height: 0; padding: 24px; }
.start .card { max-width: 560px; }
.start h2 { margin: 0 0 12px; font-size: 52px; }
.start p { color: var(--chalk-2); margin: 0 0 22px; }
.examples { margin-top: 26px; }
.examples h3 { margin: 0 0 8px; font: 600 14px/1 var(--body); color: var(--chalk-3); }
.examples button { display: block; width: 100%; text-align: left; margin: 0 0 8px; padding: 12px 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--board-3); color: var(--chalk); font: 400 15px/1.4 var(--body); }
.examples button:hover { background: #2c4335; }
.mob-switch { display: none; }

/* ---------- light pages: settings, billing ---------- */
.page { max-width: 880px; margin: 0 auto; padding: 32px 20px 64px; }
.page h1 { margin: 0 0 22px; font-size: 52px; }
.page .panel + .panel { margin-top: 18px; }
.panel h2 { margin: 0 0 14px; font: 700 20px/1.3 var(--body); color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plan { padding: 18px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); }
.plan .sum { font: 800 44px/1 var(--display); color: var(--ink); margin: 6px 0 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font: 600 12px/1.4 var(--body); background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.pill.paid, .pill.done, .pill.approved { background: #e3f3ea; color: #1d5e3c; }
.pill.pending, .pill.waiting, .pill.running { background: #fff1d6; color: #7a4d06; }
.pill.cancelled, .pill.failed, .pill.declined, .pill.stopped { background: #fde8e6; color: #8a2119; }

/* emulated Kaspi screen */
.kaspi { max-width: 400px; margin: 40px auto; background: #fff; color: #111; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.kaspi .kh { background: #f14635; color: #fff; padding: 18px 22px; font: 700 18px/1.2 var(--body); display: flex; justify-content: space-between; }
.kaspi .kb { padding: 22px; }
.kaspi .amount { font: 800 48px/1 var(--display); margin: 8px 0 18px; }
.kaspi .emu { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: #fff4e5; color: #6b4a12; font-size: 13px; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
.admin aside { background: var(--board); border-right: 1.5px solid var(--groove-strong); padding: 16px 12px; }
.admin aside .wordmark .slot { font-size: 24px; }
.admin aside .wordmark { display: inline-flex; white-space: nowrap; padding: 0; }
.admin aside a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--chalk-2); font: 600 14px/1 var(--body); }
.admin aside a.on { background: var(--board-3); color: var(--chalk); }
.admin main { background: var(--paper); color: var(--ink); padding: 26px 28px 60px; min-width: 0; }
.admin main h1 { margin: 0 0 20px; font-size: 44px; color: var(--ink); }
.admin main h2 { margin: 30px 0 12px; font: 700 18px/1.3 var(--body); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
.kpi { background: #fff; padding: 16px 18px; }
.kpi .v { font: 800 36px/1 var(--display); color: var(--ink); }
.kpi .k { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.kpi .s { margin-top: 2px; font-size: 12px; color: var(--ink-2); }
.bar { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar i.hot { background: var(--bell); }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff1d6; color: #6b4a12; font-size: 14px; margin: 0 0 16px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form .input { min-height: 34px; width: 90px; padding: 6px 8px; font-size: 13px; }
.scroll-x { overflow-x: auto; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --row: 56px; }
  .demo-body { grid-template-columns: 1fr; }
  .grid { border-right: 0; border-bottom: 1.5px solid var(--groove); }
  .rows li { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 14px; padding: 14px 0; }
  .rows li > .tag { margin-top: 2px; }
  .rows li > .state { grid-column: 2; }
  .rows li > .sum { grid-column: 2; }
  .rows .what { font-size: 19px; }
  .rows.steps li { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .rows .n { font-size: 34px; }
  .rows.steps li > .tag { grid-column: 3; }
  .work { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .work .chat, .work .screen, .work .start { grid-area: 1 / 1; }
  .work[data-view="chat"] .screen, .work[data-view="chat"] .start { display: none; }
  .work[data-view="screen"] .chat { display: none; }
  .mob-switch { display: flex; gap: 4px; padding: 3px; border-radius: 9px; box-shadow: inset 0 0 0 1.5px var(--groove-strong); }
  .mob-switch button { border: 0; background: none; color: var(--chalk-2); font: 700 13px/1 var(--body); padding: 7px 10px; border-radius: 7px; }
  .mob-switch button.on { background: var(--chalk); color: var(--ink); }
  .appbar nav { display: none; }
  .admin { grid-template-columns: 1fr; }
  .admin aside { display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .admin aside a { white-space: nowrap; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2, .plans { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .frame { padding: 0 16px; }
  .topbar nav { gap: 6px; }
  .topbar .btn.ghost { min-height: 34px; padding: 0 11px; font-size: 13px; }
  .lang a { padding: 6px 7px; }
  .wordmark .slot { font-size: 26px; }
  .hero { padding-top: 10px; padding-bottom: calc(var(--row) * .75); }
  .hero h1 { --lh: clamp(46px, 13vw, 60px); font-size: clamp(40px, 11.6vw, 54px); }
  .hero p.lead { margin-top: 12px; font-size: 16px; line-height: 1.45; }
  /* phone order: headline → lead → ribbon → demo (chat first, 3 rows) */
  .hero .cta-row { order: 3; margin-top: 16px; gap: 8px 14px; }
  .hero .cta-row .btn.ribbon { width: 100%; }
  .hero .cta-row .note { font-size: 14px; }
  .hero .demo { order: 4; margin-top: 18px; }
  .demo-head { padding: 10px 14px; } .demo-head .slot { font-size: 22px; }
  .chatdemo { order: -1; padding: 12px 14px; gap: 8px; }
  .demo-body { display: flex; flex-direction: column; }
  .grid { order: 2; border-top: 1.5px solid var(--groove); border-bottom: 0; padding: 8px 14px 12px; }
  .grid tbody tr:nth-child(n+4) { display: none; }
  .chatdemo .bubble { font-size: 13.5px; padding: 8px 11px; }
  .chatdemo.asked #demoIt { display: none; }
  .grid td.cell { width: 40px; }
  .grid td.cell span { width: 30px; }
  .grid .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
