/* Runemic Console — builds on site.css (same tokens, buttons, cards, fields) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg use { pointer-events: none; }
.small { font-size: .86rem; }
.num { text-align: right; }
.btn--block { width: 100%; justify-content: center; }
.btn__icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--danger { background: #b3261e; color: #fff; }
.btn--danger:hover { background: #8c1d18; color: #fff; }
[data-theme="dark"] .btn--danger { background: #d6453b; color: #fff; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link--danger { color: #b3261e; }
[data-theme="dark"] .link--danger { color: #f2a19a; }
kbd { font: 600 .78rem/1 var(--mono); padding: 3px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--ink-2); }
.kbd-inv { background: transparent; color: inherit; border-color: currentColor; opacity: .7; margin-left: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.brand__sub { font-weight: 600; color: var(--muted); }
.icon-btn svg, .side__nav svg, .chip svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── shell */
body.app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 57px); background: linear-gradient(to right, var(--surface) 247px, var(--line) 247px, var(--line) 248px, transparent 248px); }
.side {
  position: sticky; top: 57px; height: calc(100vh - 57px); display: flex; flex-direction: column; gap: 14px;
  padding: 20px 14px 18px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto;
}
.side__title { display: block; padding: 0 10px; font: 600 .8125rem/1.2 var(--font); color: var(--muted); }
.side__ext { width: 14px !important; height: 14px !important; margin-left: auto; opacity: .6; }

/* shared header (same as runemic.com), full width */
.console-header .site-header__inner { padding: 0 28px; }
.console-header__menu { display: none; }
.console-header .header-actions { margin-left: auto; }
.page-title { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 0 0 18px; }
.side__nav { display: grid; gap: 2px; }
.side__nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: var(--ink-2); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.side__nav a svg { width: 19px; height: 19px; flex: none; }
.side__nav a:hover { background: var(--surface-2); color: var(--brand-strong); }
.side__nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.side__nav a[aria-current="page"] svg { color: var(--brand); }
.side__label { display: block; margin: 14px 10px 4px; font: 600 .8125rem/1.2 var(--font); color: var(--muted); }
.side__foot { margin-top: auto; display: grid; gap: 10px; }
.credit-mini { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); text-decoration: none; color: var(--ink); }
.credit-mini:hover { border-color: var(--brand); }
.credit-mini__label { font: 600 .8125rem/1.2 var(--font); color: var(--muted); }
.credit-mini__value { font-size: 1.35rem; color: var(--brand-strong); }
.credit-mini__note { font-size: .8rem; color: var(--muted); }
.side__site { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: .85rem; color: var(--muted); text-decoration: none; }
.side__site svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

.meter { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter--lg { height: 10px; }
.meter__fill { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand); transition: width .4s; }
.meter__fill[data-level="high"] { background: var(--accent); }

.main { display: flex; flex-direction: column; min-width: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: 600 .85rem/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand-strong); }
.chip svg { width: 15px; height: 15px; }
.chip--credit { color: var(--brand-strong); font-family: var(--mono); font-size: .82rem; }
.chip--credit svg { color: var(--accent); }

.usermenu { position: relative; }
.usermenu__btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; display: block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); object-fit: cover; }
.avatar--fallback { display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; font-size: .9rem; }
.avatar--lg { width: 64px; height: 64px; }
.usermenu__pop { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; padding: 16px; gap: 6px; z-index: 30; }
.usermenu__pop a, .usermenu__pop .link { padding: 6px 0; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.usermenu__pop a:hover, .usermenu__pop .link:hover { color: var(--brand-strong); }
.usermenu__pop form { margin: 0; }
.usermenu__pop .link { text-decoration: none; }
#user-email { word-break: break-all; }

.content { padding: 26px 28px 32px; display: block; flex: 1; width: 100%; max-width: 1280px; }
.panel { display: grid; gap: 20px; align-content: start; }
.panel[hidden] { display: none; }
.panel > *, .cols > *, .play__main > * { min-width: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.panel__head > p { margin: 0; max-width: 680px; }
.section-bar, .card__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-bar { margin-bottom: 12px; }
.section-bar h3, .card__bar h3, .card__bar h2 { margin: 0; }
.card { padding: 22px; }
.card h3 { font-size: 1.08rem; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.console-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 20px 28px 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* ───────── home */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.hello__title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 6px; }
.hello p { margin: 0; max-width: 620px; }
.hello__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { gap: 6px; padding: 18px 20px; }
.stat__label { font: 600 .8125rem/1.2 var(--font); color: var(--muted); }
.stat__value { font-size: 1.75rem; font-weight: 600; color: var(--brand-strong); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat__note { font-size: .84rem; color: var(--muted); }
.checklist { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li > div { display: grid; flex: 1; line-height: 1.35; }
.checklist strong { font-size: .95rem; color: var(--ink); }
.tick { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.tick svg { width: 14px; height: 14px; fill: none; stroke: var(--on-brand); stroke-width: 3; opacity: 0; }
.checklist li[data-done] .tick { background: var(--brand); border-color: var(--brand); }
.checklist li[data-done] .tick svg { opacity: 1; }
.checklist li[data-done] strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.checklist li[data-done] .btn { display: none; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 6px; background: var(--surface-2); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 6px; font: 700 .84rem/1.2 var(--font); color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--brand-strong); }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--brand-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg--full { display: flex; }
.seg--full button { flex: 1; }
.codebox { position: relative; }
.codebox .code { margin: 0; white-space: pre; }
.codebox__copy { position: absolute; top: 10px; right: 10px; background: #16211f; border-color: #2a3533; color: #d8e4e1; }
.codebox__copy:hover { color: #fff; border-color: #8cc3c0; }

/* ───────── model cards */
.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.model-grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.model-card { gap: 10px; }
.model-card__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.model-card__name { font-size: 1.05rem; font-weight: 600; color: var(--brand-strong); margin: 0; }
.model-card__id { font: 500 .78rem/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.model-card__price { font: 700 .95rem/1 var(--mono); color: var(--brand-strong); white-space: nowrap; }
.model-card__price small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.model-card p { font-size: .92rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: .78rem; font-weight: 600; }
.tag--speed { background: var(--accent-soft); color: var(--brand-strong); }
.tag--default { background: var(--brand-soft); color: var(--brand-strong); }
.model-card__actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.model-grid--compact .model-card { padding: 18px; }
.model-grid--compact .model-card p, .model-grid--compact .tag--bf { display: none; }
.model-grid--compact .model-card__top { flex-direction: column; gap: 6px; }
.banner { flex-direction: row; align-items: center; gap: 18px; }
.banner h3 { margin: 0 0 2px; }

/* ───────── playground */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.play__main { display: grid; gap: 20px; min-width: 0; }
.play__input { gap: 14px; }
.drop {
  border: 2px dashed var(--line); border-radius: 6px; background: var(--bg); min-height: 220px;
  display: grid; place-items: center; cursor: pointer; transition: border-color .15s, background .15s; position: relative;
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop__empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 24px; }
.drop__icon { width: 34px; height: 34px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.drop__preview { width: 100%; padding: 12px; display: grid; gap: 10px; cursor: default; }
.drop__preview img { max-height: 360px; width: 100%; object-fit: contain; border-radius: 6px; background: var(--surface); }
.drop__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--ink-2); }
.drop__meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop.has-image { border-style: solid; min-height: 0; }
.samples { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.play__settings { position: sticky; top: 77px; gap: 16px; }
.label { font-weight: 700; color: var(--brand-strong); font-size: .95rem; }
.play__settings .field textarea { font-size: .92rem; min-height: 0; }
.play__cost { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-2); padding: 10px 12px; border-radius: 6px; background: var(--surface-2); }
.play__cost strong { font-family: var(--mono); color: var(--brand-strong); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--brand-strong); cursor: pointer; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }
.compare-list { border: 0; margin: -6px 0 0; padding: 0; display: grid; gap: 6px; }
.compare-list label { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.compare-list input { accent-color: var(--brand); width: 16px; height: 16px; }
.history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.history .side__label { margin: 0 0 6px; }
.history button { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; font: inherit; font-size: .84rem; color: var(--ink-2); }
.history button:hover { border-color: var(--line); background: var(--bg); }
.history img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.history span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.results { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.empty-state { align-items: center; text-align: center; padding: 40px 24px; }
.empty-state__icon { width: 40px; height: 40px; fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-state p { max-width: 460px; }
.result { gap: 12px; min-width: 0; }
.result__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.result__model { font-weight: 600; color: var(--brand-strong); }
.result__meta { display: flex; gap: 6px; flex-wrap: wrap; }
.result__tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* compare mode: full width below the page and settings; wraps to fewer columns when narrow */
.results--multi { grid-template-columns: minmax(0, 1fr); }
.results--side { margin-top: 20px; }
.results--multi.results--side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.results__bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.results--multi:not(.results--side) .result__body { max-height: 480px; }
.result__head { flex-wrap: wrap; row-gap: 8px; }
.result__head > div:first-child { min-width: 0; flex: 1 1 170px; }
.result__head .result__tools { margin-inline-start: auto; }
.result__model, .result__head .model-card__id { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result__tools { flex-wrap: nowrap; flex: none; }
.results--side .result__tools .seg button { padding: 5px 9px; font-size: .8125rem; }
.results--side .result__tools .icon-btn { width: 30px; height: 30px; }
.results--side .result__meta .tag { font-size: .75rem; padding: 2px 8px; }
.results--side .md h1 { font-size: 1.2rem; } .results--side .md h2 { font-size: 1.1rem; } .results--side .md h3, .results--side .md h4 { font-size: 1rem; }
.result__tools .icon-btn { width: 34px; height: 34px; }
.result__body { min-height: 180px; max-height: 620px; overflow: auto; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); padding: 16px 18px; }
.result__raw { margin: 0; white-space: pre-wrap; word-break: break-word; font: 400 .88rem/1.65 var(--mono); color: var(--ink); unicode-bidi: plaintext; }
.result--loading .result__body { display: grid; gap: 10px; align-content: start; }
.skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel:nth-child(2) { width: 80%; } .skel:nth-child(3) { width: 92%; } .skel:nth-child(4) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.result--error .result__body { color: #8c1d18; background: #fde8e6; border-color: #f4c7c3; }
[data-theme="dark"] .result--error .result__body { color: #f2a19a; background: #3d1c1a; border-color: #5a2a26; }

/* rendered markdown */

/* ───────── tables */
.table-card { padding: 0; overflow-x: auto; }
.card.table-card { padding: 4px 0; gap: 0; }
.table-card__title { padding: 16px 20px 6px; margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font: 600 .8125rem/1.2 var(--font); color: var(--muted); padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.table code { font-size: .82rem; }
.table .actions { display: flex; gap: 14px; justify-content: flex-end; }
.table .empty td { text-align: center; padding: 36px 20px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font: 600 .72rem/1.6 var(--mono); background: var(--brand-soft); color: var(--brand-strong); white-space: nowrap; }
.badge::before { content: "✓"; font-size: .7rem; }
.badge--err { background: #fde8e6; color: #8c1d18; }
.badge--err::before { content: "!"; font-weight: 600; }
[data-theme="dark"] .badge--err { background: #3d1c1a; color: #f2a19a; }
.bar-cell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.bar-cell__bar { height: 8px; border-radius: 4px; background: var(--brand); min-width: 2px; }
.mono { font-family: var(--mono); font-size: .82rem; }

/* ───────── charts */
.chart { position: relative; height: 260px; }
.chart--small { height: 170px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font: 500 11px var(--mono); }
.chart .bar { fill: var(--brand); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart .bar.is-hover { fill: var(--brand-strong); }
[data-theme="dark"] .chart .bar-hit:hover + .bar, [data-theme="dark"] .chart .bar.is-hover { fill: var(--accent); }
.chart__empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .92rem; text-align: center; padding: 0 20px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--brand-strong); color: var(--on-brand); padding: 8px 11px; border-radius: 6px; font-size: .82rem; line-height: 1.4; }
.tip strong { display: block; font-family: var(--mono); font-size: .75rem; opacity: .8; font-weight: 500; }

/* ───────── logs, billing, settings */
.filters { display: flex; gap: 12px; flex-wrap: wrap; }
.field--inline { display: flex; align-items: center; gap: 8px; }
.field--inline label { font-size: .88rem; }
.field--inline select, .field--inline input { min-height: 38px; padding: 6px 10px; font-size: .9rem; width: auto; }
.field--inline input { min-width: 240px; }
.balance-card { gap: 10px; }
.balance-card__value { font-size: 2.6rem; font-weight: 600; color: var(--brand-strong); line-height: 1.1; font-variant-numeric: tabular-nums; }
.note { padding: 12px 14px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); font-size: .9rem; }
.balance-card .btn { align-self: flex-start; }
.limits { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; font-size: .94rem; }
.limits dt { color: var(--muted); }
.limits dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.profile { flex-direction: row; align-items: center; gap: 18px; }
.profile h3 { margin: 0 0 2px; font-size: 1.3rem; }
.profile p { margin: 0; }
.setting-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.setting-row h3 { margin: 0 0 4px; }
.setting-row p { margin: 0; }
.danger { border-color: #f4c7c3; }
[data-theme="dark"] .danger { border-color: #5a2a26; }
.callout .code { margin: 0; white-space: pre-wrap; word-break: break-all; }

/* ───────── docs */
.docs { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
.docs__toc { position: sticky; top: 77px; padding: 12px; gap: 2px; }
.docs__toc a { padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.docs__toc a:hover { background: var(--surface-2); color: var(--brand-strong); }
.docs__body { display: grid; gap: 16px; min-width: 0; }
.docs__body h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.docs__body h3 { font-size: 1rem; margin: 8px 0 0; }
.docs__body .code { margin: 0; white-space: pre; }
.docs__body .table-card { border: 1px solid var(--line); border-radius: 6px; }
.method { font: 700 .72rem/1 var(--mono); padding: 5px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--brand-strong); }
.method--get { background: var(--brand-soft); }

/* ───────── modals, toast */
.modal { border: 1px solid var(--line); border-radius: 6px; padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.modal--wide { width: min(760px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(11, 21, 20, .5); backdrop-filter: blur(2px); }
.modal__body { display: grid; gap: 14px; padding: 26px; }
.modal__body h2 { font-size: 1.35rem; margin: 0; }
.modal__body p { margin: 0; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.modal .code { margin: 0; white-space: pre-wrap; word-break: break-all; font-size: .8rem; }
.modal--wide .code { white-space: pre; word-break: normal; }
.secret { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 14px; border-radius: 6px; background: var(--surface-2); }
.secret code { flex: 1; word-break: break-all; font-size: .85rem; color: var(--ink); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--brand-strong); color: var(--on-brand); padding: 10px 18px; border-radius: 6px; font-weight: 700; font-size: .92rem; }

/* ───────── login */
.login { min-height: calc(100vh - 57px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login__side { background: #0b3b3e; color: #e6f1f0; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 40px; }
[data-theme="dark"] .login__side { background: #173c3d; }
.login__side .brand { color: #fff; }
.login__side h2 { color: #fff; font-size: clamp(1.7rem, 2.6vw, 2.3rem); max-width: 460px; }
.login__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 460px; }
.login__points li { display: flex; gap: 12px; align-items: flex-start; }
.login__points svg { width: 20px; height: 20px; flex: none; margin-top: 3px; fill: none; stroke: #d9a23b; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.login__points strong { color: #fff; }
.login__side > * { min-width: 0; max-width: 100%; }
.login__code { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 16px 18px; font: 400 .8rem/1.7 var(--mono); color: #d8e4e1; white-space: pre; overflow-x: auto; max-width: 520px; margin: 0; }
.login__code .k { color: #e3b457; } .login__code .s { color: #8cc3c0; }
.login__main { display: grid; place-items: center; padding: 32px 16px; }
.login__wrap { width: 100%; max-width: 420px; }
.login__card { gap: 16px; padding: 36px 32px; }
.login__card h1 { font-size: 1.7rem; margin: 0; }
.login__buttons { display: grid; gap: 12px; margin-top: 6px; }
.login__buttons svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login__free { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; color: var(--ink); }
.login__legal { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
.login__back { text-align: center; margin-top: 18px; font-size: .92rem; }

/* ───────── responsive */
@media (max-width: 1180px) {
  .model-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .play { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; height: auto; max-height: none; z-index: 50; transform: translateX(-100%); transition: transform .2s, visibility .2s; visibility: hidden; }
  .side.is-open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .shell { background: none; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgba(11, 21, 20, .45); }
  .console-header__menu { display: grid; }
  .console-header .site-header__inner { flex-wrap: wrap; height: auto; padding: 12px 20px 0; column-gap: 10px; row-gap: 0; }
  .console-header .brand { margin-right: auto; }
  .console-header .tabs { order: 3; width: 100%; margin: 8px 0 0; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .console-header .tabs a { padding: 8px 10px; }
  .console-header .tabs a[aria-current="page"]::after { bottom: 0; left: 10px; right: 10px; }
  .play { grid-template-columns: 1fr; }
  .play__main { display: contents; }
  .play__input { order: 1; }
  .play__settings { position: static; order: 2; }
  .results { order: 3; }
  .docs { grid-template-columns: 1fr; }
  .docs__toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login__side { order: 2; padding: 32px 20px; }
}
@media (max-width: 720px) {
  .console-header .site-header__inner { padding: 12px 16px 0; }
  .content { padding: 20px 16px; }
  .console-footer { padding: 18px 16px 24px; }
  .stats, .stats--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat__value { font-size: 1.4rem; }
  .cols, .model-grid, .model-grid--compact { grid-template-columns: 1fr; }
  .results { grid-template-columns: 1fr !important; }
  .table th, .table td { padding: 10px 14px; }
  .card { padding: 18px; }
  .hello__cta .btn { flex: 1; justify-content: center; }
  .banner, .profile { flex-direction: column; align-items: flex-start; }
  .chart { height: 220px; }
}
@media (max-width: 360px) {
  .chip--credit span { display: none; }
}

[hidden] { display: none !important; }

/* ───────── blocked account page */
.blocked { min-height: calc(100vh - 57px); display: grid; place-items: center; padding: 32px 16px; }
.blocked__card { max-width: 560px; gap: 14px; padding: 36px 34px; }
.blocked__card h1 { font-size: 1.8rem; margin: 0; }
.blocked__card p { margin: 0; }
.blocked__icon { width: 52px; height: 52px; border-radius: 6px; display: grid; place-items: center; background: #fde8e6; color: #b3261e; }
[data-theme="dark"] .blocked__icon { background: #3d1c1a; color: #f2a19a; }
.blocked__icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.blocked__ref { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 6px; background: var(--surface-2); }
.blocked__ref span { color: var(--muted); font-size: .9rem; }
.blocked__ref strong { font: 700 1rem/1 var(--mono); color: var(--brand-strong); }
.blocked__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.blocked__signout { margin: 0; }
.blocked__note { font-size: .84rem; color: var(--muted); }
.blocked__card .side__title, .login__card .side__title { padding: 0; }

/* ───────── admin: switches, manage-user dialog, waitlist */
.section-title { margin: 12px 0 0; font-size: 1.15rem; }
.settings-card { gap: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; align-items: center; }
.settings-grid .field--inline input { width: 140px; min-width: 0; }
.settings-grid .field--inline label { min-width: 150px; }
.model-toggles { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.model-toggles legend { margin-bottom: 8px; }
.model-toggles label { display: flex; gap: 8px; align-items: center; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.model-toggles input { accent-color: var(--brand); width: 16px; height: 16px; }
.settings-actions { display: flex; gap: 14px; align-items: center; }
.mu-head { display: flex; gap: 14px; align-items: center; }
.mu-head h2 { margin: 0; }
.mu-head p { margin: 2px 0 0; }
.mu-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mu-stats > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 6px; background: var(--surface-2); }
.mu-stats strong { font-size: 1.1rem; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.mu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mu-box { display: grid; gap: 10px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.mu-box h3 { margin: 0; font-size: 1rem; }
.mu-box p { margin: 0; }
.mu-box input, .mu-box textarea, .mu-danger input { font: inherit; font-size: .95rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; min-height: 38px; width: 100%; min-width: 0; }
.mu-box .btn { justify-self: start; }
.mu-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mu-row input { flex: 1 1 120px; }
.mu-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mu-details { border: 1px solid var(--line); border-radius: 6px; padding: 0 14px; }
.mu-details summary { cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--brand-strong); }
.mu-details .table-card { margin: 0 -14px; border-top: 1px solid var(--line); }
.mu-danger { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px; border: 1px solid #f4c7c3; border-radius: 6px; }
[data-theme="dark"] .mu-danger { border-color: #5a2a26; }
.mu-danger h3 { margin: 0 0 4px; font-size: 1rem; }
.mu-danger p { margin: 0; max-width: 420px; }
.mu-danger .mu-row { flex: 0 1 320px; }
.role-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font: 700 .68rem/1.5 var(--mono); background: var(--accent-soft); color: var(--brand-strong); vertical-align: middle; }
.cell-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .settings-grid, .mu-grid { grid-template-columns: 1fr; }
  .mu-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.login__try { margin: 16px 0 0; text-align: center; font-size: .9rem; color: var(--muted); }

/* text arriving live: a blinking cursor at the end */
.result__raw.is-streaming::after {
  content: ""; display: inline-block; width: .5em; height: 1.1em; margin-inline-start: 2px; vertical-align: text-bottom;
  background: var(--brand); animation: caret 1s steps(2, start) infinite;
}
@keyframes caret { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .result__raw.is-streaming::after { animation: none; } }

/* ───────── admin analytics */
:root {
  --s-api: #2a78d6; --s-play: #eb6834; --s-try: #1baf7a; --s-credit: #4a3aa7; --s-ai: #e87ba4;
  --st-warn: #fab219; --st-crit: #d03b3b; --muted-bar: #7d8a90;
}
[data-theme="dark"] {
  --s-api: #3987e5; --s-play: #d95926; --s-try: #199e70; --s-credit: #9085e9; --s-ai: #d55181;
  --st-warn: #fab219; --st-crit: #d03b3b; --muted-bar: #8d989d;
}
.an { display: grid; gap: 20px; transition: opacity .15s; }
.an.is-loading { opacity: .55; }
.an-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-kpis .stat__value { font-variant-numeric: normal; }
.stat__value--loss { color: #b3261e; }
[data-theme="dark"] .stat__value--loss { color: #f2a19a; }
.an-card { gap: 8px; }
.an-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.an-card__title { margin: 0; font-size: 1rem; }
.an-card__sub { margin: 4px 0 0; color: var(--muted); font-size: .84rem; max-width: 640px; }
.an-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8125rem; color: var(--ink-2); }
.an-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.an-legend__key { display: inline-block; flex: none; }
.an-legend__key--rect { width: 10px; height: 10px; border-radius: 2px; }
.an-legend__key--line { width: 16px; height: 2px; border-radius: 1px; }
.an-chart { height: 240px; }
.an-chart.chart--small { height: 200px; }
.chart .base-line { stroke: var(--line-strong); stroke-width: 1; }
.chart .ref-line { stroke: var(--muted); stroke-width: 1; }
.chart .ref-label { fill: var(--muted); font: 500 11px var(--font); }
.chart .crosshair { stroke: var(--line-strong); stroke-width: 1; }
.chart .an-dot { stroke: var(--surface); stroke-width: 2; }
.chart .an-hit { fill: transparent; }
.chart .an-col.is-hover { opacity: .8; }
.an-table { max-height: 280px; overflow: auto; border-top: 1px solid var(--line); }
.an-table .table th { position: sticky; top: 0; background: var(--surface); }
.an-split { display: grid; gap: 8px; }
.an-split__title { margin: 8px 0 0; font: 600 .8125rem/1.2 var(--font); color: var(--muted); }
.an-bar { display: grid; grid-template-columns: minmax(120px, 36%) 1fr auto; align-items: center; gap: 12px; font-size: .875rem; }
.an-bar__label { color: var(--ink-2); overflow-wrap: anywhere; }
.an-bar__track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.an-bar__fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.an-bar__value { font-family: var(--mono); font-size: .8125rem; color: var(--ink); white-space: nowrap; }
.an-foot { margin: 0; max-width: 820px; }
.an-reason { display: grid; gap: 2px; }
.table td.nowrap { white-space: nowrap; }
.tip__row { display: block; }
.tip__row b { font-weight: 700; }
.tip__key { display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; border-radius: 1px; }
.tip__key--rect { width: 8px; height: 8px; border-radius: 2px; }
@media (max-width: 640px) {
  .an-bar { grid-template-columns: 1fr auto; }
  .an-bar__track { grid-column: 1 / -1; grid-row: 2; }
}

/* ═════════ shadcn/ui console layer (overrides the older rules above) ═════════ */
.small { font-size: .8125rem; }
.link { font-weight: 500; color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.link--danger { color: var(--danger); }
.btn--danger, [data-theme="dark"] .btn--danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-xs); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); color: #fff; }
kbd { font: 500 .75rem/1 var(--mono); padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 1px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); }

/* shell + sidebar */
.shell { background: linear-gradient(to right, var(--sidebar) 247px, var(--line) 247px, var(--line) 248px, transparent 248px); }
.side { background: var(--sidebar); padding: 12px 8px; gap: 8px; border-right: 1px solid var(--line); }
.side__nav { gap: 1px; }
.side__nav a { height: 32px; padding: 0 8px; gap: 8px; border-radius: var(--radius-md); color: var(--ink); font-weight: 400; font-size: .875rem; transition: background-color .15s; }
.side__nav a svg { width: 16px; height: 16px; color: var(--muted); }
.side__nav a:hover { background: var(--surface-2); color: var(--ink); }
.side__nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.side__nav a[aria-current="page"] svg { color: var(--ink); }
.side__label, .side__title { display: flex; align-items: center; height: 32px; margin: 8px 0 0; padding: 0 8px; font: 500 .75rem/1 var(--font); color: var(--muted); }
.credit-mini { border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-xs); padding: 12px; gap: 6px; }
.credit-mini:hover { border-color: var(--line-strong); }
.credit-mini__label { font-weight: 500; font-size: .75rem; }
.credit-mini__value { font-size: 1.25rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.console-header .site-header__inner { padding: 0 16px; }

/* meters */
.meter { height: 6px; background: var(--surface-2); }
.meter__fill { background: var(--brand); }
.meter__fill[data-level="high"] { background: var(--danger); }

/* chips, avatar, menu */
.chip { height: 32px; padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 .8125rem/1 var(--font); box-shadow: var(--shadow-xs); }
.chip:hover { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
.chip--credit { color: var(--ink); font-family: var(--mono); font-size: .8125rem; }
.chip--credit svg { color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 999px; }
.avatar--fallback { background: var(--surface-2); color: var(--ink); font-weight: 500; font-size: .8125rem; }
.avatar--lg { width: 64px; height: 64px; }
.usermenu__pop { border-radius: var(--radius-md); padding: 8px; box-shadow: var(--shadow-md); gap: 2px; }
.usermenu__pop a, .usermenu__pop .link { display: flex; align-items: center; height: 32px; padding: 0 8px; border-radius: var(--radius-sm); font-weight: 400; font-size: .875rem; color: var(--ink); }
.usermenu__pop a:hover, .usermenu__pop .link:hover { background: var(--surface-2); color: var(--ink); }

/* page structure */
.content { padding: 24px 32px 32px; }
.panel { gap: 16px; }
.page-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 16px; }
.hello__title { font-size: 1.875rem; letter-spacing: -0.03em; }
.hello p { color: var(--muted); }
.card { padding: 24px; gap: 8px; }
.card h3 { font-size: 1rem; font-weight: 600; }
.cols { gap: 16px; }
.console-footer { font-size: .8125rem; padding: 16px 32px 24px; }

/* stat cards (shadcn dashboard) */
.stats { gap: 16px; }
.stat { padding: 20px 24px; gap: 4px; }
.stat__label { font: 500 .875rem/1.3 var(--font); color: var(--muted); }
.stat__value { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__note { font-size: .8125rem; color: var(--muted); }
.balance-card__value { color: var(--ink); letter-spacing: -0.03em; }

/* checklist */
.checklist li { padding: 12px 0; }
.checklist strong { font-weight: 500; font-size: .875rem; }
.tick { width: 20px; height: 20px; border: 1px solid var(--line-strong); }
.tick svg { width: 12px; height: 12px; stroke-width: 3; }
.checklist li[data-done] .tick { background: var(--brand); border-color: var(--brand); }
.checklist li[data-done] strong { color: var(--muted); text-decoration: none; }

/* model cards + tags */
.model-card__name { color: var(--ink); font-size: 1rem; }
.model-card__price { color: var(--ink); font-weight: 500; }
.tag, .tag--speed, .tag--default { padding: 2px 8px; border-radius: 999px; font: 500 .75rem/1.4 var(--font); background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.tag--default { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.banner { border-color: var(--line); box-shadow: var(--shadow-sm); }

/* playground */
.drop { border: 1px dashed var(--line-strong); border-radius: var(--radius-xl); background: var(--bg); }
.drop:hover, .drop.is-over { border-color: var(--ink); background: var(--surface-2); }
.drop__icon, .empty-state__icon { stroke: var(--muted); }
.drop__preview img { border-radius: var(--radius-md); }
.label { font-weight: 500; font-size: .875rem; color: var(--ink); }
.play__cost { border-radius: var(--radius-md); background: var(--surface-2); font-size: .8125rem; }
.play__cost strong { color: var(--ink); font-weight: 500; }
.switch { font-weight: 500; font-size: .875rem; color: var(--ink); }
.switch__track { width: 32px; height: 18px; background: var(--line-strong); }
.switch__track::after { top: 2px; left: 2px; width: 14px; height: 14px; background: var(--bg); box-shadow: var(--shadow-sm); }
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(14px); }
.compare-list input { accent-color: var(--brand); }
.history button { border-radius: var(--radius-md); }
.history button:hover { border-color: transparent; background: var(--surface-2); }
.history img { border-radius: var(--radius-sm); }
.result__model { color: var(--ink); font-weight: 600; }
.result__body { border-radius: var(--radius-md); background: var(--bg); border: 1px solid var(--line); }
.result--error .result__body { color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--bg)); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
[data-theme="dark"] .result--error .result__body { color: #fca5a5; background: color-mix(in srgb, var(--danger) 10%, var(--bg)); }
.skel { border-radius: var(--radius-sm); background: var(--surface-2); animation: skel 1.6s ease-in-out infinite; }
@keyframes skel { 50% { opacity: .5; } }
.codebox__copy, [data-theme="dark"] .codebox__copy { background: var(--bg); border-color: var(--line); color: var(--muted); }
.codebox__copy:hover { color: var(--ink); border-color: var(--line); background: var(--surface-2); }

/* tables (shadcn table) */
.card.table-card { padding: 0; }
.table-card__title { padding: 20px 24px 8px; font-size: 1rem; }
.table { font-size: .875rem; }
.table th { height: 40px; padding: 0 16px; font: 500 .875rem/1 var(--font); color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { padding: 10px 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.table .empty td { color: var(--muted); }

/* badges (status): outline with a small dot, destructive tint for errors */
.badge { padding: 2px 8px; border-radius: 999px; font: 500 .75rem/1.4 var(--font); background: var(--bg); color: var(--ink); border: 1px solid var(--line); gap: 6px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: #16a34a; }
.badge--err { background: color-mix(in srgb, var(--danger) 8%, var(--bg)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.badge--err::before { content: ""; background: var(--danger); }
[data-theme="dark"] .badge--err { color: #fca5a5; }
.bar-cell__bar { background: var(--chart); border-radius: 2px; }

/* charts: one blue series (brand-neutral), hairline grid */
.chart .bar { fill: var(--chart); }
.chart .bar-hit:hover + .bar, .chart .bar.is-hover, [data-theme="dark"] .chart .bar-hit:hover + .bar, [data-theme="dark"] .chart .bar.is-hover { fill: color-mix(in srgb, var(--chart) 75%, var(--ink)); }
.chart .axis-label { font: 400 11px var(--font); }
.tip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: .8125rem; padding: 8px 10px; }
.tip strong { font-family: var(--font); color: var(--muted); opacity: 1; }

/* filters, notes, settings */
.field--inline select, .field--inline input { height: 36px; min-height: 0; padding: 0 12px; font-size: .875rem; }
.field--inline label { font-size: .875rem; color: var(--muted); font-weight: 500; }
.note { border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: .875rem; }
.limits dd { font-weight: 500; }
.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
[data-theme="dark"] .danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.docs__toc a { border-radius: var(--radius-md); font-weight: 400; color: var(--muted); }
.docs__toc a:hover { color: var(--ink); background: var(--surface-2); }
.docs__body .table-card { border-radius: var(--radius-xl); }
.method { border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }

/* dialogs + toast (shadcn dialog / sonner) */
.modal { border-radius: var(--radius-xl); border: 1px solid var(--line); box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); }
.modal::backdrop { background: rgb(0 0 0 / .5); backdrop-filter: none; }
.modal__body { padding: 24px; gap: 16px; }
.modal__body h2 { font-size: 1.125rem; letter-spacing: -0.02em; }
.modal__body p { color: var(--muted); font-size: .875rem; }
.modal__actions { gap: 8px; }
.secret { border-radius: var(--radius-md); border: 1px solid var(--line); }
.toast { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-weight: 500; font-size: .875rem; padding: 12px 16px; }

/* sign-in: neutral split, the dark side follows the theme */
.login__side, [data-theme="dark"] .login__side { background: var(--sidebar); color: var(--ink); border-right: 1px solid var(--line); }
.login__side .brand, .login__side h2, .login__points strong { color: var(--ink); }
.login__points li { color: var(--muted); }
.login__points svg { stroke: var(--ink); }
.login__code { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-xl); color: var(--ink); }
.login__code .k { color: #b45309; } .login__code .s { color: #0f766e; }
[data-theme="dark"] .login__code .k { color: #fbbf24; } [data-theme="dark"] .login__code .s { color: #5eead4; }
.login__card h1 { font-size: 1.5rem; letter-spacing: -0.025em; }

/* analytics */
.an-card__sub { color: var(--muted); }
.stat__value--loss { color: var(--danger); }
.seg { padding: 3px; gap: 0; border-radius: var(--radius); background: var(--surface-2); }
.seg button { height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-md); font: 500 .8125rem/1 var(--font); color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg button[aria-selected="true"], [data-theme="dark"] .seg button[aria-checked="true"] { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .15); }
.results--side .result__tools .seg button { height: 26px; padding: 0 8px; }
.drop__icon { width: 44px; height: 44px; padding: 11px; margin-bottom: 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-xs); stroke: var(--ink); stroke-width: 1.8; }
.login__free { border-radius: var(--radius-md); font-size: .875rem; }
.login__free-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 960px) {
  .shell { background: none; }
  .side { background: var(--sidebar); }
  .content { padding: 20px 16px 24px; }
  .console-footer { padding: 16px; }
}
@media (max-width: 960px) {
  .console-header .site-header__inner { height: auto; min-height: 56px; flex-wrap: wrap; padding: 10px 16px 0; column-gap: 8px; row-gap: 0; }
  .console-header .tabs { padding-bottom: 6px; }
  .console-header .tabs a { flex: none; }
}

/* ═════════ sidebar-only layout (no global top bar), after shadcn's dashboard layout ═════════ */
.shell { min-height: 100vh; background: linear-gradient(to right, var(--sidebar) 255px, var(--line) 255px, var(--line) 256px, transparent 256px); grid-template-columns: 256px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; padding: 8px; gap: 4px; border-right: 1px solid var(--line); }
.side__brand { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px; margin-bottom: 4px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.side__brand:hover { background: var(--surface-2); color: var(--ink); }
.side__brand img { width: 24px; height: 24px; flex: none; }
.side__brand-text { display: grid; line-height: 1.2; }
.side__brand-text strong { font-size: .875rem; font-weight: 600; letter-spacing: -0.01em; }
.side__brand-text span { font-size: .75rem; color: var(--muted); }
.side__label:first-child { margin-top: 0; }
.side__nav--out { margin-top: auto; padding-top: 8px; }
.side__nav--out a { color: var(--muted); }
.side__nav--out a:hover { color: var(--ink); }
.side__ext { width: 12px !important; height: 12px !important; margin-left: auto; opacity: .55; }
.side__foot { margin-top: 8px; gap: 8px; }

/* account row + menu (opens upwards) */
.side .usermenu { position: relative; }
.side .usermenu__btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 48px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.side .usermenu__btn:hover, .side .usermenu__btn[aria-expanded="true"] { background: var(--surface-2); }
.side .avatar { width: 32px; height: 32px; border-radius: var(--radius-md); flex: none; }
.usermenu__who { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.usermenu__who strong { font-size: .875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__who span { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side .usermenu__pop { position: absolute; left: 0; right: 0; top: auto; bottom: calc(100% + 6px); width: auto; display: grid; gap: 1px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 30; }
.side .usermenu__pop a, .side .usermenu__pop button { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: 400 .875rem/1 var(--font); text-decoration: none; cursor: pointer; text-align: left; }
.side .usermenu__pop a:hover, .side .usermenu__pop button:hover { background: var(--surface-2); color: var(--ink); }
.side .usermenu__pop svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side .usermenu__pop hr { margin: 3px 0; }
.side .usermenu__pop form { margin: 0; }
.theme-toggle .tt-light { display: none; }
[data-theme="dark"] .theme-toggle .tt-light { display: inline; }
[data-theme="dark"] .theme-toggle .tt-dark { display: none; }

/* each page's slim header: page title (and the menu button on small screens) */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 32px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); }
.topbar__title { margin: 0; font-size: .9375rem; font-weight: 500; letter-spacing: -0.01em; }
.topbar__menu { display: none; width: 32px; height: 32px; }
.play__settings, .docs__toc { top: 64px; }
.content { padding-top: 24px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 280px; height: auto; padding: 8px; z-index: 50; }
  .side.is-open { box-shadow: var(--shadow-md); }
  .scrim { background: rgb(0 0 0 / .4); }
  .topbar { padding: 0 12px; }
  .topbar__menu { display: grid; }
}
/* switches with long labels wrap instead of pushing past the screen edge */
.switch { max-width: 100%; align-items: flex-start; }
.switch__track { margin-top: 1px; }
.switch > span:last-child { min-width: 0; flex: 1; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .settings-grid, .mu-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid .field--inline { flex-wrap: wrap; }
  .settings-grid .field--inline label { min-width: 0; flex: 1 1 100%; }
  .settings-grid .field--inline input { width: 100%; }
}

/* sign-in and blocked pages: no website menu, just the logo (to runemic.com) and the theme switch */
.auth-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; pointer-events: none; }
.auth-bar > * { pointer-events: auto; }
.auth-bar__brand { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.auth-bar__brand:hover { background: var(--surface-2); color: var(--ink); }
.auth-bar__brand img { width: 24px; height: 24px; }
.login-page, body:has(> .auth-bar) { position: relative; }
.login { min-height: 100vh; }
.login__main { padding-top: 72px; }
.blocked { min-height: 100vh; padding-top: 72px; }
@media (min-width: 961px) { .login-page .auth-bar { right: 50%; } }

/* ───────── MCP sign-in (consent page) and connected apps */
.consent { min-height: 100vh; display: grid; place-items: center; padding: 72px 16px 32px; }
.consent__card { width: 100%; max-width: 460px; gap: 16px; padding: 32px; }
.consent__card h1 { font-size: 1.5rem; letter-spacing: -0.025em; margin: 0; overflow-wrap: anywhere; }
.consent__card p { margin: 0; }
.consent__who { font-size: .875rem; color: var(--muted); }
.consent__who strong { color: var(--ink); font-weight: 500; }
.consent__h { font-size: .875rem; font-weight: 600; margin: 0 0 8px; }
.consent__list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .875rem; }
.consent__verified { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.consent__verified svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.consent__warn { padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-2); font-size: .875rem; }
.consent__dest { font-size: .875rem; overflow-wrap: anywhere; }
.consent__actions { display: flex; justify-content: flex-end; gap: 8px; margin: 4px 0 0; }
.consent__actions .btn { min-width: 96px; }
.consent__foot { font-size: .8rem; color: var(--muted); }
@media (max-width: 480px) { .consent__card { padding: 24px 20px; } .consent__actions .btn { flex: 1; } }
.apps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.apps__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.apps__who { display: grid; gap: 2px; min-width: 0; }
.apps__who strong { font-weight: 500; overflow-wrap: anywhere; }
.apps__empty { padding: 12px 0 0; font-size: .875rem; }
@media (min-width: 961px) { body:has(> .consent) .auth-bar, body:has(> .blocked) .auth-bar { right: 0; } }
.m0 { margin: 0; }

/* ═════════ inset layout (2026-10 refresh): the page is one white surface on the sidebar's tint; panels that belong
   together share one frame split by hairlines instead of floating as separate cards ═════════ */
body.app { background: var(--sidebar); }
.shell { background: var(--sidebar); }
.side { border-right: 0; background: transparent; }
@media (min-width: 961px) {
  .main { margin: 8px 8px 8px 0; min-height: calc(100vh - 16px); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgb(0 0 0 / .04); overflow: clip; }
  .topbar { border-radius: 14px 14px 0 0; }
}
.topbar { height: 52px; }
.topbar__title { display: flex; align-items: center; gap: 8px; font-weight: 500; }

/* cards: hairline frame, no shadow, slightly rounder */
.card { border-radius: 12px; box-shadow: none; }
.card__bar { margin-bottom: 4px; }
.card h3 { display: flex; align-items: center; gap: 8px; font-size: .9375rem; }
.card h3 svg, .stat__label svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* stat rows and side-by-side panels: one frame, hairline dividers (the 1px gap shows the line colour) */
.stats, .cols { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stats > .card, .cols > .card { border: 0; border-radius: 0; background: var(--bg); }
.stat { padding: 18px 20px; }
.stat__label { display: flex; align-items: center; gap: 6px; font-size: .8125rem; }
.stat__value { font-size: 1.625rem; margin-top: 2px; }

/* home: a compact greeting, data first */
.hello { padding: 4px 0 0; align-items: center; }
.hello__title { font-size: 1.375rem; letter-spacing: -0.02em; margin: 0; }
.hello p { font-size: .875rem; margin: 4px 0 0; }

/* tables: quiet header band, roomier rows */
.table th { background: color-mix(in srgb, var(--surface-2) 55%, var(--bg)); height: 36px; font-size: .8125rem; }
.table td { padding: 12px 16px; }
.table td.num, .table th.num { font-variant-numeric: tabular-nums; }

/* chart: dark readout like a system tooltip; empty charts show a calm placeholder instead of a broken axis */
.tip { background: var(--ink); color: var(--bg); border: 0; border-radius: 10px; box-shadow: 0 12px 32px -12px rgb(0 0 0 / .45); padding: 10px 12px; }
.tip strong { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chart .bar { fill: var(--chart); }
.chart--empty .bar { fill: var(--surface-2); }
.chart__empty { display: grid; justify-items: center; gap: 8px; color: var(--muted); font-size: .875rem; }
.chart__empty svg { width: 28px; height: 28px; padding: 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart__empty a { color: var(--ink); font-weight: 500; }

/* admin: pager under the users, model errors and action log tables */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 10px 0 18px; }
.pager .muted { margin-right: auto; }

/* admin users table on phones: user (with email and totals under the name), status, Manage */
.narrow-only { display: none; }
@media (max-width: 760px) {
  .table .wide-only { display: none; }
  .narrow-only { display: block; margin-top: 2px; }
}
/* admin: translation model order */
.tr-order { display: block; margin: 14px 0; }
.tr-order__list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; max-width: 560px; }
.tr-order__item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.tr-order__move { display: flex; gap: 4px; flex: none; }
