/* MOMU API console — console.css
   Same "Doyat" ink-and-marigold look as the rest of MOMU, tuned for a developer tool: calm surfaces, hairlines, one warm accent.
   Mobile first: a top bar + bottom tab bar on phones, a side rail on computers. */
:root {
  --font-display: "Bricolage Grotesque", "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --font-text: "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --h: 38; --s: 82%;
  --r-s: 10px; --r-m: 14px; --r-l: 20px;
  --side: 248px; --bar: 58px; --tab: 62px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] {
  --bg: #0f0f11; --bg-2: #131316; --surface: #18181b; --surface-2: #1f1f23; --surface-3: #28282d;
  --line: #2a2a30; --line-2: #36363d; --text: #f2f1ee; --muted: #a09fa8; --faint: #6f6e78;
  --brand: hsl(var(--h) var(--s) 62%); --brand-2: hsl(calc(var(--h) - 12) 88% 58%); --on-brand: #1a1204; --brand-soft: hsl(var(--h) var(--s) 62% / .13);
  --ok: #6fcf8f; --ok-soft: rgba(111, 207, 143, .12); --warn: #f0b04a; --warn-soft: rgba(240, 176, 74, .13); --danger: #f0665a; --danger-soft: rgba(240, 102, 90, .12); --info: #7fb2ff; --info-soft: rgba(127, 178, 255, .12);
  --shadow: 0 18px 50px rgba(0, 0, 0, .5); --glow: radial-gradient(60% 50% at 80% -10%, hsl(var(--h) 80% 55% / .10), transparent 70%);
  --code-bg: #0b0b0d; color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f4ef; --bg-2: #f0ede6; --surface: #ffffff; --surface-2: #f4f1ea; --surface-3: #e9e5dc;
  --line: #e4dfd3; --line-2: #d3cdbe; --text: #1b1a17; --muted: #6a675e; --faint: #9a968a;
  --brand: hsl(var(--h) 85% 40%); --brand-2: hsl(calc(var(--h) - 12) 90% 38%); --on-brand: #ffffff; --brand-soft: hsl(var(--h) 85% 40% / .10);
  --ok: #23804a; --ok-soft: rgba(35, 128, 74, .10); --warn: #a8630f; --warn-soft: rgba(168, 99, 15, .11); --danger: #c23b2e; --danger-soft: rgba(194, 59, 46, .09); --info: #2f62c4; --info-soft: rgba(47, 98, 196, .09);
  --shadow: 0 18px 44px rgba(40, 30, 10, .13); --glow: radial-gradient(60% 50% at 80% -10%, hsl(var(--h) 90% 55% / .13), transparent 70%);
  --code-bg: #1d1c19; color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--font-text); font-size: 15.5px; line-height: 1.55; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; background: var(--glow); pointer-events: none; z-index: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.hidden { display: none !important; }
.mono, code, kbd { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .92rem; transition: background .15s, border-color .15s, transform .12s, opacity .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: transparent; color: var(--on-brand); box-shadow: 0 6px 20px hsl(var(--h) 80% 50% / .22); }
.btn.primary:hover { filter: brightness(1.06); background: var(--brand); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .lbl { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%239a968a' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.err { color: var(--danger); font-size: .88rem; min-height: 1.2em; }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: calc(var(--bar) + var(--safe-t)); padding: var(--safe-t) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; text-decoration: none !important; }
.brand img { width: 28px; height: 28px; border-radius: 9px; }
.brand small { font-family: var(--font-text); font-weight: 600; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: 3px 7px; border-radius: 7px; }
.grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--muted); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pill.on i { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.pill.off i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.pill.load i { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); font-weight: 700; font-size: .9rem; border: 0; }
.main { position: relative; padding: 18px max(16px, env(safe-area-inset-right)) calc(var(--tab) + var(--safe-b) + 28px) max(16px, env(safe-area-inset-left)); max-width: 1120px; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab) + var(--safe-b)); padding: 6px 6px var(--safe-b); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 12px; color: var(--faint); font-size: .68rem; font-weight: 600; text-decoration: none !important; transition: color .15s, background .15s; min-width: 0; }
.tab svg.i { width: 21px; height: 21px; }
.tab.on { color: var(--brand); }
.tab.on svg.i { filter: drop-shadow(0 0 8px var(--brand-soft)); }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 12px; top: calc(var(--bar) + var(--safe-t) + 6px); z-index: 40; width: min(280px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 8px; animation: pop .16s var(--ease); }
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; font-family: var(--font-display); }
.menu .who span { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: .92rem; text-align: left; text-decoration: none !important; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

@media (min-width: 900px) {
  body { font-size: 15px; }
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
  .side .brand { padding: 0 10px 22px; }
  .side nav { display: flex; flex-direction: column; gap: 3px; }
  .side .nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: .93rem; text-decoration: none !important; transition: background .15s, color .15s; }
  .side .nav:hover { background: var(--surface-2); color: var(--text); }
  .side .nav.on { background: var(--brand-soft); color: var(--brand); }
  .side .sp { flex: 1; }
  .side .me { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--line); margin-top: 10px; }
  .side .me div { min-width: 0; flex: 1; }
  .side .me b { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .me span { display: block; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .row2 { display: flex; gap: 6px; padding: 8px 4px 0; }
  .topbar .brand, .tabs { display: none; }
  .topbar { height: 64px; padding-top: 0; }
  .main { padding: 26px 36px 60px; }
  .menu { top: 60px; }
}

/* ---------- page parts ---------- */
.page { animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.ph h1 { font-size: clamp(1.55rem, 4.6vw, 2.15rem); }
.ph p { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.card { background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, white 4%), var(--surface)); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; position: relative; }
:root[data-theme="light"] .card { background: var(--surface); box-shadow: 0 1px 0 rgba(40, 30, 10, .03), 0 8px 24px rgba(40, 30, 10, .04); }
.card h3 { font-size: 1.02rem; }
.card .sub { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .g2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.stat .k svg.i { width: 16px; height: 16px; color: var(--brand); }
.stat .v { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.45rem, 5vw, 1.95rem); margin-top: 8px; letter-spacing: -.02em; }
.stat .v small { font-size: .52em; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat .d { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .8s var(--ease); }
.bar.hot > i { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-m); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); background: var(--warn-soft); color: var(--text); margin-bottom: 16px; font-size: .92rem; }
.notice.bad { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.notice.info { border-color: color-mix(in srgb, var(--info) 35%, var(--line)); background: var(--info-soft); }
.notice svg.i { margin-top: 2px; color: var(--warn); }
.notice.bad svg.i { color: var(--danger); }
.notice.info svg.i { color: var(--info); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-3); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .76rem; font-weight: 600; }
.empty { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty .ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); }
.empty .ico svg.i { width: 26px; height: 26px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sh 1.3s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- chart ---------- */
.chart { position: relative; margin-top: 14px; }
.chart svg { display: block; max-width: 100%; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .ax { fill: var(--faint); font-size: 10.5px; font-family: var(--font-text); }
.chart .bar-r { fill: url(#cg); transition: opacity .15s; }
.chart .bar-r:hover, .chart .bar-r.hv { opacity: .75; }
.chart .today { fill: var(--brand); }
.tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 11px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .8rem; white-space: nowrap; transform: translate(-50%, -110%); }
.tip b { display: block; font-family: var(--font-display); }

/* ---------- keys ---------- */
.keys { display: grid; gap: 14px; }
@media (min-width: 1100px) { .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.key { display: flex; flex-direction: column; gap: 14px; }
.key.off { opacity: .8; }
.key .top { display: flex; align-items: flex-start; gap: 10px; }
.key .top h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.key .top .meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.secret { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--code-bg); border: 1px solid var(--line); font-family: var(--font-mono); font-size: .82rem; color: #d9d6cc; overflow: hidden; }
.secret span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; font-size: .82rem; }
.kv div b { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; }
.key .acts { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.reason { font-size: .86rem; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; }

/* ---------- tables / lists ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px; }
.logs { display: none; }
@media (min-width: 700px) { .logs { display: table; } .loglist { display: none; } }
.loglist .li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; font-size: .86rem; }
.loglist .li:last-child { border-bottom: 0; }
.loglist .li .r { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.st { font-family: var(--font-mono); font-size: .78rem; font-weight: 700; }
.st.ok { color: var(--ok); } .st.bad { color: var(--danger); } .st.warn { color: var(--warn); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 9px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar select.input { width: auto; min-height: 38px; padding-top: 6px; padding-bottom: 6px; }

/* ---------- modal / toast ---------- */
.veil { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 5, 7, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + var(--safe-b)); box-shadow: var(--shadow); animation: up .26s var(--ease); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.modal h2 { font-size: 1.25rem; margin-bottom: 6px; }
.modal .lead { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@media (min-width: 640px) { .veil { align-items: center; } .modal { border-radius: 24px; padding: 26px; } }
.reveal { background: var(--code-bg); border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line)); border-radius: 14px; padding: 14px; font-family: var(--font-mono); font-size: .82rem; color: #f3e7c4; word-break: break-all; line-height: 1.6; user-select: all; }
.toasts { position: fixed; z-index: 200; left: 50%; bottom: calc(var(--tab) + var(--safe-b) + 14px); transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 28px)); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .9rem; animation: up .25s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast.bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.toast.ok svg.i { color: var(--ok); } .toast.bad svg.i { color: var(--danger); }

/* ---------- code ---------- */
.code { position: relative; border-radius: 14px; background: var(--code-bg); border: 1px solid var(--line); overflow: hidden; }
.code .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px 7px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); color: #8f8d85; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.code pre { margin: 0; padding: 14px; overflow-x: auto; font-family: var(--font-mono); font-size: .8rem; line-height: 1.65; color: #e6e3d8; -webkit-overflow-scrolling: touch; }
.code .k { color: #f0b04a; } .code .s { color: #9fd9a3; } .code .c { color: #77756c; } .code .n { color: #8fb8ff; }
.code .cp { background: rgba(255, 255, 255, .06); border: 0; color: #cfcdc3; border-radius: 8px; padding: 5px 10px; font-size: .72rem; font-weight: 600; }
.code .cp:hover { background: rgba(255, 255, 255, .12); }
.ctabs { display: flex; gap: 4px; margin: 12px 0 10px; flex-wrap: wrap; }
.ctabs button { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); padding: 6px 12px; border-radius: 10px; font-weight: 600; font-size: .82rem; }
.ctabs button.on { color: var(--on-brand); background: var(--brand); border-color: transparent; }

/* ---------- docs ---------- */
.docs { display: grid; gap: 22px; }
.docs section { scroll-margin-top: 80px; }
.docs h2 { font-size: 1.3rem; margin-bottom: 8px; }
.docs h3 { font-size: 1.02rem; margin: 18px 0 6px; }
.docs p, .docs li { color: var(--muted); }
.docs p + p, .docs p + .code, .docs .code + p { margin-top: 10px; }
.docs ul { margin: 8px 0; padding-left: 20px; }
.docs code.in { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: .84em; color: var(--text); }
.toc { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; -webkit-overflow-scrolling: touch; }
.toc a { flex: none; padding: 7px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none !important; }
.toc a:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- playground ---------- */
.pg { display: grid; gap: 14px; }
@media (min-width: 1000px) { .pg { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } }
.chat { display: flex; flex-direction: column; min-height: 360px; max-height: calc(100dvh - 280px); }
@media (min-width: 1000px) { .chat { max-height: calc(100vh - 190px); min-height: 520px; } }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 12px; -webkit-overflow-scrolling: touch; }
.m { max-width: 92%; padding: 11px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; line-height: 1.6; }
.m.u { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 6px; }
.m.a { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.m.a.err { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--danger); background: var(--danger-soft); }
.caret::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--brand); animation: pulse 1s steps(2) infinite; }
.composer { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.composer textarea { min-height: 46px; max-height: 140px; }
.usage-line { color: var(--faint); font-size: .76rem; padding-top: 6px; min-height: 1.3em; }

/* ---------- plans ---------- */
.plans { display: grid; gap: 14px; }
@media (min-width: 800px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan.hot { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); box-shadow: 0 0 0 1px var(--brand-soft), 0 20px 50px hsl(var(--h) 80% 50% / .07); }
.plan .price { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; margin: 10px 0 2px; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: .93rem; }
.plan li svg.i { color: var(--ok); margin-top: 3px; }
.plan.soon { opacity: .9; }

/* ---------- sign in ---------- */
.auth { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; }
.auth .l { display: none; }
.auth .r { display: flex; flex-direction: column; justify-content: center; padding: calc(28px + var(--safe-t)) 22px calc(28px + var(--safe-b)); max-width: 440px; width: 100%; margin: 0 auto; }
.auth .brand { margin-bottom: 30px; }
.auth form { margin-bottom: 4px; }
.auth h1 { font-size: 1.9rem; margin-bottom: 8px; }
.auth .lead { color: var(--muted); margin-bottom: 24px; }
.auth form { display: grid; gap: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .8rem; margin: 6px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth .fine { margin-top: 22px; color: var(--muted); font-size: .84rem; text-align: center; }
@media (min-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .auth .l { display: flex; flex-direction: column; justify-content: center; padding: 60px clamp(40px, 6vw, 90px); border-right: 1px solid var(--line); background: radial-gradient(80% 60% at 20% 0%, hsl(var(--h) 80% 55% / .12), transparent 70%), var(--bg-2); }
  .auth .l h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); max-width: 14ch; letter-spacing: -.03em; }
  .auth .l p { color: var(--muted); margin: 16px 0 28px; max-width: 42ch; font-size: 1.05rem; }
  .auth .r { max-width: 460px; padding: 40px; }
  .auth .r > .brand { display: none; }
  .auth .l .brand { margin-bottom: 0; }
}
.landing-links { display: flex; justify-content: center; gap: 18px; margin-top: 18px; font-size: .84rem; flex-wrap: wrap; }
.landing-links a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .tabs, .side, .topbar { display: none; } }

/* signed-out pages (docs / plans): no side rail */
.shell.pub { display: block; }
.shell.pub .topbar .brand { display: inline-flex !important; }
.shell.pub .main { padding-bottom: 60px; }
.topnav { display: none; gap: 4px; margin-left: 14px; }
.topnav a { padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none !important; }
.topnav a:hover, .topnav a.on { color: var(--text); background: var(--surface-2); }
@media (min-width: 700px) { .topnav { display: flex; } }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; background: var(--info-soft); color: var(--text); font-size: .86rem; }
.hint svg.i { color: var(--info); margin-top: 2px; }
.sticky-note { font-size: .8rem; color: var(--faint); }
.right { margin-left: auto; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt { margin-top: 14px; } .mt2 { margin-top: 22px; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.sec-h h2 { font-size: 1.15rem; }
.chart { min-height: 190px; }
.chart svg { height: 190px; }
/* phones: the conversation comes first, its settings below it */
@media (max-width: 999px) { .pg > .card:not(.chat) { order: 2; } .pg > .chat { order: 1; } }
