/* QBot design system
   Quality department assistant for Microfinish Valves, by AIMatric.
   Brand: Microfinish blue #0B8FD6, navy #123B5D. AIMatric teal #0E6E7C, dark teal #0A4A54. Accent orange #F97316.
   Status colours always travel with a word. Light and dark themes through tokens on :root.
   Sections: 1 tokens, 2 base, 3 shell, 4 components, 5 forms, 6 tables, 7 charts, 8 motion, 9 orb, 10 auth, 11 utilities, 12 print. */

/* ============================================================ 1. tokens */
:root {
  color-scheme: light;
  --blue: #0B8FD6; --blue-600: #0A7CBA; --blue-700: #08669A; --blue-50: #E9F5FC; --blue-100: #D1EAF8; --blue-200: #A5D5F1;
  --navy: #123B5D; --navy-700: #0E2F4A; --navy-50: #E7EDF3;
  --teal: #0E6E7C; --teal-dark: #0A4A54; --teal-50: #E6F3F5; --teal-100: #CBE6EA;
  --orange: #F97316; --orange-50: #FFF1E6; --orange-100: #FFE0C7;
  --green: #16A34A; --green-50: #ECFDF3; --green-100: #D1FAE0; --green-ink: #14532D;
  --yellow: #CA8A04; --yellow-50: #FEFAE6; --yellow-100: #FEF3C7; --yellow-ink: #713F12;
  --red: #DC2626; --red-50: #FEF2F2; --red-100: #FEE2E2; --red-ink: #7F1D1D;
  --grey: #64748B; --grey-50: #F1F5F9; --grey-100: #E2E8F0; --grey-ink: #334155;

  --bg: #F2F6F9; --bg-2: #E9EFF4; --surface: #FFFFFF; --surface-2: #F7FAFC; --surface-3: #EEF3F7;
  --ink: #14202B; --ink-2: #34465A; --muted: #5C6E7E; --faint: #5F7183;
  --line: #DCE4EC; --line-2: #E9EFF4; --line-strong: #C3CFDA;
  --accent: var(--blue); --accent-ink: #FFFFFF; --accent-soft: var(--blue-50); --accent-soft-2: var(--blue-100);
  --focus: rgba(11, 143, 214, .35); --ring: #0A78B4;
  /* solid fills that carry white text: the same in both themes and at least 4.5:1 against white */
  --fill-blue: #0A78B4; --fill-blue-2: #08669A; --fill-green: #15803D; --fill-green-2: #166534; --fill-teal: #0E6E7C; --fill-teal-2: #0A4A54;
  --fill-red: #DC2626; --fill-red-2: #B91C1C; --fill-orange: #C2410C; --fill-yellow: #A16207;
  /* hero panels: brand navy to dark teal in both themes, so white text always reads */
  --hero-a: #123B5D; --hero-b: #0A4A54;
  /* coloured words on plain surfaces and on the matching pale chip */
  --green-text: #15803D; --orange-text: #A84B08; --yellow-text: #A16207;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C6E7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* chart series, fixed order: blue, orange, teal, navy, soft orange, slate */
  --c1: #0B8FD6; --c2: #F97316; --c3: #0E6E7C; --c4: #123B5D; --c5: #FDBA74; --c6: #64748B;
  --chart-grid: var(--line-2); --chart-axis: var(--faint);

  --radius-xs: 6px; --radius-sm: 10px; --radius: 14px; --radius-lg: 20px; --radius-xl: 28px;
  --shadow-xs: 0 1px 2px rgba(18, 59, 93, .06);
  --shadow-sm: 0 1px 2px rgba(18, 59, 93, .05), 0 4px 14px rgba(18, 59, 93, .06);
  --shadow: 0 2px 4px rgba(18, 59, 93, .05), 0 12px 36px rgba(18, 59, 93, .10);
  --shadow-lg: 0 20px 70px rgba(18, 59, 93, .22);
  --glow-blue: 0 0 0 4px var(--focus);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.22, .61, .36, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --fast: 140ms; --base: 260ms; --slow: 520ms;

  --rail-w: 256px; --rail-min: 76px; --top-h: 62px; --page-max: 1360px; --gutter: 32px;
  --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark;
    --blue: #34A6E8; --blue-600: #0B8FD6; --blue-700: #7CC8F2; --blue-50: #0F2A3C; --blue-100: #123850; --blue-200: #1A4C6B;
    --navy: #9DBBD6; --navy-700: #7EA3C4; --navy-50: #15283A;
    --teal: #3CB2C3; --teal-dark: #6FD0DE; --teal-50: #0E2A30; --teal-100: #113A41;
    --orange: #FB923C; --orange-50: #3A2110; --orange-100: #4A2A12;
    --green: #34C06A; --green-50: #0F2A1A; --green-100: #14391F; --green-ink: #BBF7D0;
    --yellow: #E0B23A; --yellow-50: #2E2510; --yellow-100: #3F3312; --yellow-ink: #FDE68A;
    --red: #F26D6D; --red-50: #3A1515; --red-100: #4A1C1C; --red-ink: #FECACA;
    --grey: #94A3B8; --grey-50: #1A2633; --grey-100: #243242; --grey-ink: #CBD5E1;
    --bg: #0B141C; --bg-2: #0F1B25; --surface: #121E29; --surface-2: #172634; --surface-3: #1C2D3C;
    --ink: #E8EEF3; --ink-2: #C7D2DC; --muted: #93A4B3; --faint: #8FA2B3;
    --line: #223544; --line-2: #1B2B38; --line-strong: #2F475A;
    --accent-ink: #06202E; --focus: rgba(52, 166, 232, .4); --ring: #7CC8F2;
    --green-text: #4ADE80; --orange-text: #FDBA74; --yellow-text: #E0B23A;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393A4B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --c1: #4FB4EC; --c2: #FB923C; --c3: #3CB2C3; --c4: #9DBBD6; --c5: #FED7AA; --c6: #94A3B8;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 36px rgba(0, 0, 0, .4);
    --shadow-lg: 0 20px 70px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] { color-scheme: dark;
  --blue: #34A6E8; --blue-600: #0B8FD6; --blue-700: #7CC8F2; --blue-50: #0F2A3C; --blue-100: #123850; --blue-200: #1A4C6B;
  --navy: #9DBBD6; --navy-700: #7EA3C4; --navy-50: #15283A;
  --teal: #3CB2C3; --teal-dark: #6FD0DE; --teal-50: #0E2A30; --teal-100: #113A41;
  --orange: #FB923C; --orange-50: #3A2110; --orange-100: #4A2A12;
  --green: #34C06A; --green-50: #0F2A1A; --green-100: #14391F; --green-ink: #BBF7D0;
  --yellow: #E0B23A; --yellow-50: #2E2510; --yellow-100: #3F3312; --yellow-ink: #FDE68A;
  --red: #F26D6D; --red-50: #3A1515; --red-100: #4A1C1C; --red-ink: #FECACA;
  --grey: #94A3B8; --grey-50: #1A2633; --grey-100: #243242; --grey-ink: #CBD5E1;
  --bg: #0B141C; --bg-2: #0F1B25; --surface: #121E29; --surface-2: #172634; --surface-3: #1C2D3C;
  --ink: #E8EEF3; --ink-2: #C7D2DC; --muted: #93A4B3; --faint: #8FA2B3;
  --line: #223544; --line-2: #1B2B38; --line-strong: #2F475A;
  --accent-ink: #06202E; --focus: rgba(52, 166, 232, .4); --ring: #7CC8F2;
    --green-text: #4ADE80; --orange-text: #FDBA74; --yellow-text: #E0B23A;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393A4B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --c1: #4FB4EC; --c2: #FB923C; --c3: #3CB2C3; --c4: #9DBBD6; --c5: #FED7AA; --c6: #94A3B8;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 36px rgba(0, 0, 0, .4);
  --shadow-lg: 0 20px 70px rgba(0, 0, 0, .6);
}

/* ============================================================ 2. base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0 0 .35em; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; color: var(--ink); }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 .9em; } p:last-child { margin-bottom: 0; }
a { color: var(--blue-700); text-decoration: none; } a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
kbd { background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 120; padding: 10px 16px; border-radius: 10px; background: var(--fill-blue); color: #fff; font-weight: 650; }
.skip-link:focus { top: 10px; text-decoration: none; color: #fff; outline-color: var(--ink); }
::selection { background: var(--blue-100); }
.lead { color: var(--muted); font-size: 16px; margin: 0 0 22px; max-width: 70ch; }
.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; }

/* ============================================================ 3. shell */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--base) var(--ease); }
html[data-rail="collapsed"] .shell { grid-template-columns: var(--rail-min) minmax(0, 1fr); }

.rail { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); z-index: 40; overflow: hidden; }
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px; min-height: 68px; }
.rail-brand .logo-plate { height: 36px; }
.rail-brand .brand-text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.rail-brand .brand-text b { font-size: 17px; letter-spacing: -.02em; color: var(--ink); }
.rail-brand .brand-text small { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.rail-nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1; scrollbar-width: thin; }
.rail-label { padding: 14px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.rail-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; white-space: nowrap; position: relative; transition: background var(--fast), color var(--fast), transform var(--fast); }
.rail-item:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.rail-item:active { transform: scale(.985); }
.rail-item .ico { width: 22px; height: 22px; flex: none; color: var(--muted); transition: color var(--fast); }
.rail-item:hover .ico { color: var(--blue); }
.rail-item.on { background: var(--accent-soft); color: var(--blue-700); font-weight: 650; }
.rail-item.on .ico { color: var(--blue); }
.rail-item.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.rail-item .count { margin-left: auto; background: var(--fill-orange); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.rail-item .view-only { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.rail-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.rail-me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); color: inherit; min-width: 0; }
.rail-me:hover { background: var(--surface-3); text-decoration: none; }
.rail-me b { display: block; font-weight: 600; line-height: 1.2; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-me small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rail-powered { display: flex; align-items: center; gap: 8px; padding: 6px 6px 0; font-size: 11px; color: var(--faint); white-space: nowrap; }
.rail-powered .logo-plate { height: 20px; }
.rail-toggle { position: absolute; right: 8px; top: 51px; z-index: 2; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.rail-toggle:hover { color: var(--blue); }
html[data-rail="collapsed"] .rail .brand-text, html[data-rail="collapsed"] .rail .rail-label, html[data-rail="collapsed"] .rail-item .txt,
html[data-rail="collapsed"] .rail-item .count, html[data-rail="collapsed"] .rail-item .view-only, html[data-rail="collapsed"] .rail-me > div,
html[data-rail="collapsed"] .rail-powered span, html[data-rail="collapsed"] .rail-brand .logo-plate { display: none; }
html[data-rail="collapsed"] .rail-brand { justify-content: center; padding-left: 8px; padding-right: 8px; }
html[data-rail="collapsed"] .rail-item { justify-content: center; padding: 10px; }
html[data-rail="collapsed"] .rail-item::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(-4px); background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--fast), transform var(--fast); z-index: 50; }
html[data-rail="collapsed"] .rail-item:hover::after { opacity: 1; transform: translateY(-50%); }
html[data-rail="collapsed"] .rail-me { justify-content: center; }
html[data-rail="collapsed"] .rail-toggle svg { transform: rotate(180deg); }
.rail-mark { width: 36px; height: 36px; flex: none; display: none; }
html[data-rail="collapsed"] .rail-mark { display: block; }
.rail-mark-dot { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--fill-blue), var(--fill-teal)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -.03em; flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 var(--gutter); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line-2); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--blue-700); text-decoration: none; }
.crumbs .sep { color: var(--faint); } .crumbs .here { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { border: 0; background: none; width: var(--tap); height: var(--tap); border-radius: 12px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; position: relative; transition: background var(--fast), color var(--fast), transform var(--fast); padding: 0; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--fill-orange); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1; }
.cmd-trigger { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; color: var(--muted); cursor: pointer; font-size: 14px; min-width: 230px; transition: border-color var(--fast), box-shadow var(--fast); }
.cmd-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.cmd-trigger kbd { margin-left: auto; }
.cmd-trigger svg { width: 18px; height: 18px; flex: none; }
.menu-btn { display: none; }
.page:focus { outline: none; }
.page { padding: 28px var(--gutter) 96px; max-width: var(--page-max); width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .lead { margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; display: block; }

/* a gutter on the right for the floating orb, so it never sits on a control */
@media (min-width: 961px) { body:has(.orb-float) .page { padding-right: calc(var(--gutter) + 52px); } }
/* mobile shell */
.tabbar { display: none; }
.rail-scrim { position: fixed; inset: 0; background: rgba(8, 20, 30, .5); z-index: 39; opacity: 0; pointer-events: none; transition: opacity var(--base); }
@media (max-width: 960px) {
  .shell, html[data-rail="collapsed"] .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-104%); transition: transform var(--base) var(--ease-out); box-shadow: none; }
  html[data-nav="open"] .rail { transform: none; box-shadow: var(--shadow-lg); }
  html[data-nav="open"] .rail-scrim { opacity: 1; pointer-events: auto; }
  html[data-rail="collapsed"] .rail .brand-text, html[data-rail="collapsed"] .rail .rail-label, html[data-rail="collapsed"] .rail-item .txt, html[data-rail="collapsed"] .rail-item .count, html[data-rail="collapsed"] .rail-item .view-only, html[data-rail="collapsed"] .rail-me > div, html[data-rail="collapsed"] .rail-powered span, html[data-rail="collapsed"] .rail-brand .logo-plate { display: revert; }
  html[data-rail="collapsed"] .rail-item { justify-content: flex-start; padding: 8px 12px; }
  html[data-rail="collapsed"] .rail-item::after { display: none; }
  html[data-rail="collapsed"] .rail-mark { display: none; }
  .rail-toggle { display: none; }
  .menu-btn { display: inline-grid; }
  :root { --gutter: 16px; --top-h: 58px; }
  .cmd-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .cmd-trigger span, .cmd-trigger kbd { display: none; }
  .page { padding-top: 18px; padding-bottom: 110px; }
  h1 { font-size: 24px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; min-height: 50px; justify-content: center; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .on { color: var(--blue-700); } .tabbar .on svg { color: var(--blue); }
  /* Smith sits in the tab bar on a phone or tablet, as the last tab: it covers no content and no toast */
  .tabbar { padding-right: 72px; }
  .orb-float { bottom: calc(6px + env(safe-area-inset-bottom)) !important; right: 8px !important; z-index: 36; width: 60px; flex-direction: column; gap: 1px; color: var(--muted); }
  .orb-float .orb { --orb-size: 38px; }
  .orb-float::after { content: "Smith"; font-size: 11px; font-weight: 600; line-height: 1.2; }
  .orb-float .orb-label { position: absolute; right: 4px; bottom: calc(100% + 8px); }
  .ask-panel { bottom: 76px !important; max-height: calc(100vh - 150px) !important; }
}
@media (max-width: 600px) {
  .btn { white-space: normal; text-align: center; max-width: 100%; }
  .page-head { gap: 10px; } .page-head > * { min-width: 0; max-width: 100%; }
  .page-head .actions > .btn { overflow-wrap: anywhere; }
  .toolbar > *, .toolbar form > * { max-width: 100%; min-width: 0; }
  .toolbar form:not(.demo-toggle) { width: 100%; flex: 1 1 100%; } .toolbar form .input-wrap { flex: 1 1 100%; max-width: none !important; min-width: 0 !important; } .toolbar form .input { flex: 1 1 160px; width: auto; min-width: 0; }
  .toolbar .push { margin-left: 0; flex-wrap: wrap; }
  .btn-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; } .btn-seg .btn { flex: none; white-space: nowrap; }
}
@media (max-width: 480px) { .crumbs > * { display: none; } }

/* ============================================================ 4. components */
/* card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-xs); }
.card.flat { box-shadow: none; } .card.tight { padding: 14px; } .card.hover { transition: transform var(--base) var(--ease), box-shadow var(--base); }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .sub { color: var(--muted); font-size: 13px; display: block; font-weight: 400; }
.card.glass { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.card.accent { border-color: transparent; background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; }
/* Inside a hero panel the text tokens turn light and the buttons turn white, in both themes. */
.card.accent, .stat.hero, .next-card, .erp-health { --ink: #FFFFFF; --ink-2: #EAF2F8; --muted: #D6E4EF; --faint: #CBDBE8; --line: rgba(255, 255, 255, .28); --line-2: rgba(255, 255, 255, .18); --line-strong: rgba(255, 255, 255, .45); }
.card.accent .btn, .next-card .btn, .stat.hero .btn, .erp-health .btn { background: #FFFFFF; color: #123B5D; border-color: transparent; box-shadow: none; }
.card.accent .btn:hover, .next-card .btn:hover, .stat.hero .btn:hover, .erp-health .btn:hover { background: #EAF6FF; color: #123B5D; }
.card.accent .btn.ghost, .next-card .btn.ghost, .stat.hero .btn.ghost, .erp-health .btn.ghost { background: transparent; color: #FFFFFF; border-color: rgba(255, 255, 255, .6); }
.card.accent .btn.ghost:hover, .next-card .btn.ghost:hover, .stat.hero .btn.ghost:hover, .erp-health .btn.ghost:hover { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.card.accent a:not(.btn), .next-card a:not(.btn) { color: #FFFFFF; text-decoration: underline; }
.card.accent .stepper .step { color: #EAF2F8; }
.card.accent .stepper .step .n { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .55); color: #FFFFFF; }
.card.accent .stepper .step::before, .card.accent .stepper .step::after { background: rgba(255, 255, 255, .28); }
.card.soft { background: var(--surface-2); box-shadow: none; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.grid > .card { margin-bottom: 0; }
.grid > * { min-width: 0; }
@media (max-width: 960px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.main-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .grid, .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.stack-sm, .grid.cols-1 { grid-template-columns: minmax(0, 1fr); } }

/* stat */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden; min-width: 0; }
.stat b, .stat .value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat span, .stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .label { display: block; margin-bottom: 6px; }
.stat .delta { font-size: 12px; font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.stat .delta.up { color: var(--green-text); } .stat .delta.down { color: var(--red); } .stat .delta.flat { color: var(--muted); }
.stat .spark { position: absolute; right: 12px; bottom: 10px; width: 90px; height: 34px; opacity: .9; }
.stat .ico { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--blue); display: grid; place-items: center; }
.stat .ico svg { width: 20px; height: 20px; }
.stat .ico ~ .label { padding-right: 46px; }
.stat.tone-green { border-color: var(--green-100); } .stat.tone-green .ico { background: var(--green-50); color: var(--green); }
.stat.tone-yellow { border-color: var(--yellow-100); } .stat.tone-yellow .ico { background: var(--yellow-50); color: var(--yellow); }
.stat.tone-red { border-color: var(--red-100); } .stat.tone-red .ico { background: var(--red-50); color: var(--red); }
.stat.tone-teal .ico { background: var(--teal-50); color: var(--teal); }
.stat a.stretched::after { content: ""; position: absolute; inset: 0; }
.stat.hero { background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%); border: 0; color: #fff; }
.stat.hero b, .stat.hero .value { color: #fff; font-size: 40px; } .stat.hero span, .stat.hero .label { color: #D6E4EF; }
.stat.hero .ico { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
@media (max-width: 600px) { .stat b, .stat .value { font-size: 24px; } .stat { padding: 12px 14px; } .stat .ico { display: none; } .stat .ico ~ .label { padding-right: 0; } }

/* chip and status chip */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; background: var(--accent-soft); color: var(--blue-700); white-space: nowrap; vertical-align: middle; }
.chip.yes, .chip.green { background: var(--green-50); color: var(--green-ink); }
.chip.view, .chip.yellow { background: var(--yellow-50); color: var(--yellow-ink); }
.chip.no, .chip.grey { background: var(--grey-50); color: var(--grey-ink); }
.chip.off, .chip.red { background: var(--red-50); color: var(--red-ink); }
.chip.teal { background: var(--teal-50); color: var(--teal); }
.chip.orange { background: var(--orange-50); color: var(--orange-text); }
.chip.navy { background: var(--navy-50); color: var(--navy); }
.chip.outline { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.chip.lg { font-size: 13px; padding: 4px 12px; }
.chip .d { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip.demo { background: var(--orange-50); color: var(--orange-text); border: 1px dashed var(--orange); }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 650; line-height: 1.5; white-space: nowrap; vertical-align: middle; border: 1px solid transparent; }
.status .d { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.status.green { background: var(--green-50); color: var(--green-ink); border-color: var(--green-100); } .status.green .d { background: var(--green); }
.status.yellow { background: var(--yellow-50); color: var(--yellow-ink); border-color: var(--yellow-100); } .status.yellow .d { background: var(--yellow); }
.status.red { background: var(--red-50); color: var(--red-ink); border-color: var(--red-100); } .status.red .d { background: var(--red); }
.status.grey { background: var(--grey-50); color: var(--grey-ink); border-color: var(--grey-100); } .status.grey .d { background: var(--grey); }
.status.blue { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); } .status.blue .d { background: var(--blue); }
.status.teal { background: var(--teal-50); color: var(--teal-dark); border-color: var(--teal-100); } .status.teal .d { background: var(--teal); }
.status.navy { background: var(--navy-50); color: var(--navy); border-color: var(--line); } .status.navy .d { background: var(--navy); }
.status.orange { background: var(--orange-50); color: var(--orange-text); border-color: var(--orange-100); } .status.orange .d { background: var(--orange); }
.status.live .d { animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 8%, transparent); } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: 12px; background: var(--fill-blue); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; position: relative; transition: background var(--fast), transform var(--fast), box-shadow var(--fast), border-color var(--fast), color var(--fast); box-shadow: 0 1px 2px rgba(8, 102, 154, .2), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn:hover { background: var(--fill-blue-2); color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(11, 143, 214, .28); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-xs); }
.btn.soft { background: var(--accent-soft); color: var(--blue-700); box-shadow: none; }
.btn.soft:hover { background: var(--accent-soft-2); color: var(--blue-700); }
.btn.quiet { background: transparent; color: var(--blue-700); box-shadow: none; }
.btn.quiet:hover { background: var(--surface-3); color: var(--blue-700); }
.btn.success { background: var(--fill-green); } .btn.success:hover { background: var(--fill-green-2); }
.btn.danger { background: var(--fill-red); } .btn.danger:hover { background: var(--fill-red-2); box-shadow: 0 4px 14px rgba(220, 38, 38, .25); }
.btn.danger.ghost { background: var(--surface); color: var(--red); border-color: var(--red-100); } .btn.danger.ghost:hover { background: var(--red-50); color: var(--red); }
.btn.teal { background: var(--fill-teal); } .btn.teal:hover { background: var(--fill-teal-2); }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.large { min-height: 52px; padding: 12px 26px; font-size: 17px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 42px; } .btn.icon.small { width: 34px; }
.btn.pill { border-radius: 999px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.ghost.loading::after, .btn.quiet.loading::after, .btn.soft.loading::after { border-color: var(--line-strong); border-top-color: var(--blue); }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; }
.btn-seg .btn { background: transparent; color: var(--muted); box-shadow: none; min-height: 34px; padding: 4px 12px; font-size: 13.5px; border-radius: 9px; }
.btn-seg .btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
@keyframes spin { to { transform: rotate(360deg); } }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .input, .toolbar .field { margin: 0; width: auto; max-width: 100%; }
.toolbar .input-wrap .input { width: 100%; }
.toolbar form.demo-toggle { display: inline-flex; gap: 10px; width: auto; flex-wrap: nowrap; }
.toolbar .push { margin-left: auto; }

/* empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .art { width: 120px; height: 120px; margin-bottom: 6px; color: var(--blue); }
.empty h3 { margin: 0; color: var(--ink); font-size: 18px; }
.empty p { max-width: 42ch; margin: 0; }
.empty .btn { margin-top: 12px; }
.empty.compact { padding: 22px 16px; } .empty.compact .art { width: 72px; height: 72px; }

/* stepper, the 10 step journey */
.stepper { display: flex; align-items: flex-start; gap: 0; position: relative; margin: 0 0 14px; overflow-x: auto; padding: 8px 0 8px; scrollbar-width: thin; } /* the padding keeps the ring of the active step inside the scroller */
.stepper .step { flex: 1; min-width: 88px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.25; padding: 0 4px; }
.stepper .step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); position: relative; z-index: 1; transition: background var(--base), border-color var(--base), color var(--base), transform var(--base) var(--ease-spring); }
.stepper .step::before, .stepper .step::after { content: ""; position: absolute; top: 16px; height: 3px; background: var(--line); width: 50%; }
.stepper .step::before { left: 0; } .stepper .step::after { right: 0; }
.stepper .step:first-child::before, .stepper .step:last-child::after { display: none; }
.stepper .step.done .n { background: var(--fill-green); border-color: var(--fill-green); color: #fff; }
.stepper .step.done .n svg { width: 16px; height: 16px; }
.stepper .step.done::before, .stepper .step.done::after, .stepper .step.now::before { background: var(--green); }
.stepper .step.now { color: var(--ink); font-weight: 650; }
.stepper .step.now .n { background: var(--fill-blue); border-color: var(--fill-blue); color: #fff; box-shadow: 0 0 0 6px var(--focus); transform: scale(1.08); }
.stepper .step.hold .n { background: var(--fill-yellow); border-color: var(--fill-yellow); color: #fff; }
.stepper .step.hold::before { background: var(--green); }
.stepper .step.blocked .n { background: var(--fill-red); border-color: var(--fill-red); color: #fff; }
.stepper .step.now .n::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--blue); opacity: .5; animation: ring-out 1.8s var(--ease-out) infinite; }
@keyframes ring-out { 0% { transform: scale(.8); opacity: .6; } 100% { transform: scale(1.5); opacity: 0; } }
.stepper.vertical { flex-direction: column; align-items: stretch; overflow: visible; }
.stepper.vertical .step { flex-direction: row; text-align: left; min-width: 0; padding: 6px 0; gap: 12px; align-items: center; }
.stepper.vertical .step::before, .stepper.vertical .step::after { width: 3px; height: 50%; left: 16px; top: auto; }
.stepper.vertical .step::before { top: 0; } .stepper.vertical .step::after { bottom: 0; }
.stepper.vertical .step .n { flex: none; }
/* journey: an animated path drawn across the steps */
.journey { position: relative; }
.journey .path { position: absolute; left: 0; right: 0; top: 0; height: 40px; pointer-events: none; }

/* evidence (View) button */
.view-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 2px 9px 2px 7px; border-radius: 8px; border: 1px solid var(--blue-100); background: var(--blue-50); color: var(--blue-700); font-size: 12.5px; font-weight: 650; cursor: pointer; vertical-align: middle; white-space: nowrap; transition: background var(--fast), transform var(--fast); }
.view-btn:hover { background: var(--blue-100); text-decoration: none; transform: translateY(-1px); }
.view-btn svg { width: 14px; height: 14px; }
.view-btn.page-level { border-style: dashed; }
.view-btn .pg { color: var(--muted); font-weight: 500; }

/* modal (dialog) */
.modal { border: 0; padding: 0; background: transparent; max-width: min(720px, calc(100vw - 32px)); width: 100%; max-height: calc(100vh - 32px); overflow: visible; }
.modal::backdrop { background: rgba(8, 20, 30, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade-in var(--base) both; }
.modal[open] { animation: modal-in var(--slow) var(--ease-out) both; }
.modal.closing { animation: modal-out var(--fast) var(--ease) forwards; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 32px); color: var(--ink); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-body { padding: 4px 20px 20px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.modal.wide { max-width: min(1100px, calc(100vw - 32px)); }
.modal.sheet { max-width: 100vw; width: 100vw; max-height: 100vh; margin: 0; }
.modal.sheet .modal-box { border-radius: 0; height: 100vh; max-height: 100vh; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) { .modal, .modal.wide { max-width: 100%; width: 100%; max-height: 100vh; margin: auto 0 0; } .modal-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; } .modal[open] { animation-name: sheet-in; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 60; transform: translateX(104%); transition: transform var(--slow) var(--ease-out); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer.wide { width: min(760px, 100vw); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); }
.drawer-head h2 { margin: 0; font-size: 17px; flex: 1; }
.drawer-body { padding: 18px; overflow: auto; flex: 1; }
.drawer-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(8, 20, 30, .45); z-index: 59; opacity: 0; pointer-events: none; transition: opacity var(--base); }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.help-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 14px; }
.help-list li .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--blue-700); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* toast */
.toasts { position: fixed; top: calc(var(--top-h) + 10px); right: 14px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; animation: toast-in var(--slow) var(--ease-spring) both; position: relative; overflow: hidden; }
.toast.leaving { animation: toast-out var(--base) var(--ease) forwards; }
.toast .ti { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--blue); }
.toast .ti svg { width: 16px; height: 16px; }
.toast.success .ti { background: var(--green-50); color: var(--green); } .toast.error .ti { background: var(--red-50); color: var(--red); } .toast.warning .ti { background: var(--yellow-50); color: var(--yellow); }
.toast .tx { flex: 1; min-width: 0; } .toast .tx b { display: block; }
.toast .tx small { color: var(--muted); display: block; }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--blue); width: 100%; transform-origin: left; animation: toast-bar linear forwards; }
.toast.success .bar { background: var(--green); } .toast.error .bar { background: var(--red); } .toast.warning .bar { background: var(--yellow); }
.toast .x { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; }
.toast .x:hover { color: var(--ink); background: var(--surface-3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes toast-bar { to { transform: scaleX(0); } }
@media (max-width: 600px) { .toasts { top: auto; bottom: 86px; left: 14px; right: 14px; width: auto; } }
.msg { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); display: flex; gap: 10px; align-items: flex-start; }
.msg.success { background: var(--green-50); color: var(--green-ink); border-color: var(--green-100); }
.msg.error { background: var(--red-50); color: var(--red-ink); border-color: var(--red-100); }
.msg.warning { background: var(--yellow-50); color: var(--yellow-ink); border-color: var(--yellow-100); }
details.msg { display: block; }
.msg svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; min-height: 14px; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--surface) 70%, transparent) 50%, transparent 100%); transform: translateX(-100%); animation: shimmer 1.4s var(--ease) infinite; }
.skeleton.text { height: 14px; margin: 6px 0; } .skeleton.text.short { width: 55%; } .skeleton.title { height: 24px; width: 40%; margin-bottom: 12px; }
.skeleton.block { height: 120px; } .skeleton.circle { border-radius: 50%; width: 40px; height: 40px; } .skeleton.row { height: 44px; margin: 8px 0; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; position: relative; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { border: 0; background: none; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; position: relative; border-radius: 8px 8px 0 0; text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; gap: 8px; }
.tabs .tab:hover { color: var(--ink); background: var(--surface-3); }
.tabs .tab.on { color: var(--blue-700); }
.tabs .tab .count { background: var(--surface-3); color: var(--muted); border-radius: 99px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.tabs .tab.on .count { background: var(--blue-100); color: var(--blue-700); }
.tabs .ink { position: absolute; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); transition: left var(--base) var(--ease), width var(--base) var(--ease); }
.tab-panel[hidden] { display: none; }
.tabs.pills { border: 0; gap: 6px; } .tabs.pills .tab { border-radius: 999px; background: var(--surface-3); min-height: 36px; padding: 6px 14px; } .tabs.pills .tab.on { background: var(--fill-blue); color: #fff; } .tabs.pills .ink { display: none; }

/* file drop */
.file-drop { border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 28px 20px; text-align: center; background: var(--surface-2); color: var(--muted); transition: border-color var(--fast), background var(--fast), transform var(--fast); cursor: pointer; position: relative; }
.file-drop:hover, .file-drop.over { border-color: var(--blue); background: var(--blue-50); color: var(--blue-700); }
.file-drop.over { transform: scale(1.01); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop .art { width: 56px; height: 56px; margin: 0 auto 8px; color: var(--blue); }
.file-drop b { display: block; color: var(--ink); font-size: 16px; }
.file-drop small { display: block; margin-top: 4px; }
.file-drop .picked { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.file-drop .picked span { display: inline-flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.file-drop .picked svg { width: 16px; height: 16px; color: var(--green); }
.file-drop.busy { pointer-events: none; }
.file-drop .progress { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.file-drop .progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width var(--base); }

/* avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-100), var(--teal-100)); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; } .avatar.sm { width: 28px; height: 28px; font-size: 11px; }

/* timeline (automation events) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 16px 0; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue); box-shadow: 0 0 0 3px var(--surface); }
.timeline li.done::before { background: var(--green); border-color: var(--green); }
.timeline li.warn::before { background: var(--yellow); border-color: var(--yellow); }
.timeline li.fail::before { background: var(--red); border-color: var(--red); }
.timeline li.live::before { animation: pulse-dot 1.4s infinite; }
.timeline li b { display: block; } .timeline li small { color: var(--muted); display: block; }
.timeline li time { font-size: 12px; color: var(--faint); }

/* reconciliation bar */
.recon { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--line-2); gap: 2px; }
.recon i { display: block; height: 100%; transform-origin: left; animation: grow-x var(--slow) var(--ease-out) both; }
.recon i.ok { background: var(--green); } .recon i.aod { background: var(--yellow); } .recon i.rework { background: var(--orange); } .recon i.reject { background: var(--red); } .recon i.pending { background: var(--line-strong); }
.recon-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.recon-legend span { display: inline-flex; align-items: center; gap: 6px; } .recon-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* progress ring */
.ring { position: relative; width: 56px; height: 56px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring .track { stroke: var(--line-2); } .ring .bar { stroke: var(--blue); transition: stroke-dashoffset var(--slow) var(--ease-out); }

/* definition list */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; }

/* keyboard command palette */
.palette { border: 0; padding: 0; background: transparent; width: min(640px, calc(100vw - 24px)); max-height: none; margin-top: min(12vh, 110px); }
.palette::backdrop { background: rgba(8, 20, 30, .5); backdrop-filter: blur(4px); }
.palette[open] { animation: modal-in var(--base) var(--ease-out) both; }
.palette-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; color: var(--ink); }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 6px 16px; border-bottom: 1px solid var(--line-2); }
.palette-in svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.palette-in input { flex: 1; border: 0; background: none; font: inherit; font-size: 17px; padding: 12px 0; color: var(--ink); outline: none; min-width: 0; }
.palette-list { max-height: min(60vh, 440px); overflow: auto; padding: 8px; }
.palette-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-size: 14.5px; min-height: var(--tap); }
.palette-item .ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.palette-item .hint { margin-left: auto; font-size: 12px; color: var(--faint); }
.palette-item.on, .palette-item:hover { background: var(--accent-soft); color: var(--blue-700); }
.palette-item.on .ico, .palette-item:hover .ico { color: var(--blue); }
.palette-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.palette-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--faint); }

/* user menu */
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 50; transform-origin: top right; animation: pop-in var(--base) var(--ease-out) both; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 9px; color: var(--ink-2); font-size: 14px; cursor: pointer; min-height: 40px; }
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.menu a svg, .menu button svg { width: 18px; height: 18px; color: var(--muted); }
.menu hr { margin: 6px 0; }
.menu .who { padding: 8px 12px 10px; display: flex; gap: 10px; align-items: center; }
.menu .who b { display: block; font-size: 14px; } .menu .who small { color: var(--muted); font-size: 12px; }
.menu-wrap { position: relative; }
@keyframes pop-in { from { opacity: 0; transform: scale(.95) translateY(-6px); } to { opacity: 1; transform: none; } }

/* ============================================================ 5. forms */
label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }
.input, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=url], select, textarea { width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 11px; font: inherit; font-size: 15px; background: var(--surface); color: var(--ink); margin: 2px 0 14px; min-height: var(--tap); transition: border-color var(--fast), box-shadow var(--fast), background var(--fast); appearance: none; -webkit-appearance: none; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select, select.input { background-image: var(--chevron); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--glow-blue); }
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--blue); margin: 0 8px 0 0; vertical-align: -4px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14.5px; cursor: pointer; min-height: 32px; }
.field { margin-bottom: 14px; } .field .input, .field input, .field select, .field textarea { margin-bottom: 0; }
.field .hint, .help { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.field.error .input, .field.error input, .field.error select, .field.error textarea { border-color: var(--red); }
.errorlist { color: var(--red); font-size: 13.5px; margin: -8px 0 12px; padding-left: 0; list-style: none; }
.errorlist li::before { content: "! "; font-weight: 700; }
.input-wrap { position: relative; } .input-wrap .input, .input-wrap input { padding-left: 40px; }
.input-wrap > svg { position: absolute; left: 13px; top: 15px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.input-wrap .suffix { position: absolute; right: 8px; top: 8px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--line-strong); border: 0; cursor: pointer; transition: background var(--fast); padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform var(--base) var(--ease-spring); }
.switch[aria-checked=true] { background: var(--fill-green); } .switch[aria-checked=true]::after { transform: translateX(18px); }
/* big inspection controls */
.tick-group { display: inline-flex; gap: 8px; }
.tick { width: 56px; height: 56px; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: all var(--fast); }
.tick svg { width: 26px; height: 26px; }
.tick.accept.on { background: var(--fill-green); border-color: var(--fill-green); color: #fff; } .tick.reject.on { background: var(--fill-red); border-color: var(--fill-red); color: #fff; }
.tick:hover { border-color: var(--blue); }
.tick.pop { animation: tick-pop .45s var(--ease-spring); }
@keyframes tick-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

@media (max-width: 600px) { .input, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=url], select, textarea { font-size: 16px !important; } }

/* ============================================================ 6. tables */
.scroll, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card.scroll { padding: 0; } .card.scroll > table { margin: 0; }
.card.scroll > :not(table):not(.table-foot) { margin-left: 20px; margin-right: 20px; }
.card.scroll > :first-child:not(table) { margin-top: 18px; } .card.scroll > :last-child:not(table):not(.table-foot) { margin-bottom: 18px; }
.card.scroll > table th:first-child, .card.scroll > table td:first-child { padding-left: 20px; } .card.scroll > table th:last-child, .card.scroll > table td:last-child { padding-right: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background var(--fast); } tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.ctl { white-space: nowrap; text-align: right; }
tr.row-green td:first-child { box-shadow: inset 4px 0 0 var(--green); } tr.row-yellow td:first-child { box-shadow: inset 4px 0 0 var(--yellow); } tr.row-red td:first-child { box-shadow: inset 4px 0 0 var(--red); } tr.row-grey td:first-child { box-shadow: inset 4px 0 0 var(--line-strong); } tr.row-blue td:first-child { box-shadow: inset 4px 0 0 var(--blue); } tr.row-teal td:first-child { box-shadow: inset 4px 0 0 var(--teal); } tr.row-navy td:first-child { box-shadow: inset 4px 0 0 var(--navy); } tr.row-orange td:first-child { box-shadow: inset 4px 0 0 var(--orange); }
table.compact th, table.compact td { padding: 7px 8px; font-size: 13px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
@media (max-width: 600px) { th, td { padding: 9px 8px; font-size: 13.5px; } }
/* stacked rows on phones: add .stack-sm to the table and data-th to cells */
@media (max-width: 600px) {
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody { display: block; width: 100%; }
  table.stack-sm tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.stack-sm tr:last-child { border-bottom: 0; }
  table.stack-sm td, .card.scroll > table.stack-sm td:first-child, .card.scroll > table.stack-sm td:last-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; border: 0; padding: 4px 16px; min-width: 0; overflow-wrap: anywhere; white-space: normal; text-align: left; }
  table.stack-sm td::before { content: attr(data-th); color: var(--muted); font-size: 12px; min-width: 96px; flex: none; }
  table.stack-sm td:not([data-th])::before, table.stack-sm td[data-th=""]::before { display: none; }
  table.stack-sm td.ctl { justify-content: flex-start; }
}

/* ============================================================ 7. charts */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; }
.chart .label-text { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.chart .legend span { display: inline-flex; align-items: center; gap: 6px; } .chart .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity var(--fast); z-index: 5; }
.chart .tip.show { opacity: 1; }
.chart .tip b { font-weight: 700; } .chart .tip small { opacity: .75; display: block; }
.chart.sm { height: 40px; } .chart.sm svg { height: 100%; }
.chart .big { font-size: 28px; font-weight: 750; fill: var(--ink); letter-spacing: -.02em; }
.chart .sub { font-size: 12px; fill: var(--muted); }
.chart .textalt { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.chart-plain ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.chart-plain li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; color: var(--ink-2); }
.chart-plain li b { font-size: 22px; font-weight: 750; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 28px; }
.chart-plain p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.chart .bullet-lbl { font-size: 11px; fill: var(--muted); }
.chart table.alt { font-size: 12.5px; margin-top: 8px; }

/* ============================================================ 8. motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 70% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-30px, -18px); } }
html.js [data-reveal] { opacity: 0; transform: translateY(14px); }
html.js [data-reveal].is-in { animation: rise var(--slow) var(--ease-out) both; opacity: 1; transform: none; }
html.js [data-reveal="pop"].is-in { animation-name: pop; }
html.js [data-reveal="fade"] { transform: none; } html.js [data-reveal="fade"].is-in { animation-name: fade-in; }
.anim-float { animation: float 5s ease-in-out infinite; }
.pop-in { animation: pop var(--base) var(--ease-spring) both; }
.rise-in { animation: rise var(--slow) var(--ease-out) both; }
.count-up { font-variant-numeric: tabular-nums; }
.hx-indicator, .htmx-indicator { opacity: 0; transition: opacity var(--fast); } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request .btn:not(.ghost) { pointer-events: none; }
.htmx-swapping { opacity: 0; transition: opacity var(--fast); } .htmx-settling { animation: fade-in var(--base) both; }
.topload { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--blue), var(--teal)); z-index: 100; opacity: 0; transition: width var(--base) var(--ease), opacity var(--base); }
.topload.on { opacity: 1; }
::view-transition-old(root) { animation: 160ms var(--ease) both fade-out-vt; }
::view-transition-new(root) { animation: 240ms var(--ease-out) both rise-vt; }
@keyframes fade-out-vt { to { opacity: 0; } }
@keyframes rise-vt { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.marquee-path { stroke-dasharray: 6 8; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
/* ?motion=0 (tools/shot.py --still): every reveal drawn settled, for screenshots in the user manual */
html[data-motion="off"] [data-reveal], html[data-motion="off"] .rise-in, html[data-motion="off"] .pop-in { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation-delay: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important; }
html[data-motion="off"] ::view-transition-group(*), html[data-motion="off"] ::view-transition-old(*), html[data-motion="off"] ::view-transition-new(*) { animation: none !important; }

/* ============================================================ 9. Smith orb */
.orb { --orb-size: 64px; --lvl: 0; position: relative; width: var(--orb-size); height: var(--orb-size); display: grid; place-items: center; cursor: pointer; border: 0; background: none; padding: 0; border-radius: 50%; }
.orb .orb-glow { position: absolute; inset: -22%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--blue) 55%, transparent) 0%, transparent 65%); filter: blur(8px); opacity: .55; transition: opacity var(--base); animation: orb-breathe 4s ease-in-out infinite; }
.orb .orb-core { position: relative; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #BDEBFF 0%, #34A6E8 22%, #0B8FD6 48%, #0E6E7C 85%, #0A4A54 100%); box-shadow: inset -6px -8px 18px rgba(10, 74, 84, .55), inset 6px 6px 14px rgba(255, 255, 255, .35), 0 10px 26px rgba(11, 143, 214, .35); overflow: hidden; transition: transform var(--base) var(--ease-spring); }
.orb .orb-core::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 255, 255, .35) 75%, transparent 90%); opacity: 0; mix-blend-mode: screen; animation: orb-spin 2.2s linear infinite; transition: opacity var(--base); }
.orb .orb-core::after { content: ""; position: absolute; left: 18%; top: 14%; width: 34%; height: 24%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .85), transparent 70%); filter: blur(1px); }
.orb .orb-wave { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; opacity: 0; transition: opacity var(--base); pointer-events: none; }
.orb .orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; pointer-events: none; }
.orb .orb-dots { position: absolute; inset: 0; opacity: 0; transition: opacity var(--base); pointer-events: none; animation: orb-spin 1.6s linear infinite; }
.orb .orb-dots i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px var(--blue); left: calc(50% - 3.5px); top: -4px; }
.orb .orb-dots i:nth-child(2) { transform: rotate(120deg); transform-origin: 3.5px calc(var(--orb-size) / 2 + 4px); } .orb .orb-dots i:nth-child(3) { transform: rotate(240deg); transform-origin: 3.5px calc(var(--orb-size) / 2 + 4px); }
.orb:hover .orb-core { transform: scale(1.06); }
.orb[data-state="idle"] .orb-core { animation: orb-idle 6s ease-in-out infinite; }
.orb[data-state="listening"] .orb-wave { opacity: 1; }
.orb[data-state="listening"] .orb-glow { opacity: calc(.6 + var(--lvl) * .6); background: radial-gradient(circle, color-mix(in srgb, var(--orange) 70%, transparent) 0%, transparent 65%); animation: none; transform: scale(calc(1 + var(--lvl) * .35)); }
.orb[data-state="listening"] .orb-core { background: radial-gradient(circle at 32% 28%, #FFE1C7 0%, #FB923C 25%, #F97316 55%, #C2410C 100%); box-shadow: inset -6px -8px 18px rgba(124, 45, 18, .5), inset 6px 6px 14px rgba(255, 255, 255, .35), 0 10px 26px rgba(249, 115, 22, .4); transform: scale(calc(1 + var(--lvl) * .12)); transition: transform 80ms linear, background var(--base); }
.orb[data-state="thinking"] .orb-core::before { opacity: 1; }
.orb[data-state="thinking"] .orb-dots { opacity: 1; }
.orb[data-state="thinking"] .orb-glow { animation: orb-breathe 1.2s ease-in-out infinite; }
.orb[data-state="speaking"] .orb-ring { animation: orb-ripple 1.4s var(--ease-out) infinite; opacity: 1; }
.orb[data-state="speaking"] .orb-ring.r2 { animation-delay: .45s; } .orb[data-state="speaking"] .orb-ring.r3 { animation-delay: .9s; }
.orb[data-state="speaking"] .orb-core { transform: scale(calc(1 + var(--lvl) * .15)); transition: transform 70ms linear; background: radial-gradient(circle at 32% 28%, #C9F6F9 0%, #3CB2C3 22%, #0E6E7C 55%, #0A4A54 100%); }
.orb[data-state="speaking"] .orb-glow { background: radial-gradient(circle, color-mix(in srgb, var(--teal) 70%, transparent) 0%, transparent 65%); opacity: calc(.5 + var(--lvl) * .7); animation: none; }
.orb[data-state="error"] .orb-core { background: radial-gradient(circle at 32% 28%, #FECACA 0%, #F26D6D 30%, #DC2626 60%, #7F1D1D 100%); }
.orb.lg { --orb-size: 120px; } .orb.xl { --orb-size: 168px; } .orb.sm { --orb-size: 40px; }
.orb-float { position: fixed; right: 22px; bottom: calc(22px + var(--orb-lift, 0px)); z-index: 45; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.orb-float .orb-label { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); opacity: 0; transform: translateX(8px); transition: opacity var(--base), transform var(--base) var(--ease-out); pointer-events: none; white-space: nowrap; }
.orb-float:hover .orb-label, .orb-float.show-label .orb-label { opacity: 1; transform: none; }
.orb-float[data-state]:not([data-state="idle"]) .orb-label { opacity: 1; transform: none; }
@keyframes orb-breathe { 0%, 100% { transform: scale(1); opacity: .5; } 50% { transform: scale(1.12); opacity: .8; } }
@keyframes orb-idle { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.02); } }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
.orb-states { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; }

/* ============================================================ 10. auth pages */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.auth-brand { position: relative; overflow: hidden; background: linear-gradient(160deg, #0F3350 0%, #123B5D 35%, #0A4A54 100%); color: #fff; display: flex; flex-direction: column; padding: 40px 48px; }
.auth-brand::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 500px at 10% 0%, rgba(11, 143, 214, .45), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(14, 110, 124, .6), transparent 60%); }
.auth-brand .mesh { position: absolute; inset: -40px; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(ellipse at 40% 50%, black 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 40% 50%, black 10%, transparent 70%); animation: drift 24s linear infinite alternate; }
.auth-brand > * { position: relative; }
.auth-logos { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.auth-logos .logo-plate { height: 44px; }
.auth-logos .x { color: rgba(255, 255, 255, .55); font-weight: 300; font-size: 22px; }
.auth-hero { margin: auto 0; padding: 36px 0; }
.auth-hero .eyebrow { color: #7CD5FF; }
.auth-hero h1 { font-size: clamp(34px, 4.2vw, 54px); color: #fff; letter-spacing: -.03em; line-height: 1.04; margin-bottom: 14px; }
.auth-hero h1 em { font-style: normal; background: linear-gradient(90deg, #7CD5FF, #5EEAD4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { font-size: 17px; color: rgba(255, 255, 255, .8); max-width: 48ch; }
.auth-scene { margin-top: 28px; width: min(520px, 100%); }
.auth-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.auth-points div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 12px 14px; backdrop-filter: blur(6px); }
.auth-points b { display: block; font-size: 22px; letter-spacing: -.02em; } .auth-points span { font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.auth-foot { font-size: 12.5px; color: rgba(255, 255, 255, .55); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; position: relative; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 36px 36px 28px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-card .lead { margin-bottom: 22px; font-size: 15px; }
.auth-card .btn.block { margin-top: 6px; }
.auth-card .small { font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-card .demo { margin-top: 16px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 12.5px; color: var(--muted); }
.auth-card .demo code { margin: 0 2px; }
.auth-mobile-brand { display: none; }
.auth-theme { position: absolute; top: 14px; right: 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-wrap .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--muted); border-radius: 9px; cursor: pointer; display: grid; place-items: center; margin-top: -6px; }
.pw-wrap .eye:hover { background: var(--surface-3); color: var(--ink); }
.pw-wrap .eye svg { width: 18px; height: 18px; }
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-form { padding: 24px 16px 40px; align-items: flex-start; background: linear-gradient(180deg, #123B5D 0, #0A4A54 220px, var(--bg) 220px); }
  .auth-mobile-brand { display: flex; flex-direction: column; gap: 10px; color: #fff; padding: 10px 4px 22px; }
  .auth-mobile-brand .auth-logos .logo-plate { height: 34px; }
  .auth-mobile-brand .auth-logos .x { display: none; }
  .auth-mobile-brand h1 { color: #fff; font-size: 26px; margin: 0; letter-spacing: -.02em; }
  .auth-mobile-brand p { color: rgba(255, 255, 255, .8); font-size: 14px; margin: 0; }
  .auth-card { padding: 26px 22px 22px; border-radius: var(--radius-lg); }
  .auth-theme { top: 10px; right: 10px; color: #fff; }
}

/* logos: a white plate keeps the dark marks visible on dark surfaces */
.logo-plate { display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: 4px 8px; height: 36px; }
.logo-plate img { height: 100%; width: auto; display: block; }
:root[data-theme="light"] .logo-plate.bare, :root:not([data-theme="dark"]) .logo-plate.bare { background: none; padding: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-plate.bare { background: #fff; padding: 4px 8px; } }

/* activity record */
.activity-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.activity-what small { display: block; font-size: 12.5px; }
.activity-table td.nowrap { white-space: nowrap; }
@media (max-width: 600px) { .activity-table td[data-th="When"] { color: var(--muted); font-size: 12.5px; padding-bottom: 0; } .activity-table td[data-th="When"]::before { display: none; } }
.my-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 14px; }
.my-activity li { padding: 8px 0; border-bottom: 1px solid var(--line-2); overflow-wrap: anywhere; }
.my-activity li:last-child { border-bottom: 0; }
.my-activity time { display: block; font-size: 12.5px; color: var(--muted); }
/* users and permissions on a phone */
.user-acts { white-space: nowrap; }
.user-acts form { display: inline; margin: 0; }
@media (max-width: 600px) { .user-acts { white-space: normal; gap: 8px !important; } table.stack-sm td.user-acts::before { display: none; } }
.perm-picker { margin-bottom: 12px; font-weight: 600; }
.perm-picker .input { margin: 4px 0 0; }
@media (max-width: 600px) {
  .perm-picker.show-sm { display: block !important; }
  .perm-table .perm-off { display: none; }
  .perm-table td:first-child { white-space: normal; }
  .perm-table td:last-child, .perm-table th:last-child { text-align: right; }
}

/* ============================================================ demo data switch */
.demo-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 14px; border: 1px dashed var(--orange); border-radius: 999px; background: var(--orange-50); color: var(--orange-text); font-size: 13px; font-weight: 650; margin: 0; }
.demo-toggle.off { border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.demo-toggle .switch { width: 38px; height: 22px; } .demo-toggle .switch::after { width: 16px; height: 16px; } .demo-toggle .switch[aria-checked=true] { background: var(--fill-orange); } .demo-toggle .switch[aria-checked=true]::after { transform: translateX(16px); }
@media print { .demo-toggle .switch { display: none !important; } }

/* ============================================================ 11. utilities */
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 11.5px; } .strong { font-weight: 650; }
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; } .row.between { justify-content: space-between; } .row.tight { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; } .spacer { flex: 1; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hide-sm { } .show-sm { display: none !important; }
@media (max-width: 600px) { .hide-sm { display: none !important; } .show-sm { display: revert !important; } }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.divider { border-top: 1px solid var(--line-2); margin: 14px 0; }
.ico-inline { width: 18px; height: 18px; vertical-align: -4px; }
.demo-badge { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 36; }
.sticky-foot { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 16px; margin: 16px calc(-1 * var(--gutter)) 0; display: flex; gap: 8px; align-items: center; z-index: 20; }
@media (max-width: 960px) { .sticky-foot { bottom: 62px; } }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; }
.big-touch .btn { min-height: 52px; font-size: 16px; } .big-touch .input, .big-touch input, .big-touch select { min-height: 52px; font-size: 17px; }

/* ============================================================ 12. print */
@media print {
  .rail, .topbar, .tabbar, .orb-float, .toasts, .drawer, .drawer-scrim, .rail-scrim, .no-print { display: none !important; }
  .shell { display: block; } .page { padding: 0; max-width: none; }
  body { background: #fff; color: #000; } .card { box-shadow: none; break-inside: avoid; }
}
