/* Layout: light nav rail | airy cream-mint canvas | agent drawer.
   Visual language follows the Worktail HR dashboard: warm off-white cards with large radii, black
   active pills, light-weight numerals, pastel bars with one orange highlight, black tooltips. */
:root {
  --bg: #eef0e6; --bg-2: #f3f2ea; --surface: #faf9f4; --surface-2: #f2f1e9;
  /* --muted was #86867d (3.4:1 on the cards); #63635b keeps 4.5:1 on the cards and the tinted page background. */
  --ink: #1a1a17; --ink-2: #4b4b45; --muted: #63635b; --title: #1a1a17;
  --line: #e6e4da; --line-2: #eeede5; --grid: #e9e7de; --axis: #d6d4ca; --hatch: #d3d1c6;
  --accent: #e8531a; --accent-ink: #c2410c; --accent-soft: #fde7db;
  --ai: #4f46e5; --ai-violet: #7c3aed; --ai-light: #a5b4fc;
  --pill: #151513; --pill-ink: #ffffff;
  --mint: #cdeacf; --mint-2: #9fd3a8; --blue: #93aef7; --blue-soft: #dde6fd; --peach: #f6c48b;
  --s1: #8fcb98; --s2: #e8531a; --s3: #93aef7; --bar: #cdeacf;
  --good-ink: #2f7d45; --warn-ink: #b4560f; --crit-ink: #c2410c;
  --seq-0: #f1f4ec; --seq-1: #d6edd8; --seq-2: #addbb4; --seq-3: #7ec58a; --seq-4: #4e9e5e;
  --tip-bg: #151513; --tip-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 20, 15, .04);
  --shadow: 0 14px 34px -20px rgba(20, 20, 15, .28);
  --shadow-pop: 0 24px 60px -20px rgba(20, 20, 15, .35);
  --font-ui: "Be Vietnam Pro", system-ui, "Segoe UI", sans-serif;
  --font-display: var(--font-ui);
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
}
/* Light by default (Owner 27/11/2026), whatever the OS setting; dark only when chosen with the theme button. */
:root[data-theme="dark"] {
  --bg: #131311; --bg-2: #1a1a17; --surface: #1d1d1a; --surface-2: #252521;
  --ink: #eeede6; --ink-2: #c3c2b8; --muted: #9a998f; --title: #f4f3ec;
  --line: #2e2d28; --line-2: #262622; --grid: #2a2925; --axis: #3a3933; --hatch: #3d3c36;
  --accent: #f2692f; --accent-ink: #ff8a57; --accent-soft: #3a2116; --pill: #eeede6; --pill-ink: #151513;
  --mint: #2f4a34; --mint-2: #5e9c68; --blue: #8ba4f0; --blue-soft: #263150; --peach: #c98d4d;
  --s1: #6db57a; --s2: #f2692f; --s3: #8ba4f0; --bar: #3f6e47;
  --good-ink: #7cc98a; --warn-ink: #f0a35e; --crit-ink: #ff8a57;
  --seq-0: #1c211c; --seq-1: #2d4a33; --seq-2: #3f6e47; --seq-3: #5e9c68; --seq-4: #9ed3a6;
  --tip-bg: #eeede6; --tip-ink: #151513;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 14px 34px -20px rgba(0, 0, 0, .7); --shadow-pop: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); font: var(--fs-body, 14px)/1.55 var(--font-ui); -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 600px at 0% 0%, color-mix(in srgb, var(--mint) 55%, transparent), transparent 70%),
    radial-gradient(1000px 700px at 100% 100%, color-mix(in srgb, var(--peach) 22%, transparent), transparent 65%), var(--bg);
  background-attachment: fixed;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
/* Icon defaults. Every SVG Plotly draws stays out, not only .main-svg: the 3D scenes draw their hover
   labels in an unclassed SVG, and an inherited stroke here outlined that text into a dark smudge. */
svg:not(.js-plotly-plot svg) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
kbd { font: 500 11px var(--font-mono); padding: 1px 6px; border: 1px solid currentColor; border-radius: 6px; opacity: .6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
/* No transition on the columns: a sliding resize would make every chart re-fit mid-animation. */
/* Shell grid, sidebar modes, spacing and sizes: layout.css. */
.nav, .agent { position: sticky; top: env(safe-area-inset-top, 0px); height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.nav { padding: 24px 14px 18px; gap: 28px; overflow: hidden; z-index: 30; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, var(--mint) 12%); }
/* Middle of the rail: scrolls on its own. The negative margin keeps the active item's accent bar and focus ring
   inside the scroll box instead of clipped by it. */
.nav-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 28px; overflow-y: auto; overscroll-behavior: contain;
  margin: -4px -14px; padding: 4px 14px; scrollbar-width: thin; scrollbar-color: var(--axis) transparent; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
/* NHG logo as in the IDP platform and Master Dashboard: bare, 28px tall, then a thin divider and the app name. */
.logo-plate { display: grid; place-items: center; flex: none; }
.logo-plate img { height: 28px; width: auto; display: block; }
/* Dark theme only: the logo's dark "Nguyen Hoang Group" lettering needs a light backing. */
:root[data-theme="dark"] .logo-plate { padding: 4px 6px; border-radius: 10px; background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; padding-left: 12px; border-left: 1px solid var(--axis); }
.brand-text b { font-weight: 600; font-size: 16px; color: var(--title); letter-spacing: -.02em; white-space: nowrap; }
.brand-text small { font-size: 12px; color: var(--muted); margin-top: 5px; }
.nav-group { display: flex; flex-direction: column; gap: 6px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--muted); margin: 0 12px 8px; letter-spacing: .08em; text-transform: uppercase; }
.nav-group a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 12px; width: 100%;
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px; border: 1px solid transparent; background: none; text-align: left;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-group a[hidden] { display: none; } /* screens without permission (meta.views): display:flex above would show them */
.nav-group .t { min-width: 0; }
.nav-group .t b { font-weight: 600; line-height: 1.35; }
.nav-group a > svg { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--surface-2); stroke-width: 1.6; }
.nav-group a:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.nav-group a[aria-current="page"] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.nav-group a[aria-current="page"]::before { content: ''; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-group a[aria-current="page"] > svg { color: var(--accent-ink); background: var(--accent-soft); }
/* Pages on top, the assistant docked at the bottom of the rail, just above the user. */
.nav-agent { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line); }
/* Primary agent entry: spectrum border + AI orb, so it reads as an action rather than another page. */
.agent-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px 8px 9px; margin-bottom: 4px;
  border: 1.5px solid transparent; border-radius: 16px; font-size: 14px; color: var(--title); text-align: left; box-shadow: var(--shadow-sm);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, #0891b2, #6366f1 55%, #a855f7) border-box;
  transition: box-shadow .2s, transform .2s;
}
.agent-cta:hover { box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .5); }
.agent-cta b { font-weight: 600; }
.agent-cta-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; color: #fff; background: linear-gradient(135deg, var(--ai), var(--ai-violet)); }
.agent-cta-icon svg { width: 18px; height: 18px; }
.agent-cta .go { margin-left: auto; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.agent-cta:hover .go { transform: translateX(3px); color: var(--ink); }
/* Open: tinted fill, arrow turns back to say "click to close". */
.agent-cta[aria-expanded="true"] {
  background: linear-gradient(color-mix(in srgb, var(--ai-light) 16%, var(--surface)), color-mix(in srgb, var(--ai-light) 16%, var(--surface))) padding-box,
    linear-gradient(135deg, #0891b2, #6366f1 55%, #a855f7) border-box;
}
.agent-cta[aria-expanded="true"] .go { transform: rotate(180deg); color: var(--ai); }
.count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; text-align: center; }
.nav-foot { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.me { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.me b { font-size: 13.5px; font-weight: 500; }
.me-btn > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
/* Account button and its menu (a native popover; app.js places it above the button). */
.me-btn { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; padding: 4px; margin: -4px; border: 0; border-radius: 12px; background: none; text-align: left; }
.me-btn:hover, .me-btn:has(+ .me-menu:popover-open) { background: var(--surface); }
.me-menu { inset: auto; margin: 0; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
.me-menu:popover-open { display: flex; flex-direction: column; gap: 2px; }
.me-menu > * { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; text-align: left; }
.me-menu > [hidden] { display: none; }
.me-menu > :hover { background: var(--surface-2); }
.me-menu svg { width: 16px; height: 16px; color: var(--ink-2); }
.me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: color-mix(in srgb, var(--accent-ink) 85%, var(--ink)); font-weight: 700; font-size: 12px; }
.scrim { position: fixed; inset: 0; background: rgba(20, 20, 15, .4); z-index: 25; display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.hero { position: relative; }
/* Wraps: when the filters no longer fit beside the breadcrumb they drop to their own row. */
.hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* Filters stay reachable while scrolling (as in Master Dashboard); see DESIGN.md. The background only shows once
   stuck (.stuck, filters.js): above that the page gradient shows through. Spacing: layout.css. */
.hero-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; border-bottom: 1px solid transparent; transition: background .15s, border-color .15s, box-shadow .15s; }
.hero-top.stuck { background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.hero-kicker { flex: 1 1 160px; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Breadcrumb left, filters right on the top row; the title gets its own row, so the filters stay
   in the same place on every view whatever the title length. */
h1 { font-weight: 300; line-height: 1.1; letter-spacing: -.02em; color: var(--title); }
h1 em { font-style: normal; font-weight: 600; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); flex: none; transition: background .15s, transform .15s; }
.icon-btn:hover { transform: translateY(-1px); }
.menu-btn, .brand .nav-close { display: none; }
.agent-toggle { position: fixed; right: max(24px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; gap: 9px; flex: none; height: 50px; padding: 0 20px 0 15px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--ai-light) 45%, var(--line)); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500;
  box-shadow: 0 6px 24px rgba(30, 27, 75, .12), 0 2px 5px rgba(30, 27, 75, .04); }
.agent-toggle-icon { display: grid; place-items: center; width: 24px; height: 24px; }
.agent-toggle-icon svg { width: 23px; height: 23px; stroke: url(#agent-spectrum); stroke-width: 1.8; }
.agent-toggle[aria-expanded="true"] { background: color-mix(in srgb, var(--ai-light) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ai-light) 70%, var(--line)); }
.filters { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 10px; }
.field { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
/* Filter dropdowns (select.js): pill trigger, one chevron centred in it, flipped while the list is open. */
.sel-btn { display: flex; align-items: center; height: 40px; min-width: 190px; padding: 0 40px 0 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink); text-align: left; }
.sel-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field::after { content: ''; position: absolute; right: 17px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 1.7px solid var(--ink-2); border-bottom: 1.7px solid var(--ink-2); transform: rotate(45deg); pointer-events: none; transition: transform .15s ease-out, margin-top .15s ease-out; }
.field.open::after { margin-top: -1px; transform: rotate(225deg); }
.sel-btn:hover { border-color: var(--axis); }
/* Open reads like a focused input: the user is still "in" the field. */
.sel-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
/* Unit names can be very long: fixed comfortable width, the full name is in the list and the breadcrumb. */
.field-unit .sel-btn { width: clamp(220px, 20vw, 300px); min-width: 0; }

/* The list: portalled to <body>, at least as wide as its button. 16px frame = 4px gap + 12px item radius. */
.sel-pop {
  position: fixed; z-index: 60; display: flex; flex-direction: column; width: max-content; padding: 4px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-pop); color: var(--ink);
  opacity: 0; scale: .95; transform-origin: top left; transition: opacity .1s ease-in, scale .1s ease-in;
}
.sel-pop.up { transform-origin: bottom left; }
.sel-pop[data-open] { opacity: 1; scale: 1; translate: 0; transition: opacity .15s ease-out, scale .15s ease-out, translate .15s ease-out; }
@starting-style { .sel-pop[data-open] { opacity: 0; scale: .95; translate: 0 -4px; } }
.sel-pop.up[data-open] { translate: 0; }
.sel-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; margin: -4px -4px 4px; border-bottom: 1px solid var(--line); color: var(--muted); }
.sel-search[hidden] { display: none; }
.sel-search svg { width: 16px; height: 16px; }
.sel-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); }
.sel-search input::placeholder { color: var(--muted); }
/* 332px shows seven and a half rows: the cut-off row says the list goes on. */
.sel-list { display: flex; flex-direction: column; gap: 4px; max-height: 332px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: thin; scrollbar-color: var(--axis) transparent; scrollbar-gutter: stable; }
.sel-item { flex: none; display: flex; align-items: flex-start; gap: 10px; min-height: 40px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; cursor: pointer; text-wrap: pretty; }
.sel-item[hidden] { display: none; }
.sel-item > span { flex: 1; min-width: 0; }
.sel-item > svg { width: 16px; height: 16px; margin-top: 1px; color: var(--ink); visibility: hidden; }
.sel-item.active { background: var(--surface-2); }
.sel-item[aria-selected="true"] { font-weight: 600; }
.sel-item[aria-selected="true"] > svg { visibility: visible; }
.sel-empty { padding: 16px 12px; text-align: center; font-size: 13.5px; color: var(--muted); }
.link-btn { height: 40px; border: 0; background: none; color: var(--accent-ink); font-weight: 600; padding: 0 6px; white-space: nowrap; }
.reset-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; }
.reset-btn svg { width: 15px; height: 15px; }
.chip-list { display: contents; }
.chip-list:empty + .reset-btn { padding-left: 0; } /* alone on the row: line up with the title */
/* Standard filters: a pill that opens a panel of selects; active ones show as removable chips. */
.filter-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.filter-btn:hover { border-color: var(--axis); }
.filter-btn[aria-expanded="true"] { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.filter-btn svg { width: 16px; height: 16px; }
.fcount { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.fcount[hidden] { display: none; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.filter-chips[hidden] { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft); color: var(--ink); font-size: 12.5px; font-weight: 500; max-width: 100%; }
.chip span { color: var(--ink-2); font-weight: 400; }
.chip svg { width: 14px; height: 14px; color: var(--ink-2); }
.chip:hover svg { color: var(--accent-ink); }
/* Drops down under the sticky bar, over the page (position: layout.css). */
.filter-panel { position: absolute; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); overflow-y: auto; overscroll-behavior: contain; }
.filter-panel[hidden] { display: none; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.fp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.fp-field select { width: 100%; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  font-size: 13.5px; color: var(--ink); text-overflow: ellipsis; }
.fp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.fp-note { flex: 1 1 260px; font-size: 12px; color: var(--muted); }
/* Phone: labels are dropped (the selects say what they filter); reset and theme join the breadcrumb
   row and the two selects share the row below. */
@media (max-width: 640px) {
  .filters { display: contents; }
  .hero-kicker { flex-basis: 0; order: 1; }
  #fMore { order: 2; }
  #themeBtn { order: 3; }
  .hero-top::after { content: ''; order: 4; flex-basis: 100%; margin-bottom: -10px; }
  .field { order: 5; flex: 1 1 140px; }
  .field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sel-btn, .field-unit .sel-btn { width: 100%; min-width: 0; }
}

/* Canvas, KPI row, grid and chart sizes: layout.css. Phones keep room under the last block for the floating
   HR Agent button (layout.css). */
.canvas { outline: none; view-transition-name: canvas; }

/* ---------- KPI tiles ---------- */
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { color: var(--ink-2); font-weight: 500; }
.kpi-go { position: absolute; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); background: var(--surface); text-decoration: none; transition: background .15s; }
.kpi-go:hover { background: var(--pill); color: var(--pill-ink); }
.kpi-go svg { width: 14px; height: 14px; }
.kpi-value { font-weight: 300; letter-spacing: -.02em; line-height: 1.15; color: var(--title); }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: flex-end; gap: 8px; justify-content: space-between; min-height: 34px; }
.kpi-foot > span { font-size: 12px; color: var(--muted); }
.kpi-foot .spark { height: 34px; flex: none; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.delta svg { width: 13px; height: 13px; stroke-width: 2.4; }
.delta.good { color: var(--good-ink); }
.delta.bad { color: var(--crit-ink); }
.delta.flat { color: var(--ink-2); }
.delta-cap { font-size: 12px; color: var(--muted); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; display: flex; flex-direction: column; transition: box-shadow .3s, border-color .3s; }
.card:hover { box-shadow: var(--shadow); }
.card.flash { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-head > div { flex: 1; min-width: 0; }
.card h2 { font-weight: 500; line-height: 1.25; letter-spacing: -.01em; color: var(--title); }
.card-sub { color: var(--muted); margin-top: 3px; }
.tag3d { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: var(--accent-ink); background: var(--accent-soft); vertical-align: 3px; margin-left: 6px; }
.tag3d svg { width: 12px; height: 12px; }
.chart { position: relative; min-width: 0; overflow: hidden; }  /* heights: layout.css */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend-note { font-size: 12px; color: var(--muted); margin-top: -8px; }

/* 3D blocks: preset bar, chart + reading guide */
.viz3d-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg button { height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); border-color: var(--axis); }
.seg button[aria-pressed="true"] { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.viz3d { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@container (min-width: 760px) { .viz3d { grid-template-columns: minmax(0, 1fr) 260px; } }
.guide { align-self: start; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 18px; background: var(--surface-2); font-size: 12.5px; }
.guide-t { font-size: 12px; font-weight: 600; color: var(--ink); }
.guide-ul { margin: 0 0 6px; padding-left: 16px; display: flex; flex-direction: column; gap: 5px; color: var(--ink-2); line-height: 1.45; }
.avg-dot { display: inline-block; width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); margin-right: 4px; }

/* Empty / error states */
.empty-state { align-items: flex-start; padding: 28px; }
.empty-state h2 { font-size: 20px; }
.agent-error { color: var(--crit-ink); background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; }
.dot.off { background: var(--peach); }

/* Value chips: show a number and its reference, never a verdict */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 10px 2px 8px; border-radius: 99px; white-space: nowrap; height: 24px; }
.status svg { width: 13px; height: 13px; stroke-width: 2.2; }
.status.lead { color: var(--accent-ink); background: var(--accent-soft); }
.status.flat { color: var(--ink-2); background: var(--surface-2); }
/* Gap to the overall value next to a table value: up = above average, down = below */
.gap { display: inline-block; min-width: 46px; margin-left: 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; }
.gap.up { color: var(--crit-ink); }
.gap.down { color: var(--good-ink); }

/* Bridge strip & split bar */
.bridge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bridge > div { flex: 1 1 110px; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); }
.bridge b { display: block; font-size: 22px; font-weight: 300; color: var(--title); font-variant-numeric: tabular-nums; }
.bridge span { font-size: 11.5px; color: var(--muted); }
.bridge .op { flex: 0 0 auto; padding: 0; background: none; color: var(--muted); font-weight: 500; font-size: 18px; }
.split { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 3px; }
.split i { display: block; height: 100%; border-radius: 99px; }
.split-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.split-legend b { font-size: 24px; font-weight: 300; color: var(--title); font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; }
/* Long lists (every department): scroll inside the card, header stays visible. */
.table-wrap.scroll { max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.table-wrap.scroll th { position: sticky; top: 0; z-index: 1; }
.table-wrap.scroll td:first-child { white-space: normal; min-width: 160px; line-height: 1.4; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); padding: 9px 10px; white-space: nowrap; }
th:first-child { border-radius: 12px 0 0 12px; } th:last-child { border-radius: 0 12px 12px 0; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
th.r, td.r { text-align: right; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell i { display: block; height: 6px; border-radius: 3px; background: var(--mint-2); }

/* ---------- Agent drawer ---------- */
.agent { width: 392px; min-width: 0; background: var(--surface); border-left: 1px solid var(--line); z-index: 30; }
.agent[hidden] { display: none !important; }
.agent-head { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.agent-head > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.agent-head b { font-size: 16px; font-weight: 600; color: var(--title); }
.agent-head small { color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--s1); margin-right: 6px; vertical-align: 1px; }
/* Context, two rows with their labels in one column: "Đang xem" the screen (ellipsis if too long), "Phạm vi" period,
   unit and the active filters (scrolls sideways, with a fade on the side that has more). Never wraps. */
.agent-ctx { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 8px; padding: 8px 0 8px 14px; border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.ctx-fit { display: flex; gap: 6px; min-width: 0; padding-right: 14px; }
.ctx-fit .ctx-chip { flex: 0 1 auto; min-width: 0; max-width: none; }
.ctx-track { min-width: 0; display: flex; gap: 6px; padding: 2px 14px 2px 2px; overflow-x: auto; scrollbar-width: none; }
.ctx-track::-webkit-scrollbar { display: none; }
.ctx-track:focus-visible { outline: 2px solid var(--ai); outline-offset: -2px; border-radius: 8px; }
.ctx-track.fade-r { mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.ctx-track.fade-l { mask-image: linear-gradient(to right, transparent, #000 24px); }
.ctx-track.fade-l.fade-r { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 32px), transparent); }
.ctx-chip { flex: none; max-width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-weight: 500; font-size: 11.5px; line-height: 18px; }
/* An active filter: same accent tint as the filter chips on the page. */
.ctx-chip.is-filter { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, var(--line)); }
.agent-log { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 14px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.msg { flex-shrink: 0; min-width: 0; max-width: 100%; font-size: 13.5px; line-height: 1.65; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 90%; background: color-mix(in srgb, var(--blue-soft) 75%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line)); padding: 11px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.msg.bot { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.msg.bot p b, .msg.bot li b { font-weight: 600; color: var(--title); }
.msg.bot p, .msg.bot ul, .msg.bot ol { margin: 0; }
.msg.bot ul, .msg.bot ol { padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.msg.bot a { color: color-mix(in srgb, var(--ai-light) 45%, var(--ink)); text-decoration: underline; text-underline-offset: 2px; }
.msg.bot code { font-family: var(--font-mono); font-size: 12px; }
.markdown-body { min-width: 0; max-width: 100%; }
.markdown-body > * + * { margin-top: 12px !important; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 14px; font-weight: 600; line-height: 1.5; letter-spacing: 0; color: var(--title); text-wrap: wrap; }
.markdown-body h1 { font-size: 17px; }
.markdown-body h2 { font-size: 15px; }
.markdown-body strong { font-weight: 600; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.markdown-body blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--ai-light); background: var(--surface-2); color: var(--ink-2); }
.markdown-body :not(pre) > code { background: var(--surface-2); padding: 2px 4px; border-radius: 4px; }
.markdown-body pre { max-width: 100%; overflow-x: auto; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; white-space: pre; overflow-wrap: normal; }
.markdown-body li > ul, .markdown-body li > ol { margin-top: 4px; }
.md-table { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; overscroll-behavior-x: contain; scrollbar-width: thin; }
.md-table table { border-collapse: collapse; width: 100%; font-size: 12px; line-height: 1.55; }
.md-table th, .md-table td { min-width: 105px; max-width: 240px; padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); white-space: normal; overflow-wrap: anywhere; }
.md-table tr:last-child td { border-bottom: 0; }
.agent-image { display: block; width: 100%; min-width: 0; max-width: 100%; margin-block: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 11px; overflow-wrap: anywhere; }
.agent-image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 380px; object-fit: contain; border-radius: 7px; background: var(--surface); }
.agent-image img[hidden], .image-fallback[hidden] { display: none; }
.image-caption { display: block; margin-top: 6px; }
.image-fallback { display: block; padding: 20px 10px; color: var(--muted); }
.md-table th { color: var(--muted); font-weight: 600; background: var(--surface-2); }
a.src { text-decoration: none; }
.trace { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font-size: 12px; }
.trace summary { cursor: pointer; padding: 7px 10px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; list-style: none; }
.trace summary::-webkit-details-marker { display: none; }
.trace summary svg { width: 14px; height: 14px; color: var(--good-ink); }
.trace ol { margin: 0; padding: 0 10px 8px 28px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.trace code, .step-live code { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }
.mini-bars { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.mini-bars .t { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.mb { display: grid; grid-template-columns: minmax(0, 1fr) 90px 48px; gap: 8px; align-items: center; font-size: 12.5px; }
.mb span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb i { display: block; height: 8px; border-radius: 4px; background: var(--mint-2); }
.mb:first-of-type i { background: var(--accent); }
.mb b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sources, .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.src { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px dashed var(--axis); background: none; color: var(--ink-2); }
.src:hover { border-color: var(--accent); color: var(--accent-ink); }
.src svg { width: 13px; height: 13px; }
.act { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink); transition: background .2s, color .2s; }
.act:hover { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.act svg { width: 15px; height: 15px; }
.sugg { flex: 0 1 auto; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--ink-2); }
.sugg:hover { color: var(--ink); border-color: var(--axis); }
/* Starter questions in the empty chat (as in Master Dashboard): one card per row in the AI tint, so they read as
   the way to begin rather than as fine print. */
.starters { display: grid; gap: 4px; }
.starter { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 30px; padding: 4px 10px; border-radius: 8px; text-align: left;
  border: 1px solid color-mix(in srgb, var(--ai-light) 45%, var(--line)); background: color-mix(in srgb, var(--ai-light) 10%, var(--surface));
  font-size: 12.5px; font-weight: 500; line-height: 1.4; color: var(--ink); transition: border-color .15s, background .15s, box-shadow .15s; }
@media (pointer: coarse) { .starter { min-height: 44px; } }
.starter span { flex: 1; min-width: 0; }
.starter svg { flex: none; width: 13px; height: 13px; color: var(--ai); }
.starter svg:last-child { color: var(--muted); transition: transform .15s, color .15s; }
.starter:hover { border-color: var(--ai); background: color-mix(in srgb, var(--ai-light) 18%, var(--surface)); box-shadow: var(--shadow-sm); }
.starter:hover svg:last-child { color: var(--ai); transform: translateX(3px); }
.composer { padding: 10px 14px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
.composer textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 18px 18px 0 0; border-bottom: 0; padding: 12px 14px; background: var(--surface); font-size: 13.5px; outline: none; }
.composer-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; padding: 4px 6px 6px 14px; background: var(--surface); }
.composer:focus-within textarea, .composer:focus-within .composer-row { border-color: var(--axis); }
.composer-row .send { margin-left: auto; }
.send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--ai), var(--ai-violet)); color: #fff; display: grid; place-items: center; }
.send svg { width: 16px; height: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--pill); color: var(--pill-ink); padding: 10px 18px; border-radius: 99px; font-size: 13px; box-shadow: var(--shadow-pop); z-index: 50; max-width: calc(100% - 32px); }

/* The Agent is fixed to the viewport and never changes the chart grid. */
.app.agent-overlay .agent {
  position: fixed; top: auto; right: max(24px, env(safe-area-inset-right, 0px)); bottom: calc(max(20px, env(safe-area-inset-bottom, 0px)) + 64px);
  height: min(700px, calc(100dvh - max(20px, env(safe-area-inset-bottom, 0px)) - env(safe-area-inset-top, 0px) - 80px));
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-pop);
}
@media (pointer: coarse) { .act, .sugg { min-height: 40px; } }

/* Admin without any dashboard screen: no empty "Phân tích nhân sự" group and no agent (it would refuse). */
/* No screen: hide the dashboard menu and the agent; an admin keeps "Monitor chat Agent" in the account menu. */
.no-views .nav-group[aria-label="Dashboard nhân sự"], .no-views .nav-agent, .no-views ~ .agent-toggle { display: none; }
.act.primary { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.act.danger { color: var(--crit-ink); }
.act:disabled { opacity: .5; pointer-events: none; }
/* "Kết nối AI" dialog (admin.js): status first, the key form on demand, removal apart. */
.ai-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-2); color: var(--ink); box-shadow: var(--shadow-pop); overscroll-behavior: contain; }
.ai-dialog::backdrop { background: rgba(20, 20, 15, .4); }
.ai-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 14px 22px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.ai-dialog-head h2 { font-size: 17px; font-weight: 600; color: var(--title); }
.ai-dialog-body { container-type: inline-size; padding: 16px; }
.ai-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: 100%; align-items: start; }
@container (max-width: 480px) { .ai-facts .f-gw { grid-column: span 2; } }
.ai { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ai-wrap [hidden] { display: none !important; } /* .act and .card set display, which would show a hidden one */
.ai code, .ai .mono { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.ai-facts .url { white-space: nowrap; }
.ai-field input:disabled { opacity: .55; cursor: not-allowed; }
.ai-status { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 22px; }
.ai-medal { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; flex: none; background: var(--surface-2); color: var(--ink-2); }
.ai-medal svg { width: 24px; height: 24px; stroke-width: 1.9; }
.ai-status[data-tone="good"] .ai-medal { background: color-mix(in srgb, var(--good-ink) 12%, var(--surface)); color: var(--good-ink); }
.ai-status[data-tone="warn"] .ai-medal { background: color-mix(in srgb, var(--warn-ink) 13%, var(--surface)); color: var(--warn-ink); }
.ai-status[data-tone="bad"] .ai-medal { background: color-mix(in srgb, var(--crit-ink) 12%, var(--surface)); color: var(--crit-ink); }
.ai-head { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ai-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ai-title { font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -.01em; color: var(--title); }
.ai-status[data-tone="good"] .ai-title b { color: var(--good-ink); font-weight: 600; }
.ai-status[data-tone="warn"] .ai-title b { color: var(--warn-ink); font-weight: 600; }
.ai-status[data-tone="bad"] .ai-title b { color: var(--crit-ink); font-weight: 600; }
.ai-lead { font-size: 13.5px; color: var(--ink-2); text-wrap: pretty; }
.ai-btns { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.ai-wrap .act { height: 40px; padding: 0 18px; font-size: 13px; }
.ai-wrap .act svg { width: 16px; height: 16px; }
.ai-wrap .act:focus-visible { border-radius: 99px; }
.ai-facts { flex-basis: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line-2); }
.ai-facts > div { min-width: 0; }
.ai-facts dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.ai-facts dd { text-wrap: pretty; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.ai-facts dd small { font-weight: 400; color: var(--muted); font-size: 12px; }
.ai-result { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-height: 20px; }
.ai-result svg { width: 16px; height: 16px; }
.ai-result.good { color: var(--good-ink); }
.ai-result.bad { color: var(--crit-ink); }
.ai-result:empty { display: none; }
.ai-form { gap: 18px; }
.ai-form h2, .ai-zone h2 { font-size: 17px; font-weight: 600; color: var(--title); letter-spacing: -.01em; }
.ai-sub { font-size: 13px; color: var(--muted); margin-top: 3px; text-wrap: pretty; }
.ai-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ai-field em { font-style: normal; font-weight: 400; color: var(--muted); }
.ai-input { position: relative; display: flex; }
.ai-field input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--ink); font: 500 14px/1 var(--font-mono); min-width: 0; transition: border-color .15s, box-shadow .15s; }
.ai-field input::placeholder { color: var(--muted); font-weight: 400; }
.ai-field input:hover { border-color: var(--axis); }
.ai-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.ai-input input { padding-right: 52px; }
.ai-eye { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--muted); }
.ai-eye:hover { background: var(--surface-2); color: var(--ink); }
.ai-eye svg { width: 17px; height: 17px; }
.ai-field small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-row .spacer { flex: 1; }
.ai-zone { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ai-zone > div { flex: 1 1 320px; min-width: 0; }
.ai-wrap .act.danger { color: var(--crit-ink); border-color: color-mix(in srgb, var(--crit-ink) 30%, var(--line)); }
.ai-wrap .act.danger:hover { background: var(--crit-ink); color: #fff; border-color: var(--crit-ink); }
.sk { display: block; max-width: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--line-2), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
