/* V4 — Gut Lab: admin "control room". Dense, keyboard-first. Tokens in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; color: var(--ink); font: 400 13.5px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; background: var(--bench);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--protein); outline-offset: 1px; border-radius: 4px; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font: 500 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; font: 500 11px var(--font-mono); background: var(--lab); box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 0 var(--line-strong); color: var(--ink); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 60px minmax(0, 1fr); transition: grid-template-columns .3s cubic-bezier(.2,.7,.2,1); grid-template-rows: 52px minmax(0, 1fr); min-height: 100vh; }
.rail { grid-row: 1 / -1; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--ink); z-index: 30; }
.rail__logo { position: relative; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--leaf); margin-bottom: 10px; flex: none; }
.rail__logo svg { width: 22px; height: 22px; flex: none; transition: rotate .3s cubic-bezier(.2,.7,.2,1); }
.rail__brand { display: none; font: 600 14px var(--font-ui); color: var(--ink); white-space: nowrap; }
.rail a { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: color-mix(in oklab, var(--lab) 60%, transparent); transition: background .2s, color .2s; }
.rail a:hover { background: #ffffff14; color: var(--lab); }
.rail a.active { background: var(--lab); color: var(--ink); }
.rail a svg { width: 19px; height: 19px; }
.rail [data-tip]::after { content: attr(data-tip); z-index: 5; position: absolute; left: 50px; top: 50%; translate: 0 -50%; padding: 4px 8px; border-radius: 6px; background: var(--ink); color: var(--lab); font: 500 12px var(--font-ui); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; box-shadow: var(--shadow); }
.rail [data-tip]:hover::after { opacity: 1; }
/* Expanded rail: labels inline instead of tooltips */
.shell.wide { grid-template-columns: 196px minmax(0, 1fr); }
.shell.wide .rail { align-items: stretch; padding: 10px; overflow: hidden; }
.shell.wide .rail a { width: 100%; display: flex; justify-content: flex-start; gap: 12px; padding: 0 11px; }
.shell.wide .rail a::after { content: attr(data-label); position: static; translate: none; opacity: 1; background: none; box-shadow: none; padding: 0; color: inherit; font-size: 13px; }
.shell.wide .rail__logo { width: 100%; justify-content: flex-start; padding: 0 8px; }
.shell.wide .rail__logo::after { display: none; }
.shell.wide .rail__logo svg { rotate: 180deg; }
.shell.wide .rail__brand { display: block; }
.shell.wide .rail a .badge { position: static; margin-left: auto; }
.shell.wide .rail__foot { justify-items: start; }
.rail a .badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--fat); color: #fff; font: 600 10px/16px var(--font-mono); text-align: center; }
.rail a .badge[data-zero="true"] { display: none; }
.rail__foot { margin-top: auto; display: grid; gap: 6px; justify-items: center; }
.rail__me { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklab, var(--lab) 20%, transparent); color: var(--lab); font: 600 12px var(--font-mono); }
.bar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: color-mix(in oklab, var(--bench) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar__crumb { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.bar__crumb small { font: 500 11px var(--font-mono); color: var(--muted); }
.cmdk-btn { margin: 0 auto; width: min(460px, 40vw); height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; border-radius: 9px; background: var(--lab); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 13px; text-align: left; }
.cmdk-btn:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.cmdk-btn svg { width: 15px; height: 15px; }
.cmdk-btn span { flex: 1; }
.sel { height: 32px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--lab); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }
.clock { font: 500 12px var(--font-mono); display: flex; align-items: center; gap: 6px; color: var(--muted); }
.clock i { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.main { min-width: 0; padding: 16px 18px 60px; }
.head { display: flex; align-items: baseline; gap: 14px; margin: 2px 0 14px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.head__tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- Building blocks ---------- */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; } .span-9 { grid-column: span 9; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.box { background: var(--lab); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; min-width: 0; position: relative; }
.box__h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.box__h b { font-weight: 600; font-size: 13.5px; }
.box__h .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; background: var(--ink); color: var(--lab); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--moss); }
.btn--ghost { background: var(--lab); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost:hover { background: #fff; }
.btn svg { width: 14px; height: 14px; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--lab); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button b { font: 600 11px var(--font-mono); color: var(--faint); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--lab); }
.seg button[aria-pressed="true"] b { color: var(--leaf); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--leaf-ink); flex: none; }
.dot--busy { background: var(--carbs); } .dot--paused { background: var(--fat); }

/* KPI strip with sparklines */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--lab); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 2px; }
.kpi__l { font: 500 10.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi__v { display: flex; align-items: baseline; gap: 8px; font: 600 24px var(--font-ui); letter-spacing: -.03em; }
.kpi__d { font: 600 11px var(--font-mono); color: var(--leaf-ink); }
.kpi__d.down { color: var(--fat); }
.spark { width: 100%; height: 30px; display: block; overflow: visible; }
.spark path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spark .area { fill: color-mix(in oklab, var(--leaf) 22%, transparent); stroke: none; }
.spark .end { fill: var(--ink); }

/* Kitchens small multiples */
.kgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kcard { background: var(--lab); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 8px; }
.kcard[data-status="paused"] { opacity: .65; }
.kcard__h { display: flex; align-items: center; gap: 8px; }
.kcard__h b { font-size: 14px; font-weight: 600; }
.kcard__h .btn { margin-left: auto; height: 24px; padding: 0 8px; font-size: 11px; }
.kcard__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kcard__nums b { display: block; font: 600 17px var(--font-mono); }
.kcard__nums > span > span { font: 500 9.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sla { height: 5px; border-radius: 3px; background: color-mix(in oklab, var(--ink) 8%, transparent); overflow: hidden; }
.sla i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--leaf-ink); }

/* Live feed */
.feed { display: grid; gap: 0; max-height: 330px; overflow: hidden; }
.feed__row { display: grid; grid-template-columns: 46px 64px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.feed__row:last-child { border-bottom: 0; }
.feed__row .mono { font-size: 11.5px; }

/* ---------- Queue table ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { position: sticky; top: 52px; z-index: 2; text-align: left; font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 9px 10px; background: var(--lab); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl .r { text-align: right; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #fff; }
.tbl tbody tr.sel { background: color-mix(in oklab, var(--protein) 9%, #fff); box-shadow: inset 3px 0 0 var(--protein); }
.tbl tbody tr.new { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { background: color-mix(in oklab, var(--leaf) 45%, #fff); } 100% { background: transparent; } }
.ono { font: 600 13px var(--font-mono); white-space: nowrap; }
.items { max-width: 320px; }
.items .mod { color: var(--muted); }
.items .out { color: var(--fat); font-weight: 600; }
.allergy { font: 600 10.5px var(--font-mono); color: var(--fat); text-transform: uppercase; white-space: nowrap; }
.age { font: 500 12px var(--font-mono); white-space: nowrap; }
.slabar { width: 110px; height: 6px; border-radius: 3px; background: color-mix(in oklab, var(--ink) 8%, transparent); overflow: hidden; }
.slabar i { display: block; height: 100%; border-radius: 3px; }
.st { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.st--new { background: color-mix(in oklab, var(--carbs) 20%, transparent); color: #8a5c05; }
.st--preparing { background: color-mix(in oklab, var(--protein) 15%, transparent); color: var(--protein); }
.st--ready { background: color-mix(in oklab, var(--leaf) 30%, transparent); color: var(--leaf-ink); }
.st--collected { background: color-mix(in oklab, var(--ink) 6%, transparent); color: var(--muted); }
.ch { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ch svg { width: 13px; height: 13px; }
.act { height: 26px; padding: 0 9px; border-radius: 7px; background: var(--ink); color: var(--lab); font-size: 11.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.act:hover { background: var(--moss); }
.keys { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- Availability matrix ---------- */
.mx { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.mx th { position: sticky; top: 0; z-index: 2; background: var(--lab); text-align: left; font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.mx th.c { text-align: center; }
.mx th button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); padding: 3px 6px; border-radius: 5px; }
.mx th button:hover { background: var(--bench); }
.mx td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mx tr.cat td { background: var(--bench); font: 600 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--moss); padding: 8px; }
.mx .pname { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.mx .pname img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--agar); }
.mx .pname button { text-align: left; font-weight: 500; }
.mx .pname button:hover { text-decoration: underline; }
.mx .meta { font: 400 11px var(--font-mono); color: var(--muted); white-space: nowrap; }
.mx .meta .al { color: var(--fat); }
.cell { width: 100%; min-width: 74px; height: 30px; border-radius: 7px; display: grid; place-items: center; font: 600 10.5px var(--font-mono); text-transform: uppercase; transition: background .2s, color .2s; }
.cell[data-v="on"] { background: color-mix(in oklab, var(--leaf) 32%, transparent); color: var(--leaf-ink); }
.cell[data-v="snoozed"] { background: color-mix(in oklab, var(--carbs) 24%, transparent); color: #8a5c05; }
.cell[data-v="off"] { background: color-mix(in oklab, var(--ink) 5%, transparent); color: var(--faint); }
.cell:hover { outline: 1.5px solid var(--ink); }
.lockp { font: 600 12px var(--font-mono); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.lockp svg { width: 11px; height: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font: 500 11px var(--font-mono); color: var(--muted); }
.legend i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -2px; margin-right: 5px; }
.legend .sw { width: 14px; height: 3px; border-radius: 2px; }

/* Drawer */
.scrim { position: fixed; inset: 0; z-index: 60; background: #1B2A2340; opacity: 0; pointer-events: none; }
.scrim.open { pointer-events: auto; }
.drawer { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--lab); box-shadow: -20px 0 50px #1B2A2330; display: flex; flex-direction: column; visibility: hidden; }
.drawer__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; display: grid; gap: 16px; align-content: start; }
.drawer__foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; }
.field { display: grid; gap: 4px; }
.field > span { font: 500 10.5px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.field > span svg { width: 11px; height: 11px; }
.input { min-height: 36px; padding: 7px 10px; border-radius: 8px; border: 0; background: var(--bench); width: 100%; font-size: 13px; }
.input:focus { outline: 2px solid var(--protein); }
.input[readonly] { color: var(--muted); font-family: var(--font-mono); background: repeating-linear-gradient(135deg, var(--bench) 0 6px, var(--lab) 6px 8px); }
textarea.input { resize: vertical; min-height: 70px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggles { display: flex; flex-wrap: wrap; gap: 5px; }
.toggles button { height: 26px; padding: 0 9px; border-radius: 6px; font: 500 11px var(--font-mono); background: var(--bench); color: var(--muted); }
.toggles button[aria-pressed="true"] { background: var(--fat); color: #fff; }
.toggles--diet button[aria-pressed="true"] { background: var(--leaf-ink); }
.own { font-size: 12.5px; padding: 10px 12px; border-radius: 8px; background: color-mix(in oklab, var(--protein) 10%, var(--lab)); box-shadow: inset 3px 0 0 var(--protein); }
.minirow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }

/* ---------- Reports: small multiples ---------- */
.sm { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sm__item { display: grid; gap: 4px; }
.sm__item b { font-size: 13px; font-weight: 600; }
.sm__item .v { font: 600 18px var(--font-mono); }
.sm svg { width: 100%; height: 90px; overflow: visible; }
.sm svg .grid-line { stroke: var(--line); }
.sm svg path.cur { fill: none; stroke: var(--leaf-ink); stroke-width: 1.6; }
.sm svg path.prev { fill: none; stroke: var(--faint); stroke-width: 1.2; stroke-dasharray: 3 3; }
.sm svg .hit { fill: transparent; }
.sm svg .cross { stroke: var(--line-strong); }
.sm svg .mk { fill: var(--leaf-ink); }
.sm__tip { font: 500 11px var(--font-mono); color: var(--muted); min-height: 16px; }
.stack { display: grid; gap: 8px; }
.stack__row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.stack__bar { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; }
.stack__bar i { display: block; height: 100%; position: relative; }
.stack__bar i:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
.hgrid { display: grid; grid-template-columns: 34px repeat(10, 1fr); gap: 3px; font: 500 10px var(--font-mono); color: var(--muted); align-items: center; }
.hgrid span.c { height: 24px; border-radius: 4px; background: color-mix(in oklab, var(--leaf-ink) calc(var(--v) * 100%), var(--lab)); }
.hgrid span.c:hover { outline: 2px solid var(--ink); }
.hgrid .hh { text-align: center; }
.tip { position: absolute; z-index: 5; pointer-events: none; padding: 6px 9px; border-radius: 6px; background: var(--ink); color: var(--lab); font: 500 11.5px var(--font-mono); opacity: 0; translate: -50% calc(-100% - 8px); white-space: nowrap; }
.dtbl td .tinyspark { width: 90px; height: 22px; }

/* ---------- Access ---------- */
.pmx { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.pmx th { position: sticky; top: 0; z-index: 2; background: var(--lab); padding: 8px 6px; border-bottom: 1px solid var(--line-strong); font: 500 10px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); vertical-align: bottom; text-align: center; white-space: nowrap; }
.pmx th:first-child { text-align: left; }
.pmx td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.pmx td:first-child { text-align: left; white-space: nowrap; }
.pmx tr.grp td { background: var(--bench); font: 600 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--moss); text-align: left; }
.pmx .key { font: 400 10.5px var(--font-mono); color: var(--muted); }
.pc { width: 54px; height: 24px; border-radius: 6px; font: 600 10px var(--font-mono); text-transform: uppercase; transition: background .15s, color .15s; }
.pc[data-v="allow"] { background: color-mix(in oklab, var(--leaf) 32%, transparent); color: var(--leaf-ink); }
.pc[data-v="deny"] { background: color-mix(in oklab, var(--fat) 18%, transparent); color: var(--fat); }
.pc[data-v="inherit"] { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
.pc small { display: block; font-size: 8.5px; color: #8a5c05; margin-top: -2px; }
.pc:hover { outline: 1.5px solid var(--ink); }
.ptbl td .scope { font: 500 11px var(--font-mono); padding: 2px 6px; border-radius: 5px; background: var(--bench); margin-right: 4px; white-space: nowrap; }
.ptbl td .scope--g { background: color-mix(in oklab, var(--leaf) 28%, transparent); }
.ptbl td .scope--x { background: color-mix(in oklab, var(--fat) 18%, transparent); color: var(--fat); }
.log { display: grid; font-size: 12.5px; }
.log__row { display: grid; grid-template-columns: 58px 92px 1fr 90px; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.log__k { font: 600 10px var(--font-mono); text-transform: uppercase; padding: 2px 6px; border-radius: 4px; justify-self: start; }
.log__k--money { background: color-mix(in oklab, var(--carbs) 22%, transparent); color: #8a5c05; }
.log__k--menu { background: color-mix(in oklab, var(--leaf) 30%, transparent); color: var(--leaf-ink); }
.log__k--access { background: color-mix(in oklab, var(--protein) 15%, transparent); color: var(--protein); }
.log__k--integration { background: var(--bench); color: var(--moss); }
.log__k--danger { background: color-mix(in oklab, var(--fat) 18%, transparent); color: var(--fat); }
.log__ctx { font: 400 11px var(--font-mono); color: var(--muted); }
.diff-old { color: var(--fat); text-decoration: line-through; font-family: var(--font-mono); }
.diff-new { color: var(--leaf-ink); font-weight: 600; font-family: var(--font-mono); }
.chain { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--font-mono); color: var(--leaf-ink); }
.chain svg { width: 14px; height: 14px; }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; z-index: 90; inset: 0; display: grid; justify-items: center; align-content: start; padding-top: 14vh; background: #1B2A2333; backdrop-filter: blur(3px); }
.cmdk[hidden] { display: none; }
.cmdk__box { width: min(640px, 92vw); background: var(--lab); border-radius: 14px; box-shadow: 0 30px 80px #1B2A2355, inset 0 0 0 1px var(--line); overflow: hidden; }
.cmdk__in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk__in svg { width: 18px; height: 18px; color: var(--muted); }
.cmdk__in input { flex: 1; border: 0; background: transparent; font-size: 16px; outline: none; }
.cmdk__list { max-height: 380px; overflow-y: auto; padding: 6px; }
.cmdk__group { font: 500 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.cmdk__item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-align: left; font-size: 13.5px; }
.cmdk__item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.cmdk__item small { margin-left: auto; font: 500 11px var(--font-mono); color: var(--muted); }
.cmdk__item mark { background: color-mix(in oklab, var(--carbs) 30%, transparent); color: inherit; border-radius: 2px; }
.cmdk__item.on { background: var(--ink); color: var(--lab); }
.cmdk__item.on svg, .cmdk__item.on small { color: color-mix(in oklab, var(--lab) 70%, transparent); }
.cmdk__foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.cmdk__empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- Sign-in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login__card { width: min(420px, 100%); background: var(--lab); border-radius: 16px; box-shadow: var(--shadow-lift); padding: 26px; display: grid; gap: 14px; }
.login__top { display: flex; align-items: center; gap: 10px; }
.login__top img { height: 34px; }
.login__top .label { margin-left: auto; }
.login h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.login p { margin: 0; color: var(--muted); font-size: 13px; }
.login .btn { height: 42px; font-size: 14px; justify-content: center; }
.login .input { min-height: 42px; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 3px; border-radius: 2px; background: var(--line-strong); }
.steps i.on { background: var(--ink); }
.mfa-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.pk { display: grid; justify-items: center; gap: 8px; padding: 10px 0; text-align: center; }
.pk__btn { position: relative; width: 110px; height: 110px; border-radius: 26px; display: grid; place-items: center; background: var(--bench); color: var(--ink); }
.pk__btn svg.fp { width: 54px; height: 54px; }
.pk__btn svg.fp path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pk__scan { position: absolute; left: 18%; right: 18%; height: 2px; top: 30%; background: var(--protein); box-shadow: 0 0 10px var(--protein); opacity: 0; }
.pk__btn.ok { background: var(--leaf-ink); color: #fff; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.otp input { height: 52px; text-align: center; font: 600 22px var(--font-mono); border: 0; border-radius: 9px; background: var(--bench); width: 100%; }
.otp input:focus { outline: 2px solid var(--protein); }
.otp input.ok { background: var(--leaf-ink); color: #fff; }
.otp-meta { display: flex; align-items: center; gap: 8px; font: 400 11px var(--font-mono); color: var(--muted); }
.otp-ring { width: 18px; height: 18px; transform: rotate(-90deg); }
.otp-ring circle { fill: none; stroke-width: 3; }
.otp-ring .bg { stroke: var(--line); } .otp-ring .fg { stroke: var(--protein); stroke-linecap: round; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; z-index: 95; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--lab); font-size: 13px; box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none; max-width: 420px; }
.toast b { font-weight: 600; }
.toast .ono { color: var(--leaf); }

@media (max-width: 1200px) {
  .span-9, .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kgrid, .sm { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 52px auto 1fr; }
  .rail { grid-row: auto; position: sticky; top: 52px; height: auto; flex-direction: row; padding: 6px 10px; justify-content: space-around; }
  .rail__logo, .rail__foot { display: none; }
  .rail [data-tip]::after { display: none; }
  .shell.wide { grid-template-columns: 1fr; }
  .cmdk-btn span, .cmdk-btn kbd { display: none; }
  .cmdk-btn { width: 40px; margin: 0 0 0 auto; }
  .kpis, .kgrid, .sm { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* Tables inside a scroll box stick to that box; give those boxes their own height so the header can stick */
.scrollbox { max-height: calc(100vh - 150px); overflow: auto; }
