/* Booklet konkurs paneli. Tokenlar va asosiy komponentlar: analytics-dashboard-design skill namunasi asosida */
:root {
  color-scheme: light;
  --bg: #fafafa; --side: #ffffff; --card: #ffffff; --line: #e5e5e5; --grid: #f0f0f0; --hover: #f5f5f5;
  --ink: #1f1f1f; --ink-2: #595959; --ink-3: #8c8c8c;
  --brand: #f6821f; --link: #0051c3;
  --series: #2a78d6; --series-wash: rgba(42, 120, 214, .12); --track: #edf3fb;
  --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4;
  --good: #0ca30c; --good-wash: rgba(12, 163, 12, .10); --bad: #d03b3b; --bad-wash: rgba(208, 59, 59, .09); --warn: #c98500;
  --seq-0: #f4f7fb; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95; --heat-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #121212; --side: #171717; --card: #1b1b1b; --line: #2e2e2e; --grid: #262626; --hover: #232323;
    --ink: #ededed; --ink-2: #b0b0b0; --ink-3: #808080;
    --link: #66a3ff;
    --series: #3987e5; --series-wash: rgba(57, 135, 229, .16); --track: #1e2a3a;
    --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181;
    --good: #3fbf6a; --good-wash: rgba(63, 191, 106, .12); --bad: #e66767; --bad-wash: rgba(230, 103, 103, .12); --warn: #e0a000;
    --seq-0: #1f2329; --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef; --heat-ink: #0b0b0b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212; --side: #171717; --card: #1b1b1b; --line: #2e2e2e; --grid: #262626; --hover: #232323;
  --ink: #ededed; --ink-2: #b0b0b0; --ink-3: #808080;
  --link: #66a3ff;
  --series: #3987e5; --series-wash: rgba(57, 135, 229, .16); --track: #1e2a3a;
  --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181;
  --good: #3fbf6a; --good-wash: rgba(63, 191, 106, .12); --bad: #e66767; --bad-wash: rgba(230, 103, 103, .12); --warn: #e0a000;
  --seq-0: #1f2329; --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef; --heat-ink: #0b0b0b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 13.5px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: none; }

/* Layout: sidebar + main, like the Cloudflare dashboard */
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
main { min-width: 0; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; color: #fff; flex: none; }
.brand-mark svg { width: 16px; height: 16px; }
.brand b { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--ink-3); font-size: 12px; margin-top: -2px; }
.nav { display: grid; gap: 1px; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="true"] { background: var(--hover); color: var(--ink); }
.nav a[aria-current="true"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .icon { color: var(--ink-3); }
.nav a[aria-current="true"] .icon { color: var(--ink); }
.side-foot { margin-top: auto; padding: 10px; color: var(--ink-3); font-size: 12px; line-height: 1.45; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumbs { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--ink); font-weight: 600; }
.top .spacer { flex: 1; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.status.error i { background: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--hover); }
.text-btn { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.text-btn:hover { text-decoration: underline; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 4px; color: var(--ink-2); cursor: pointer; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

.content { max-width: 1280px; padding: 24px 28px 64px; }
section { margin-bottom: 40px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 16px; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.section-head { margin-bottom: 12px; }
.section-head p, .page-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.card + .card { margin-top: 16px; }
.pad { padding: 16px 18px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 13.5px; font-weight: 600; margin: 0; }
.card-head .meta { color: var(--ink-3); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid > .card + .card { margin-top: 0; }

/* Metric row: cells divided by hairlines */
/* Each cell draws its own left and top hairline and is pulled 1px up-left, so the lines on the card's edges are
   clipped away. A short last row leaves an empty card-coloured space, not a grey hole (no gap-colour trick). */
.metrics { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); overflow: hidden; }
.metric { background: var(--card); padding: 14px 16px 10px; min-width: 0; margin: -1px 0 0 -1px; box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line); }
.metric .label { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.metric .sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-3); font-size: 12px; min-height: 20px; }
.metric svg.spark { display: block; width: 100%; height: 28px; margin-top: 6px; }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-radius: 4px; font-size: 11.5px; font-weight: 600; line-height: 18px; background: var(--grid); color: var(--ink-2); }
.delta.up { background: var(--good-wash); color: var(--good); }
.delta.down { background: var(--bad-wash); color: var(--bad); }

/* Underline tabs */
.tabs { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; margin-bottom: -13px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 2px 0 11px; cursor: pointer; color: var(--ink-2); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--series); }

.chart-body { padding: 14px 18px 12px; }
.chart-context { color: var(--ink-3); font-size: 12px; margin: 0 0 6px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 260px; overflow: visible; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; }
.chart svg #hit:focus { outline: 2px solid var(--series); outline-offset: -2px; }
.tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; color: var(--ink-2);
       box-shadow: 0 6px 20px rgba(0, 0, 0, .10); white-space: nowrap; transform: translate(-50%, -110%); display: none; }
.tip b { display: block; font-size: 14px; color: var(--ink); }

/* Tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
thead th { color: var(--ink-3); font-weight: 500; font-size: 12px; background: var(--card); border-bottom: 1px solid var(--line); }
tbody tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.muted { color: var(--ink-3); }

/* Countries */
.geo-summary { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; }
.geo-summary b { color: var(--ink); font-weight: 600; }
.geo th.sortable { padding: 0; }
.geo th.sortable button { width: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: 0; border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--ink-3); font-size: 12px; font-weight: 500; text-align: right; }
.geo th.sortable button small { font-size: 10.5px; color: var(--ink-3); opacity: .8; }
.geo th.sortable button:hover { color: var(--ink); }
.geo th[aria-sort="descending"] button { color: var(--ink); font-weight: 600; }
.geo th[aria-sort="descending"] button::after { content: "↓"; position: absolute; }
.geo th { position: relative; }
.geo th[aria-sort="descending"] button span::after { content: " ↓"; }
.geo th[aria-sort="descending"] button::after { content: none; }
.geo td.country, .geo th.country { position: sticky; left: 0; background: var(--card); z-index: 1; }
.geo tbody tr:hover td.country { background: var(--hover); }
.country-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.flag { font-size: 17px; line-height: 1; width: 20px; text-align: center; }
.flag.none { color: var(--ink-3); }
.geo td.sorted { background: color-mix(in srgb, var(--series) 4%, var(--card)); }
.geo tbody tr:hover td.sorted { background: var(--hover); }
.share { display: block; margin-top: 4px; height: 4px; border-radius: 2px; background: var(--track); min-width: 64px; }
.share i { display: block; height: 100%; border-radius: 2px; background: var(--series); }
.geo td small { color: var(--ink-3); font-size: 11.5px; margin-left: 4px; }
.geo tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
.geo tfoot td.country { background: var(--card); }

/* Funnel */
.funnel-group + .funnel-group { border-top: 1px solid var(--line); }
.funnel-group h4 { margin: 0; padding: 12px 18px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.step { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(120px, 2fr) 74px 104px; align-items: center; gap: 16px; padding: 9px 18px; }
.step .name small { display: block; color: var(--ink-3); font-size: 11.5px; }
.step .bar { height: 22px; background: var(--track); border-radius: 4px; overflow: hidden; }
.step .bar i { display: block; height: 100%; background: var(--series); border-radius: 4px; min-width: 2px; }
.step .count { text-align: right; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.step .conv { text-align: right; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.step .conv small { display: block; color: var(--ink-3); font-size: 11px; }

/* Buyers */
.buyers-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.buyers tbody tr.row { cursor: pointer; }
.buyers tbody tr.row:focus-visible { outline: 2px solid var(--series); outline-offset: -2px; }
.buyers tbody tr.row td:first-child { padding-left: 34px; position: relative; }
.buyers tbody tr.row td:first-child::before { content: "›"; position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: var(--ink-3); font-size: 16px; transition: transform .15s; }
.buyers tbody tr.row[aria-expanded="true"] td:first-child::before { transform: translateY(-52%) rotate(90deg); }
.buyers tbody tr.row[aria-expanded="true"] td { border-bottom-color: transparent; }
.buyers tr.detail > td { background: var(--bg); padding: 4px 18px 16px 34px; white-space: normal; }
.buyers tr.detail:hover > td { background: var(--bg); }
.src small, .when small { display: block; color: var(--ink-3); font-size: 11.5px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 18px; background: var(--grid); color: var(--ink-2); }
.tag.after { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.tag.during { background: var(--series-wash); color: var(--series); }
.tag.good { background: var(--good-wash); color: var(--good); }
.tl { position: sticky; left: 34px; max-width: min(760px, calc(100vw - 84px)); }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; max-width: 760px; }
.timeline li { position: relative; padding: 0 0 14px 24px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 2px var(--series); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 17px; bottom: -1px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.key::before { background: var(--good); box-shadow: none; }
.timeline li.warn::before { box-shadow: inset 0 0 0 2px var(--warn); }
.timeline li.quiet::before { box-shadow: inset 0 0 0 2px var(--ink-3); }
.timeline b { font-weight: 600; }
.timeline time, .timeline .t { white-space: nowrap; color: var(--ink-3); font-size: 12px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.timeline p { margin: 1px 0 0; color: var(--ink-2); font-size: 12.5px; }

/* Bar lists */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 13px; }
.bar-row .k { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bar-row .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.bar-row .v small { color: var(--ink-3); font-weight: 400; }
.bar-row .track { grid-column: 1 / -1; height: 6px; background: var(--track); border-radius: 3px; position: relative; }
.bar-row .fill { position: absolute; inset: 0 auto 0 0; background: var(--series); border-radius: 3px; }
.empty { color: var(--ink-3); font-size: 13px; padding: 4px 0; }
.note { color: var(--ink-3); font-size: 12px; margin: 12px 0 0; }

/* Donut and histogram */
.donut-layout { display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: center; min-height: 140px; }
.donut { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; }
.donut-hole { width: 80px; height: 80px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-hole strong { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-hole small { color: var(--ink-3); font-size: 11px; }
.legend { display: grid; gap: 9px; }
.legend-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.legend-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-row small { display: block; font-size: 11px; color: var(--ink-3); }
.histogram { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; height: 170px; align-items: end; }
.hist-col { display: grid; grid-template-rows: 20px 118px 26px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.hist-track { display: flex; align-items: end; justify-content: center; border-bottom: 1px solid var(--line); }
.hist-fill { width: 56%; border-radius: 4px 4px 0 0; background: var(--series); }
.hist-label { padding-top: 7px; color: var(--ink-2); }

/* Retention heatmap */
.heat td.cell { text-align: center; min-width: 54px; padding: 7px 6px; border: 2px solid var(--card); border-radius: 4px; font-variant-numeric: tabular-nums; font-size: 12px; }
.heat tbody tr:hover td { background: transparent; }
.heat tbody tr:hover td.cell { filter: brightness(.97); }
.heat-legend { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px 14px; font-size: 11.5px; color: var(--ink-2); border-top: 1px solid var(--line); }
.heat-legend span { display: inline-flex; align-items: center; gap: 4px; }
.heat-key { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 4px; background: var(--grid); color: var(--ink-2); font-size: 11.5px; }
.pill .icon { width: 13px; height: 13px; }
html.only .side, html.only .top { display: none; }
html.only .app { grid-template-columns: minmax(0, 1fr); }
html.only .content { padding: 20px; }
html.only section { margin-bottom: 0; }
#error { display: none; margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--bad); border-radius: 8px; background: var(--bad-wash); color: var(--bad); }


/* ---------- Booklet panel qo'shimchalari ---------- */
.contest { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
           background: var(--series-wash); color: var(--series); }
.contest.closed { background: var(--grid); color: var(--ink-2); }
.top form { margin: 0; }

/* Reyting jadvallari */
.rank td.pos { width: 44px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rank td.pos.top3 { color: var(--ink); font-weight: 600; }
.who { display: flex; flex-direction: column; min-width: 0; max-width: 260px; }
.who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.rank td.score { font-weight: 600; }
.rank td small, .rank th small { display: block; color: var(--ink-3); font-size: 10.5px; font-weight: 400; }
.rank-wrap { max-height: 560px; overflow: auto; }
.rank thead th { position: sticky; top: 0; z-index: 1; }
.card-foot { padding: 10px 18px; border-top: 1px solid var(--line); }

/* Tillar jadvali (skillning countries jadvali bilan bir xil) */
.geo th.sortable button span::after { content: ""; }
.geo th[aria-sort="descending"] button span::after { content: " ↓"; }

/* Issiqlik xaritasi */
.heat { font-size: 11.5px; }
.heat th { padding: 6px 4px; text-align: center; font-weight: 500; color: var(--ink-3); border: 0; background: var(--card); }
.heat th.day { text-align: left; padding-right: 10px; color: var(--ink-2); white-space: nowrap; }
.heat td.cell { min-width: 26px; padding: 5px 2px; font-size: 11px; }

/* Hodisalar */
.events td.when { color: var(--ink-3); font-variant-numeric: tabular-nums; width: 120px; }
.events td.detail { color: var(--ink-2); white-space: normal; min-width: 220px; }
.pill.joined { background: var(--series-wash); color: var(--series); }
.pill.subscribed { background: var(--good-wash); color: var(--good); }
.pill.comment { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }

/* Kichik raqamlar qatori (auditoriya kartasida) */
.mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--grid); }
.mini div { font-size: 12.5px; color: var(--ink-2); }
.mini b { display: block; font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Kirish sahifasi */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 360px; }
.login form { display: grid; gap: 12px; padding: 20px 22px 22px; }
.login label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.login input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); width: 100%; }
.login input:focus { outline: 2px solid var(--series); outline-offset: -1px; border-color: var(--series); }
.login button[type=submit] { font: inherit; font-weight: 600; padding: 8px 12px; border: 0; border-radius: 6px; background: var(--ink); color: var(--card); cursor: pointer; }
.login .err { margin: 0; color: var(--bad); font-size: 12.5px; }
.login .brand { padding: 18px 22px 0; }

@media (max-width: 1100px) {
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { --cols: 3 !important; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 6; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 6px 0 0; }
  .brand small, .side-foot { display: none; }
  .nav { display: flex; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
  .nav a .icon { display: none; }
  .nav a[aria-current="true"]::before { left: 10px; right: 10px; top: auto; bottom: -9px; width: auto; height: 2px; border-radius: 2px; }
  .top { position: static; height: auto; flex-wrap: wrap; padding: 10px 16px; }
  .crumbs { display: none; }
  .content { padding: 18px 16px 48px; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid.three { grid-template-columns: 1fr; }
  .metrics { --cols: 2 !important; }
  .metric .value { font-size: 21px; }
  .step { grid-template-columns: minmax(0, 1fr) 64px 92px; }
  .step .bar { grid-column: 1 / -1; grid-row: 2; height: 10px; }
  .status { display: none; }
  .tabs { margin-bottom: 0; width: 100%; }
  .tabs button { padding-bottom: 8px; }
  .top { gap: 8px; }
  .top .spacer { display: none; }
  .seg { flex: 1; justify-content: space-between; }
  .seg button { padding: 4px 8px; }
  .donut-layout { grid-template-columns: 96px 1fr; gap: 14px; }
  .donut { width: 96px; height: 96px; }
  .donut-hole { width: 68px; height: 68px; }
}
