/* Tokens and component shapes mirror kestrel/web (shadcn base-luma, neutral). */
:root {
  --background: oklch(1 0 0); --foreground: oklch(.145 0 0);
  --card: oklch(1 0 0); --popover: oklch(1 0 0);
  --primary: oklch(.205 0 0); --primary-foreground: oklch(.985 0 0);
  --secondary: oklch(.97 0 0); --secondary-foreground: oklch(.205 0 0);
  --muted: oklch(.97 0 0); --muted-foreground: oklch(.556 0 0);
  --accent: oklch(.97 0 0);
  --destructive: oklch(.577 .245 27.325);
  --border: oklch(.922 0 0); --input: oklch(.922 0 0); --ring: oklch(.708 0 0);
  --sidebar: oklch(.985 0 0); --sidebar-accent: oklch(.97 0 0);
  --sky: oklch(.685 .169 237.323); --sky-fg: oklch(.5 .134 242.749);
  --emerald-fg: oklch(.508 .118 165.612); --emerald: oklch(.696 .17 162.48);
  --amber-fg: oklch(.555 .163 48.998); --amber: oklch(.769 .188 70.08);
  --rose-fg: oklch(.514 .222 16.935); --rose: oklch(.645 .246 16.439);
  --violet-fg: oklch(.491 .27 292.581); --violet: oklch(.606 .25 292.717);
  --radius: .625rem;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
.dark {
  --background: oklch(.145 0 0); --foreground: oklch(.985 0 0);
  --card: oklch(.205 0 0); --popover: oklch(.205 0 0);
  --primary: oklch(.922 0 0); --primary-foreground: oklch(.205 0 0);
  --secondary: oklch(.269 0 0); --secondary-foreground: oklch(.985 0 0);
  --muted: oklch(.269 0 0); --muted-foreground: oklch(.708 0 0);
  --accent: oklch(.269 0 0);
  --destructive: oklch(.704 .191 22.216);
  --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(.556 0 0);
  --sidebar: oklch(.205 0 0); --sidebar-accent: oklch(.269 0 0);
  --sky-fg: oklch(.828 .111 230.318); --emerald-fg: oklch(.845 .143 164.978);
  --amber-fg: oklch(.879 .169 91.605); --rose-fg: oklch(.81 .117 11.638); --violet-fg: oklch(.811 .111 293.571);
  color-scheme: dark;
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; }
body { background: var(--background); color: var(--foreground); font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted-foreground); }
.xs { font-size: 12px; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }

/* Shell */
.shell { display: flex; min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; width: 208px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--sidebar); }
.brand { display: flex; height: 48px; align-items: center; gap: 10px; padding: 0 16px; font-weight: 600; font-size: 14px; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.nav a { display: flex; height: 32px; align-items: center; gap: 8px; border-radius: 8px; padding: 0 8px; color: var(--muted-foreground); text-decoration: none; transition: background-color .15s, color .15s; }
.nav a:hover { background: color-mix(in oklch, var(--sidebar-accent) 60%, transparent); color: var(--foreground); }
.nav a[aria-current="page"] { background: var(--sidebar-accent); color: var(--foreground); font-weight: 500; }
.nav a svg { width: 16px; height: 16px; }
.nav .dot { margin-left: auto; position: relative; width: 8px; height: 8px; }
.nav .dot::before, .nav .dot::after { content: ""; position: absolute; inset: 0; border-radius: 99px; background: var(--sky); }
.nav .dot::before { animation: ping 1.8s ease-out infinite; opacity: .6; }
@keyframes ping { to { transform: scale(2.2); opacity: 0; } }
.foot { margin-top: auto; border-top: 1px solid var(--border); padding: 10px 12px; font-size: 12px; }
.foot .row { display: flex; align-items: center; gap: 8px; }
.foot .who { flex: 1; min-width: 0; padding: 0 4px; }
.foot .hint { margin-top: 6px; padding: 0 4px; font: 11px var(--font-mono); color: var(--muted-foreground); }
.kbd { border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }

.main-col { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; height: 48px; min-width: 0; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--background) 80%, transparent); backdrop-filter: blur(8px); padding: 0 16px; }
.counts { display: flex; gap: 16px; font-size: 12px; overflow-x: auto; white-space: nowrap; }
.counts b { font-weight: 500; }
.counts span { color: var(--muted-foreground); }
.counts span i { font-style: normal; color: var(--foreground); margin-left: 4px; font-variant-numeric: tabular-nums; }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
main { flex: 1; padding: 20px 24px; min-width: 0; }

.page-head { margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; font-size: 18px; font-weight: 600; }
.page-head p { margin: 0; font-size: 14px; color: var(--muted-foreground); }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Buttons (rounded-4xl pills) */
.btn { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 26px; border: 1px solid transparent; background: var(--primary); color: var(--primary-foreground); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: all .15s; user-select: none; }
.btn:hover { background: color-mix(in oklch, var(--primary) 80%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { pointer-events: none; opacity: .5; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn.sm { height: 32px; padding: 0 12px; }
.btn.xs { height: 24px; padding: 0 10px; font-size: 12px; gap: 4px; }
.btn.xs svg { width: 12px; height: 12px; }
.btn.outline { background: var(--background); color: var(--foreground); border-color: var(--border); }
.dark .btn.outline { background: transparent; }
.btn.outline:hover { background: var(--muted); }
.btn.secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn.secondary:hover { background: color-mix(in oklch, var(--secondary), var(--foreground) 5%); }
.btn.ghost { background: transparent; color: var(--foreground); }
.btn.ghost:hover { background: var(--muted); }
.btn.destructive { background: color-mix(in oklch, var(--destructive) 10%, transparent); color: var(--destructive); }
.btn.destructive:hover { background: color-mix(in oklch, var(--destructive) 20%, transparent); }
.btn.icon { width: 32px; height: 32px; padding: 0; background: transparent; color: var(--foreground); }
.btn.icon:hover { background: var(--muted); }
.btn.icon.danger:hover { color: var(--destructive); }
.btn .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Inputs */
.input, select.input { height: 36px; width: 100%; min-width: 0; border-radius: 22px; border: 1px solid transparent; background: color-mix(in oklch, var(--input) 50%, transparent); padding: 4px 12px; font-size: 14px; outline: none; transition: box-shadow .15s, border-color .15s; }
.input::placeholder { color: var(--muted-foreground); }
.input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23888'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-foreground); pointer-events: none; }
.search .input { padding-left: 34px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filters .search { width: 256px; }
.filters select.input { width: auto; }
.filters .spacer { margin-left: auto; }
label.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
label.field .help { font-weight: 400; font-size: 12px; color: var(--muted-foreground); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* Switch */
.switch { position: relative; display: inline-flex; width: 32px; height: 18px; flex-shrink: 0; border-radius: 99px; background: var(--input); border: 1px solid transparent; cursor: pointer; transition: background .15s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: 24px; height: 14px; border-radius: 99px; background: var(--background); box-shadow: 0 1px 2px rgb(0 0 0 / .1); transition: transform .15s; width: 14px; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(14px); }
.dark .switch[aria-checked="true"]::after { background: var(--primary-foreground); }
.dark .switch[aria-checked="false"]::after { background: var(--foreground); }
.switch:disabled { opacity: .5; cursor: default; }

/* Badges */
.badge { display: inline-flex; height: 20px; width: fit-content; flex-shrink: 0; align-items: center; gap: 4px; overflow: hidden; border-radius: 18px; border: 1px solid transparent; padding: 2px 8px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--secondary); color: var(--secondary-foreground); }
.badge.outline { border-color: var(--border); background: transparent; color: var(--foreground); }
.badge .pip { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.tone-ok { background: color-mix(in oklch, var(--emerald) 15%, transparent); color: var(--emerald-fg); }
.tone-warn { background: color-mix(in oklch, var(--amber) 15%, transparent); color: var(--amber-fg); }
.tone-bad { background: color-mix(in oklch, var(--rose) 15%, transparent); color: var(--rose-fg); }
.tone-info { background: color-mix(in oklch, var(--sky) 15%, transparent); color: var(--sky-fg); }
.tone-violet { background: color-mix(in oklch, var(--violet) 15%, transparent); color: var(--violet-fg); }
.tone-mute { background: var(--muted); color: var(--muted-foreground); }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { height: 48px; padding: 0 12px; text-align: left; font-weight: 500; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover, tbody tr[aria-selected="true"] { background: color-mix(in oklch, var(--muted) 50%, transparent); }
td .sub { font-size: 12px; color: var(--muted-foreground); }
td.num, .tab { font-variant-numeric: tabular-nums; }
td.right { text-align: right; white-space: nowrap; }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 99px; background: var(--primary); color: var(--primary-foreground); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.avatar-id { flex-shrink: 0; border-radius: 9px; }
.avatar-id.off { filter: grayscale(1); opacity: .55; }
.avatar.off { background: var(--muted); color: var(--muted-foreground); }

/* Accounts split */
.main-col { min-width: 0; overflow-x: clip; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.split > * { min-width: 0; }
.panel { max-width: 100%; }
.split.nodetail { grid-template-columns: minmax(0, 1fr); }
.panel { position: sticky; top: 64px; display: flex; flex-direction: column; gap: 16px; border-radius: 26px; background: var(--card); padding: 20px; box-shadow: 0 4px 6px -1px rgb(0 0 0 / .06), 0 2px 4px -2px rgb(0 0 0 / .06); outline: 1px solid color-mix(in oklch, var(--foreground) 5%, transparent); max-height: calc(100svh - 80px); overflow-y: auto; scrollbar-width: thin; }
.dark .panel { outline-color: color-mix(in oklch, var(--foreground) 10%, transparent); }
.panel h2 { margin: 0; font-size: 16px; font-weight: 500; }
.panel h3 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
.panel-head { display: flex; gap: 12px; align-items: flex-start; }
.panel-head .grow { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; min-width: 0; text-align: right; }
.sep { height: 1px; background: var(--border); border: 0; margin: 0; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Sign-in flow */
.flow { border-radius: 18px; border: 1px solid var(--border); padding: 14px; display: grid; gap: 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted-foreground); }
.steps li .ix { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; border-radius: 99px; border: 1px solid var(--border); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.steps li.done { color: var(--foreground); }
.steps li.done .ix { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.steps li.now { color: var(--foreground); font-weight: 500; }
.steps li.now .ix { border-color: var(--sky); color: var(--sky-fg); box-shadow: 0 0 0 3px color-mix(in oklch, var(--sky) 20%, transparent); }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; background: var(--muted); padding: 12px 14px; }
.code-box code { font: 600 26px/1 var(--font-mono); letter-spacing: .18em; }
.sub-head { margin: 24px 0 10px; }
.sub-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.link-plain { color: var(--sky-fg); text-decoration: none; }
.link-plain:hover { text-decoration: underline; }
.tfa { display: grid; gap: 10px; }
.tfa .tfa-secret { font: 600 15px/1.4 var(--font-mono); letter-spacing: .12em; word-break: break-all; }
.tfa .tfa-qr { width: 176px; height: 176px; justify-self: center; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.auth-result { display: grid; gap: 8px; }
.auth-result .code-box code.auth-code { font: 600 13px/1.4 var(--font-mono); letter-spacing: 0; min-width: 0; word-break: break-all; }
textarea.input { resize: vertical; min-height: 56px; line-height: 1.5; }
.code-meta { font-size: 12px; color: var(--muted-foreground); }
.alert { display: flex; gap: 8px; border-radius: 14px; border: 1px solid var(--border); padding: 10px 12px; font-size: 13px; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.alert.bad { color: var(--destructive); background: color-mix(in oklch, var(--destructive) 6%, transparent); border-color: color-mix(in oklch, var(--destructive) 25%, transparent); }
.alert.warn { color: var(--amber-fg); background: color-mix(in oklch, var(--amber) 8%, transparent); border-color: color-mix(in oklch, var(--amber) 30%, transparent); }
.list { display: grid; gap: 2px; }
.list .item { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.list .item:last-child { border-bottom: 0; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--border); border-radius: 14px; padding: 64px 16px; text-align: center; }
.empty p { margin: 0; }
.empty .title { font-size: 14px; font-weight: 500; }
.empty .hint { max-width: 28rem; font-size: 14px; color: var(--muted-foreground); }
.empty svg { width: 28px; height: 28px; color: var(--muted-foreground); margin-bottom: 8px; }

/* Dialog */
dialog { border: 0; padding: 0; background: transparent; color: var(--foreground); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgb(0 0 0 / .1); backdrop-filter: blur(4px); }
.dialog { position: relative; width: 480px; max-width: 100%; display: grid; gap: 16px; border-radius: 26px; background: var(--popover); padding: 24px; box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); outline: 1px solid color-mix(in oklch, var(--foreground) 5%, transparent); animation: pop .12s ease-out; }
.dark .dialog { outline-color: color-mix(in oklch, var(--foreground) 10%, transparent); }
@keyframes pop { from { opacity: 0; transform: scale(.95); } }
.dialog h2 { margin: 0; font-size: 16px; font-weight: 500; }
.dialog .desc { margin: 4px 0 0; font-size: 14px; color: var(--muted-foreground); }
.dialog .close { position: absolute; top: 16px; right: 16px; background: var(--secondary); }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
.dialog .err { color: var(--destructive); font-size: 13px; min-height: 0; margin: 0; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* Toasts (floating pill, like Kestrel's FloatingBar) */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 8px; border-radius: 99px; background: var(--popover); padding: 8px 16px; font-size: 14px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); outline: 1px solid color-mix(in oklch, var(--foreground) 8%, transparent); animation: rise .2s cubic-bezier(.22, 1, .36, 1); max-width: calc(100vw - 32px); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.ok svg { color: var(--emerald-fg); }
.toast.bad svg { color: var(--destructive); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Gate */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.gate .dialog { width: 380px; }

/* Authenticate Claude Code: automated, with a live view only when a check appears */
.dialog:has(.auth-stage-wrap:not([hidden])) { width: min(920px, 94vw); }
.auth-head h2 { margin: 0; }
.auth-status { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--muted-foreground); }
.auth-note { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--amber-fg); }
.auth-ok { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 500; color: var(--emerald-fg); }
.auth-status svg, .auth-note svg, .auth-ok svg { width: 16px; height: 16px; flex-shrink: 0; }
.live-stage { display: grid; gap: 10px; }
.live-screen { position: relative; display: grid; place-items: center; min-height: 240px; border-radius: 16px; overflow: hidden; background: var(--muted); }
.live-img { display: block; max-width: 100%; max-height: min(70vh, 720px); cursor: crosshair; -webkit-user-select: none; user-select: none; outline: none; }
.live-wait { position: absolute; font-size: 13px; color: var(--muted-foreground); }
.live-hint { margin: 0; text-align: center; }
.gate .brand { padding: 0; height: auto; }

.skeleton { border-radius: 8px; background: var(--muted); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* Usage (account panel) */
.usage { display: flex; flex-direction: column; gap: 14px; }
.usage.enter { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.u-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.u-head h3 { margin: 0; }
.u-plan { margin-left: 6px; text-transform: none; letter-spacing: 0; color: var(--foreground); font-weight: 500; }
.btn.icon.sm { width: 26px; height: 26px; }
.num { font-variant-numeric: tabular-nums; }
.u-meters { display: grid; gap: 14px; }
.u-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
.u-pct { font-weight: 500; }
.u-note { margin-top: 5px; font-size: 12px; color: var(--muted-foreground); }
.u-track { display: block; height: 4px; margin-top: 7px; border-radius: 99px; background: var(--muted); overflow: hidden; }
.u-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--foreground); opacity: .8; transition: width .9s cubic-bezier(.22, 1, .36, 1); }
.u-meter.warn .u-track i { background: var(--amber); opacity: 1; }
.u-meter.bad .u-track i { background: var(--rose); opacity: 1; }
.u-flag { font-weight: 500; }
.u-meter.warn .u-flag { color: var(--amber-fg); }
.u-meter.bad .u-flag { color: var(--rose-fg); }
.u-cell { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.u-cell .u-track { width: 56px; margin: 0; }
.u-cell .u-track i { transition: none; }
.u-foot, .u-empty { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.skeleton { display: grid; gap: 10px; }
.skeleton i { display: block; height: 8px; border-radius: 99px; background: var(--muted); animation: pulse 1.4s ease-in-out infinite; }
.skeleton i:nth-child(2) { width: 60%; }
@keyframes pulse { 50% { opacity: .5; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; max-height: none; }
  .hide-md { display: none; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 50; left: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / .2); }
  .menu-btn { display: inline-flex; }
  main { padding: 20px 16px; }
  .topbar { padding: 0 12px; }
  .filters .search { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
a.brand { text-decoration: none; color: inherit; }
.who-name { display: block; font-weight: 500; }
.btn.ghost.danger { color: var(--destructive); }
td .sub.err { color: var(--destructive); }
.err { color: var(--destructive); }
.btn.menu-btn { display: none; }
@media (max-width: 768px) { .btn.menu-btn { display: inline-flex; } }
.split:not(.nodetail) .hide-md { display: none; }
dialog { border-radius: 26px; overflow: visible; }
.step-note { display: block; margin-top: 2px; font-weight: 400; }

/* account access picker (users / invites) */
.access-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.access-pick[hidden] { display: none; }
.access-pick legend { padding: 0; margin-bottom: 6px; }
.pick-list { display: grid; max-height: 208px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.pick { display: grid; grid-template-columns: auto auto minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; }
.pick + .pick { border-top: 1px solid var(--border); }
.pick:hover { background: var(--muted); }
.pick input { margin: 0; accent-color: var(--foreground); }
.pick .muted { text-align: right; }
.pick-tools { display: flex; gap: 12px; }
.pick-tools button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted-foreground); cursor: pointer; }
.pick-tools button:hover { color: var(--foreground); text-decoration: underline; }

/* sign-in step 2: one-time code */
.otp-head { display: grid; justify-items: center; text-align: center; gap: 6px; margin-top: 4px; }
.otp-badge { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--muted); color: var(--foreground); margin-bottom: 4px; }
.otp-badge svg { width: 20px; height: 20px; }
.otp-head .desc { max-width: 290px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-digit { width: 100%; min-width: 0; height: 52px; text-align: center; font: 600 22px/1 var(--font-mono); border: 1px solid var(--input); border-radius: 12px; background: var(--background); color: var(--foreground); caret-color: transparent; transition: border-color .12s, box-shadow .12s; }
.otp-digit:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }
.otp.bad .otp-digit { border-color: var(--destructive, #e5484d); }
.otp.bad { animation: otp-shake .32s; }
@keyframes otp-shake { 20%, 60% { transform: translateX(-5px) } 40%, 80% { transform: translateX(5px) } }
@media (prefers-reduced-motion: reduce) { .otp.bad { animation: none; } }
.err.center { text-align: center; min-height: 0; }
.err.center:empty { display: none; }
.otp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted-foreground); cursor: pointer; }
.link-btn:hover { color: var(--foreground); }
#otp-user { white-space: nowrap; color: var(--foreground); }

/* per-account proxy */
.proxy-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.proxy-actions { gap: 6px; flex-wrap: wrap; }
.err-inline { color: var(--destructive); }
