/* Driftfix app: developer and API-company pages, and the demo.
   One file, cached for good (linked with a content hash). Light and dark follow the system.
   Built for speed: no web fonts, no blur, no background animation; the only motion is a short
   fade when streamed content replaces its skeleton, and the skeleton shimmer.
   Look: a ledger. Flat surfaces (no shadows), hairline dividers, 4px corners, light-weight numbers
   with tight tracking and tabular figures, in the site's own colors (neutral grays, peach accent).
   Motion is short, eased, entrance-only, and off under prefers-reduced-motion. */

:root {
  color-scheme: light dark;
  --bg: #0b0b0d; --side: #0e0e11; --surface: #131316; --surface-2: #18181c; --hover: #1c1c21;
  --line: #24242a; --line-soft: #1c1c21; --fg: #ededf0; --fg-2: #c6c6cc; --muted: #93939c; --dim: #63636c;
  --accent: #f2a27e; --accent-ink: #160b06; --accent-soft: rgba(242, 162, 126, .12); --accent-line: rgba(242, 162, 126, .45);
  --ok: #3fb950; --warn: #e0a526; --bad: #f2555a; --run: #5b9cff; --violet: #a78bfa;
  --track: #232328; --sk: #1d1d23; --sk-hi: #2b2b33;
  --shadow: none; --radius: 4px; --pad: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f7; --side: #fbfbfc; --surface: #ffffff; --surface-2: #f4f4f6; --hover: #f0f0f3;
    --line: #e3e3e8; --line-soft: #ececf0; --fg: #111114; --fg-2: #34343b; --muted: #62626b; --dim: #8e8e97;
    --accent: #d9663f; --accent-ink: #ffffff; --accent-soft: rgba(217, 102, 63, .1); --accent-line: rgba(217, 102, 63, .4);
    --ok: #1f883d; --warn: #b7791f; --bad: #d1242f; --run: #2f6fdd; --violet: #7c5ce0;
    --track: #ececf0; --sk: #ececef; --sk-hi: #f6f6f8;
    --shadow: none;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html { -webkit-text-size-adjust: 100% }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "tnum" }
a { color: inherit }
code, .mono { font-family: var(--mono); font-size: .88em }
h1 { font-size: 30px; font-weight: 300; letter-spacing: -.022em; line-height: 1.1 }
h2 { font-size: 14px; font-weight: 600; letter-spacing: -.005em }
h3 { font-size: 13.5px; font-weight: 600 }
.muted { color: var(--muted) } .dim { color: var(--dim) } .nowrap { white-space: nowrap }
.up { color: var(--ok) } .down { color: var(--bad) }
[hidden] { display: none !important }

/* ---------------------------------------------------------------- buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 4px; border: 1px solid transparent;
  background: var(--fg); color: var(--bg); font: 500 13px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: opacity .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease) }
.btn:hover { opacity: .88 }
.btn:active { transform: translateY(1px) }
.btn.accent { background: var(--accent); color: var(--accent-ink) }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--line) }
.btn.ghost:hover { background: var(--hover); border-color: var(--dim); opacity: 1 }
.btn.small { height: 26px; padding: 0 10px; font-size: 12.5px; border-radius: 4px }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.btn:disabled { opacity: .45; cursor: not-allowed }
input[type=text], input[type=search], select { font: inherit; font-size: 13px; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; height: 32px; padding: 0 10px; min-width: 0; transition: border-color .15s var(--ease), box-shadow .15s var(--ease) }
input[type=text]:focus, input[type=search]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; color: var(--fg-2) }
.switch input { appearance: none; width: 30px; height: 18px; border-radius: 99px; background: var(--track); position: relative; cursor: pointer; flex: none; transition: background .15s }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s }
.switch input:checked { background: var(--ok) } .switch input:checked::after { transform: translateX(12px) }
.switch input:disabled { opacity: .4; cursor: not-allowed }

/* ---------------------------------------------------------------- app frame */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line-soft); padding: 14px 10px; display: flex; flex-direction: column; gap: 18px }
.logo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: -.025em; text-decoration: none; padding: 4px 8px }
.logo .mark { width: 20px; height: 20px }
.nav-group { display: grid; gap: 1px }
.nav-title { font-size: 11px; font-weight: 500; color: var(--dim); padding: 0 10px 5px }
.nav a { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px; border-radius: 4px; color: var(--muted); text-decoration: none; font-size: 13.5px; position: relative; transition: background-color .15s var(--ease), color .15s var(--ease) }
.nav a:hover { background: var(--hover); color: var(--fg) }
.nav a.on { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-soft) }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); animation: grow-y .25s var(--ease) both }
.nav svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.nav .count { margin-left: auto; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--fg-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; line-height: 17px; display: none }
.nav .count:not(:empty), .nav .count.late { display: inline-block }
.nav .count.late::after { content: var(--n) }
.search { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 10px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-align: left; box-shadow: var(--shadow) }
.search:hover { color: var(--fg); border-color: var(--dim) }
.search svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round }
.search span { flex: 1 } .search kbd { font: 11px var(--mono); padding: 0 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim) }
/* Small screens fold the sidebar behind a Menu button (a checkbox, so it needs no script). */
.side-toggle { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px }
.menu-btn { display: none }
.side-menu { display: flex; flex-direction: column; gap: 18px; flex: 1; min-height: 0 }
.side-foot { margin-top: auto; display: grid; gap: 10px; font-size: 12.5px; color: var(--muted); padding: 10px 8px 2px; border-top: 1px solid var(--line-soft) }
.side-foot a { text-decoration: none } .side-foot a:hover { color: var(--fg) }
.who { display: flex; align-items: center; gap: 9px; color: var(--fg-2); min-width: 0 } .who span { overflow: hidden; text-overflow: ellipsis }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #f5b38a, #ee7b62); display: grid; place-items: center; color: #1a0d07; font-weight: 600; font-size: 11px; flex: none }
.main { min-width: 0; display: flex; flex-direction: column }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px var(--pad); background: var(--accent-soft); border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--fg-2) }
.banner b { font-weight: 600; color: var(--fg) }
.banner a { text-decoration: none; border-bottom: 1px solid currentColor }
.banner-actions { margin-left: auto; display: flex; align-items: center; gap: 14px }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none }
.page { width: 100%; max-width: 1320px; padding: 26px var(--pad) 72px }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 52em; font-size: 14.5px }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 8px } .crumbs a { text-decoration: none } .crumbs a:hover { color: var(--fg) }

/* ---------------------------------------------------------------- layout and cards */
.grid { display: grid; gap: 12px }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)) } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)) } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 12px; align-items: start }
.stack { display: grid; gap: 12px; min-width: 0 }
.rail { display: grid; gap: 12px; position: sticky; top: 16px }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0 }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px 0 }
.card-head h2 { font-weight: 500 }
.card-head a { font-size: 12.5px; color: var(--muted); text-decoration: none } .card-head a:hover { color: var(--fg) }
.card-body { padding: 12px 16px 16px }
.card-pad { padding: 16px }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; font-size: 13.5px }
.note { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; color: var(--muted); font-size: 13px; background: var(--surface) }
.note.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok) } .note.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad) }

/* stat tiles: the number first, the context under it */
.stat { padding: 13px 16px 14px; display: grid; gap: 2px; position: relative; text-decoration: none }
a.stat:hover { border-color: var(--line) ; background: var(--hover) }
.stat { padding: 16px 18px 16px }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em }
.stat .value { font-size: 34px; font-weight: 300; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: 2px }
.stat .sub { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 18px }
.stat .sub a { color: var(--fg-2) }
.stat.tone-bad .value { color: var(--bad) } .stat.tone-warn .value { color: var(--warn) } .stat.tone-run .value { color: var(--run) }
.spark { width: 84px; height: 24px; flex: none }

/* badges */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap;
  color: var(--fg-2); background: var(--surface-2); border: 1px solid var(--line-soft) }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: none }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, transparent); border-color: transparent } .pill.ok::before { background: var(--ok) }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: transparent } .pill.warn::before { background: var(--warn) }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 11%, transparent); border-color: transparent } .pill.bad::before { background: var(--bad) }
.pill.run { color: var(--run); background: color-mix(in srgb, var(--run) 11%, transparent); border-color: transparent } .pill.run::before { background: var(--run) }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; font-size: 11.5px; color: var(--fg-2); line-height: 19px }
.tag { display: inline-block; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px }

/* ---------------------------------------------------------------- lists */
.list { display: grid }
.item { display: flex; gap: 11px; align-items: flex-start; padding: 11px 16px; border-top: 1px solid var(--line-soft); text-decoration: none }
.item:first-child { border-top: 0 }
a.item:hover { background: var(--hover) }
.item .what { min-width: 0; flex: 1 } .item .what div { overflow: hidden; text-overflow: ellipsis }
.item .when { font-size: 12px; color: var(--dim); white-space: nowrap }
.ico { width: 26px; height: 26px; border-radius: 4px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted) }
.ico svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.ico.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent) } .ico.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent) }
.ico.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent) } .ico.run { color: var(--run); background: color-mix(in srgb, var(--run) 12%, transparent) }

/* developer inbox */
.inbox-sec .card-head h2 .n { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 6px; font-variant-numeric: tabular-nums }
.inbox-sec .card-head .hint { font-size: 12px }
.inbox-sec .list { margin-top: 8px }
.inbox-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--line-soft) }
.inbox-item:hover { background: var(--hover) }
.inbox-item .title { text-decoration: none; font-weight: 600; font-size: 13.5px } .inbox-item .title:hover { text-decoration: underline; text-underline-offset: 3px }
.inbox-item .change { font-size: 12.5px; color: var(--muted); margin-top: 2px }
.inbox-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center }
.inbox-item .meta b { font-weight: 500; color: var(--fg-2) }
.inbox-item .why { flex-basis: 100%; color: var(--fg-2); margin-top: 4px; font-size: 13px }
.inbox-item .act { display: flex; gap: 8px; align-items: center; white-space: nowrap }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px }

/* tabs and toolbars */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px }
.toolbar .grow { flex: 1 }
.toolbar input[type=search] { width: min(280px, 100%); padding-left: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393939c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 9px 50% / 14px }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; flex-wrap: wrap }
.tabs a { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 3px; font-size: 12.5px; color: var(--muted); text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease) }
.tabs a:hover { color: var(--fg) } .tabs a.on { color: var(--fg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line) }
.tabs .n { color: var(--dim); margin-left: 5px; font-variant-numeric: tabular-nums }

/* tables */
table { width: 100%; border-collapse: collapse }
th, td { text-align: left; padding: 9px 16px; border-top: 1px solid var(--line-soft); vertical-align: middle; font-size: 13px }
thead th { border-top: 0; color: var(--muted); font-weight: 400; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding-top: 11px; padding-bottom: 8px; white-space: nowrap; position: sticky; top: 0; background: var(--surface) }
thead th[data-sort] { cursor: pointer; user-select: none } thead th[data-sort]:hover { color: var(--fg) }
thead th[aria-sort]::after { content: "↓"; margin-left: 4px; color: var(--accent) } thead th[aria-sort=ascending]::after { content: "↑" }
tbody tr { transition: background-color .12s var(--ease) } tbody tr:hover { background: var(--hover) }
td a { text-decoration: none } td a:hover { text-decoration: underline; text-underline-offset: 3px }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums }
.row-link { font-weight: 600 }
.card > table:first-child thead th:first-child, .card table thead th:first-child { border-top-left-radius: var(--radius) }

/* ---------------------------------------------------------------- charts (server-rendered SVG) */
.chart-box { position: relative }
.chart { width: 100%; height: auto; display: block; overflow: visible }
.chart .grid { stroke: var(--line-soft); stroke-width: 1 }
.chart .tick { fill: var(--dim); font-size: 11px; font-family: var(--sans) }
.chart .marker { stroke: var(--bad); stroke-dasharray: 3 4; stroke-width: 1.2 }
.chart .marker-label { fill: var(--bad) }
.chart .dot { opacity: 0 }
.chart .guide { stroke: var(--dim); stroke-width: 1; opacity: 0 }
.chart .hit { fill: transparent; cursor: crosshair }
.chart-box.hover .guide { opacity: .6 }
.chart-box .dot.on { opacity: 1 }
.track { stroke: var(--track) }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 130px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; line-height: 1.5; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)) }
.tip b { display: block; font-weight: 600; margin-bottom: 2px }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px }
.tip span { color: var(--muted) }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px }
.donut { display: flex; align-items: center; gap: 20px }
.donut svg { width: 132px; height: 132px; flex: none }
.donut .donut-value { fill: var(--fg); font-size: 24px; font-weight: 600; font-family: var(--sans) }
.donut .tick { fill: var(--muted); font-size: 10.5px; font-family: var(--sans) }
.donut ul { list-style: none; display: grid; gap: 7px; font-size: 13px; flex: 1; min-width: 0 }
.donut li { display: flex; align-items: center; gap: 8px } .donut li span { flex: 1; color: var(--fg-2) } .donut li b { font-weight: 600; font-variant-numeric: tabular-nums }
.donut li i { width: 9px; height: 9px; border-radius: 2px; flex: none }
.hbars { display: grid; gap: 13px }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px } .hbar-top span { color: var(--fg-2) } .hbar-top b { font-weight: 600; font-variant-numeric: tabular-nums }
.hbar-track { height: 7px; border-radius: 99px; background: var(--track); overflow: hidden }
.hbar-fill { height: 100%; border-radius: 99px }
.hbar-note { font-size: 12px; color: var(--dim); margin-top: 4px }
.progress { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; min-width: 70px }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px }
.mini { display: grid; gap: 10px }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px }
.mini-row .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; margin: 0 10px }
.mini-row .bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent) }

/* ---------------------------------------------------------------- detail pages */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; font-size: 13px }
.kv dt { color: var(--muted) }
.quote { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; color: var(--fg-2); line-height: 1.6; font-size: 13px }
.quote code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px }
.steps { display: grid }
.step { display: grid; grid-template-columns: 20px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line-soft); font-size: 13px }
.step:first-child { border-top: 0 }
.step .dotc { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--dim) }
.step .dotc.ok { background: var(--ok); border-color: var(--ok) } .step .dotc.error { background: var(--bad); border-color: var(--bad) } .step .dotc.skipped { border-style: dashed }
.step .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums }
summary { list-style: none } summary::-webkit-details-marker { display: none }
summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
details.card > summary:hover { background: var(--hover); border-radius: var(--radius) }
.checklist { list-style: none; display: grid; gap: 12px } .checklist li { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--fg-2) }
.checklist .ico { width: 22px; height: 22px; border-radius: 6px } .checklist .ico svg { width: 12px; height: 12px }
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line-soft) }
.settings-row:first-child { border-top: 0 }
.settings-row p { color: var(--muted); font-size: 12.5px; margin-top: 4px }
.settings-row .cmd { width: 190px }
.settings-row .knows { font-size: 12.5px; margin-top: 3px }
.invite { display: flex; gap: 8px } .invite input { flex: 1; min-width: 0 }
.plain { list-style: none; display: grid; gap: 6px; font-size: 13.5px; color: var(--fg-2) } .plain li::before { content: '–'; color: var(--dim); margin-right: 8px }

/* ---------------------------------------------------------------- loading skeletons
   The page streams: the frame and a skeleton shaped like the page arrive first, the real content
   follows in the same response. When it lands, this rule hides the skeleton. No script needed. */
.sk { display: grid; gap: 12px }
.sk:has(~ .real) { display: none }
.real { animation: reveal .18s ease-out }
@keyframes reveal { from { opacity: 0 } to { opacity: 1 } }
.bone { border-radius: 3px; background: linear-gradient(90deg, var(--sk) 0%, var(--sk-hi) 40%, var(--sk) 80%) 0 0 / 300% 100%; animation: shimmer 1.4s ease-in-out infinite }
.bone.line { height: 11px } .bone.title { height: 20px; width: 240px } .bone.sub { height: 12px; width: 420px; max-width: 70% } .bone.big { height: 26px; width: 70px }
.bone.circle { width: 26px; height: 26px; border-radius: 7px; flex: none } .bone.btnb { width: 64px; height: 26px; flex: none }
.bone.chart { height: 220px; border-radius: 4px }
.sk .card { padding: 14px 16px; display: grid; gap: 10px }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 4px 0 }
.sk-row .grow { flex: 1; display: grid; gap: 7px }
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: 0 0 } }

/* ---------------------------------------------------------------- motion
   Entrance only, short and eased, so a page settles in instead of popping: cards and stats rise in
   a quick stagger, bars grow from the left, chart lines draw themselves. Nothing loops except the
   skeleton shimmer, and all of it stops under prefers-reduced-motion (below). */
@keyframes rise { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes grow-x { from { transform: scaleX(0) } }
@keyframes grow-y { from { transform: scaleY(0) } }
@keyframes draw { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }
@keyframes fade { from { opacity: 0 } }
.page-head { animation: rise .35s var(--ease) both }
.real :is(.summary, .g4, .g3, .g2, .stack, .rail, .layout) > * { animation: rise .4s var(--ease) both }
.real :is(.summary, .g4, .g3, .g2, .stack, .rail, .layout) > :nth-child(2) { animation-delay: .04s }
.real :is(.summary, .g4, .g3, .g2, .stack, .rail, .layout) > :nth-child(3) { animation-delay: .08s }
.real :is(.summary, .g4, .g3, .g2, .stack, .rail, .layout) > :nth-child(4) { animation-delay: .12s }
.real :is(.summary, .g4, .g3, .g2, .stack, .rail, .layout) > :nth-child(n+5) { animation-delay: .16s }
.real .inbox-item { animation: rise .35s var(--ease) both }
.real .inbox-item:nth-child(2) { animation-delay: .05s } .real .inbox-item:nth-child(3) { animation-delay: .1s }
.real .inbox-item:nth-child(4) { animation-delay: .15s } .real .inbox-item:nth-child(n+5) { animation-delay: .2s }
.progress i, .hbar-fill, .mini-row .bar i { transform-origin: left center; animation: grow-x .8s var(--ease) .15s both }
.chart .ln { stroke-dasharray: 1; animation: draw 1.1s var(--ease) .2s both }
.chart path[fill^="url"] { animation: fade .7s ease .5s both }
a.stat, a.item, .inbox-item, .card { transition: border-color .15s var(--ease), background-color .15s var(--ease) }
a.stat:hover { border-color: var(--dim) }
.stat .value[data-counting] { color: inherit }

/* ---------------------------------------------------------------- toasts, ⌘K, tour */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)) }
.toast { padding: 11px 14px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--run); font-size: 13px;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.4); transform: translateY(6px); opacity: 0; transition: transform .2s, opacity .2s }
.toast.in { transform: none; opacity: 1 } .toast.ok { border-left-color: var(--ok) } .toast.bad { border-left-color: var(--bad) }
.toast b { font-weight: 600 } .toast a { color: var(--fg) }
.item.fresh { animation: fresh 1.2s ease-out }
@keyframes fresh { from { background: color-mix(in srgb, var(--ok) 16%, transparent) } to { background: transparent } }
.palette-shade { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4); display: none; align-items: flex-start; justify-content: center; padding-top: 14vh }
.palette-shade.open { display: flex }
.palette { width: min(600px, calc(100vw - 32px)); border-radius: 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); overflow: hidden }
.palette input { width: 100%; height: auto; background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); padding: 15px 16px; font-size: 15px; border-radius: 0 }
.palette input:focus { box-shadow: none; border-color: var(--line-soft) }
.palette-list { max-height: 52vh; overflow: auto; padding: 6px }
.palette-list a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 7px; text-decoration: none; font-size: 13.5px }
.palette-list a.on, .palette-list a:hover { background: var(--hover) }
.palette-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--dim) }
.keys { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4); display: none; place-items: center }
.keys.open { display: grid }
.keys > div { width: min(420px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; display: grid; gap: 9px; font-size: 13px }
.keys kbd { font: 11.5px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2) }
.keys .k { display: flex; justify-content: space-between; gap: 16px; color: var(--fg-2) }
.tour-shade { position: fixed; inset: 0; z-index: 80; pointer-events: none }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55), 0 0 0 2px var(--accent); transition: all .3s ease; pointer-events: none }
.tour-card { position: fixed; z-index: 81; width: min(360px, calc(100vw - 32px)); padding: 18px 18px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.5); transition: top .3s ease, left .3s ease; pointer-events: auto }
.tour-card .step-n { font-size: 11px; font-weight: 600; color: var(--accent) }
.tour-card h3 { font-size: 16px; margin: 6px 0 } .tour-card p { color: var(--fg-2); font-size: 13.5px; line-height: 1.6 }
.tour-nav { display: flex; align-items: center; gap: 8px; margin-top: 14px }
.tour-nav .skip { margin-right: auto; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer }
.tour-dots { display: flex; gap: 4px; margin-top: 12px } .tour-dots i { width: 14px; height: 3px; border-radius: 2px; background: var(--line) } .tour-dots i.on { background: var(--accent) }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) }

/* ---------------------------------------------------------------- small screens */
@media (prefers-reduced-motion: reduce) {
  .bone, .real, .item.fresh, .page-head, .real *, .progress i, .hbar-fill, .mini-row .bar i, .chart .ln, .chart path, .nav a.on::before { animation: none !important }
  .chart .ln { stroke-dasharray: none }
  * { transition: none !important }
}
@media (max-width: 1200px) { .layout { grid-template-columns: minmax(0, 1fr) } .rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 1100px) { .g4, .summary { grid-template-columns: repeat(2, minmax(0, 1fr)) } .g-main { grid-template-columns: 1fr } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr }
  .app { grid-template-rows: auto 1fr }
  .side { position: sticky; z-index: 20; height: auto; max-height: 100vh; align-self: start; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line-soft) }
  .menu-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--fg-2); font-size: 13.5px; cursor: pointer }
  .menu-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round }
  .side-toggle:focus-visible + .menu-btn { outline: 2px solid var(--accent); outline-offset: 2px }
  .side-menu { display: none; flex-basis: 100%; padding: 12px 0 4px; gap: 14px }
  .side-toggle:checked ~ .side-menu { display: flex }
  .nav a { height: 40px; font-size: 14.5px }
  .side-foot { margin-top: 0 }
  .search kbd, .side-foot [data-keys-open] { display: none }
  /* Tables marked .stack become one card per row: no sideways scrolling on a phone. */
  .job-head { flex-wrap: wrap; align-items: flex-start !important } .job-head > span:first-child { flex-basis: 100% }
  table.stack thead { display: none }
  table.stack tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft) }
  table.stack tbody tr:first-child { border-top: 0 }
  table.stack td { display: block; padding: 0; border: 0; min-width: 0 !important; text-align: left }
  table.stack td:first-child, table.stack td.empty { flex-basis: 100% }
  table.stack td.hide-sm { display: none }
  table.stack td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12.5px }
  .chart-box:not(.ring) { overflow-x: auto; -webkit-overflow-scrolling: touch } .chart-box:not(.ring) > .chart { min-width: 640px }
  .g3, .g2, .rail { grid-template-columns: 1fr }
  th, td { padding: 9px 12px } .hide-sm { display: none }
  .settings-row { grid-template-columns: 1fr } .settings-row .cmd-label { flex-basis: 100% } .settings-row .cmd { flex: 1; width: auto; min-width: 0 }
  .inbox-item { grid-template-columns: auto minmax(0, 1fr) } .inbox-item .act { grid-column: 2; flex-wrap: wrap }
  .inbox-sec .card-head { flex-direction: column; align-items: flex-start; gap: 2px }
  .banner-actions { margin-left: 0 }
  *:has(> table) { overflow-x: auto }
}
@media (max-width: 520px) { .g4, .summary { grid-template-columns: 1fr 1fr } .stat .value { font-size: 21px } .bone.sub { width: 90% } }
