/* Deskhand: one hand-written stylesheet. Tokens first, then the shell, then components. */
:root {
  --bg: #f5f5f7; --panel: #ffffff; --raised: #ffffff; --text: #1d1d1f; --muted: #6e6e73; --faint: #aeaeb2; --line: rgba(0,0,0,.09);
  --fill: rgba(120,120,128,.1); --fill-2: rgba(120,120,128,.18); --bar: rgba(250,250,252,.78); --side: rgba(236,236,240,.6);
  --accent: #0071e3; --accent-hi: #0077ed; --accent-text: #ffffff; --link: #0066cc; --ring: rgba(0,113,227,.3);
  --ok: #1a7f37; --ok-bg: rgba(52,199,89,.14); --err: #c5221a; --err-bg: rgba(255,59,48,.11);
  --warn: #9a5b00; --warn-bg: rgba(255,159,10,.16); --add: rgba(52,199,89,.2); --del: rgba(255,59,48,.16);
  --green: #34c759; --red: #ff3b30; --orange: #ff9f0a;
  --shadow: 0 0 0 .5px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.035);
  --shadow-hi: 0 0 0 .5px rgba(0,0,0,.07), 0 4px 10px rgba(0,0,0,.05), 0 22px 48px rgba(0,0,0,.12);
  --r: 18px; --r-md: 14px; --r-sm: 10px; --ease: cubic-bezier(.25,.1,.25,1); --spring: cubic-bezier(.3,1.3,.5,1);
  --side-w: 256px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 16px; line-height: 1.47; letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --panel: #161618; --raised: #232326; --text: #f5f5f7; --muted: #98989d; --faint: #5a5a5f; --line: rgba(255,255,255,.1);
    --fill: rgba(120,120,128,.2); --fill-2: rgba(120,120,128,.32); --bar: rgba(18,18,20,.78); --side: rgba(14,14,16,.9);
    --accent: #0a84ff; --accent-hi: #2b95ff; --link: #3d9bff; --ring: rgba(10,132,255,.42);
    --ok: #30d158; --ok-bg: rgba(48,209,88,.16); --err: #ff6961; --err-bg: rgba(255,69,58,.17);
    --warn: #ffd60a; --warn-bg: rgba(255,214,10,.14); --add: rgba(48,209,88,.2); --del: rgba(255,69,58,.22);
    --green: #30d158; --red: #ff453a; --orange: #ff9f0a;
    --shadow: 0 0 0 .5px rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.5);
    --shadow-hi: 0 0 0 .5px rgba(255,255,255,.1), 0 22px 48px rgba(0,0,0,.65);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--ring); border-radius: 8px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--panel); padding: 8px 14px; border-radius: 999px; z-index: 60; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; display: block; }

/* ============================================================ shell */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.05rem; letter-spacing: -.022em; color: var(--text); }
.brand:hover { text-decoration: none; }
.mark {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: linear-gradient(140deg, #64d2ff 0%, var(--accent) 52%, #5e5ce6 100%);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.55), 0 2px 6px rgba(0,113,227,.35);
}
header.top { display: flex; justify-content: center; padding: 28px 20px 0; }

body.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.mtop { display: none; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 12px 14px; background: var(--side); border-right: .5px solid var(--line); overflow-y: auto;
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
}
.side > .brand { padding: 2px 10px 18px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.nav li { list-style: none; }
.nav a, .more > summary, .navbtn {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 0; padding: 7px 10px; border-radius: 9px;
  color: var(--text); background: none; font-size: .92rem; font-weight: 500; letter-spacing: -.01em; text-align: left;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav .ic, .navbtn .ic { color: var(--muted); transition: color .18s var(--ease); }
.nav a:hover, .navbtn:hover, .more > summary:hover { background: var(--fill); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--panel); box-shadow: var(--shadow); font-weight: 600; }
.nav a[aria-current="page"] .ic { color: var(--accent); }
.nav-h { padding: 20px 10px 6px; font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.nb {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums;
  animation: pop .35s var(--spring) both;
}
.nb:empty { display: none; }
@keyframes pop { from { transform: scale(.6); } }
.narrow-only { display: none; }
.navbtn { border: 0; cursor: pointer; font: inherit; justify-content: flex-start; }
.navbtn:active { transform: none; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 4px 0 10px; border-top: .5px solid var(--line); }
.side-foot .navbtn { width: auto; padding: 7px; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 500; color: var(--muted); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
[data-conn="live"] .conn-dot { background: var(--green); box-shadow: 0 0 0 3px var(--ok-bg); animation: breathe 2.8s ease-in-out infinite; }
[data-conn="paused"] .conn-dot { background: var(--orange); box-shadow: 0 0 0 3px var(--warn-bg); }
[data-conn="down"] .conn-dot { background: var(--orange); animation: blink 1s steps(2) infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px transparent; } }
@keyframes blink { 50% { opacity: .3; } }

main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 44px clamp(20px, 4vw, 56px) 96px; }
#page { animation: rise .4s var(--ease) both; }
@keyframes rise { from { transform: translateY(6px); } }

.toast {
  position: fixed; z-index: 50; top: 18px; left: calc(50% + var(--side-w) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px)); padding: 10px 18px 10px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--raised) 88%, transparent); box-shadow: var(--shadow-hi); font-size: .92rem; font-weight: 500; cursor: pointer;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  animation: toast-in .45s var(--spring) both;
}
body:not(.app) .toast { left: 50%; }
.toast.ok { animation: toast-in .45s var(--spring) both, toast-out .35s var(--ease) 5s forwards; }
.toast.ok .ic { color: var(--green); }
.toast.err { border-radius: 18px; }
.toast.err .ic { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -10px); visibility: hidden; } }

/* ============================================================ type and page header */
h1 { font-size: clamp(1.85rem, 3.4vw, 2.4rem); line-height: 1.08; font-weight: 700; letter-spacing: -.034em; margin: 0 0 18px; }
h2 { font-size: 1.25rem; line-height: 1.2; font-weight: 650; letter-spacing: -.022em; margin: 36px 0 12px; }
h3 { font-size: 1.05rem; line-height: 1.35; font-weight: 600; letter-spacing: -.015em; margin: 0 0 4px; }
h1 + p { color: var(--muted); font-size: 1.04rem; margin-top: -8px; }
section > h2:first-child, .card > h2:first-child { margin-top: 0; }
p { margin: 10px 0; }
hr { border: 0; border-top: .5px solid var(--line); margin: 24px 0; }
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 26px; }
.ph h1 { margin: 0; }
.ph .sub { margin: 6px 0 0; color: var(--muted); font-size: 1.04rem; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================ Needs you */
.composer {
  position: relative; margin: 0 0 22px; padding: 14px 14px 10px 20px; border-radius: 22px; background: var(--panel); box-shadow: var(--shadow-hi);
  transition: box-shadow .25s var(--ease);
}
.composer:focus-within { box-shadow: var(--shadow-hi), 0 0 0 4px var(--ring); }
.composer textarea, .composer textarea:hover, .composer textarea:focus {
  display: block; width: 100%; min-height: 30px; max-height: 40vh; padding: 4px 0; border: 0; background: none; box-shadow: none; resize: none;
  font-size: 1.08rem; line-height: 1.45; field-sizing: content;
}
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.hint { color: var(--muted); font-size: .84rem; }
button.round { width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 50%; flex: none; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 14px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow);
  color: var(--text); transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
a.stat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hi); }
.stat-k { font-size: .8rem; font-weight: 600; color: var(--muted); }
.stat-v { font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-n { font-size: .8rem; color: var(--muted); }
.stat.hot .stat-v { color: var(--red); }
.stat.warn .stat-v { color: var(--warn); }
.stat.bad .stat-v { color: var(--err); }
progress { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; margin-top: 10px; border: 0; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--fill-2); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 99px; }
.warn progress::-webkit-progress-value { background: var(--orange); }
.warn progress::-moz-progress-bar { background: var(--orange); }
.bad progress::-webkit-progress-value { background: var(--red); }
.bad progress::-moz-progress-bar { background: var(--red); }

.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 0 0 16px; border-radius: var(--r-md); background: var(--fill); font-weight: 500; font-size: .94rem; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--err-bg); color: var(--err); }

.hero-empty { text-align: center; padding: 64px 16px 40px; }
.hero-empty h2 { margin: 18px 0 6px; font-size: 1.4rem; }
.hero-empty p { margin: 0 auto; max-width: 30em; color: var(--muted); }
.hero-icon {
  display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: #fff;
  background: linear-gradient(150deg, #5fe08a, #28b250); box-shadow: 0 10px 28px rgba(52,199,89,.35), inset 0 1px 0 rgba(255,255,255,.4);
  animation: pop .6s var(--spring) both;
}
.hero-icon .ic { width: 38px; height: 38px; stroke-width: 2; }

.sect { margin-top: 34px; }
.sect > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.08rem; }
.card.item { padding: 18px 20px; margin: 0 0 12px; animation: rise .35s var(--ease) both; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--fill);
  color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: 0; white-space: nowrap;
}
a.chip:hover { color: var(--text); text-decoration: none; background: var(--fill-2); }
.chip .ic { width: 14px; height: 14px; }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--err-bg); color: var(--err); }
.when { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.item h3 { font-size: 1.1rem; }
.item h3 a { color: inherit; }
.item .detail { color: var(--muted); margin: 8px 0 0; }
.card.ask.high { box-shadow: var(--shadow), inset 3px 0 0 var(--orange); }
.card.failed { box-shadow: var(--shadow), inset 3px 0 0 var(--red); }
.suggest { color: var(--muted); font-size: .92rem; }
.suggest code { margin-left: 6px; }
.errbox { margin: 10px 0 0; padding: 10px 14px; max-height: 9.5em; background: var(--err-bg); color: var(--err); font-size: .82rem; }
.actions, .choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.actions .inline { display: flex; gap: 8px; align-items: center; }
.actions select { width: auto; min-width: 12em; min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.choices button { min-width: 96px; }

.rows { list-style: none; margin: 0; padding: 0; background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.rows li + li { box-shadow: inset 0 .5px 0 var(--line); }
.rows a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: var(--text); transition: background .15s var(--ease); }
.rows a:hover { background: var(--fill); text-decoration: none; }
.rows a > .ic { color: var(--faint); width: 16px; height: 16px; }
.row-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; flex: none; }
.row-ic .ic { width: 19px; height: 19px; }
.row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-t strong { font-weight: 600; font-size: .96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-t span { color: var(--muted); font-size: .84rem; }

/* Icon tiles: one colour per kind */
.tint-blue, .sq-backup { background: linear-gradient(160deg, #4fb6ff, #0a6cff); }
.tint-purple, .sq-model { background: linear-gradient(160deg, #c26bff, #6a4cf6); }
.sq-server { background: linear-gradient(160deg, #a1a1a8, #6b6b73); }
.sq-budget { background: linear-gradient(160deg, #4cd97b, #1fa64d); }
.sq-library { background: linear-gradient(160deg, #ffb340, #ff7a00); }
.sq-drafting { background: linear-gradient(160deg, #ff6b8b, #ef2d5e); }
.sq-speech { background: linear-gradient(160deg, #5ad8e6, #0a9bd8); }
.sq-alerts { background: linear-gradient(160deg, #ff7a6b, #f23a2f); }

/* ============================================================ Settings */
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
.subnav { position: sticky; top: 24px; }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; color: var(--text); font-size: .92rem; font-weight: 500; transition: background .15s var(--ease); }
.subnav a:hover { background: var(--fill); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--accent); color: #fff; }
.subnav .ext { margin-left: auto; color: var(--faint); }
.subnav .ext .ic { width: 14px; height: 14px; }
.sq { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: #fff; flex: none; box-shadow: inset 0 .5px 0 rgba(255,255,255,.35); }
.sq .ic { width: 16px; height: 16px; stroke-width: 2; }
.sq.big { width: 46px; height: 46px; border-radius: 12px; }
.sq.big .ic { width: 26px; height: 26px; stroke-width: 1.8; }
.panel { min-width: 0; }
.sec-head { display: flex; align-items: center; gap: 14px; margin: 0 0 24px; }
.sec-head h2 { margin: 0; font-size: 1.45rem; font-weight: 700; }
.sec-head p { margin: 2px 0 0; color: var(--muted); font-size: .94rem; }
.gt { margin: 28px 4px 8px; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.panel form > .gt:first-of-type, .panel > .gt:first-child { margin-top: 0; }
.group { background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow); }
.fr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 8px 24px; padding: 12px 16px; min-height: 54px; }
.group > .fr + .fr, .group > .msg + .fr { box-shadow: inset 0 .5px 0 var(--line); }
.fr.sw { grid-template-columns: minmax(0, 1fr) auto; }
.fr.col { grid-template-columns: minmax(0, 1fr); }
.fl label { display: block; margin: 0; font-size: .95rem; font-weight: 500; }
.fl .note { margin: 2px 0 0; font-size: .8rem; line-height: 1.4; }
.fc { display: flex; justify-content: flex-end; min-width: 0; }
.fc > * { width: 100%; }
.fc.right > * { width: auto; }
.group input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .group select, .group textarea { min-height: 38px; padding: 7px 12px; border-radius: 9px; font-size: .95rem; }
.group select { padding-right: 34px; background-position: right 12px center; }
.group input.num, .affix { width: 150px; max-width: 100%; }
.group input.num { text-align: right; font-variant-numeric: tabular-nums; }
.affix { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.affix input { flex: 1; min-width: 0; }
.group > .msg { margin: 12px 16px; }
.form-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 20px 0 0; }
.foot-note { margin: 16px 4px 0; }
.panel .banner { margin-bottom: 22px; }
.narrow .group { box-shadow: none; background: none; }
.narrow .fr { grid-template-columns: 1fr; padding: 0; margin-top: 16px; min-height: 0; box-shadow: none !important; }
.narrow .fl label { font-size: .86rem; font-weight: 600; margin-bottom: 6px; }

/* ============================================================ shared components (also on pages not yet redesigned) */
.card { background: var(--panel); border-radius: var(--r); padding: 22px 24px; margin: 16px 0; box-shadow: var(--shadow); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid .card { margin: 0; }
.grid .card:hover { box-shadow: var(--shadow-hi); transform: translateY(-2px); }
details.card > summary, details > summary { cursor: pointer; font-weight: 600; }
details > summary { list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .2s var(--ease); flex: none; }
details[open] > summary::before { transform: rotate(45deg); }
details[open] > summary { margin-bottom: 12px; }
.meta, .note { color: var(--muted); font-size: .86rem; }
.note { margin: 6px 2px 0; }
.empty { color: var(--muted); text-align: center; padding: 44px 16px; font-size: 1.04rem; }
.card .empty, td.empty, li.empty { padding: 8px 0; text-align: left; font-size: 1rem; }
.detail { white-space: pre-wrap; }
.summary { font-size: 1.1rem; }
.answered { color: var(--muted); }
.req { color: var(--muted); font-weight: 400; font-size: .8rem; }
.count, .badge {
  display: inline-block; min-width: 1.6em; padding: 1px 8px; border-radius: 999px; background: var(--fill-2); color: var(--muted);
  font-size: .74rem; line-height: 1.5; text-align: center; font-weight: 600; letter-spacing: 0; vertical-align: middle; font-variant-numeric: tabular-nums;
}
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.msg, .budget { padding: 12px 16px; border-radius: var(--r-sm); background: var(--fill); font-weight: 500; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.err, .budget.reached { background: var(--err-bg); color: var(--err); overflow-wrap: anywhere; }
.budget.warn { background: var(--warn-bg); color: var(--warn); }
.err-text { color: var(--err); }
.state { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.state.done, .state.ready, .state.succeeded, .state.ok { color: var(--ok); background: var(--ok-bg); }
.state.failed, .state.cancelled, .state.rejected { color: var(--err); background: var(--err-bg); }
.state.running, .state.waiting, .state.drafting, .state.queued, .state.needs_owner, .state.proposed { color: var(--warn); background: var(--warn-bg); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.off { background: var(--faint); }

/* Forms */
form { margin: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; }
.row.between { justify-content: space-between; align-items: center; }
.row.grow > :first-child { flex: 1 1 240px; }
.sticky {
  position: sticky; bottom: 16px; z-index: 5; padding: 12px 16px; border-radius: var(--r); background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow-hi);
}
.field label, legend { display: block; font-size: .86rem; font-weight: 600; margin: 0 2px 6px; }
.field.check { display: flex; gap: 12px; align-items: center; }
.field.check label { margin: 0; font-size: 1rem; font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 16px; }
fieldset { border: 0; border-radius: var(--r-sm); padding: 14px 16px; margin: 0; background: var(--fill); }
legend { float: left; width: 100%; padding: 0; }
legend + * { clear: both; }
input, select, textarea, button { font: inherit; color: inherit; letter-spacing: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  width: 100%; max-width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--fill); transition: background .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):hover, select:hover, textarea:hover { background: var(--fill-2); }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):focus, select:focus, textarea:focus {
  outline: 0; background: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring);
}
select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l3-3 3 3M3 10l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select option { background: var(--panel); color: var(--text); }
.filters input, .filters select { width: auto; min-width: 11em; }
textarea { resize: vertical; line-height: 1.45; }
input[type=file] { font-size: .9rem; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; margin-right: 12px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--fill-2); color: var(--text); cursor: pointer; }
/* Checkboxes drawn as switches */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0; border-radius: 999px;
  background: var(--fill-2); cursor: pointer; transition: background .25s var(--ease); vertical-align: middle;
}
input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.2), 0 0 0 .5px rgba(0,0,0,.04); transition: transform .28s var(--spring);
}
input[type=checkbox]:checked { background: var(--green); }
input[type=checkbox]:checked::after { transform: translateX(18px); }
input[type=checkbox]:focus-visible { border-radius: 999px; }
input[type=radio] { accent-color: var(--accent); width: 1.15em; height: 1.15em; }
input[type=range] { accent-color: var(--accent); width: 100%; }

.mono, code, pre, kbd { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-size: .88em; letter-spacing: 0; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 18px; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--text); font-weight: 500; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
}
button .ic, .button .ic { width: 17px; height: 17px; }
button:hover, .button:hover { background: var(--fill-2); text-decoration: none; }
button:active, .button:active { transform: scale(.97); }
button:focus-visible, .button:focus-visible { border-radius: 999px; }
button.primary { background: var(--accent); color: var(--accent-text); font-weight: 600; box-shadow: inset 0 .5px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,80,200,.25); }
button.primary:hover { background: var(--accent-hi); filter: brightness(1.04); }
button.primary:focus-visible { box-shadow: 0 0 0 4px var(--ring); }
button.round:focus-visible { border-radius: 50%; }
.button.ghost { background: none; color: var(--link); }
.button.ghost:hover { background: var(--fill); }
button.danger { color: var(--err); background: var(--err-bg); }
button.danger:hover { background: color-mix(in srgb, var(--red) 22%, transparent); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
button.link { background: none; box-shadow: none; color: var(--link); padding: 6px 10px; min-height: 0; font-size: .875rem; }
button.link:hover { background: var(--fill); }
details.confirm, details.pop { display: inline-block; position: relative; }
details.confirm > summary, details.pop > summary {
  display: inline-flex; min-height: 40px; padding: 8px 18px; border-radius: 999px; background: var(--fill); font-weight: 500; font-size: .93rem;
}
details.confirm > summary { color: var(--err); background: var(--err-bg); }
details.confirm > summary::before, details.pop > summary::before { display: none; }
details.confirm[open] > summary, details.pop[open] > summary { margin-bottom: 8px; }
details.confirm[open] > form, details.pop[open] > form, details.pop[open] > div {
  position: absolute; z-index: 10; padding: 16px; border-radius: var(--r-md); background: var(--raised); box-shadow: var(--shadow-hi); min-width: 280px; animation: rise .2s var(--ease) both;
}

code.inline, :not(pre) > code { background: var(--fill); padding: 2px 6px; border-radius: 6px; word-break: break-word; }
pre { background: var(--fill); padding: 14px 16px; border-radius: var(--r-sm); overflow: auto; white-space: pre-wrap; word-break: break-word; max-height: 60vh; line-height: 1.5; }
pre.doc { background: var(--panel); box-shadow: var(--shadow); }
pre.diff { white-space: pre; padding: 14px 0; }
pre.diff > * { padding: 0 16px; }
pre.diff .add { background: var(--add); display: block; }
pre.diff .del { background: var(--del); display: block; }
pre.diff .gap { color: var(--muted); display: block; }
blockquote { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--fill); }
.scroll { overflow-x: auto; border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); }
.card .scroll { box-shadow: none; border-radius: 0; background: none; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 16px; border-bottom: .5px solid var(--line); vertical-align: top; }
th { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 14px; padding-bottom: 10px; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--fill); }
tbody tr:last-child td { border-bottom: 0; }
.card table th:first-child, .card table td:first-child { padding-left: 0; }
.list, .timeline, .steps { padding: 0; margin: 12px 0; list-style: none; }
.list { background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.list li { padding: 13px 18px; }
.list li + li { box-shadow: inset 0 .5px 0 var(--line); }
.card .list { background: none; box-shadow: none; border-radius: 0; }
.card .list li { padding: 10px 0; }
.concerns li { color: var(--warn); }
.steps { counter-reset: s; display: flex; margin: 4px 0 28px; text-align: center; }
.steps > li { counter-increment: s; flex: 1; position: relative; padding-top: 38px; font-size: .8rem; line-height: 1.25; }
.steps > li::before {
  content: counter(s); position: absolute; left: 50%; top: 0; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%;
  display: grid; place-items: center; background: var(--fill-2); color: var(--muted); font-weight: 600; font-size: .82rem;
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 1px; background: var(--line); }
.steps a { color: var(--muted); }
.steps a[aria-current] { color: var(--text); font-weight: 600; }
.steps > li:has(a[aria-current])::before { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--ring); }
.steps > li:has(~ li a[aria-current])::before { content: "\2713"; background: var(--ok-bg); color: var(--ok); }
.steps > li:has(~ li a[aria-current])::after { background: var(--ok); opacity: .5; }

/* Segmented controls */
.tabs, .toc { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 4px 0 24px; padding: 3px; border-radius: 11px; background: var(--fill); max-width: 100%; }
.tabs a, .toc a { padding: 6px 16px; border-radius: 8px; color: var(--text); font-size: .875rem; font-weight: 500; transition: background .2s var(--ease); }
.tabs a:hover, .toc a:hover { text-decoration: none; background: var(--fill); }
.tabs a[aria-current="page"] { background: var(--raised); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 24px 0; color: var(--muted); font-size: .9rem; }
.pager a { padding: 8px 16px; border-radius: 999px; background: var(--fill); color: var(--text); font-weight: 500; }
.pager a:hover { background: var(--fill-2); text-decoration: none; }

.timeline { position: relative; }
.timeline .step { position: relative; padding: 0 0 20px 28px; }
.timeline .step::before { content: ""; position: absolute; left: 3px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.timeline .step:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 22px; bottom: 0; width: 1px; background: var(--line); }
.step-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.progress { color: var(--warn); }

/* Model forms show the key for API providers and the tool for the command-line one */
.model-form:has(select.prov option[value="cli"]:checked) .only-api,
.model-form:not(:has(select.prov option[value="cli"]:checked)) .only-cli,
.model-form:has(select.prov option[value=""]:checked) :is(.only-api, .picks, .picks-t, .needs-provider) { display: none; }

/* Sign-in and setup */
.narrow, .auth {
  max-width: 420px; margin: clamp(16px, 8vh, 88px) auto 0; padding: 40px 36px 36px; border-radius: 28px; text-align: center;
  background: var(--panel); box-shadow: var(--shadow-hi);
}
body.app .narrow { max-width: 560px; }
.narrow::before {
  content: ""; display: block; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 17px;
  background: linear-gradient(140deg, #64d2ff 0%, var(--accent) 52%, #5e5ce6 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 10px 24px rgba(0,113,227,.35);
}
.narrow h1 { font-size: 1.75rem; margin-bottom: 10px; }
.narrow h1 + p { font-size: .94rem; margin: 0 0 24px; }
.narrow form { text-align: left; }
.narrow form > button, .narrow .row button { width: 100%; min-height: 48px; font-size: 1rem; }
.narrow form > button { margin-top: 24px; }
.narrow .row { flex-direction: column; align-items: stretch; gap: 10px; margin: 24px 0 0; }
.narrow .lead { color: var(--muted); font-size: .94rem; margin: 0 0 24px; }
.narrow .meta { margin: 20px 0 0; }

/* ============================================================ lists, detail pages and library */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.toolbar select, .toolbar input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]) { width: auto; min-height: 36px; padding: 6px 14px; border-radius: 999px; font-size: .9rem; }
.toolbar select { padding-right: 34px; background-position: right 12px center; }
.toolbar .check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; padding: 0 6px; }
.search { position: relative; flex: 1 1 220px; max-width: 360px; }
.search .ic { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.toolbar .search input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]) { width: 100%; padding-left: 36px; }
.rows .row-in { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.row-end { display: flex; align-items: center; gap: 10px; flex: none; }
.row-end .when { margin: 0; }
.row-t .err-text { color: var(--err); }
.row-ic { background: linear-gradient(160deg, #b4b4bb, #85858d); }
.row-ic.s-done, .row-ic.s-ready, .row-ic.s-succeeded { background: linear-gradient(160deg, #4cd97b, #1fa64d); }
.row-ic.s-failed, .row-ic.s-rejected { background: linear-gradient(160deg, #ff7a6b, #f23a2f); }
.row-ic.s-running, .row-ic.s-waiting, .row-ic.s-queued, .row-ic.s-needs_owner, .row-ic.s-drafting, .row-ic.s-proposed { background: linear-gradient(160deg, #ffb340, #ff7a00); }
.row-ic.tint-blue { background: linear-gradient(160deg, #4fb6ff, #0a6cff); }
.row-ic.tint-purple { background: linear-gradient(160deg, #c26bff, #6a4cf6); }
.rows.inset { box-shadow: none; background: var(--fill); margin-top: 4px; }
.sq.grey, .hero-icon.grey { background: linear-gradient(160deg, #b4b4bb, #85858d); }
.hero-empty.quiet { padding: 40px 16px 28px; }
.hero-empty.quiet .hero-icon { box-shadow: none; }
.empty.card { padding: 28px 16px; text-align: center; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px -4px; color: var(--link); font-size: .9rem; font-weight: 500; }
.back .ic { width: 17px; height: 17px; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 0; color: var(--muted); }
.facts .when { margin-left: 4px; }
.ph-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ph-id .sq.big { width: 60px; height: 60px; border-radius: 15px; }
.ph-id .sq.big .ic { width: 32px; height: 32px; }
.lead { font-size: 1.08rem; line-height: 1.5; max-width: 46em; margin: -8px 0 20px; }
.card .lead { margin: 0 0 8px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; font-size: .9rem; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.errbox.big { max-height: 22em; font-size: .86rem; padding: 14px 16px; margin: 0 0 16px; border-radius: var(--r-md); }
.timeline.card { padding: 22px 24px 4px; }
.step-more { margin-top: 8px; }
.step-more > summary { font-weight: 500; font-size: .86rem; color: var(--muted); }
.step-more pre { margin: 0 0 10px; }
.sect.first { margin-top: 0; }
.sect-note { margin: -6px 4px 12px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.two > .side-col { position: sticky; top: 24px; }
.two > .side-col .card { margin: 34px 0 0; }
.two > .side-col .card h2 { margin: 0 0 12px; font-size: 1.08rem; }
.card .group { background: var(--fill); box-shadow: none; }
.stacked .fr { grid-template-columns: 1fr; gap: 6px; }
.fr > .note { grid-column: 1 / -1; margin: -2px 0 0; font-size: .8rem; }
.fc.inline { gap: 8px; }
.fc.inline > input { flex: 1; width: auto; }
.fc.inline > button { width: auto; flex: none; }
details.fold { padding: 0; }
details.fold > summary { padding: 16px 20px; margin: 0; }
details.fold[open] > summary { margin: 0; box-shadow: inset 0 -.5px 0 var(--line); }
details.fold > :not(summary) { margin-left: 20px; margin-right: 20px; }
details.fold > summary + * { margin-top: 18px; }
details.fold > :last-child:not(summary) { margin-bottom: 20px; }
details.fold > pre { max-height: 34em; }
details.fold > pre.diff { margin: 0 !important; border-radius: 0 0 var(--r) var(--r); }
.fold-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fold-t strong { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.fold-t span { color: var(--muted); font-size: .84rem; font-weight: 400; }
.fold-t .ic { width: 16px; height: 16px; }
details.fold.add > summary { color: var(--link); }
details.fold.add > summary::before { display: none; }
.mini-steps { list-style: none; counter-reset: m; margin: 0; padding: 0; }
.mini-steps li { counter-increment: m; display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: .92rem; }
.mini-steps li + li { box-shadow: inset 0 .5px 0 var(--line); }
.mini-steps li::before { content: counter(m); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fill); color: var(--muted); font-size: .74rem; font-weight: 600; flex: none; }
.mini-steps li > span:first-of-type { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-steps .note { margin: 2px 0 0; font-size: .82rem; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; font-size: .9rem; }
.mini li + li { box-shadow: inset 0 .5px 0 var(--line); }
.mini li > span { color: var(--muted); }
.mini.concerns li { color: var(--warn); align-items: center; }
.mini.concerns li > span { color: inherit; }
.mini .ic { width: 16px; height: 16px; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); color: var(--text); transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.tile:hover { text-decoration: none; box-shadow: var(--shadow-hi); transform: translateY(-2px); }
.tile strong { margin-top: 6px; font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; }
.tile p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.action-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; margin: 28px 0 0; padding: 10px; border-radius: 999px; background: color-mix(in srgb, var(--raised) 85%, transparent); box-shadow: var(--shadow-hi); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.quote { margin: 0 0 8px; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 4px var(--r-md) var(--r-md) 4px; background: var(--panel); box-shadow: var(--shadow); font-size: 1.02rem; }
.card.flush { padding: 0; overflow: auto; }
.card.flush table { margin: 0; }
.card.flush td.when { white-space: nowrap; font-size: .84rem; }
.stats.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.dev-head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.dev-head h3 { margin: 0; font-size: 1.2rem; }
.dev-head .facts { margin-top: 6px; }
.dev form + form, .dev .gt { margin-top: 20px; }
.dev-foot { padding-top: 16px; margin-top: 20px; box-shadow: inset 0 .5px 0 var(--line); }
.find { margin: 16px 0; }
.rows details.pop[open] > form { right: 0; left: auto; }
.feed { list-style: none; margin: 0; padding: 0; background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow); }
.feed > li { display: flex; gap: 14px; padding: 14px 18px; }
.feed > li + li { box-shadow: inset 0 .5px 0 var(--line); }
.feed-dot { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--ring); flex: none; }
.feed-b { flex: 1; min-width: 0; }
.feed-h { font-size: .95rem; overflow-wrap: anywhere; }
.feed-h strong { font-weight: 600; }
.feed-s { color: var(--muted); }
.feed-m { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: .8rem; }
.feed-d { display: block; margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--fill); font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow: auto; }
.oops::before { background: linear-gradient(140deg, #ff9f0a, #ff3b30); box-shadow: 0 10px 24px rgba(255,59,48,.3); }
.oops .code { margin: 0 0 4px; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.oops p[role=alert] { overflow-wrap: anywhere; color: var(--muted); }
.toast span { overflow-wrap: anywhere; }
.narrow .fr > .note { margin-top: 6px; }
@media (max-width: 1100px) { .two { grid-template-columns: minmax(0, 1fr); } .two > .side-col { position: static; } .two > .side-col .card { margin-top: 8px; } }
@media (max-width: 860px) {
  .rows .when { display: none; }
  .ph-id .sq.big { width: 48px; height: 48px; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .action-bar { bottom: calc(76px + env(safe-area-inset-bottom)); border-radius: var(--r); }
  .action-bar > form, .action-bar > .button { flex: 1; }
  .action-bar button, .action-bar .button { width: 100%; }
  details.fold > summary { padding: 14px 16px; }
  details.fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
  .card.dev { padding: 18px 16px; }
}

/* ============================================================ narrow screens: top bar and bottom tab bar */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 190px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 860px) {
  body.app { display: block; }
  .mtop {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bar); border-bottom: .5px solid var(--line);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  }
  .mtop .conn-text { font-size: .76rem; }
  .side {
    position: fixed; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; overflow: visible;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--bar); border-right: 0; border-top: .5px solid var(--line);
  }
  .side > .brand, .side-foot, .nav-h, .nav .wide { display: none; }
  .nav { flex-direction: row; width: 100%; }
  .nav > li { flex: 1; min-width: 0; }
  .narrow-only { display: block; }
  .nav > li > a, .more > summary {
    flex-direction: column; justify-content: center; gap: 3px; padding: 5px 2px; font-size: .67rem; font-weight: 500; letter-spacing: 0; color: var(--muted);
  }
  .nav > li > a .ic, .more > summary .ic { width: 24px; height: 24px; }
  .nav > li > a[aria-current="page"], .more > summary[aria-current="page"] { background: none; box-shadow: none; color: var(--accent); font-weight: 600; }
  .more > summary[aria-current="page"] .ic { color: var(--accent); }
  .nav > li > a:hover, .more > summary:hover { background: none; }
  .nb { position: absolute; top: 0; left: calc(50% + 5px); margin: 0; height: 18px; min-width: 18px; font-size: .66rem; box-shadow: 0 0 0 2px var(--bg); }
  .more { position: relative; }
  .more > summary::before { display: none; }
  .more[open] > summary { margin: 0; }
  .sheet {
    position: absolute; right: 0; bottom: calc(100% + 14px); min-width: 230px; margin: 0; padding: 6px; list-style: none;
    border-radius: 18px; background: var(--raised); box-shadow: var(--shadow-hi); animation: rise .22s var(--ease) both;
  }
  .sheet a, .sheet .navbtn { padding: 11px 12px; font-size: .98rem; gap: 12px; }
  .sheet li + li { box-shadow: inset 0 .5px 0 var(--line); }
  main { padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
  .toast, body:not(.app) .toast { left: 50%; top: calc(64px + env(safe-area-inset-top)); }
  .ph { margin-bottom: 18px; }
  .composer { border-radius: 20px; }
  .hint { display: none; }
  .composer-foot { justify-content: flex-end; margin-top: 0; }
  .stats { gap: 10px; }
  .stat { padding: 14px 15px; }
  .stat-v { font-size: 1.6rem; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .subnav { position: static; margin: 0 -16px; }
  .subnav ul { flex-direction: row; overflow-x: auto; gap: 6px; padding: 2px 16px 6px; scrollbar-width: none; }
  .subnav ul::-webkit-scrollbar { display: none; }
  .subnav a { white-space: nowrap; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--fill); font-size: .86rem; }
  .subnav .sq { width: 22px; height: 22px; border-radius: 50%; }
  .subnav .sq .ic { width: 13px; height: 13px; }
  .subnav .ext { display: none; }
  .sec-head { margin-bottom: 18px; }
  .sq.big { width: 40px; height: 40px; border-radius: 11px; }
  .fr { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .fr.sw { grid-template-columns: minmax(0, 1fr) auto; }
  .fc { justify-content: flex-start; }
  .group input.num, .affix { width: 100%; }
  .form-foot > button { flex: 1; }
  .card { padding: 18px; }
  .card.item { padding: 16px; }
  .narrow { padding: 32px 22px 26px; border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
