/* 2dayAPI panel — one visual system. Tokens on :root; the dark theme follows the system. */
:root {
  color-scheme: light;
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #f0efec;
  --border: #e1e0db;
  --border-strong: #c4c3bc;
  --text: #1a1a19;
  --text-2: #52514e;
  --muted: #6d6c67;
  --accent: #256abf;          /* links, primary buttons */
  --accent-hover: #1c5cab;
  --on-accent: #ffffff;
  --series: #2a78d6;          /* chart bars, meter fill */
  --series-active: #184f95;
  --focus: #2a78d6;
  /* reserved status colours — always paired with a text label */
  --st-good: #0ca30c;
  --st-warning: #d48f00;
  --st-critical: #d03b3b;
  --st-info: #2a78d6;
  --st-neutral: #8b8a84;
  --danger-text: #b02a2a;
  --danger-bg: #d03b3b;
  --notice-error-bg: #fdf0ef;
  --notice-ok-bg: #eef7ee;
  --notice-info-bg: #eef4fc;
  --secret-bg: #fff8e6;
  --secret-border: #d9a200;
  --track: #e6e5e0;
  --grid: #e6e5e0;
  --shadow: 0 1px 2px rgba(20, 20, 18, .06);
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1b1b1a;
    --surface-2: #262624;
    --border: #32322f;
    --border-strong: #4a4a45;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #9c9b93;
    --accent: #6da7ec;
    --accent-hover: #86b6ef;
    --on-accent: #0d1b2e;
    --series: #3987e5;
    --series-active: #86b6ef;
    --focus: #6da7ec;
    --st-good: #2bb52b;
    --st-warning: #fab219;
    --st-critical: #e66767;
    --st-info: #5598e7;
    --st-neutral: #8b8a84;
    --danger-text: #f08a8a;
    --danger-bg: #c23a3a;
    --notice-error-bg: #2e1c1b;
    --notice-ok-bg: #1a2a1a;
    --notice-info-bg: #18222f;
    --secret-bg: #2b2412;
    --secret-border: #c98500;
    --track: #33332f;
    --grid: #2e2e2b;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); overflow-x: hidden; }
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
h1 { font-size: 20px; line-height: 1.3; font-weight: 650; }
h2 { font-size: 15px; line-height: 1.4; font-weight: 650; }
h3 { font-size: 13px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
strong { font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.text-strong { color: var(--text); font-weight: 600; }
.break { overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }

/* --- shell --------------------------------------------------------------------------------------------------------- */
.shell { background: linear-gradient(to right, var(--surface) 199px, var(--border) 199px, var(--border) 200px, transparent 200px); display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: 52px 1fr; grid-template-areas: "top top" "nav main"; min-height: 100vh; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 6px 10px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 8px; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 700; letter-spacing: -.02em; }
.brand-lg { font-size: 18px; }
.topbar-role { color: var(--muted); font-size: 13px; padding-left: 12px; border-left: 1px solid var(--border); white-space: nowrap; }
.topbar-who { margin-left: auto; color: var(--text-2); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { grid-area: nav; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; position: sticky; top: 52px; align-self: start; height: calc(100vh - 52px); overflow-y: auto; }
.nav-link { display: block; padding: 7px 12px; border-radius: 6px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-link[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.main { grid-area: main; padding: 24px; min-width: 0; max-width: 1440px; width: 100%; outline: none; }

/* --- page furniture ------------------------------------------------------------------------------------------------ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head-text { min-width: 0; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions .input { width: auto; }
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.crumbs-action { margin-left: auto; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack-sm { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.split { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.card > .hint, .card p.hint { margin: 8px 0; }
.plain-list { list-style: none; display: grid; gap: 8px; margin: 0 0 12px; }
.plain-list li { padding-left: 14px; position: relative; }
.plain-list li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; white-space: nowrap; }
.two-line > .muted { font-size: 12px; }
.id-list { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; }

/* --- buttons and inputs -------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-weight: 550; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-bg); color: #fff; }
.btn-danger:hover { filter: brightness(.93); background: var(--danger-bg); }
.btn-danger-quiet { color: var(--danger-text); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions-nowrap { flex-wrap: nowrap; }
.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; min-width: 0; }
textarea.input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field > label, .field-label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field-submit { align-self: end; justify-items: start; }
.stack > .page-head { margin-bottom: 0; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: start; }
.form-row .field-submit { align-self: start; padding-top: 23px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.inline-form .field { flex: 1 1 220px; max-width: 360px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.check input { margin-top: 3px; }

/* --- status -------------------------------------------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text); white-space: nowrap; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-neutral); flex: none; }
.badge-good .dot { background: var(--st-good); }
.badge-warning .dot { background: var(--st-warning); }
.badge-critical .dot { background: var(--st-critical); }
.badge-info .dot { background: var(--st-info); }
.badge-neutral .dot { background: var(--st-neutral); }
.badge-outline .dot { background: transparent; border: 1.5px solid var(--st-neutral); }
.badge-detail { color: var(--muted); font-weight: 400; }

/* --- meters -------------------------------------------------------------------------------------------------------- */
.meters { display: grid; gap: 8px; }
.meter { display: grid; grid-template-columns: 4.2em minmax(40px, 1fr) auto; column-gap: 10px; row-gap: 0; align-items: center; font-size: 13px; }
.meter-label { color: var(--text-2); white-space: nowrap; }
.meter-track { display: block; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 2px; background: var(--series); }
.meter-warning { background: var(--st-warning); }
.meter-critical { background: var(--st-critical); }
.meter-value { font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; white-space: nowrap; }
.meter-reset { grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
.meter-compact { grid-template-columns: minmax(48px, 1fr) auto; min-width: 120px; }
.meter-compact .meter-label { display: none; }
.meters-tight { gap: 3px; min-width: 150px; }
.meters-tight .meter-compact { grid-template-columns: 1.8em minmax(48px, 1fr) auto; column-gap: 6px; font-size: 12px; }
.meters-tight .meter-compact .meter-label { display: inline; color: var(--muted); }
.meters-tight .meter-reset { display: none; }

/* --- notices and states -------------------------------------------------------------------------------------------- */
.notices { display: grid; gap: 8px; }
.notices:not(:empty) { margin-bottom: 16px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--notice-info-bg); font-size: 13.5px; }
.notice-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice-tag { font-weight: 650; white-space: nowrap; }
.notice-error { background: var(--notice-error-bg); border-color: color-mix(in srgb, var(--st-critical) 45%, var(--border)); }
.notice-error .notice-tag { color: var(--danger-text); }
.notice-ok { background: var(--notice-ok-bg); border-color: color-mix(in srgb, var(--st-good) 40%, var(--border)); }
.notice .btn { flex: none; margin: -3px 0; }
.section-warn:not(:empty) { margin-bottom: 12px; }
.state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 16px; color: var(--muted); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.state-loading { flex-direction: row; justify-content: center; border-style: solid; border-color: var(--border); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* --- tables -------------------------------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-2); background: var(--surface-2); white-space: nowrap; font-size: 12.5px; }
td { white-space: nowrap; }
td .break, td.wrap { white-space: normal; }
td.wrap { min-width: 11em; }
th.num, td.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 1px solid var(--border-strong); border-bottom: 0; font-weight: 650; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.card .table-wrap { box-shadow: none; }
.col-windows { min-width: 170px; }
@media (min-width: 900px) {
  th.col-ops, td.col-ops { position: sticky; right: 0; box-shadow: -1px 0 0 var(--border); }
  td.col-ops { background: var(--surface); }
  tbody tr:hover td.col-ops { background: var(--surface); }
}
td .break { display: inline-block; max-width: 320px; }

/* --- stats --------------------------------------------------------------------------------------------------------- */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.stat-label { color: var(--text-2); font-size: 12.5px; }
.stat-value { font-size: 22px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-value a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.stat-value-sm { font-size: 13px; font-weight: 500; padding-top: 6px; }
.stat-sub { color: var(--muted); font-size: 12px; }
.usage-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.usage-summary .stat { border: 0; padding: 0 20px 0 0; background: none; }
.usage-summary .stat-value { font-size: 20px; }

/* --- cell cards ---------------------------------------------------------------------------------------------------- */
.cell-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.cell-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow); min-width: 0; }
.cell-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cell-title { font-weight: 650; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.cell-card-note { color: var(--text-2); font-size: 13px; }
.cell-card-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.facts { display: grid; gap: 6px; }
.fact { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.fact dt { color: var(--text-2); white-space: nowrap; }
.fact dd { text-align: right; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; min-width: 0; }
.detail-overview { display: grid; gap: 16px 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.detail-overview > :only-child { grid-column: 1 / -1; }

/* --- code, copy, secrets ------------------------------------------------------------------------------------------- */
.code-inline { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; color: var(--text); }
.code-inline.muted { color: var(--muted); }
th .code-inline, td .code-inline { white-space: nowrap; }
.code-block { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 6px; overflow-x: auto; line-height: 1.6; flex: 1; min-width: 0; }
.copy-field { display: flex; gap: 8px; align-items: center; min-width: 0; }
.copy-field > .code-inline { padding: 6px 10px; flex: 0 1 auto; min-width: 0; }
.copy-multiline { align-items: flex-start; }
.secret-box { border: 1px solid var(--secret-border); background: var(--secret-bg); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; }
.secret-head { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text); }
.secret-value { font-size: 13px; overflow-wrap: anywhere; user-select: all; color: var(--text); }
.secret-actions { display: flex; }
.secret-box + .hint { margin-top: 10px; }

/* --- dialogs ------------------------------------------------------------------------------------------------------- */
.dialog { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 0; width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.dialog::backdrop { background: rgba(10, 10, 9, .5); }
.dialog-form { display: grid; gap: 14px; padding: 20px; }
.dialog-title { font-size: 16px; }
.dialog-body { display: grid; gap: 12px; min-width: 0; }
.dialog-body > div { display: grid; gap: 10px; }
.dialog-body .plain-list { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* --- onboarding steps ---------------------------------------------------------------------------------------------- */
.steps { list-style: none; counter-reset: step; display: grid; gap: 0; }
.step { counter-increment: step; position: relative; padding: 0 0 18px 40px; min-width: 0; }
.step::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-strong); }
.step::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 1px; background: var(--border); }
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step.is-current::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step-title { font-weight: 650; line-height: 26px; }
.step-text { color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.step-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 4px 0 6px; }
.step-form .field { flex: 1 1 220px; max-width: 360px; }

/* --- buy ----------------------------------------------------------------------------------------------------------- */
.buy-form { display: grid; gap: 16px; }
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.plan { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; }
.plan.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan input { margin-top: 3px; }
.plan-body { display: grid; gap: 2px; }
.plan-title { font-weight: 650; }
.plan-desc { color: var(--text-2); font-size: 13px; }
.plan-stock { font-size: 13px; margin-top: 4px; }
.plan-stock strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.buy-form .form-row { grid-template-columns: repeat(auto-fit, minmax(160px, 220px)); }

/* --- timeline ------------------------------------------------------------------------------------------------------ */
.timeline { list-style: none; display: grid; }
.timeline-item { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline-title { font-weight: 600; }

/* --- chart --------------------------------------------------------------------------------------------------------- */
.chart-title { color: var(--text-2); margin: 16px 0 8px; font-weight: 550; }
.chart { position: relative; margin-bottom: 12px; min-width: 0; }
.chart-plot { overflow: hidden; }
.chart svg { display: block; }
.chart-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-base { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--series); }
.chart-bar.is-active { fill: var(--series-active); }
.chart-hit { fill: transparent; outline-offset: -2px; }
.chart-tip { position: absolute; top: 0; z-index: 2; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .14); min-width: 150px; }
.chart-tip-title { font-weight: 650; margin-bottom: 4px; }
.chart-tip-row { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.chart-tip-row span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }

/* --- login --------------------------------------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px 24px; box-shadow: var(--shadow); }
.login-title { font-size: 18px; }

/* --- small screens: the navigation becomes a scrolling row, 16 px gutters ------------------------------------------ */
@media (max-width: 899px) {
  .shell { background: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px auto 1fr; grid-template-areas: "top" "nav" "main"; }
  .topbar { padding: 0 16px; gap: 10px; }
  .nav { background: var(--surface); flex-direction: row; position: sticky; top: 52px; z-index: 9; height: auto; padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .main { padding: 16px; }
  .split, .detail-overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .topbar-role { display: none; }
  .input, .btn { font-size: 16px; }
  .btn-sm { font-size: 14px; height: 32px; }
  .card { padding: 14px; }
  .timeline-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .copy-field { flex-wrap: wrap; }
  .form-row .field-submit { padding-top: 0; }
  .dialog-form { padding: 16px; }
  .usage-summary .stat { padding-right: 12px; }
}
