/* Dewin AI OP — "light glass" look. The rules behind every value are in dewin_final_uiux_plan.md.
   Order: tokens → base → frame (aurora, sidebar, sheet, top bar) → components → pages → responsive. */

/* ============ Tokens ============ */
:root {
  --ink: #121216; --ink-2: #3c3c47; --muted: #5c5c6a; --faint: #6e6e7c;
  --paper: #ffffff;
  --sheet: #fcfbfe; --card: #ffffff; --tint: #f3f2f8; --tint-2: #ecebf3;
  --line: rgba(18, 18, 22, .07); --line-2: rgba(18, 18, 22, .13);
  --lime: #c4f25a; --lime-ink: #24400a; --lime-soft: #eefbd3;
  --violet: #5b4ae8; --violet-soft: #ecebff;
  --danger-text: #c4252e; --ok-text: #1f7a33; --alert-red: #d92d3a; --on-lime: #24400a;
  --fab-clear: 92px;
  --peach-soft: #fff0e0; --peach-ink: #9a4b00;
  --lav-soft: #efeaff; --lav-ink: #4b3bb5;
  --rose-soft: #ffe7ea; --rose-ink: #b4232f;
  --sev-critical: #e5484d; --sev-high: #f76b15; --sev-medium: #d99a00; --sev-low: #3e63dd; --sev-info: #8b8d98;
  --ok: #2f9e44;
  --aur-base: #f6f1fb;
  --aur-1: #ffd1ea; --aur-2: #dcd2ff; --aur-3: #c9ecff; --aur-4: #cff7e6; --aur-5: #ffe3c8;
  --spectrum: linear-gradient(125deg, #ffe25a 0%, #8be86f 24%, #47d3f7 48%, #ff86da 74%, #b77bff 100%);
  --glass: rgba(255, 255, 255, .62); --glass-strong: rgba(255, 255, 255, .82);
  --blur: blur(18px) saturate(160%);
  --r-sheet: 28px; --r-card: 22px; --r-ctl: 14px; --r-pill: 999px;
  --shadow-sheet: 0 30px 60px -30px rgba(70, 40, 140, .25), 0 0 0 1px rgba(255, 255, 255, .7);
  --shadow-card: 0 1px 2px rgba(20, 20, 40, .04), 0 8px 24px -12px rgba(60, 40, 120, .12);
  --shadow-pill: 0 1px 2px rgba(20, 20, 40, .06), 0 6px 16px -6px rgba(60, 40, 120, .18);
  --shadow-pop: 0 24px 60px -16px rgba(40, 20, 90, .30), 0 0 0 1px rgba(18, 18, 22, .06);
  --tatv-dot: conic-gradient(from 210deg, #ff5fd2, #ffe14d, #5be37a, #3fd0ff, #9b6bff, #ff5fd2);
  --tatv-si: #8b8fa8;
  --side-w: 264px; --side-w-min: 84px; --top-h: 72px; --frame: 10px;
  --pad: 24px; --gap: 18px; --row-h: 52px;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #f4f3f8; --ink-2: #d2d1dc; --muted: #a6a5b4; --faint: #8d8c9c;
  --danger-text: #ff8a8f; --ok-text: #6fd38a;
  --paper: #121216;
  --sheet: #131219; --card: #1a1922; --tint: #22212b; --tint-2: #2a2934;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --lime-soft: #23300f; --lime-ink: #d4f78a;
  --violet: #9d91ff; --violet-soft: #26233f;
  --peach-soft: #33240f; --peach-ink: #ffc184;
  --lav-soft: #26213f; --lav-ink: #c3b8ff;
  --rose-soft: #3a1a1e; --rose-ink: #ff9aa2;
  --aur-base: #0c0b12;
  --tatv-si: #9a9eb8;
  --aur-1: rgba(255, 110, 190, .20); --aur-2: rgba(140, 110, 255, .24); --aur-3: rgba(70, 170, 255, .18); --aur-4: rgba(60, 220, 170, .14); --aur-5: rgba(255, 170, 90, .12);
  --glass: rgba(30, 29, 40, .62); --glass-strong: rgba(30, 29, 40, .86);
  --shadow-sheet: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, .02);
  --shadow-pill: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-pop: 0 24px 60px -16px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
  color-scheme: dark;
}
[data-density="compact"] { --pad: 16px; --gap: 12px; --row-h: 42px; --top-h: 62px; }

/* ============ Base ============ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-optical-sizing: auto; font: 14px/1.5 var(--sans); color: var(--ink); background: var(--aur-base); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 15px; } h3 { font-size: 14px; }
p { margin: 0; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.serif, .serif-lead { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; }
kbd { font: 500 11px var(--sans); padding: 2px 7px; border-radius: var(--r-pill); background: var(--tint); color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 14px; height: 14px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--card); padding: 6px 10px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.link { color: var(--violet); font-weight: 500; }
.link:hover { text-decoration: underline; }
.hidden, [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ============ Frame ============ */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; background:
  radial-gradient(40% 50% at 6% 10%, var(--aur-1), transparent 70%),
  radial-gradient(45% 45% at 18% 55%, var(--aur-3), transparent 70%),
  radial-gradient(40% 40% at 4% 95%, var(--aur-4), transparent 70%),
  radial-gradient(50% 50% at 30% 30%, var(--aur-2), transparent 70%),
  radial-gradient(40% 40% at 95% 0%, var(--aur-5), transparent 70%),
  radial-gradient(50% 50% at 100% 100%, var(--aur-2), transparent 70%),
  var(--aur-base); }
/* overflow: clip, not only hidden: a jump to "#part" in the address (or scrollIntoView) also scrolls a hidden-overflow box, which pushed
   the top bar out of the window and left an empty band below (owner 2026-12-03, Procedures › Try it). A clipped box cannot scroll. */
.shell { position: relative; z-index: 1; display: flex; height: 100vh; height: 100dvh; overflow: hidden; overflow: clip; }

/* sidebar sits right on the aurora */
.sidebar { width: var(--side-w); flex: none; display: flex; flex-direction: column; padding: 14px 12px 12px; transition: width .2s var(--ease); z-index: 30; min-height: 0; }
.brand { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 8px; flex: none; margin-bottom: 8px; }
.brand-mark { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
/* TATV.si by Dewin — wordmark (type-built, follows the theme) and compact mark for the icon rail */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; white-space: nowrap; }
.wm-line { display: inline-flex; align-items: baseline; font: 800 27px/1 var(--sans); letter-spacing: .01em; }
.wm-tatv { color: var(--ink); }
.wm-dot { display: inline-block; width: .24em; height: .24em; border-radius: 50%; margin: 0 .07em 0 .05em; background: var(--tatv-dot); box-shadow: 0 0 10px rgba(255, 120, 220, .35); }
.wm-si { color: var(--tatv-si); }
.wm-by { margin-top: 5px; font: 500 11.5px/1 var(--sans); color: var(--muted); letter-spacing: .01em; }
.tatv-mark { display: none; position: relative; width: 38px; height: 38px; border-radius: 12px; background: #06060f; color: #fff; font: 800 21px/1 var(--sans); place-items: center; flex: none; box-shadow: 0 6px 14px -8px rgba(6, 6, 15, .7); }
.tatv-mark i { position: absolute; right: 5px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--tatv-dot); }
.nav-collapsed .tatv-mark { display: none; }
[data-theme="dark"] .tatv-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
/* folded menu: the whole TATV.si wordmark, smaller, without "by Dewin" */
.nav-collapsed .brand-mark { justify-content: center; }
.nav-collapsed .wm-line { font-size: 15.5px; letter-spacing: 0; }
.nav-collapsed .wm-by { display: none; }
.brand-lg .wm-line { font-size: 40px; }
.brand-lg .wm-by { font-size: 13px; color: rgba(18, 18, 22, .7); margin-top: 7px; }
.brand-lg .wm-tatv { color: #06060f; }
.brand-lg .wm-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 2px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-heading { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 12px 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
button.nav-heading { cursor: pointer; } button.nav-heading:hover { color: var(--ink); }
.fold-ic { width: 14px; height: 14px; transition: transform .15s; }
.nav-group.folded ul { display: none; }
.nav-group.folded .fold-ic { transform: rotate(-90deg); }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--r-ctl); color: var(--ink-2); font-weight: 500; white-space: nowrap; width: 100%; border: 0; background: none; cursor: pointer; text-align: left; transition: background .15s, box-shadow .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .45); color: var(--ink); }
[data-theme="dark"] .nav-link:hover { background: rgba(255, 255, 255, .06); }
.nav-link.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-pill); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.tiles .nav-link { min-height: 52px; padding: 6px 10px; gap: 11px; }
.tile-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px var(--line); }
[data-theme="dark"] .tile-ic { background: rgba(255, 255, 255, .05); }
.tile-ic .ic { width: 17px; height: 17px; }
.tiles .nav-label b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.tiles .nav-label small { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.rail-expand { display: none; }

/* frosted user card */
.user-wrap { flex: none; margin-top: 10px; }
.user-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px 9px 9px; border-radius: 18px; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow-pill); }
.user-card:hover { background: var(--glass-strong); }
.user-text { flex: 1; min-width: 0; }
.user-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text small { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chev { color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--lav-soft); color: var(--lav-ink); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }

/* collapsed rail */
.nav-collapsed .sidebar { width: var(--side-w-min); padding-left: 10px; padding-right: 10px; }
.nav-collapsed .brand { justify-content: center; padding: 0; }
.nav-collapsed .brand-mark { flex: none; }
.nav-collapsed .user-text, .nav-collapsed .user-chev, .nav-collapsed .brand .nav-toggle { display: none; }
.nav-collapsed .nav-heading { justify-content: center; padding: 0 0 6px; min-height: 8px; }
.nav-collapsed .nav-group + .nav-group { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.nav-collapsed .nav-link { justify-content: center; padding: 0; }
.nav-collapsed .tiles .nav-link { min-height: 46px; padding: 0; }
.nav-collapsed .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
.nav-collapsed .rail-expand { display: flex; }
.nav-collapsed .user-card { padding: 4px; justify-content: center; background: transparent; box-shadow: none; backdrop-filter: none; }

/* tooltips: rail items and icon buttons (not on touch) */
[data-tip] { position: relative; }
.nav-collapsed .sidebar [data-tip]:hover::after, .icon-btn[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; white-space: nowrap; z-index: 70; pointer-events: none;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 10px; box-shadow: var(--shadow-pop); }
.nav-collapsed .sidebar [data-tip]:hover::after { left: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
.icon-btn[data-tip]:hover::after { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.sidebar .icon-btn[data-tip]:hover::after { left: calc(100% + 10px); top: 50%; transform: translateY(-50%); }

/* the sheet */
.main { flex: 1; min-width: 0; display: flex; padding: var(--frame) var(--frame) var(--frame) 0; }
.sheet { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--sheet); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet); overflow: hidden; overflow: clip; min-height: 0; }
.topbar { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 var(--pad); }
.page-title { min-width: 0; flex: 0 0 auto; max-width: 48%; display: flex; align-items: center; gap: 8px; }
.page-title h1 { font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { display: flex; align-items: baseline; gap: 8px; color: var(--muted); white-space: nowrap; min-width: 0; font-size: 13px; font-weight: 500; }
.crumbs a:hover { color: var(--ink); }
.crumbs .ic { width: 13px; height: 13px; color: var(--faint); align-self: center; }
.crumbs h1, .crumbs b { margin: 0; color: var(--ink); font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.crumb-back { display: none; }
.crumbs .crumb { display: inline-flex; align-items: center; min-height: 32px; }
.search-trigger { margin: 0 auto; flex: 0 1 520px; min-width: 44px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 7px 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--faint); cursor: pointer; text-align: left; box-shadow: var(--shadow-card); transition: box-shadow .15s; }
.search-trigger:hover { box-shadow: var(--shadow-pill); color: var(--muted); }
.search-trigger .ic { color: var(--ink); }
.search-trigger kbd { padding: 5px 10px; }
.st-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.content { flex: 1; overflow: auto; padding: 4px var(--pad) var(--fab-clear); outline: none; }
.content.flush { padding: 0; overflow: hidden; overflow: clip; min-height: 0; display: flex; border-top: 1px solid var(--line); }  /* min-height 0: a clipped flex child must still shrink to the sheet, so the page inside scrolls */

.icon-btn { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; transition: background .15s; }
.icon-btn:hover { background: var(--tint); color: var(--ink); }
.icon-btn.on { background: var(--ink); color: var(--paper); }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .55); }
.pip { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--sev-critical); border: 2px solid var(--sheet); }
.site-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); cursor: pointer; font-weight: 500; color: var(--ink); }
.site-btn:hover { box-shadow: var(--shadow-pill); }
.site-btn .ic { color: var(--muted); }
.health { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.ok { background: #7cc520; box-shadow: 0 0 0 4px var(--lime-soft); }
.dot.warn { background: var(--sev-medium); } .dot.bad { background: var(--sev-critical); }
button.health { border: 0; background: none; font: inherit; cursor: pointer; border-radius: var(--r-pill); }
button.health:hover { background: var(--tint); color: var(--ink); }
.health-lead { padding: 0 10px 8px; color: var(--ink); }
.health-item { align-items: flex-start; } .health-item .dot { margin-top: 7px; }
.health-item b { font-weight: 500; display: block; } .health-item small { display: block; margin-top: 2px; color: var(--muted); }
div.health-item { cursor: default; } div.health-item:hover { background: none; }
.only-mobile { display: none; }

/* pop-ups: glass */
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 8px; display: none; z-index: 60; }
.pop.open { display: block; animation: pop-in .16s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.pop-up { top: auto; bottom: calc(100% + 10px); left: 0; right: auto; width: 270px; }
.nav-collapsed .pop-up { left: calc(100% + 10px); bottom: 0; }
.pop-wide { width: 380px; }
.pop-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pop-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 12px; color: var(--ink); }
.pop-item:hover { background: var(--tint); }
.pop-item:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.pop-item .ic { color: var(--muted); }
.pop-item.on { font-weight: 600; }
.pop-item .tick { margin-left: auto; color: var(--on-lime); background: var(--lime); border-radius: 50%; padding: 2px; width: 18px; height: 18px; }
.pop-sep { height: 1px; background: var(--line); margin: 6px 6px; }
.pop-user { display: flex; gap: 12px; align-items: center; padding: 10px; }
.pop-user b { display: block; } .pop-user small { display: block; font-size: 12px; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 14px; }
.note:hover { background: var(--tint); }
.note .dot { margin-top: 7px; }
.note b { font-weight: 500; } .note small { display: block; margin-top: 2px; }
.sev-dot-critical { background: var(--sev-critical); } .sev-dot-high { background: var(--sev-high); }
.sev-dot-medium { background: var(--sev-medium); } .sev-dot-low { background: var(--sev-low); } .sev-dot-info { background: var(--sev-info); }
/* the bell's notices are small forms (open = mark read, then the alert); app/alerts.py */
.note-form { margin: 0; }
button.note { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.note.unread b { font-weight: 600; }
.note-empty { padding: 10px; margin: 0; font-size: 13px; }
.note-all { display: flex; justify-content: flex-end; padding: 6px 4px 2px; }
/* the bell list scrolls inside the popover, which ends above the floating TATV Ask button (laptop screens are short) */
#bellPop.open { display: flex; flex-direction: column; max-height: calc(100vh - var(--top-h) - 110px); max-height: calc(100dvh - var(--top-h) - 110px); }
#bellPop .pop-title, #bellPop .note-all { flex: none; }
#bellList { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
a.tl { display: block; color: inherit; } a.tl:hover b { text-decoration: underline; }
.side-panel .list-row .hp-rail { width: 4px; align-self: stretch; border-radius: var(--r-pill); flex: none; }
.list-row.fresh, .tl.fresh { animation: al-fresh 2.6s ease-out; }
@keyframes al-fresh { 0% { background: var(--lav-soft); } 100% { background: transparent; } }
[data-theme="dark"] .when-light, [data-theme="light"] .when-dark, :root:not([data-theme]) .when-dark { display: none; }

/* ============ Components ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--tint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: 0 6px 16px -8px rgba(18, 18, 22, .6); }
.btn.primary:hover { background: var(--ink-2); }
.btn.danger { color: var(--danger-text); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--tint); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.sq { width: 40px; padding: 0; }
.btn.sm.sq { width: 34px; }
.btn .ic { width: 16px; height: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px; }
.card-h h2 { flex: 1; font-size: 15px; font-weight: 600; }
.card-b { padding: 4px 20px 20px; }
.card-b.flush { padding: 0 8px 8px; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: var(--gap); }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -.02em; line-height: 1.1; }
.page-head p { margin-top: 2px; color: var(--muted); font-size: 15px; }

.grid { display: grid; gap: var(--gap); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-grid { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); align-items: start; }

.kpi { padding: 18px 20px; display: flex; gap: 14px; align-items: center; transition: box-shadow .15s, transform .15s; }
a.kpi:hover { box-shadow: var(--shadow-pill); transform: translateY(-1px); }
.kpi-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--tint); color: var(--ink); flex: none; }
.kpi-ic.bad { background: var(--rose-soft); color: var(--rose-ink); }
.kpi-ic.ok { background: var(--lime-soft); color: var(--lime-ink); }
.kpi-ic.warn { background: var(--peach-soft); color: var(--peach-ink); }
.kpi b { display: block; font-family: var(--serif); font-weight: 400; font-size: 31px; line-height: 1; letter-spacing: -.02em; }
.kpi small { font-size: 13px; display: block; margin-top: 4px; }
.kpi .delta { font-size: 12px; font-weight: 600; }
.up { color: var(--ok-text); } .down { color: var(--danger-text); }

.tabs { display: flex; gap: 4px; margin-bottom: var(--gap); overflow-x: auto; scrollbar-width: none; padding: 4px; background: var(--tint); border-radius: var(--r-pill); width: fit-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 8px; padding: 7px 14px; color: var(--muted); font-weight: 500; border-radius: var(--r-pill); white-space: nowrap; cursor: pointer; border: 0; background: none; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); background: var(--card); box-shadow: var(--shadow-pill); }
.count { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); background: var(--tint-2); color: var(--muted); }
.tab.on .count, .btn .count { background: var(--ink); color: var(--paper); }

.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--tint); gap: 2px; flex: none; }
.seg a, .seg button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--r-pill); color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg a:focus-visible, .seg button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; } /* all: unset above removed the focus ring */
.seg .on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-pill); }
.seg .ic { width: 15px; height: 15px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; background: var(--tint); color: var(--ink-2); white-space: nowrap; }
a.chip, button.chip { border: 1px solid var(--line-2); background: var(--card); height: 34px; padding: 0 15px; cursor: pointer; font-size: 13px; }
a.chip:hover, button.chip:hover { background: var(--tint); }
a.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.st-live, .st-online, .st-running { background: var(--lime-soft); color: var(--lime-ink); }
.st-trial, .st-waiting, .st-degraded, .st-changeover, .st-acknowledged { background: var(--peach-soft); color: var(--peach-ink); }
.st-draft, .st-new { background: var(--lav-soft); color: var(--lav-ink); }
.st-offline, .st-stopped { background: var(--rose-soft); color: var(--rose-ink); }
.st-resolved, .st-paused { background: var(--tint); color: var(--muted); }
.st-live::before, .st-running::before, .st-online::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7cc520; }
.sev { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.sev::before { content: ""; width: 9px; height: 9px; border-radius: 3px; }
.sev-critical::before { background: var(--sev-critical); } .sev-critical { color: var(--danger-text); }
.sev-high::before { background: var(--sev-high); }
.sev-medium::before { background: var(--sev-medium); }
.sev-low::before { background: var(--sev-low); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--gap); }
.toolbar .spacer { flex: 1; }
.field-search { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--card); min-width: 240px; color: var(--faint); }
.field-search:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--tint); }
.field-search .ic { color: var(--ink-2); }
.field-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--ink); }

table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 11px 16px; background: var(--tint); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl th:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.tbl th:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.tbl td { padding: 0 16px; height: var(--row-h); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--tint); }
.tbl .name { font-weight: 500; }
.tbl-wrap { overflow: auto; padding: 8px; }
.thumb { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: #1c1b24; color: #fff; vertical-align: middle; margin-right: 10px; flex: none; }
.thumb .ic { width: 16px; height: 16px; }
.cell { display: flex; align-items: center; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-ctl); }
a.list-row:hover { background: var(--tint); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-row small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; }

.bar { height: 8px; border-radius: var(--r-pill); background: var(--tint); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ink); }
.bar.ok > i { background: linear-gradient(90deg, #8be86f, #c4f25a); }
.bar.warn > i { background: linear-gradient(90deg, #ffc15a, #ffe25a); }
.bar.bad > i { background: linear-gradient(90deg, #ff7a8a, #ff86da); }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; color: var(--ink); }
/* an empty state stacks icon, text, buttons and notes: the base p has no margin, so give each block air (screens set
   their own spacing on top: these rules weigh one class); a long button wraps inside a narrow card instead of leaving it */
.empty > * + :where(p, div, form, ul, small, .btn) { margin-top: 10px; }
.empty > :where(.ic) + * { margin-top: 8px; }
.empty .btn { max-width: 100%; white-space: normal; height: auto; min-height: 40px; padding-block: 8px; line-height: 1.3; text-align: center; }

/* the one bright moment: spectrum hero */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 26px 28px; background: var(--spectrum); color: #121216; min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; box-shadow: 0 20px 40px -24px rgba(120, 60, 200, .5); isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 80% at 0% 100%, rgba(255, 255, 255, .55), transparent 60%), radial-gradient(40% 60% at 100% 0%, rgba(255, 255, 255, .35), transparent 70%); }
.hero .spark { position: absolute; right: 7%; top: 50%; transform: translateY(-50%); width: 170px; height: 170px; z-index: -1; filter: drop-shadow(0 0 30px rgba(255, 255, 255, .9)); }
.hero-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .55); backdrop-filter: blur(10px); font-size: 13px; font-weight: 500; width: fit-content; }
.hero-chip .rnd { width: 26px; height: 26px; border-radius: 50%; background: #121216; color: #fff; display: grid; place-items: center; margin-right: -4px; border: 2px solid rgba(255, 255, 255, .7); }
.hero-chip .rnd .ic { width: 13px; height: 13px; }
.hero h2 { font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1.04; letter-spacing: -.025em; max-width: 640px; }
.hero h2 em { font-style: italic; }
.hero p { font-size: 15px; font-weight: 500; opacity: .85; margin-top: 8px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { border-color: transparent; background: rgba(255, 255, 255, .7); color: #121216; backdrop-filter: blur(8px); }
.hero .btn:hover { background: #fff; }
.hero .btn.primary { background: #121216; color: #fff; }

/* ============ Camera stand-ins ============ */
.scene { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(180deg, #3b4656 0%, #2a323e 55%, #1d232c 100%); }
.scene.s1 { background: linear-gradient(180deg, #4a4f45 0%, #33372f 60%, #23261f 100%); }
.scene.s2 { background: linear-gradient(180deg, #3d4a55 0%, #2b3640 60%, #1c242b 100%); }
.scene.s3 { background: linear-gradient(180deg, #554b40 0%, #3a332b 60%, #26211b 100%); }
.scene.s4 { background: linear-gradient(180deg, #3f4651 0%, #30363f 60%, #1f242b 100%); }
.scene.s5 { background: linear-gradient(180deg, #48505e 0%, #343a46 60%, #22262e 100%); }
.scene-floor { position: absolute; left: -10%; right: -10%; bottom: -30%; height: 70%; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 60px), linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.25)); transform: perspective(300px) rotateX(55deg); }
.scene-obj { position: absolute; background: rgba(255,255,255,.12); border-radius: 3px; }
.o1 { left: 12%; bottom: 22%; width: 18%; height: 34%; }
.o2 { left: 52%; bottom: 26%; width: 7%; height: 26%; border-radius: 40% 40% 4px 4px; background: rgba(255, 220, 160, .22); }
.o3 { right: 8%; bottom: 18%; width: 22%; height: 22%; }
.s1 .o1 { left: 30%; width: 26%; } .s2 .o2 { left: 22%; } .s3 .o3 { right: 30%; height: 30%; } .s4 .o1 { height: 48%; } .s5 .o2 { left: 70%; }
.scene-box { position: absolute; left: 47%; bottom: 22%; width: 16%; height: 40%; border: 2px solid var(--alert-red); border-radius: 6px; }
.scene-box span { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 4px); max-width: 520%; overflow: hidden; text-overflow: ellipsis; background: var(--alert-red); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.scene.off { background: repeating-linear-gradient(45deg, #1b1f26 0 10px, #20252d 10px 20px); }
.scene.off .scene-floor, .scene.off .scene-obj { display: none; }
.scene-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #8b93a1; font-weight: 500; }

/* ============ Home ============ */
.hello { margin-bottom: var(--gap); }
.ask-inline { display: flex; align-items: center; gap: 12px; width: 100%; height: 54px; padding: 0 8px 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-card); cursor: text; color: var(--faint); font-size: 15px; }
.ask-inline > .ic { color: var(--violet); }
.ask-inline:hover { box-shadow: var(--shadow-pill); }
.ask-inline .send { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.mini-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mini-wall a { border-radius: 16px; overflow: hidden; position: relative; display: block; }
.mini-wall .cap { position: absolute; left: 8px; bottom: 8px; right: 8px; padding: 5px 10px; font-size: 12px; font-weight: 500; color: #fff; background: rgba(18, 18, 22, .45); backdrop-filter: blur(8px); border-radius: var(--r-pill); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.line-row { display: grid; grid-template-columns: 64px 104px 1fr 48px; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-ctl); }
.line-row:hover { background: var(--tint); }
.line-row > b:last-child { font-family: var(--serif); font-weight: 400; font-size: 20px; text-align: right; }
.timeline { position: relative; padding: 4px 20px 18px 44px; }
.timeline::before { content: ""; position: absolute; left: 27px; top: 12px; bottom: 26px; width: 1.5px; background: var(--line-2); }
.tl { position: relative; padding: 8px 0; }
.tl b { font-weight: 500; }
.tl::before { content: ""; position: absolute; left: -22px; top: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); }
.tl.bad::before { border-color: var(--sev-critical); background: var(--rose-soft); }
.tl.ok::before { border-color: #7cc520; background: var(--lime); }
.tl.warn::before { border-color: var(--sev-medium); background: var(--peach-soft); }
.tl small { display: block; font-size: 12.5px; }

/* ============ Live ============ */
.live-wrap { display: flex; flex: 1; min-width: 0; min-height: 0; }
.live-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.live-bar { display: flex; align-items: center; gap: 10px; padding: 12px var(--pad); flex-wrap: wrap; }
.live-bar .spacer { flex: 1; }
.live-bar .chips { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.live-bar .chips::-webkit-scrollbar { display: none; }
.wall { flex: 1; overflow: auto; padding: 4px var(--pad) var(--pad); display: grid; gap: 14px; align-content: start; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-auto-rows: max-content; }
.wall[data-grid="1"] { grid-template-columns: 1fr; }
.wall[data-grid="2"] { grid-template-columns: repeat(2, 1fr); }
.wall[data-grid="3"] { grid-template-columns: repeat(3, 1fr); }
.wall[data-grid="4"] { grid-template-columns: repeat(4, 1fr); }
.tile { position: relative; display: block; border-radius: 18px; overflow: hidden; background: #000; box-shadow: var(--shadow-card); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -16px rgba(40, 20, 90, .45); }
.tile.has-alert { box-shadow: 0 0 0 2px var(--alert-red), 0 12px 26px -14px rgba(217, 45, 58, .6); }
.tile-top { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; align-items: center; gap: 8px; color: #fff; font-size: 12.5px; font-weight: 500; }
.tile-top .grow { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(18, 18, 22, .45); backdrop-filter: blur(8px); width: fit-content; flex: 0 1 auto; }
.tile-top > span:last-child { margin-left: auto; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .18); backdrop-filter: blur(8px); white-space: nowrap; }
.tile-top .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9be15d; box-shadow: 0 0 0 3px rgba(155, 225, 93, .3); flex: none; }
.tile.off .live-dot { background: #ff5a6a; box-shadow: 0 0 0 3px rgba(255, 90, 106, .3); } .tile.deg .live-dot { background: #ffc15a; }
.tile-acts { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-acts { opacity: 1; }
.tile-acts span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .85); color: #121216; }
.tile-acts .ic { width: 15px; height: 15px; }
.side-panel { width: 330px; flex: none; border-left: 1px solid var(--line); background: var(--sheet); display: flex; flex-direction: column; min-height: 0; }
.side-panel header { display: flex; align-items: center; gap: 8px; padding: 16px 18px 10px; }
.side-panel header h2 { flex: 1; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.side-panel .body { overflow: auto; flex: 1; padding: 0 8px 8px; }
.live-wrap.panel-closed .side-panel { display: none; }
body.focus .sidebar, body.focus .topbar, body.focus .ask-fab { display: none; }
body.focus .main { padding: 0; } body.focus .sheet { border-radius: 0; }
.focus-exit { display: none; }
body.focus .focus-exit { display: inline-flex; }

.cam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.player { border-radius: var(--r-card); overflow: hidden; background: #000; position: relative; box-shadow: var(--shadow-card); }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #121216; color: #d8d7e0; font-size: 12.5px; }
.player-bar .ic { width: 16px; height: 16px; }
.scrub { flex: 1; height: 26px; position: relative; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: #2c2b36; }
.scrub i { position: absolute; top: 7px; width: 4px; height: 12px; border-radius: 2px; background: #ff5a6a; }
.scrub::after { content: ""; position: absolute; right: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--lime); }

/* ============ Alerts ============ */
.split { display: flex; flex: 1; min-height: 0; min-width: 0; }
.split-list { width: 420px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.split-list .tabs { margin: 14px 14px 0; }
.split-list .filters { display: flex; gap: 8px; padding: 12px 14px; }
.split-list .filters .field-search { flex: 1; min-width: 0; }
.split-scroll { overflow: auto; flex: 1; padding: 0 8px 8px; }
.alert-row { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; padding: 12px 12px 12px 8px; border-radius: 16px; margin-bottom: 2px; }
.alert-row:hover { background: var(--tint); }
.alert-row.on { background: var(--card); box-shadow: var(--shadow-pill); }
.alert-row .rail { border-radius: var(--r-pill); }
.rail.critical { background: var(--sev-critical); } .rail.high { background: var(--sev-high); } .rail.medium { background: var(--sev-medium); } .rail.low { background: var(--sev-low); }
.alert-row .t { font-weight: 600; }
.alert-row small { display: block; margin-top: 2px; font-size: 12.5px; }
.alert-row .meta { text-align: right; display: grid; gap: 5px; justify-items: end; font-size: 12px; color: var(--faint); }
.split-detail { flex: 1; min-width: 0; overflow: auto; padding: var(--pad); position: relative; }
.detail-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--gap); }
.detail-head .grow { flex: 1; min-width: 240px; }
.detail-head h2 { font-family: var(--serif); font-weight: 400; font-size: 31px; line-height: 1.05; letter-spacing: -.02em; margin: 10px 0 4px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: var(--gap); align-items: start; }
.detail-grid .card { overflow: hidden; }
.facts { display: grid; grid-template-columns: 100px 1fr; gap: 10px 12px; padding: 4px 20px 20px; font-size: 13px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 500; }
.why { padding: 4px 20px 20px 38px; display: grid; gap: 8px; margin: 0; }
.sticky-actions { position: sticky; bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px; margin-top: var(--gap); border-radius: 26px; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow-pop); width: fit-content; max-width: 100%; }

/* ============ Ask ============ */
.ask-page { display: flex; flex: 1; min-height: 0; }
.ask-hist { width: 270px; flex: none; border-right: 1px solid var(--line); padding: 14px 10px; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.ask-hist .btn { margin-bottom: 4px; }
.ask-hist .lbl { font-size: 12px; font-weight: 500; color: var(--muted); padding: 14px 10px 4px; }
.ask-hist a { padding: 9px 12px; border-radius: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.ask-hist a:hover { background: var(--tint); }
.ask-hist a.on { background: var(--card); box-shadow: var(--shadow-pill); color: var(--ink); }
.ask-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ask-scroll { flex: 1; overflow: auto; padding: 28px var(--pad); }
.ask-col { max-width: 860px; margin: 0 auto; display: grid; gap: 18px; }
.ask-welcome { text-align: center; padding: 5vh 0 10px; }
.ask-welcome .big-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--spectrum); color: #fff; box-shadow: 0 16px 30px -14px rgba(120, 60, 200, .55); }
.ask-welcome .big-ic .ic { width: 34px; height: 34px; stroke-width: 1.8; filter: drop-shadow(0 0 6px rgba(255,255,255,.8)); }
.ask-welcome h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; letter-spacing: -.025em; line-height: 1; }
.ask-welcome p { color: var(--muted); margin-top: 10px; font-size: 15px; }
.sugg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; text-align: left; }
.sugg { all: unset; box-sizing: border-box; cursor: pointer; display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font-size: 14px; box-shadow: var(--shadow-card); }
.sugg:hover { box-shadow: var(--shadow-pill); border-color: var(--line-2); }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .who { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ink); color: var(--paper); }
.msg .who .ic { width: 16px; height: 16px; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bubble { background: var(--ink); color: var(--paper); border-color: var(--ink); border-radius: 20px 20px 6px 20px; white-space: pre-wrap; }
.bubble { padding: 12px 16px; border-radius: 20px 20px 20px 6px; border: 1px solid var(--line); background: var(--card); max-width: 680px; box-shadow: var(--shadow-card); }
.bubble .cites { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.cite { font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--tint); color: var(--ink-2); }
.ask-compose { padding: 12px var(--pad) 20px; }
.composer { max-width: 860px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 28px; background: var(--card); box-shadow: var(--shadow-pop); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; min-height: 40px; max-height: 200px; padding: 9px 6px; }
.composer-hint { max-width: 860px; margin: 8px auto 0; font-size: 12px; color: var(--faint); text-align: center; }

.ask-fab { position: fixed; right: 26px; bottom: 26px; z-index: 40; display: flex; align-items: center; gap: 9px; height: 50px; padding: 0 22px 0 8px; border-radius: var(--r-pill); border: 0; background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: 0 16px 34px -12px rgba(18, 18, 22, .6); cursor: pointer; transition: transform .15s; }
.ask-fab:hover { transform: translateY(-2px); }
.ask-fab > .ic { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: var(--paper); }
[data-theme="dark"] .ask-fab > .ic { background: rgba(0, 0, 0, .08); }
.ask-fab[hidden] { display: none; }
body.menu-open .ask-fab { display: none; }
.ask-drawer { position: fixed; right: 26px; bottom: 26px; z-index: 45; width: min(430px, calc(100vw - 32px)); height: min(640px, calc(100vh - 100px)); display: flex; flex-direction: column; background: radial-gradient(90% 40% at 100% 0%, var(--aur-1), transparent 70%), radial-gradient(90% 40% at 0% 0%, var(--aur-3), transparent 70%), var(--sheet); border-radius: 26px; box-shadow: var(--shadow-pop); overflow: hidden; animation: pop-in .2s var(--ease); }
.ask-drawer[hidden] { display: none; }
.ask-drawer header { display: flex; align-items: center; gap: 4px; padding: 12px 10px 10px 14px; }
.ask-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.spark-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); flex: none; }
.spark-dot .ic { width: 16px; height: 16px; }
.ask-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-body { flex: 1; overflow: auto; padding: 8px 16px 14px; display: grid; gap: 12px; align-content: start; }
.ask-hello { display: grid; gap: 8px; }
.ask-hello .serif-lead { font-size: 30px; line-height: 1; color: var(--ink); }
.ask-hello p { color: var(--muted); margin-bottom: 4px; }
.ask-input { display: flex; gap: 6px; align-items: center; margin: 0 12px 12px; padding: 6px; border-radius: var(--r-pill); background: var(--card); box-shadow: var(--shadow-card); }
.ask-input input { flex: 1; height: 38px; border: 0; padding: 0 6px; background: transparent; outline: 0; min-width: 0; }
.ask-input .btn.sq { border-radius: 50%; }

/* ============ Insights · automations · studio ============ */
.dash-card { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.dash-card:hover { box-shadow: var(--shadow-pill); transform: translateY(-2px); }
.dash-thumb { height: 120px; margin: 8px 8px 0; border-radius: 16px; background: var(--tint); padding: 16px; display: flex; align-items: flex-end; gap: 6px; }
.dash-thumb i { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--ink); opacity: .85; }
.dash-thumb i:nth-child(even) { background: var(--spectrum); background-size: 800% 100%; opacity: 1; }
.dash-meta { padding: 14px 16px 16px; display: flex; gap: 12px; align-items: flex-start; }
.dash-meta .grow { flex: 1; min-width: 0; }
.dash-meta b { font-weight: 600; }
.dash-meta small { display: block; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding: 10px 20px 0; }
.chart-card { display: flex; flex-direction: column; }
.chart-card .chart { flex: 1; min-height: 170px; height: auto; padding-bottom: 18px; }
.chart .col .v { font-size: 11px; color: var(--muted); font-weight: 500; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; font-size: 11.5px; color: var(--muted); }
.chart .col i { width: 100%; max-width: 38px; background: var(--ink); border-radius: 10px 10px 4px 4px; min-height: 4px; }
.chart .col i.bad { background: linear-gradient(180deg, #ff86da, #ff7a8a); }
.create-hero { padding: 26px; display: grid; gap: 14px; }
.create-hero h2 { font-family: var(--serif); font-weight: 400; font-size: 32px !important; letter-spacing: -.02em; line-height: 1.05; }
.create-hero textarea { width: 100%; min-height: 96px; resize: none; padding: 16px 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .85); outline: 0; font-size: 15px; color: #121216; }
.create-hero textarea:focus { background: #fff; }
.tpl { padding: 16px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; text-align: left; transition: box-shadow .15s, transform .15s; }
.tpl:hover { box-shadow: var(--shadow-pill); transform: translateY(-1px); }
.tpl .kpi-ic { width: 40px; height: 40px; }
.tpl b { font-weight: 600; }
.tpl small { display: block; margin-top: 2px; }
.steps { display: flex; gap: 8px; margin-bottom: var(--gap); flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding: 5px 15px 5px 5px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--line); font-weight: 500; color: var(--muted); font-size: 13px; }
.step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); font-size: 12px; color: var(--ink-2); }
.step.on { color: var(--ink); } .step.on b { background: var(--lime); color: var(--on-lime); }
.step.done b { background: var(--lime-soft); color: var(--lime-ink); }
h3.section { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.02em; margin: 26px 0 12px; }

/* ============ Settings ============ */
.settings-wrap { display: flex; flex: 1; min-height: 0; }
.set-nav { width: 256px; flex: none; border-right: 1px solid var(--line); overflow: auto; padding: 14px 10px; scrollbar-width: thin; }
.set-nav .lbl { display: flex; align-items: center; gap: 8px; padding: 16px 12px 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
.set-nav .lbl .ic { width: 14px; height: 14px; }
.set-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 34px; border-radius: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-nav a:first-child { padding-left: 12px; font-weight: 500; }
.set-nav a:hover { background: var(--tint); color: var(--ink); }
.set-nav a.on { background: var(--card); box-shadow: var(--shadow-pill); color: var(--ink); font-weight: 500; }
.set-main { flex: 1; overflow: auto; padding: var(--pad) calc(var(--pad) + 6px); min-width: 0; }
.set-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.set-hero .grow { flex: 1; min-width: 240px; }
.set-hero h2 { font-family: var(--serif); font-weight: 400; font-size: 31px; letter-spacing: -.02em; line-height: 1.05; }
.set-hero p { color: var(--muted); margin-top: 4px; font-size: 15px; }
.set-hero .field-search { width: 420px; max-width: 100%; flex: 1 1 320px; height: 46px; }
.set-hero .grow + .field-search { flex: 0 1 420px; }
@media (max-width: 1100px) { .set-hero .grow + .field-search { flex: 1 1 100%; width: 100%; } }
.set-group { margin-bottom: 30px; }
.set-group-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.set-group-h .kpi-ic { width: 38px; height: 38px; border-radius: 12px; }
.set-group-h h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.015em; line-height: 1.1; }
.set-group-h small { display: block; }
.set-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.set-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow-card); transition: box-shadow .15s, transform .15s; }
.set-card:hover { box-shadow: var(--shadow-pill); transform: translateY(-1px); }
.set-card > .ic { width: 36px; height: 36px; padding: 9px; border-radius: 11px; background: var(--tint); color: var(--ink); }
.set-card .grow { flex: 1; min-width: 0; }
.set-card b { font-weight: 600; display: block; }
.set-card small { display: block; margin-top: 2px; font-size: 12.5px; }
.set-card .stat { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--tint); padding: 3px 10px; border-radius: var(--r-pill); }
.set-card .stat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7cc520; }
.set-card .stat.idle::before { background: var(--faint); }
.form { display: grid; gap: 18px; max-width: 780px; }
.form-sec { padding: 22px; }
.form-sec h3, .form-sec .sec-title { font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -.015em; margin-bottom: 2px; }
.form-sec > p { color: var(--muted); margin-bottom: 14px; }
details.form-sec summary { font-family: var(--serif); font-size: 22px; }
.frow { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.frow:first-of-type { border-top: 0; }
.frow label b { display: block; font-weight: 500; } .frow label small { display: block; font-size: 12.5px; }
.input, select.input { height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--card); outline: 0; width: 100%; max-width: 400px; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--tint); }
.switch { width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--tint-2); position: relative; cursor: pointer; border: 0; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--lime); } .switch.on::after { left: 21px; }
.savebar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 8px; padding: 10px; border-radius: var(--r-pill); background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow-pop); }

/* ============ Search palette, toast ============ */
.palette { position: fixed; inset: 0; z-index: 80; background: rgba(30, 20, 60, .22); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette[hidden] { display: none; }
.palette-box { width: min(640px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: 24px; box-shadow: var(--shadow-pop); overflow: hidden; animation: pop-in .16s var(--ease); }
.palette-in { display: flex; flex-shrink: 0; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--line); color: var(--ink); }
.palette-in input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 17px; color: var(--ink); }
.palette-list { list-style: none; margin: 0; padding: 8px; overflow: auto; }
.palette-list .grp { padding: 10px 12px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.palette-list a .ic { color: var(--muted); }
.palette-list a small { margin-left: auto; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-list a.sel { background: var(--card); box-shadow: var(--shadow-pill); }
.palette-list a.sel .ic { color: var(--ink); }
.palette-foot { flex-shrink: 0; display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 90; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: var(--r-pill); font-weight: 500; box-shadow: var(--shadow-pop); transition: all .2s var(--ease); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.has-action-bar .toast { bottom: 110px; }  /* above the alert's action bar, never over its buttons */

/* ============ Sign-in and licence (no shell: a centred card on the aurora) ============ */
.auth { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 16px; }
.auth-card { width: min(440px, 100%); background: var(--sheet); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet); padding: 40px 40px 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card.wide { width: min(560px, 100%); }
.auth-logo { display: flex; justify-content: flex-start; margin-bottom: 6px; }
.auth-logo .wm-line { font-size: 34px; }
.auth-head h1 { font-family: var(--serif); font-weight: 400; font-size: 38px; letter-spacing: -.02em; line-height: 1.05; }
.auth-head p { margin-top: 8px; font-size: 15px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form > label:not(.drop):not(.check) { font-weight: 500; font-size: 13px; margin-top: 6px; }
.auth-form .input { max-width: none; height: 48px; padding: 0 16px; font-size: 16px; }
.auth-form .btn { margin-top: 10px; }
.btn.wide { width: 100%; height: 48px; }
.auth-help { font-size: 13px; }
.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 14px; }
.auth-links form { margin: 0; }
.link-btn { all: unset; cursor: pointer; color: var(--muted); font-weight: 500; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
.auth-foot { color: var(--muted); font-size: 12.5px; }
.auth-test { align-self: flex-start; }
.st-warn { background: var(--peach-soft); color: var(--peach-ink); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-weight: 500; line-height: 1.45; }
.notice .ic { margin-top: 1px; }
.notice.ok { background: var(--lime-soft); color: var(--lime-ink); }
.notice.error { background: var(--rose-soft); color: var(--rose-ink); }
.notice.warn { background: var(--peach-soft); color: var(--peach-ink); }
.code-input { font: 600 22px/1 var(--mono) !important; letter-spacing: .25em; text-align: center; }
.input[aria-invalid="true"] { border-color: var(--danger-text); }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 22px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--r-card); background: var(--card); cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--tint); border-color: var(--violet); }
.drop.has-file { border-style: solid; border-color: var(--ok); }
.drop:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }
.drop-ic { width: 28px; height: 28px; color: var(--muted); }
.drop b { font-weight: 600; font-size: 15px; word-break: break-all; }
.drop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.enrol-steps { margin: 0; padding-left: 20px; display: grid; gap: 18px; }
.enrol-steps li { padding-left: 4px; }
.enrol-steps li::marker { font-weight: 600; }
.qr { margin-top: 10px; width: 180px; padding: 8px; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.setup-key { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; font: 600 15px/1 var(--mono); user-select: all; }
.setup-key span { padding: 8px 9px; border-radius: 10px; background: var(--tint); }
/* Keys and codes: no letter/digit mix-ups — slashed zero, and digits in colour (base32 keys hold only A–Z and 2–7) */
.setup-key, .recovery-codes, .code-input, .setup-code { font-variant-numeric: slashed-zero; font-feature-settings: "zero" 1; }
.setup-key .dg, .recovery-codes .dg { font-style: normal; color: var(--violet); }
.key-hint { margin-top: 8px; font-size: 12.5px; }
.field-help { font-size: 12.5px; margin-top: 2px; }
.field-help code { font: 500 12px/1.4 var(--mono); padding: 1px 5px; border-radius: 6px; background: var(--tint); }
.setup-code { font: 600 17px/1 var(--mono) !important; letter-spacing: .08em; }
.rk-words { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; border-radius: 16px; background: var(--tint); counter-reset: none; }
.rk-words li { display: flex; align-items: baseline; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--card); min-width: 0; }
.rk-words .rk-n { flex: none; min-width: 18px; font: 500 11.5px/1 var(--mono); color: var(--muted); text-align: right; }
.rk-words b { font: 600 14.5px/1.3 var(--mono); overflow-wrap: normal; word-break: keep-all; white-space: nowrap; }
.rk-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 12px 12px 16px; margin-bottom: var(--gap); border-radius: var(--r-card); background: var(--peach-soft); color: var(--peach-ink); }
.rk-banner p { flex: 1 1 220px; margin: 0; font-weight: 500; }
.rk-banner-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card); flex: none; }
.rk-banner .icon-btn { color: inherit; }
.recovery-codes { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border-radius: 16px; background: var(--tint); font: 600 15px/1.4 var(--mono); text-align: center; user-select: all; }
.terms-text { max-height: 260px; overflow: auto; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.terms-text h2 { font-size: 14px; margin: 8px 0 4px; } .terms-text h2:first-child { margin-top: 0; }
.terms-text .pre { white-space: pre-wrap; color: var(--ink-2); }
.terms-text .md { color: var(--ink-2); } .terms-text .md p, .terms-text .md ul { margin: 0 0 8px; } .terms-text .md ul { padding-left: 20px; } .terms-text .md h3, .terms-text .md h4, .terms-text .md h5, .terms-text .md h6 { font-size: 13px; margin: 8px 0 4px; color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; min-height: 44px; padding-top: 4px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.mono-id { font-family: var(--mono); font-size: 13.5px; word-break: break-all; }
.stack-form { display: grid; gap: 8px; max-width: 420px; }
.nt-form .nt-row { grid-template-columns: 1fr auto; cursor: pointer; }
.nt-form .nt-check { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.nt-form .btn-row { margin-top: 10px; }
.stack-form label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; }
.stack-form .btn-row { margin-top: 8px; }
.pop-form { margin: 0; }
.form-sec .notice { margin-bottom: 12px; }
.form > .notice { margin: 0; }
.acct-form { max-width: none; }  /* My account uses the page's full width, as every page does */
/* My account: the recovery-codes fold, the note under it and the phone button keep air from what sits above them */
.acct-form .sub-form { margin-top: 12px; }
.acct-form .sub-form > summary { cursor: pointer; font-weight: 500; }
.acct-form .sub-form[open] > * + * { margin-top: 10px; }
.acct-form .sub-form + p, .acct-form .nt-phone { margin-top: 12px; }
@media (max-width: 767px) { .acct-form .head-desc .mono-id { display: block; overflow-wrap: anywhere; } }  /* a long user ID on its own line */
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
@media (max-width: 600px) {
  .auth { justify-content: flex-start; padding: 0; gap: 0; background: var(--sheet); }
  .auth-card, .auth-card.wide { width: 100%; flex: 1 0 auto; border-radius: 0; box-shadow: none; padding: 28px 20px 24px; }
  .auth-foot { padding-top: 8px; }
  .auth-head h1 { font-size: 32px; }
  .auth-foot { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .recovery-codes { grid-template-columns: 1fr 1fr; font-size: 14px; }
  .rk-words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 601px) and (max-width: 760px) { .rk-words { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (hover: none), (pointer: coarse) {
  .link-btn, .auth-links a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ============ Shared helpers (audit fixes) ============ */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-desc { display: flex; gap: 14px; align-items: center; }
.head-desc p { color: var(--muted); font-size: 15px; }
.who-name { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -.02em; line-height: 1.1; }
.head-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.time { flex: none; min-width: 56px; text-align: right; color: var(--muted); font-size: 12.5px; }
.list-row small.time { overflow: visible; text-overflow: clip; }  /* "Sat 28 Nov, 14:46" whole, never "Sat 28 …" */
.hint { color: var(--muted); margin-top: 12px; font-size: 13px; }
.alert-dot { background: var(--alert-red); }
.avatar.sm { width: 34px; height: 34px; font-size: 11px; margin-right: 10px; }
.pb-btn { all: unset; box-sizing: border-box; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: inherit; }
.pb-btn:hover { background: rgba(255, 255, 255, .12); }
.pb-btn:focus-visible { outline: 2px solid var(--lime); }
ol.steps { list-style: none; padding: 0; margin: 0 0 var(--gap); }
.line-row.reason-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 44px; }
.reason-row b { text-align: right; }
.frow .seg, .frow .btn, .frow .chip { justify-self: start; }
.frow .lbl b { display: block; font-weight: 500; } .frow .lbl small { display: block; font-size: 12.5px; }
details.form-sec > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 32px; cursor: pointer; font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -.015em; }
details.form-sec > summary::-webkit-details-marker { display: none; }
details.form-sec > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 6px 0 0; transition: transform .15s; }
details.form-sec[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.form-sec[open] > summary { margin-bottom: 10px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a88' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.mini-wall .cap .cap-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ask-hist .hist { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; min-height: 38px; padding: 8px 12px; border-radius: 12px; color: var(--ink-2); }
.ask-hist .hist:hover { background: var(--tint); }
.ask-hist .hist.on { background: var(--card); box-shadow: var(--shadow-pill); color: var(--ink); }
.ask-hist .hist:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.ask-hist .hist span, .ask-hist a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list a .pl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list a { scroll-margin: 8px; }
/* rows that scroll sideways: keep items whole and fade the edge that has more */
.chips > *, .tabs > *, .seg > * { flex-shrink: 0; }
.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; }
/* Live toolbar: area chips take the room that is left and drop to their own row when it is too little */
.live-bar .chips { flex: 1 1 320px; }
.live-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* scroll areas leave room for the floating TATV Ask button */
.wall, .split-scroll, .set-main, .side-panel .body, .split-detail { padding-bottom: var(--fab-clear); }
.sticky-actions { margin-right: 76px; }
/* the folded menu keeps its names for screen readers */
.nav-collapsed .nav-label, .nav-collapsed .nav-heading span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); padding-bottom: 22px; }
@media (max-height: 860px) and (min-width: 768px) {
  .tiles .nav-label small { display: none; }
  .tiles .nav-link { min-height: 44px; }
  .nav-group + .nav-group { margin-top: 12px; }
}
/* tables become stacked rows on small screens */
@media (max-width: 700px) {
  .tbl.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl.stack, .tbl.stack tbody { display: block; }
  .tbl.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 14px 8px; border-bottom: 1px solid var(--line); position: relative; }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack td { display: block; height: auto; padding: 0; border: 0; white-space: normal; min-width: 0; }
  .tbl.stack td.name { grid-column: 1 / -1; padding-right: 48px; }
  .tbl.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
  .tbl.stack td.act { position: absolute; top: 10px; right: 4px; }
  .tbl.stack tbody tr:hover td { background: none; }
  .tbl-wrap { padding: 4px 12px; }
}
@media (hover: none) {
  .nav-link:hover { background: transparent; color: var(--ink-2); }
  .nav-link.active:hover { background: var(--card); color: var(--ink); }
  .palette-foot { display: none; }
}

/* ============ Responsive ============
   Desktop > 1100: sidebar (names or rail) + floating sheet.
   Tablet 768–1100: rail always; expanding lays the menu over the page.
   Phone < 768: sheet fills the screen; menu is a drawer on the aurora.
   Touch: bigger targets, nothing hover-only. */
.settings-wrap, .live-wrap, .split, .ask-page, .live-main, .split-detail, .set-main { min-width: 0; }
.back-link, .panel-close { display: none; }

@media (max-width: 1280px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .cam-layout { grid-template-columns: 1fr; }
  .health-text { display: none; }
  .hero h2 { font-size: 40px; }
}
@media (max-width: 1100px) {
  .live-wrap { position: relative; }
  .panel-close { display: inline-grid; }
  .ask-fab span { display: none; } .ask-fab { padding: 0 8px; width: 54px; height: 54px; justify-content: center; }
  .ask-fab > .ic { width: 38px; height: 38px; }
  .sticky-actions { max-width: calc(100% - 66px); }
  .side-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; width: min(340px, 90%); box-shadow: var(--shadow-pop); display: none; }
  .live-wrap.panel-open .side-panel { display: flex; }
  .live-wrap.panel-closed .side-panel { display: none; }
  .split-list { width: 340px; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-nav { display: none; }
  .page-title h1 { font-size: 28px; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  .shell.tablet .sidebar { position: fixed; left: 0; top: 0; bottom: 0; }
  .shell.tablet .main { margin-left: var(--side-w-min); }
  .shell.tablet:not(.nav-collapsed) .sidebar { background: var(--aur-base); background-image: inherit; box-shadow: var(--shadow-pop); }
  .shell.tablet:not(.nav-collapsed) .sidebar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(80% 50% at 0% 0%, var(--aur-1), transparent 70%), radial-gradient(80% 50% at 0% 60%, var(--aur-3), transparent 70%), radial-gradient(80% 40% at 50% 100%, var(--aur-4), transparent 70%), var(--aur-base); }
}
@media (max-width: 900px) {
  .st-text, .search-trigger kbd, .site-name, .health-text { display: none; }
  .health { padding: 0 12px; }
  .search-trigger { flex: none; width: 42px; height: 42px; padding: 0; justify-content: center; margin-left: auto; border: 0; background: none; box-shadow: none; }
  .site-btn { padding: 0 10px; }
  .split-list { width: 100%; border-right: 0; flex: 1; }
  .split[data-picked] .split-list { display: none; }
  .split:not([data-picked]) .split-detail { display: none; }
  .back-link { display: inline-flex; margin-bottom: 10px; }
  .ask-hist { display: none; }
  .frow { grid-template-columns: 1fr; gap: 6px; }
  .wall[data-grid="3"], .wall[data-grid="4"] { grid-template-columns: repeat(2, 1fr); }
  .live-bar .chips { order: 10; flex: 1 1 100%; }
  .grid-seg [data-grid="3"], .grid-seg [data-grid="4"] { display: none; }
  .live-bar .seg[aria-label="Grid size"] { margin-left: auto; }
  .hero { min-height: 0; } .hero .spark { width: 120px; height: 120px; right: 4%; }
  .hero h2 { font-size: 36px; }
  .detail-head h2 { font-size: 27px; }
}
@media (max-width: 767px) {
  :root { --frame: 0px; --top-h: 62px; }
  .only-mobile { display: inline-grid; }
  .main { padding: 0; }
  .sheet { border-radius: 0; box-shadow: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); transition: transform .22s var(--ease); width: min(var(--side-w), 84vw) !important; padding: 14px 12px 12px !important; box-shadow: var(--shadow-pop); border-radius: 0 26px 26px 0; isolation: isolate; overflow: hidden; }
  .sidebar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(80% 40% at 0% 0%, var(--aur-1), transparent 70%), radial-gradient(90% 40% at 0% 55%, var(--aur-3), transparent 70%), radial-gradient(80% 40% at 60% 100%, var(--aur-4), transparent 70%), radial-gradient(70% 40% at 100% 30%, var(--aur-2), transparent 70%), var(--aur-base); }
  .nav-collapsed .sidebar .nav-label, .nav-collapsed .nav-heading span { position: static; width: auto; height: auto; overflow: hidden; clip: auto; }
  .nav-collapsed .user-text, .nav-collapsed .user-chev { display: initial; }
  .nav-collapsed .user-text { display: block; }
  .nav-collapsed .wm-line { font-size: 27px; letter-spacing: .01em; } .nav-collapsed .wm-by { display: block; }
  .nav-collapsed .nav-link { justify-content: flex-start; padding: 0 12px; }
  .nav-collapsed .tiles .nav-link { padding: 6px 10px; }
  .nav-collapsed .nav-heading { justify-content: space-between; padding: 0 12px 6px; }
  .nav-collapsed .nav-group + .nav-group { border-top: 0; padding-top: 0; margin-top: 18px; }
  .nav-collapsed .brand { justify-content: flex-start; padding: 0 4px 0 8px; }
  .nav-collapsed .nav-badge { position: static; }
  .nav-collapsed .user-card { padding: 9px 12px 9px 9px; justify-content: flex-start; background: var(--glass); box-shadow: var(--shadow-pill); }
  .nav-collapsed .pop-up { left: 0; bottom: calc(100% + 10px); }
  .rail-expand, .nav-collapsed .rail-expand { display: none; }
  .shell.mobile-open .sidebar { transform: none; }
  .nav-toggle { display: none !important; }
  .nav-collapsed .sidebar [data-tip]:hover::after { display: none; }
  .page-title h1, .crumbs b { font-size: 23px; }
  .topbar { gap: 6px; padding: 0 10px 0 6px; }
  .page-title { flex: 0 1 auto; }  /* a long title shortens (…) instead of pushing the bell off the screen */
  .top-actions { gap: 2px; }
  /* QA 2026-12-02: a long page title pushed the bell off a 390 px phone; the title gives way (ellipsis) instead */
  .page-title { flex: 1 1 auto; max-width: none; }
  .search-trigger { flex: none; margin: 0; }
  .site-btn > .ic:last-child { display: none; }  /* the chevron: room for the title */
  .content { padding: 0 14px var(--fab-clear); }
  .live-bar { padding: 8px 12px; gap: 8px; }
  .live-bar .seg[aria-label="Grid size"] { display: none; }
  #focusBtn { display: none; }
  .wall { padding: 4px 12px var(--fab-clear); gap: 10px; }
  .sticky-actions { border-radius: 24px; }
}
.scrim { position: fixed; inset: 0; background: rgba(30, 20, 60, .28); backdrop-filter: blur(2px); z-index: 25; }
.scrim[hidden] { display: none; }
@media (max-width: 600px) {
  :root { --pad: 14px; --gap: 12px; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3, .cols-2, .sugg-grid { grid-template-columns: 1fr; }
  .kpi { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; } .kpi-ic { width: 36px; height: 36px; border-radius: 11px; } .kpi b { font-size: 28px; }
  .hero { padding: 20px; border-radius: 22px; } .hero h2 { font-size: 31px; } .hero .spark { width: 64px; height: 64px; top: 16px; right: 16px; transform: none; }
  .hero-actions .btn { flex: 1; }
  .set-hero .field-search { width: 100%; }
  .set-hero h2 { font-size: 30px; }
  .set-cards { grid-template-columns: 1fr; }
  .wall, .wall[data-grid] { grid-template-columns: 1fr; }
  .line-row { grid-template-columns: 56px 1fr 44px; } .line-row .bar { display: none; } .line-row > .chip { display: none; }
  .list-row > .chip, .list-row > small.faint { display: none; }
  .ask-inline { height: 50px; font-size: 14px; }
  .ask-inline span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .page-head .grow { flex-basis: 100%; }
  .page-head h2 { font-size: 26px; }
  .toolbar .field-search { min-width: 0; flex: 1; }
  .ask-drawer { right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  .ask-fab { right: 14px; bottom: 14px; }
  .pop { position: fixed; left: 10px; right: 10px; top: 64px; min-width: 0; width: auto; }
  .pop-up { top: auto; bottom: 84px; }
  .pop-wide { width: auto; }
  .detail-head .grow { min-width: 0; flex-basis: 100%; }
  .detail-head h2 { font-size: 28px; }
  .facts { grid-template-columns: 92px 1fr; }
  .ask-scroll { padding: 16px var(--pad); }
  .ask-welcome { padding-top: 2vh; } .ask-welcome h2 { font-size: 33px; }
  .ask-compose { padding: 8px 10px 12px; }
  .chart { gap: 5px; padding: 10px 12px 0; }
  .create-hero { padding: 18px; } .create-hero h2 { font-size: 28px !important; }
}
@media (hover: none), (pointer: coarse) {
  .btn { height: 44px; } .btn.sm { height: 38px; } .btn.sq { width: 44px; } .btn.sm.sq { width: 38px; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-link { min-height: 46px; }
  a.chip, button.chip { height: 38px; padding: 0 16px; }
  .seg a, .seg button { padding: 9px 14px; }
  .tab { padding: 9px 15px; }
  .pop-item { padding: 12px 10px; }
  .tile-acts { opacity: 1; }
  [data-tip]:hover::after { display: none !important; }
  .tbl td { height: 54px; }
  .input, select.input { height: 46px; font-size: 16px; }
  .field-search { height: 46px; } .field-search input, .ask-input input, .composer textarea, .palette-in input { font-size: 16px; }
  .switch { width: 50px; height: 30px; } .switch::after { width: 24px; height: 24px; } .switch.on::after { left: 23px; }
}

/* ===== Responsive additions from the UI audit ===== */
@media (max-width: 1280px) {
  .sticky-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 767px) {
  .crumbs .crumb, .crumbs .sep { display: none; }
  .crumb-back { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: -6px; border-radius: 50%; color: var(--ink); flex: none; }
  .crumb-back:hover { background: var(--tint); }
  .crumbs { gap: 2px; }
  .savebar { margin-right: 66px; }
  .sticky-actions { margin-right: 66px; }
}
@media (max-width: 600px) {
  .pop-up, .nav-collapsed .pop-up { top: auto; bottom: 84px; left: 10px; right: 10px; }
  .sticky-actions .btn { flex: 1 1 calc(50% - 8px); }
  .savebar .btn { flex: 1; }
}
@media (max-width: 420px) {
  .hero .spark { display: none; }
}
@media (hover: none), (pointer: coarse) {
  .seg a, .seg button { min-height: 44px; padding: 0 15px; }
  a.chip, button.chip { height: 44px; }
  .tab { min-height: 44px; }
  .btn.sm { height: 42px; } .btn.sm.sq { width: 42px; }
  .card-h .link, .crumbs .crumb { display: inline-flex; align-items: center; min-height: 44px; }
  button.nav-heading { min-height: 40px; }
  .switch { position: relative; }
  .switch::before { content: ""; position: absolute; inset: -8px; }
  details.form-sec > summary { min-height: 44px; }
  .set-nav a { min-height: 44px; display: flex; align-items: center; }
  .ask-hist .hist, .ask-hist a { min-height: 44px; }
  .pb-btn { width: 44px; height: 44px; }
  .create-hero textarea { font-size: 16px; }
  .brand-mark { min-height: 44px; }
}
@media (max-width: 600px) {
  .line-row.reason-row { grid-template-columns: minmax(0, 1fr) 44px; }
}
@media (hover: none), (pointer: coarse) {
  #sidebar button.nav-heading { min-height: 40px; }
  .grid-seg a { min-width: 44px; justify-content: center; }
  .crumbs .crumb { padding: 0 6px; margin: 0 -6px; }
}
.crumb-back .ic { width: 20px !important; height: 20px !important; color: var(--ink) !important; }
/* sticky bars measure their offset inside the scroller's padding, so pages that end in one keep normal padding;
   the bar itself stays clear of the TATV Ask button with its right margin */
.split-detail:has(.sticky-actions), .set-main:has(.savebar) { padding-bottom: var(--pad); }
@media (max-width: 1280px) { .sticky-actions { width: auto; } }
@media (max-width: 767px) {
  .crumbs a.crumb, .crumbs .sep { display: none !important; }
}
@media (max-width: 600px) {
  .toolbar .spacer { display: none; }
  .toolbar .field-search { flex: 1 1 100%; }
}

/* Home: "Finish setting up" (Quick Setup) */
.setup-banner { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; padding: 12px 12px 12px 16px; margin-bottom: var(--gap); border-radius: var(--r-card); background: var(--lime-soft); color: var(--lime-ink); }
.setup-banner .grow { flex: 1 1 220px; min-width: 0; }
.setup-banner-go { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; }
.setup-banner > .icon-btn { flex: none; align-self: flex-start; color: inherit; }
.setup-banner b { display: block; }
.setup-banner small { display: block; opacity: .85; }
/* Keyboard focus stays visible on controls that reset their look with `all: unset` (it also drops the outline). */
/* (.pop-item, .seg, .link-btn, .pb-btn and .ask-hist .hist keep their own rules next to their look.) */
.nav-heading:focus-visible, .user-card:focus-visible, .sugg:focus-visible, .more-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
/* Screen audit 2026-12-02 (area C): on a tablet, three parent crumbs ("Settings › TATV Teach › Battery line model ›") left
   the page's own title no room at all (it showed as "."). Between phone and laptop only the nearest parent stays. */
@media (min-width: 768px) and (max-width: 1100px) {
  .crumbs a.crumb:not(:last-of-type), .crumbs a.crumb:not(:last-of-type) + .sep { display: none; }
}

/* TATV Ask paused while a model is being taught (static/js/ask-state.js): every Ask control greyed, with the reason */
html[data-ask-paused] .ask-fab { background: var(--line); color: var(--faint); box-shadow: none; cursor: not-allowed; transform: none; }
html[data-ask-paused] .ask-fab > .ic { background: rgba(0, 0, 0, .06); color: var(--faint); }
html[data-ask-paused] [data-open-ask], html[data-ask-paused] .askp-sugg [data-ask], html[data-ask-paused] .ask-list [data-ask],
html[data-ask-paused] .ask-welcome [data-ask], html[data-ask-paused] .ask-hello [data-ask], html[data-ask-paused] a[href*="?ask=1"],
html[data-ask-paused] a[href^="/ask?q="], html[data-ask-paused] [data-ask-control],
html[data-ask-paused] #askSend, html[data-ask-paused] #askMic, html[data-ask-paused] #askPageMic,
html[data-ask-paused] #composerForm button[type=submit] { opacity: .45; filter: grayscale(1); cursor: not-allowed; box-shadow: none; }
html[data-ask-paused] #askText, html[data-ask-paused] #composer { cursor: not-allowed; color: var(--faint); }
html[data-ask-paused] .askp-input, html[data-ask-paused] .composer { opacity: .6; }
.ask-pause-line { margin: 0 0 8px; padding: 9px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; line-height: 1.45; }
