/* yuask app: charcoal backgrounds, Inter and a soft sand accent shared with the landing */

:root {
  --bg: #0c0a09;
  --bg-2: #12100e;
  --bg-3: #1a1714;
  --bg-4: #24201c;
  --ink: #faf8f6;
  --muted: rgba(250, 248, 246, .68);
  --faint: rgba(250, 248, 246, .48);
  --line: rgba(250, 248, 246, .11);
  --line-2: rgba(250, 248, 246, .22);
  --edge: rgba(250, 248, 246, .88);
  --ember: #d8d0c2;
  --ember-2: #ebe4d8;
  --ember-bg: rgba(216, 208, 194, .12);
  --ok: #6fd79a;
  --bad: #ff6a5c;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 16px;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--ui);
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
::selection { background: var(--ember); color: #0c0a09; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ember { color: var(--ember); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font: 500 11px/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.eyebrow.plain::before { display: none; }
h1, h2, h3 { font-variation-settings: "opsz" 32; letter-spacing: -0.04em; font-weight: 500; margin: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px 3px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); font: 500 10px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tag.ember { border-color: var(--ember); color: var(--ember); }
.tag.ok { border-color: var(--ok); color: var(--ok); }
.tag.bad { border-color: var(--bad); color: var(--bad); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 42px; padding: 0 16px;
  border: 1px solid var(--ink); border-radius: var(--radius-sm); background: var(--ink); color: var(--bg);
  font: 500 14px/1 var(--ui); text-decoration: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: #e7e3de; border-color: #e7e3de; }
.btn svg { flex: none; width: 16px; height: 16px; }
.btn.arrow::after { content: ""; width: 6px; height: 6px; border-top: 1.5px solid; border-right: 1.5px solid; transform: rotate(45deg); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn.ember { background: var(--ember); border-color: var(--ember); color: var(--bg); }
.btn.ember:hover { background: var(--ember-2); border-color: var(--ember-2); }
.btn.danger { background: transparent; border-color: rgba(255, 106, 92, .5); color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--bg-3); }
.icon-btn svg { width: 17px; height: 17px; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; margin-bottom: 7px; font: 500 12px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); outline: 0; font-size: 15px;
}
.input:focus { border-color: var(--ember); }
textarea.input { resize: vertical; line-height: 1.5; }
.check { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--ember); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

.spinner { width: 15px; height: 15px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.note { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.note b { color: var(--ink); font-weight: 500; }
.note.warn { border-color: rgba(216, 208, 194, .55); background: var(--ember-bg); color: #e5dacc; }
.note.bad { border-color: rgba(255, 106, 92, .55); background: rgba(255, 106, 92, .08); color: #ffd0cb; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.4; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: rise .2s ease; }
.toast.bad { background: var(--bad); color: #1a0503; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- modal ---------- */
.modal { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(6, 5, 4, .72); backdrop-filter: blur(6px); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--bg-2); border: 1.5px solid var(--edge); padding: 28px;
}
.sheet.wide { width: min(980px, 100%); }
.sheet > .close { position: absolute; top: 12px; right: 12px; }
.sheet h2 { font-size: 28px; line-height: 1.05; margin-bottom: 10px; }
.sheet .lede { margin: 0 0 22px; color: var(--muted); }
.sheet .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sheet .row.end { justify-content: flex-end; }
.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

/* ================= gate: sign in ================= */
.gate { display: grid; grid-template-columns: minmax(0, 1fr) clamp(480px, 32vw, 720px); min-height: calc(100dvh - var(--site-header-height)); }
.gate-art { --art-gutter: clamp(32px, 3vw, 80px); position: relative; overflow: hidden; border-right: 1px solid var(--line); background: var(--bg); }
.gate-art .gate-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 64% center; }
.gate-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 56%, var(--bg) 91%); }
.gate-art .claim { position: absolute; z-index: 2; left: var(--art-gutter); right: var(--art-gutter); bottom: clamp(32px, 5vh, 64px); }
.gate-art .claim h1 { max-width: 12em; font-size: clamp(34px, 3.4vw, 54px); line-height: 1.02; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, .8); }
.gate-art .claim p { margin: 14px 0 0; max-width: 30em; color: var(--muted); text-shadow: 0 1px 12px rgba(0, 0, 0, .9); }
.gate-pane { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 3vw, 64px); }
.gate-pane > .gate-step { width: 100%; max-width: 448px; margin-inline: auto; }

.gate-pane h2 { font-size: 34px; line-height: 1.05; }
.gate-pane .lede { margin: 12px 0 28px; color: var(--muted); }
.gate-step { animation: fade .2s ease; }

.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; margin-bottom: 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-md); background: transparent; text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: var(--ink); background: var(--bg-2); }
.choice .ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.choice .ico svg, .choice .ico img { width: 20px; height: 20px; }
.choice b { display: block; font-weight: 500; font-size: 15px; }
.choice small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.choice .go { margin-left: auto; color: var(--faint); }
.choice.primary { border-color: var(--edge); }
.choice[disabled] { opacity: .45; cursor: not-allowed; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--faint); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; }
.back:hover { color: var(--ink); }
.fineprint { margin-top: 26px; font-size: 12.5px; line-height: 1.5; color: var(--faint); }
.fineprint a { color: var(--muted); }

.keybox {
  position: relative; padding: 18px; border: 1px solid var(--ember); border-radius: var(--radius-md); background: var(--ember-bg);
  font: 500 15px/1.5 var(--mono); letter-spacing: 0; word-break: break-all; color: #e8dfd1;
}
.keybox.blur { filter: blur(6px); user-select: none; }
.keyacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }

/* ================= shell ================= */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: calc(100dvh - var(--site-header-height)); }
.side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.side-top { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 12px 16px; }
.side-title { font-size: 12px; font-weight: 500; color: var(--muted); }
.side-top .icon-btn { display: none; }
.side .new { min-height: 44px; margin: 0 12px 10px; justify-content: flex-start; background: var(--bg-3); }
.side .new:hover { background: var(--bg-4); border-color: var(--ember); }
.side .new svg { width: 16px; height: 16px; }
.side .kbd { margin-left: auto; font: 500 11px/1 var(--mono); opacity: .5; }
.search { position: relative; margin: 0 12px 8px; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); outline: 0; font-size: 13px; }
.search input:focus { border-color: var(--line-2); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.convs { flex: 1; min-height: 0; overflow: auto; padding: 4px 8px 12px; }
.convs h4 { margin: 14px 8px 6px; font: 500 10.5px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.conv { position: relative; display: flex; align-items: center; width: 100%; padding: 10px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; font-size: 13.5px; color: var(--muted); }
.conv span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv:hover { background: var(--bg-3); color: var(--ink); }
.conv.on { background: var(--bg-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.conv .del { display: none; flex: none; width: 24px; height: 24px; margin: -4px -4px -4px 4px; }
.conv:hover .del, .conv.on .del { display: inline-grid; }
.convs .empty { padding: 18px 8px; font-size: 13px; color: var(--faint); }

.side-foot { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.meter { display: block; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-2); text-align: left; }
.meter:hover { border-color: var(--line-2); }
.meter .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meter .bal { font: 500 20px/1 var(--ui); font-variation-settings: "opsz" 32; letter-spacing: -0.03em; }
.meter .bar { height: 3px; margin: 10px 0 8px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--ember); }
.meter .sub { font-size: 12px; color: var(--muted); }
.me { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.me .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px/1 var(--mono); color: var(--muted); }
.side-logout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: 500 13px/1.4 var(--ui); transition: background .15s, color .15s, border-color .15s; }
.side-logout:hover { background: var(--bg-3); border-color: var(--ember); color: var(--ember); }
.side-logout:disabled { opacity: .55; cursor: wait; }
.side-logout svg { flex: none; width: 17px; height: 17px; }
.avatar { flex: none; width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: var(--radius-xs); }

.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.workspace-actions .icon-btn { width: 38px; height: 38px; }
.workspace-actions .workspace-menu { display: none; }
.model { position: relative; display: flex; align-items: center; min-width: 0; max-width: 260px; font-weight: 500; font-size: 13px; }
.model .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px var(--ember); }
.model-btn { display: inline-flex; align-items: center; gap: 7px; min-width: 0; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; font-weight: 500; font-size: 13px; }
.model-btn:hover, .model-btn[aria-expanded="true"] { border-color: var(--line-2); }
.model-btn .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-btn svg { flex: none; width: 14px; height: 14px; color: var(--muted); }
.model-btn .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px var(--ember); }
.model-pop { position: fixed; z-index: 45; width: min(400px, calc(100vw - 24px)); padding: 6px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.model-pop .eyebrow { margin: 8px 12px 8px; }
.model-pop button { display: block; width: 100%; padding: 12px; border: 0; background: none; text-align: left; }
.model-pop button:hover { background: var(--bg-4); }
.model-pop button.on { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--bg-3); }
.model-pop .mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-pop b { font-weight: 500; font-size: 14px; }
.model-pop small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.model-pop .cost { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.model-note { margin: 6px 12px 8px; font-size: 12px; line-height: 1.5; color: var(--faint); }
.lvl { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.lvl i { width: 4px; background: var(--line-2); }
.lvl i:nth-child(1) { height: 5px; }
.lvl i:nth-child(2) { height: 8px; }
.lvl i:nth-child(3) { height: 12px; }
.lvl.l1 i:nth-child(-n+1), .lvl.l2 i:nth-child(-n+2), .lvl.l3 i:nth-child(-n+3) { background: var(--ink); }
.temp-on { display: none; }
.is-temp .temp-on { display: inline-flex; }

.scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.thread { width: min(780px, 100%); margin: 0 auto; padding: 28px var(--gutter) 20px; }


.msg { margin: 0 0 26px; }
.msg:last-child { margin-bottom: 0; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .user-content { min-width: 0; max-width: min(86%, 620px); }
.msg.user .user-content.editing { width: min(86%, 620px); }
.msg.user .bubble { padding: 12px 16px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-lg); white-space: pre-wrap; overflow-wrap: anywhere; }
.message-edit { width: 100%; }
.message-edit .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.msg.ai .who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 500 11px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.msg.ai .who i { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); }
.msg .tools { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .tools, .msg:last-child .tools { opacity: 1; }
.msg .tools .icon-btn { width: 28px; height: 28px; }
.msg .tools .icon-btn svg { width: 15px; height: 15px; }
.msg .meta { min-width: 0; margin-left: 6px; align-self: center; font: 400 11.5px/1.5 var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.msg .err { margin-top: 10px; }

.think { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-2); }
.think > summary { display: flex; align-items: center; gap: 8px; padding: 2px 0; list-style: none; cursor: pointer; font-size: 13px; color: var(--muted); }
.think > summary::-webkit-details-marker { display: none; }
.think > summary::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(-45deg); transition: transform .15s; }
.think[open] > summary::after { transform: rotate(45deg); }
.think .body { padding: 10px 0 2px; font-size: 13.5px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; max-height: 360px; overflow: auto; }
.think.live > summary { color: var(--ember); }

.caret::after { content: ""; display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--ember); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md table, .md pre { margin: 0 0 14px; }
.md h1, .md h2, .md h3, .md h4 { margin: 24px 0 10px; letter-spacing: -0.02em; line-height: 1.25; }
.md h1 { font-size: 24px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; } .md h4 { font-size: 15px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--faint); }
.md a { color: var(--ember-2); text-underline-offset: 3px; }
.md strong { font-weight: 600; }
.md blockquote { padding: 2px 0 2px 14px; border-left: 1.5px solid var(--ember); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.md table { display: block; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); border-collapse: separate; border-spacing: 0; font-size: 14px; }
.md th, .md td { padding: 7px 12px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.md th { font-weight: 500; background: var(--bg-2); }
.md tr > :last-child { border-right: 0; }
.md tbody tr:last-child > * { border-bottom: 0; }
.md :not(pre) > code { padding: 1px 5px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-xs); font: 400 .88em/1 var(--mono); }
.code { margin: 0 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-md); overflow: hidden; background: #080706; }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); font: 500 11.5px/1 var(--mono); color: var(--faint); }
.code-head button { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 0; border-radius: var(--radius-xs); background: none; color: var(--muted); font: 500 12px/1 var(--ui); }
.code-head button:hover { color: var(--ink); background: var(--bg-3); }
.md pre { margin: 0; padding: 14px; overflow-x: auto; font: 400 13px/1.6 var(--mono); }
.md pre code { font: inherit; }

/* highlight.js: a quiet palette on the night, sand for keywords */
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: var(--ember); }
.hljs-string, .hljs-attr-value, .hljs-template-tag, .hljs-addition { color: #c9d98f; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #cdbd9f; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #f1ede8; font-weight: 500; }
.hljs-comment, .hljs-quote, .hljs-meta { color: #776f67; font-style: italic; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-property, .hljs-params { color: #d9ceba; }
.hljs-type, .hljs-class .hljs-title, .hljs-title.class_ { color: #e1d3bb; }
.hljs-deletion { color: var(--bad); }
.hljs-regexp, .hljs-link { color: #d8c4a4; }

/* composer */
.dock { flex: none; padding: 0 var(--gutter) 16px; }
.composer { width: min(780px, 100%); margin: 0 auto; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--bg-2); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: rgba(216, 208, 194, .6); box-shadow: 0 0 0 3px rgba(216, 208, 194, .04); }
.composer textarea { display: block; width: 100%; max-height: min(240px, 40dvh); min-height: 56px; padding: 16px 16px 6px; border: 0; outline: 0; resize: none; overflow-y: auto; background: transparent; font-size: 16px; line-height: 1.5; }
.composer textarea::placeholder { color: var(--faint); }
.composer-toolbar { display: grid; grid-template-columns: minmax(0, max-content) auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px 10px; }
.composer-toolbar .grow { min-width: 0; }
.composer .send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--ember); color: var(--bg); }
.composer .send:hover { background: var(--ember-2); }
.composer .send:disabled { opacity: .3; background: var(--ink); cursor: not-allowed; }
.composer .send.stop { background: var(--ember); }
.composer .send svg { width: 18px; height: 18px; }
.effort { position: relative; }
.effort-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; font-size: 13px; color: var(--muted); }
.effort-btn:hover { border-color: var(--line-2); color: var(--ink); }
.effort-btn svg { width: 14px; height: 14px; }
.effort-pop { position: fixed; z-index: 45; width: 270px; padding: 6px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.effort-pop button { display: block; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; }
.effort-pop button:hover:not(:disabled) { background: var(--bg-4); }
.effort-pop button.on { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--bg-3); }
.effort-pop button:disabled { opacity: .4; cursor: not-allowed; }
.effort-pop b { display: flex; align-items: center; justify-content: space-between; font-weight: 500; font-size: 14px; }
.effort-pop small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.temp-toggle { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; font-size: 13px; color: var(--muted); }
.temp-toggle:hover { color: var(--ink); border-color: var(--line-2); background: var(--bg-3); }
.temp-toggle.on { border-color: var(--ember); color: var(--ember); }
.temp-toggle svg { width: 14px; height: 14px; }
.dock .hint { width: min(780px, 100%); margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--faint); }

.paywall { width: min(780px, 100%); margin: 0 auto 10px; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid rgba(216, 208, 194, .3); border-radius: var(--radius-md); background: var(--ember-bg); }
.paywall p { flex: 1; min-width: 0; margin: 0; font-size: 14px; }
.paywall .btn { flex: none; min-height: 36px; }

/* ================= billing ================= */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line-2); border-radius: var(--radius-md); overflow: hidden; }
.plan { display: flex; flex-direction: column; padding: 22px; border-left: 1px solid var(--line-2); }
.plan:first-child { border-left: 0; }
.plan.best { background: var(--bg-3); }
.plan .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.plan .name { font: 500 12px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; }
.plan .price { margin: 16px 0 2px; font: 500 42px/1 var(--ui); font-variation-settings: "opsz" 32; letter-spacing: -0.05em; }
.plan .price small { font-size: 14px; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.plan .per { font-size: 13px; color: var(--muted); }
.plan ul { flex: 1; margin: 18px 0 20px; padding: 0; list-style: none; font-size: 13.5px; }
.plan li { display: flex; gap: 9px; padding: 5px 0; color: var(--muted); }
.plan li::before { content: ""; flex: none; width: 9px; height: 5px; margin-top: 6px; border-left: 1.5px solid var(--ember); border-bottom: 1.5px solid var(--ember); transform: rotate(-45deg); }
.plan li b { color: var(--ink); font-weight: 500; }
.packs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pack { padding: 14px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: transparent; text-align: left; }
.pack:hover { border-color: var(--ink); background: var(--bg-3); }
.pack b { display: block; font: 500 22px/1 var(--ui); letter-spacing: -0.03em; }
.pack small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.pack small.ember { color: var(--ember); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-title h3 { font-size: 18px; letter-spacing: -0.02em; }
.section-title p { margin: 0; font-size: 13px; color: var(--muted); }

.pay { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 22px; }
.qr { width: 196px; height: 196px; padding: 10px; border-radius: var(--radius-md); background: #faf8f6; }
.qr img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.kv { margin: 0; }
.kv > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { margin-bottom: 4px; font: 500 11px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.kv dd { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.kv dd .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kv dd .big { font: 500 22px/1.1 var(--ui); letter-spacing: -0.02em; }
.status { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 14px; }
.status.ok { border-color: var(--ok); color: var(--ok); }
.chains { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: transparent; font-size: 13.5px; font-weight: 500; }
.chip.on { border-color: var(--ember); color: var(--ember); }
.chip:hover { border-color: var(--ink); }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li .grow { flex: 1; min-width: 0; }

/* ---------- plans with weekly usage ---------- */
.meter .bar.hot i, .use-card .bar.hot i { background: var(--bad); }
.plans.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plans.four .plan { padding: 20px 18px; }
.plans.four .plan .price { font-size: 38px; }
.plan .per { min-height: 20px; margin-top: 6px; }
.plan .per b { font-weight: 600; }
.plan .weekly { display: flex; align-items: baseline; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.plan .weekly b { font: 500 22px/1 var(--ui); letter-spacing: -0.03em; }
.plan .weekly span { font-size: 13px; color: var(--muted); }
.plan .btn[disabled] { opacity: .45; cursor: default; }
.trial-cta { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(216, 208, 194, .3); border-radius: var(--radius-md); background: var(--ember-bg); }
.trial-cta p { flex: 1; margin: 0; font-size: 14px; }

/* ---------- usage page ---------- */
.use-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border: 1px solid var(--line-2); border-radius: var(--radius-md); overflow: hidden; }
.use-card { padding: 18px; border-left: 1px solid var(--line-2); }
.use-card:first-child { border-left: 0; }
.use-card .k { font: 500 11px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.use-card .v { margin: 12px 0 4px; font: 500 34px/1 var(--ui); font-variation-settings: "opsz" 32; letter-spacing: -0.04em; }
.use-card .v small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.use-card .bar { height: 4px; margin: 12px 0 10px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.use-card .bar i { display: block; height: 100%; background: var(--ember); }
.use-card .s { margin-top: 4px; font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.seg button[aria-selected="true"] { background: var(--bg-4); color: var(--ink); }
.use-sum { margin: -2px 0 14px; font-size: 13.5px; color: var(--muted); }
.use-sum b { color: var(--ink); font-weight: 500; }
.chart { position: relative; height: 210px; padding: 0 0 26px 62px; }
.chart .grid { position: absolute; inset: 0 0 26px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart .grid span { position: relative; height: 0; font-size: 11px; line-height: 0; color: var(--faint); }
.chart .grid span::after { content: ""; position: absolute; left: 62px; right: 0; top: 0; border-top: 1px solid var(--line); }
.chart .bars { position: relative; display: flex; align-items: stretch; gap: 2px; height: 100%; }
.chart .col { position: relative; flex: 1; display: flex; align-items: flex-end; outline: none; }
.chart .col:hover, .chart .col:focus-visible { background: rgba(250, 248, 246, .05); }
.chart .col i { display: block; width: 100%; background: var(--ember); border-radius: 4px 4px 0 0; }
.chart .tip { position: absolute; z-index: 3; top: 6px; left: 50%; transform: translateX(-50%); display: none; min-width: 150px; padding: 9px 11px; border: 1px solid var(--line-2); background: var(--bg-4); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5; white-space: nowrap; pointer-events: none; }
.chart .col.l .tip { left: 0; transform: none; }
.chart .col.r .tip { left: auto; right: 0; transform: none; }
.chart .col:hover .tip, .chart .col:focus-visible .tip { display: block; }
.chart .tip b { display: block; font-weight: 500; }
.chart .tip span { display: block; color: var(--muted); }
.chart .x { position: absolute; left: 62px; right: 0; bottom: 0; display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }
.chart-empty { padding: 40px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-md); text-align: center; font-size: 14px; color: var(--muted); }
.use-table { margin-top: 12px; font-size: 13.5px; }
.use-table summary { cursor: pointer; color: var(--muted); }
.use-table table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.use-table th, .use-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.use-table th { font: 500 11px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.use-table .r { text-align: right; }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; }
  .gate-art { display: none; }
  .gate-pane { justify-content: flex-start; padding: 28px 20px 32px; }

  .plans, .plans.four { grid-template-columns: 1fr; }
  .plan { border-left: 0; border-top: 1px solid var(--line-2); }
  .plan:first-child { border-top: 0; }
  .use-card { border-left: 0; border-top: 1px solid var(--line-2); }
  .use-card:first-child { border-top: 0; }
  .trial-cta { flex-direction: column; align-items: flex-start; }
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; inset: var(--site-header-height) auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; }
  .shell.nav-open .side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .shell.nav-open::after { content: ""; position: fixed; z-index: 55; inset: var(--site-header-height) 0 0; background: rgba(0, 0, 0, .55); }
  .workspace-actions .workspace-menu, .side-top .icon-btn { display: inline-grid; }
  .workspace-actions .temp-on { display: none; }
  .msg.user .user-content { max-width: 94%; }
  .msg.user .user-content.editing { width: 94%; }
  .sheet { padding: 22px 18px; }
  .sheet h2 { font-size: 24px; }
  .dock { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .temp-toggle span, .effort-btn .lbl-long { display: none; }
}
@media (min-width: 360px) and (max-width: 760px) { .temp-toggle span { display: inline; } }
@media (max-width: 560px) {
  .composer-toolbar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .composer-toolbar .model { grid-column: 1 / -1; justify-self: start; max-width: 100%; }
  .composer-toolbar .grow { display: none; }
  .composer-toolbar .effort { justify-self: start; }
}

/* ================= legal pages ================= */
.doc { width: min(760px, 100%); margin: 0 auto; padding: 56px 16px 96px; }
.doc h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.02; }
.doc .updated { margin: 14px 0 36px; color: var(--faint); font-size: 13px; }
.doc h2 { margin: 44px 0 12px; font-size: 22px; letter-spacing: -0.02em; }
.doc p, .doc li { color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.doc p b, .doc li b { color: var(--ink); font-weight: 500; }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc .summary { padding: 20px 22px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--bg-2); }
.doc .summary li { color: var(--ink); }
.doc-foot { padding: 24px clamp(16px, 5vw, 72px); border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); display: flex; gap: 22px; flex-wrap: wrap; }
.doc-foot a { color: var(--muted); }

/* ================= code page ================= */
.cli-page { width: min(880px, 100%); margin: 0 auto; padding: 56px 16px 40px; }
.code-me { display: flex; align-items: center; gap: 10px; }
.me-chip { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px 0 6px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; }
.me-chip:hover { border-color: var(--ink); }
.me-chip canvas { width: 22px; height: 22px; border-radius: var(--radius-xs); image-rendering: pixelated; }
.cli-status { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--bg-2); font-size: 13.5px; color: var(--muted); }
.cli-status b { color: var(--ink); font-weight: 500; }
.cli-status .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.cli-status .grow { flex: 1; min-width: 0; }
.cli-status a { flex: none; color: var(--ink); border-bottom: 1px solid var(--line-2); text-decoration: none; }
.cli-status a:hover { border-color: var(--ink); }
.code-hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.02; text-wrap: balance; }
.code-hero h1 em { font-style: normal; color: var(--ember); }
.code-hero .lede { margin: 20px 0 0; max-width: 40em; font-size: 17px; line-height: 1.55; color: var(--muted); }
.code h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.1; }
.code h3 { font-size: 16px; letter-spacing: -0.01em; }
.code-block, .code-grid, .code-cta { margin-top: 64px; }
.code-block > p { margin: 14px 0 0; max-width: 42em; color: var(--muted); }
.code-block > p a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.code-block > p a:hover { border-color: var(--ink); }

.install { margin-top: 28px; border: 1px solid var(--line-2); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-2); }
.install-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.install-row:first-child { border-top: 0; }
.install .os { flex: none; width: 96px; font: 500 11px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 400 13px/1.6 var(--mono); color: #ded4c5; }
.install .icon-btn { flex: none; }

.term { margin-top: 22px; border: 1px solid var(--line-2); border-radius: var(--radius-md); overflow: hidden; background: #080706; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 8px; height: 8px; border: 1px solid var(--line-2); border-radius: 50%; }
.term-bar span { margin-left: 8px; font: 400 11.5px/1 var(--mono); color: var(--faint); }
.term pre { margin: 0; padding: 16px; overflow-x: auto; font: 400 13px/1.65 var(--mono); color: #d8d2ca; }
.term .p { color: var(--faint); }
.term .e { color: var(--ember); }
.term .g { color: var(--ok); }
.term .y { color: var(--ember); }
.term .d { color: var(--faint); }
.term b { font-weight: 500; color: var(--ink); }

.code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.code-grid p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

.cmd-list { margin: 22px 0 0; }
.cmd-list > div { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.cmd-list dt { font-size: 13.5px; }
.cmd-list dd { margin: 0; font-size: 14px; color: var(--muted); }

.code-cta { padding: 32px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--bg-2); }
.code-cta p { margin: 12px 0 0; color: var(--muted); }
.code-cta .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* the docs page: a contents rail beside one long .doc column, with wide tables that scroll on their own */
.docs { display: grid; grid-template-columns: 200px minmax(0, 880px); justify-content: center; gap: 56px; padding: 0 16px; }
.docs-toc { position: sticky; top: 24px; align-self: start; padding-top: 64px; }
.docs-toc ol { margin: 0; padding: 0; list-style: none; }
.docs-toc li { margin: 0; }
.docs-toc a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--line); font-size: 13.5px; color: var(--muted); text-decoration: none; }
.docs-toc a:hover { color: var(--ink); border-color: var(--ink); }
.doc.docs-main { width: 100%; margin: 0; padding: 56px 0 96px; }
.docs-main .lede { margin: 20px 0 8px; max-width: 40em; font-size: 17px; line-height: 1.55; color: var(--muted); }
.docs-main section { scroll-margin-top: 24px; }
.docs-main h3 { margin: 28px 0 8px; font-size: 16px; letter-spacing: -0.01em; }
.docs-main a { color: var(--ink); border-bottom: 1px solid var(--line-2); text-decoration: none; }
.docs-main a:hover { border-color: var(--ink); }
.docs-main .callout { margin: 18px 0; padding: 14px 16px; border: 1px solid rgba(216, 208, 194, .3); border-radius: var(--radius-md); background: var(--ember-bg); font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.docs-main .callout b { color: var(--ink); font-weight: 500; }
.docs-main .fineprint { margin-top: 12px; }
.docs-main .cmd-list dt { color: var(--ink); }
.docs-main .install code { font-size: 12.5px; }
.table-wrap { margin: 20px 0 0; overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-md); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-wrap th, .table-wrap td { padding: 11px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.table-wrap thead th { border-top: 0; font: 500 11px/1.3 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); background: var(--bg-2); }
.table-wrap tbody th { font-weight: 500; color: var(--ink); }
.table-wrap td { color: var(--muted); }
.table-wrap .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap .sub { display: block; margin-top: 4px; max-width: 24em; font-weight: 400; font-size: 12.5px; line-height: 1.45; white-space: normal; color: var(--faint); }
.table-wrap .tag { margin-left: 6px; vertical-align: 1px; }
@media (max-width: 960px) {
  .docs { display: block; }
  .docs-toc { display: none; }
  .doc.docs-main { padding-top: 32px; }
}

/* the device page: a code input that reads like a code */
.code-input { font: 500 22px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; text-align: center; height: 60px; }
.device-card { margin-top: 4px; }
.device-card > div { padding: 9px 0; }

@media (max-width: 760px) {
  .me-chip .mono, .me-chip .tag { display: none; }
  .me-chip { padding: 0 6px; }
  .cli-page { padding-top: 32px; }
  .cli-status { flex-wrap: wrap; }
  .code-grid { grid-template-columns: 1fr; gap: 24px; }
  .cmd-list > div { grid-template-columns: 1fr; gap: 4px; }
  .install .os { width: 74px; }
  .code-cta { padding: 22px; }
}

/* Clear, guided account screens and dialogs. */
.gate-pane .choice, .sheet .choice { min-height: 76px; border-radius: 12px; gap: 14px; }
.gate-pane .choice > span:not(.ico):not(.go) { min-width: 0; }
.gate-pane .choice b { font-size: 16px; }
.gate-pane .choice small { line-height: 1.5; }
.gate-pane .choice .ico { width: 40px; height: 40px; border-radius: var(--radius-sm); border-color: var(--line); }
.gate-pane .choice.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.gate-pane .choice.primary small { color: #514c46; }
.gate-pane .choice.primary .ico { border-color: #14121026; }
.gate-pane .choice.primary .go { color: var(--bg); }
.gate-pane .choice.primary:hover { background: #e7e3de; }
.gate-pane .btn, .sheet .btn { min-height: 46px; height: auto; padding: 12px 18px; border-radius: var(--radius-sm); border-width: 1px; line-height: 1.35; text-align: center; }
.gate-pane .btn.block, .sheet .btn.block { min-height: 48px; }
.gate-pane .input, .sheet .input { border-radius: var(--radius-sm); border-width: 1px; padding: 13px 14px; font-size: 16px; }
.gate-pane .field > span, .sheet .field > span { text-transform: none; letter-spacing: 0; font-size: 14px; line-height: 1.4; }
.gate-pane .input[aria-invalid="true"], .sheet .input[aria-invalid="true"] { border-color: var(--bad); }
.gate-pane h2:focus, .sheet h2:focus { outline: none; }
.gate-pane .back { min-height: 40px; gap: 8px; margin-bottom: 16px; }
.gate-pane .back svg { width: 16px; height: 16px; }
.gate-alternative { margin: 24px 0 0; }
.text-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; border: 0; background: none; color: var(--muted); font: 500 14px/1.4 var(--ui); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.text-btn:hover { color: var(--ink); }
.text-btn svg { flex: none; width: 17px; height: 17px; }
.text-btn.inline { display: inline; min-height: 0; font: inherit; }
.gate-reassurance { margin: 20px 0 0; font-size: 13px; color: var(--muted); }
.gate-legal { margin-top: 20px; line-height: 1.7; }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.field-label { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.key-card { padding: 18px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--bg-2); }
.key-card .keybox { padding: 0; border: 0; background: none; color: var(--ink); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.key-card .keyacts { margin: 16px 0 0; gap: 10px; }
.key-card .keyacts .btn { flex: 1; padding-inline: 10px; font-size: 14px; white-space: normal; }
.key-status { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.key-reminder { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.key-reminder svg { flex: none; width: 17px; height: 17px; margin-top: 2px; }
.key-ack { padding: 12px 0 18px; line-height: 1.6; }
.key-file-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: -6px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.simple-details { margin: 20px 0 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.simple-details > summary { padding: 14px 0; cursor: pointer; color: var(--muted); font-weight: 500; }
.simple-details > summary:hover { color: var(--ink); }
.simple-details p { margin: 0 0 14px; color: var(--muted); }
.simple-details ol { margin: 0 0 14px; padding-left: 22px; color: var(--muted); }
.simple-details li + li { margin-top: 8px; }

.modal { padding: 20px; background: rgba(0, 0, 0, .64); backdrop-filter: blur(8px); animation: fade .16s ease; }
.sheet { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: 0 28px 100px #0008; }
.sheet.wide { width: min(1040px, 100%); }
.dialog-content { min-height: 0; padding: 32px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ffffff38 transparent; }
.sheet > .close { z-index: 3; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--bg-2); }
.sheet > .close:hover { background: var(--bg-3); }
.sheet h2 { padding-right: 42px; font-size: 29px; line-height: 1.15; margin-bottom: 12px; }
.sheet .lede { font-size: 15px; line-height: 1.65; margin-bottom: 24px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dialog-actions.compact { justify-content: flex-start; margin-top: 14px; }
.dialog-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 0 18px; border-radius: 12px; background: var(--bg-3); }
.dialog-symbol svg { width: 23px; height: 23px; }
.dialog-symbol.danger { color: var(--bad); background: #ff6a5c14; }
.dialog-symbol.success { color: var(--ok); background: #6fd79a14; }
.dialog-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 24px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.dialog-tabs button { min-width: 0; min-height: 44px; padding: 10px 8px; background: transparent; border: 0; border-radius: 8px; color: var(--muted); font-weight: 500; }
.dialog-tabs button[aria-selected="true"] { background: var(--bg-4); color: var(--ink); }
.settings-section { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.settings-section h3, [data-panel="devices"] h3 { font-size: 17px; line-height: 1.4; }
.settings-section p { margin: 8px 0 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.account-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.account-summary span { display: block; font-size: 12px; color: var(--muted); }
.account-summary b { display: block; margin-top: 7px; font-size: 18px; font-weight: 500; }
.danger-details > summary { color: var(--bad); }
.sheet .list li { flex-wrap: wrap; }
.sheet .note { border-radius: var(--radius-sm); line-height: 1.6; }
.toast { display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; max-width: 420px; border-radius: 12px; line-height: 1.5; }
.toast-symbol svg { width: 20px; height: 20px; }
.toast .icon-btn { width: 32px; height: 32px; color: inherit; border-radius: 8px; }
.toast.bad { background: #3c1d19; color: #ffe2dc; border: 1px solid #ff6a5c55; }
.trial-cta { border-radius: var(--radius-md); border-width: 1px; }
.trial-cta > div { min-width: 0; }
.trial-cta p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; }
.billing-explainer { margin: 18px 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.billing-footnote { margin-top: 16px; }
.sheet .plans { border-radius: var(--radius-md); border-width: 1px; overflow: hidden; }
.sheet .plan .weekly { margin: 18px 0 14px; }
.sheet .plan .per { margin: 7px 0; }
.plan-details { flex: 1; font-size: 13px; color: var(--muted); }
.plan-details summary { padding: 10px 0; cursor: pointer; }
.plan-details ul { margin: 0 0 18px; }
.plan-details + .btn { margin-top: 18px; }
.sheet .pack { border-width: 1px; border-radius: var(--radius-sm); }
.checkout-summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px; margin-bottom: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.checkout-summary strong { font-size: 25px; font-weight: 500; }
.payment-options { padding: 0; margin: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.payment-options legend { padding: 0 0 10px; font-size: 14px; }
.payment-option { display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; }
.payment-option input { flex: none; accent-color: var(--ink); width: 17px; height: 17px; margin: 0; }
.payment-option span { flex: 1; min-width: 0; }
.payment-option b, .payment-option small { display: block; }
.payment-option small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.payment-option > svg { display: none; width: 17px; height: 17px; }
.payment-option:has(input:checked) { border-color: var(--ink); background: var(--bg-3); }
.payment-option:has(input:checked) > svg { display: block; }
.payment-amount { padding: 18px; margin-bottom: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.payment-amount > span { display: block; color: var(--muted); font-size: 13px; }
.payment-amount strong { display: block; margin: 10px 0 16px; font-size: clamp(22px, 4vw, 30px); font-weight: 500; overflow-wrap: anywhere; }
.payment-address { font-size: 13px !important; line-height: 1.6; overflow-wrap: anywhere; resize: none; }
.payment-warning { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 18px 0; }
.sheet .status { border-radius: var(--radius-sm); line-height: 1.6; }
.sheet .qr { border-radius: 12px; }
@media (max-width: 900px) {
  .sheet .trial-cta { align-items: stretch; }
  .sheet .trial-cta .btn { width: 100%; }
}
@media (max-width: 560px) {
  .modal { padding: 12px; }
  .sheet { max-height: calc(100dvh - 24px); border-radius: 16px; }
  .dialog-content { padding: 24px 20px; }
  .sheet h2 { font-size: 25px; }
  .sheet > .close { top: 8px; right: 8px; width: 44px; height: 44px; }
  .dialog-actions > .btn { flex: 1 1 130px; white-space: normal; }
  .payment-options { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; max-width: none; }
  .toast { max-width: none; }
  .account-summary { padding: 14px; }
  .sheet .section-title { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .modal, .gate-step, .toast { animation: none; }
}
.model-pop, .effort-pop { max-height: min(560px, 70dvh); overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--radius-md); box-shadow: 0 18px 48px #0007; }
.model-pop button, .effort-pop button { min-height: 48px; border-radius: 9px; }
@media (max-width: 560px) {
  .text-btn, .gate-pane .back { min-height: 44px; }
  .toast { grid-template-columns: 20px minmax(0, 1fr) 40px; }
  .toast .icon-btn { width: 40px; height: 40px; }
}

@media (max-width: 560px) {
  .paywall { align-items: flex-start; gap: 12px; padding: 12px; }
  .paywall p { font-size: 13px; line-height: 1.5; }
  .paywall .btn { align-self: center; padding-inline: 12px; }
}
