/* ==========================================================================
   BuildTrack Design System — "Launch" variant tokens  (v1.0)
   Direction: loud, clean, premium startup. Glass panels over a lit
   gradient field, colored shadows, springy motion. Gold = commit/save.
   Same token names as the industrial variant, so components are swappable.
   ========================================================================== */

/* Fonts: system stacks only. Nothing is fetched from the web.
   iPad renders San Francisco, Windows renders Segoe UI; hierarchy comes from weight and size. */

:root {
  color-scheme: dark;

  /* ---------- Surfaces (Midnight) ---------- */
  --bt-bg:          #0A0E1A;
  --bt-mesh:
    radial-gradient(900px 600px at 8% -10%,  rgba(79,124,255,.32), transparent 60%),
    radial-gradient(800px 600px at 100% 20%, rgba(20,184,166,.22), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(129,140,248,.18), transparent 60%);
  --bt-bg-grid:     transparent;
  --bt-surface:     rgba(17, 23, 40, 0.68);   /* glass — pair with backdrop-filter */
  --bt-raised:      #182036;
  --bt-overlay:     rgba(4, 7, 16, 0.62);
  --bt-line:        rgba(255, 255, 255, 0.08);
  --bt-line-strong: rgba(255, 255, 255, 0.16);
  --bt-glass-blur:  18px;

  /* ---------- Text ---------- */
  --bt-text:        #F3F5F9;
  --bt-text-muted:  #9AA4B8;
  --bt-text-faint:  #626D84;
  --bt-text-on-accent: #FFFFFF;

  /* ---------- Accent: electric blue ---------- */
  --bt-accent:        #4F7CFF;
  --bt-accent-hover:  #6B91FF;
  --bt-accent-press:  #3B66EA;
  --bt-accent-text:   #93B1FF;
  --bt-accent-soft:   rgba(79, 124, 255, 0.16);
  --bt-accent-glow:   0 0 0 1px rgba(107,145,255,.55), 0 10px 32px rgba(79,124,255,.45);
  --bt-accent-grad:   linear-gradient(135deg, #6B91FF 0%, #4F7CFF 55%, #3B66EA 100%);

  /* ---------- Gold: save, create, commit. Nothing else. ---------- */
  --bt-gold-1: #FFF1B8;
  --bt-gold-2: #F5C542;
  --bt-gold-3: #C9931A;
  --bt-gold-text-on: #2A1D00;
  --bt-gold-grad: linear-gradient(135deg, var(--bt-gold-1) 0%, var(--bt-gold-2) 45%, var(--bt-gold-3) 100%);
  --bt-gold-glow: 0 0 0 1px rgba(255,241,184,.45), 0 12px 36px rgba(245,197,66,.45);
  --bt-gold-glow-hover: 0 0 0 1px rgba(255,241,184,.7), 0 16px 48px rgba(245,197,66,.65);

  /* ---------- Status ---------- */
  --bt-pass:        #34D399;  --bt-pass-soft:   rgba(52,211,153,.16);
  --bt-fail:        #FB7185;  --bt-fail-soft:   rgba(251,113,133,.16);
  --bt-active:      #38BDF8;  --bt-active-soft: rgba(56,189,248,.16);
  --bt-warn:        #FBBF24;  --bt-warn-soft:   rgba(251,191,36,.16);
  --bt-idle:        #8B95A7;  --bt-idle-soft:   rgba(139,149,167,.16);
  --bt-hazard: repeating-linear-gradient(-45deg,
                 rgba(251,191,36,.95) 0 8px, rgba(10,14,26,.95) 8px 16px);

  --bt-led-pass:   0 0 10px rgba(52,211,153,.9);
  --bt-led-fail:   0 0 10px rgba(251,113,133,.9);
  --bt-led-active: 0 0 10px rgba(56,189,248,.9);
  --bt-led-warn:   0 0 10px rgba(251,191,36,.9);

  /* ---------- Elevation: deep, colored ---------- */
  --bt-shadow-1: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 14px rgba(2,6,23,.45);
  --bt-shadow-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 16px 48px rgba(2,6,23,.6), 0 0 0 1px rgba(255,255,255,.03);
  --bt-shadow-3: 0 1px 0 rgba(255,255,255,.08) inset, 0 40px 100px rgba(2,6,23,.8), 0 0 60px rgba(79,124,255,.12);
  --bt-shadow-lift: 0 1px 0 rgba(255,255,255,.08) inset, 0 28px 64px rgba(2,6,23,.7), 0 0 0 1px rgba(107,145,255,.25);
  --bt-focus:    0 0 0 2px var(--bt-bg), 0 0 0 5px var(--bt-accent), 0 0 24px rgba(79,124,255,.5);

  /* ---------- Typography ---------- */
  --bt-font-ui:      system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bt-font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bt-font-data:    ui-monospace, "SF Mono", Menlo, Consolas, "Cascadia Mono", "Liberation Mono", monospace; /* IDs, counters, timestamps only */

  --bt-text-xs:   12px;  --bt-text-sm:  13.5px; --bt-text-base: 15px;
  --bt-text-md:   17px;  --bt-text-lg:  21px;   --bt-text-xl:   28px;
  --bt-text-2xl:  36px;  --bt-text-3xl: 48px;   --bt-text-4xl:  68px;
  --bt-leading-tight: 1.1;
  --bt-leading-body:  1.55;

  /* ---------- Spacing ---------- */
  --bt-space-1: 4px;  --bt-space-2: 8px;  --bt-space-3: 12px;
  --bt-space-4: 16px; --bt-space-5: 20px; --bt-space-6: 24px;
  --bt-space-8: 32px; --bt-space-10: 40px; --bt-space-12: 48px;

  /* ---------- Shape: soft, pill-ready ---------- */
  --bt-radius-xs: 6px;
  --bt-radius-sm: 10px;
  --bt-radius-md: 16px;
  --bt-radius-lg: 24px;
  --bt-radius-pill: 999px;

  --bt-hit-min:   44px;
  --bt-hit-floor: 56px;

  /* ---------- Motion: a touch longer, springy ---------- */
  --bt-dur-instant: 90ms;
  --bt-dur-fast:    160ms;
  --bt-dur-base:    260ms;
  --bt-dur-slow:    440ms;
  --bt-dur-flash:   1400ms;
  --bt-dur-shine:   2800ms;  /* gold sweep period */

  --bt-ease-out:  cubic-bezier(.22, 1, .36, 1);
  --bt-ease-in:   cubic-bezier(.55, 0, 1, .45);
  --bt-ease-snap: cubic-bezier(.34, 1.56, .64, 1);  /* spring */
  --bt-ease-std:  cubic-bezier(.4, 0, .2, 1);

  --bt-stagger: 50ms;
  --bt-rise:    14px;

  --bt-sidebar-w: 240px;
  --bt-sidebar-rail: 64px;
  --bt-topbar-h: 64px;
  --bt-content-max: 1440px;
}

/* ==========================================================================
   Daylight (light)
   ========================================================================== */
:root[data-theme="light"] {
  color-scheme: light;

  --bt-bg:          #F5F7FC;
  --bt-mesh:
    radial-gradient(900px 600px at 8% -10%,  rgba(79,124,255,.18), transparent 60%),
    radial-gradient(800px 600px at 100% 20%, rgba(20,184,166,.14), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(129,140,248,.12), transparent 60%);
  --bt-surface:     rgba(255, 255, 255, 0.78);
  --bt-raised:      #FFFFFF;
  --bt-overlay:     rgba(15, 23, 42, 0.42);
  --bt-line:        rgba(15, 23, 42, 0.08);
  --bt-line-strong: rgba(15, 23, 42, 0.16);

  --bt-text:        #0F172A;
  --bt-text-muted:  #596273;
  --bt-text-faint:  #8A93A6;
  --bt-text-on-accent: #FFFFFF;

  --bt-accent:        #3B5BFF;
  --bt-accent-hover:  #5572FF;
  --bt-accent-press:  #2E4AE0;
  --bt-accent-text:   #2F49D6;
  --bt-accent-soft:   rgba(59, 91, 255, 0.12);
  --bt-accent-glow:   0 0 0 1px rgba(59,91,255,.35), 0 10px 30px rgba(59,91,255,.30);
  --bt-accent-grad:   linear-gradient(135deg, #5572FF 0%, #3B5BFF 55%, #2E4AE0 100%);

  --bt-gold-1: #FFF4C2;  --bt-gold-2: #F2BD2C;  --bt-gold-3: #B9820C;
  --bt-gold-glow: 0 0 0 1px rgba(185,130,12,.35), 0 12px 32px rgba(242,189,44,.40);
  --bt-gold-glow-hover: 0 0 0 1px rgba(185,130,12,.5), 0 16px 44px rgba(242,189,44,.55);

  --bt-pass:   #0E9F6E; --bt-pass-soft:   rgba(14,159,110,.12);
  --bt-fail:   #E11D48; --bt-fail-soft:   rgba(225,29,72,.10);
  --bt-active: #0284C7; --bt-active-soft: rgba(2,132,199,.11);
  --bt-warn:   #B45309; --bt-warn-soft:   rgba(251,191,36,.18);
  --bt-idle:   #6B7489; --bt-idle-soft:   rgba(107,116,137,.12);
  --bt-hazard: repeating-linear-gradient(-45deg, #F2BD2C 0 8px, #0F172A 8px 16px);

  --bt-led-pass:   0 0 0 3px rgba(14,159,110,.18);
  --bt-led-fail:   0 0 0 3px rgba(225,29,72,.16);
  --bt-led-active: 0 0 0 3px rgba(2,132,199,.16);
  --bt-led-warn:   0 0 0 3px rgba(242,189,44,.25);

  --bt-shadow-1: 0 2px 8px rgba(15,23,42,.06), 0 0 0 1px rgba(15,23,42,.03);
  --bt-shadow-2: 0 16px 40px rgba(59,91,255,.10), 0 2px 6px rgba(15,23,42,.05);
  --bt-shadow-3: 0 40px 100px rgba(15,23,42,.22), 0 0 60px rgba(59,91,255,.10);
  --bt-shadow-lift: 0 28px 60px rgba(59,91,255,.18), 0 0 0 1px rgba(59,91,255,.18);
  --bt-focus:    0 0 0 2px var(--bt-bg), 0 0 0 5px var(--bt-accent), 0 0 20px rgba(59,91,255,.35);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --bt-rise: 0px;
    --bt-stagger: 0ms;
    --bt-dur-slow: 180ms;
    --bt-ease-snap: var(--bt-ease-std);
  }
}

/* ==========================================================================
   BuildTrack Design System — Components & Motion  (v1.0)
   Requires tokens.css. Class prefix: .bt-
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--bt-bg);
  background-image:
    linear-gradient(var(--bt-bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bt-bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--bt-text);
  font-family: var(--bt-font-ui);
  font-size: var(--bt-text-base);
  line-height: var(--bt-leading-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--bt-dur-slow) var(--bt-ease-std),
              color var(--bt-dur-slow) var(--bt-ease-std);
}

h1, h2, h3, h4 {
  font-family: var(--bt-font-display);
  font-weight: 600;
  line-height: var(--bt-leading-tight);
  letter-spacing: 0.01em;
  margin: 0;
}
h1 { font-size: var(--bt-text-2xl); }
h2 { font-size: var(--bt-text-xl); }
h3 { font-size: var(--bt-text-lg); }
h4 { font-size: var(--bt-text-md); }
p  { margin: 0; max-width: 72ch; }

.bt-muted { color: var(--bt-text-muted); }
.bt-data  { font-family: var(--bt-font-data); font-size: .92em; letter-spacing: -0.01em; }

:focus-visible { outline: none; box-shadow: var(--bt-focus); border-radius: var(--bt-radius-sm); }

/* ---------- Panel: the base container. Corner ticks = blueprint registration ---------- */
.bt-panel {
  position: relative;
  background: var(--bt-surface);
  border: 1px solid var(--bt-line);
  border-radius: var(--bt-radius-md);
  box-shadow: var(--bt-shadow-1);
  padding: var(--bt-space-5);
}
.bt-panel--ticked::before, .bt-panel--ticked::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--bt-line-strong); border-style: solid; pointer-events: none;
}
.bt-panel--ticked::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--bt-radius-md); }
.bt-panel--ticked::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--bt-radius-md); }
.bt-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--bt-space-3);
  margin-bottom: var(--bt-space-4);
}
.bt-panel__title { font-family: var(--bt-font-display); font-size: var(--bt-text-md); font-weight: 600; }

/* ---------- Buttons ---------- */
.bt-btn {
  --_bg: var(--bt-raised); --_fg: var(--bt-text); --_bd: var(--bt-line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--bt-space-2);
  min-height: var(--bt-hit-min); padding: 0 var(--bt-space-4);
  background: var(--_bg); color: var(--_fg);
  border: 1px solid var(--_bd); border-radius: var(--bt-radius-sm);
  font: 600 var(--bt-text-sm)/1 var(--bt-font-ui); letter-spacing: .01em;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background-color var(--bt-dur-fast) var(--bt-ease-std),
              border-color var(--bt-dur-fast) var(--bt-ease-std),
              box-shadow var(--bt-dur-fast) var(--bt-ease-std),
              transform var(--bt-dur-instant) var(--bt-ease-std);
}
.bt-btn:hover  { border-color: var(--bt-text-faint); }
.bt-btn:active { transform: translateY(1px) scale(.985); }
.bt-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.bt-btn--primary { --_bg: var(--bt-accent); --_fg: var(--bt-text-on-accent); --_bd: var(--bt-accent); }
.bt-btn--primary:hover { --_bg: var(--bt-accent-hover); --_bd: var(--bt-accent-hover); box-shadow: var(--bt-accent-glow); }
.bt-btn--primary:active { --_bg: var(--bt-accent-press); }

.bt-btn--ghost { --_bg: transparent; --_bd: transparent; color: var(--bt-text-muted); }
.bt-btn--ghost:hover { --_bg: var(--bt-raised); color: var(--bt-text); border-color: transparent; }

.bt-btn--danger { --_bg: transparent; --_fg: var(--bt-fail); --_bd: color-mix(in srgb, var(--bt-fail) 55%, transparent); }
.bt-btn--danger:hover { --_bg: var(--bt-fail-soft); border-color: var(--bt-fail); }

.bt-btn--floor { min-height: var(--bt-hit-floor); font-size: var(--bt-text-md); padding: 0 var(--bt-space-6); }
.bt-btn--icon  { width: var(--bt-hit-min); padding: 0; }

.bt-btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.bt-btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--_fg); border-right-color: transparent;
  animation: bt-spin 700ms linear infinite;
}

/* ---------- Inputs ---------- */
.bt-field { display: grid; gap: 6px; }
.bt-label { font-size: var(--bt-text-sm); font-weight: 600; color: var(--bt-text-muted); }
.bt-hint  { font-size: var(--bt-text-xs); color: var(--bt-text-faint); }
.bt-input, .bt-select, .bt-textarea {
  width: 100%; min-height: var(--bt-hit-min); padding: 0 var(--bt-space-3);
  background: var(--bt-raised); color: var(--bt-text);
  border: 1px solid var(--bt-line); border-radius: var(--bt-radius-sm);
  font: 500 var(--bt-text-base) var(--bt-font-ui);
  transition: border-color var(--bt-dur-fast) var(--bt-ease-std), box-shadow var(--bt-dur-fast) var(--bt-ease-std);
}
.bt-textarea { padding: var(--bt-space-3); min-height: 96px; resize: vertical; }
.bt-input::placeholder, .bt-textarea::placeholder { color: var(--bt-text-faint); }
.bt-input:hover, .bt-select:hover, .bt-textarea:hover { border-color: var(--bt-line-strong); }
.bt-input:focus, .bt-select:focus, .bt-textarea:focus {
  outline: none; border-color: var(--bt-accent); box-shadow: 0 0 0 3px var(--bt-accent-soft);
}
.bt-field.is-error .bt-input { border-color: var(--bt-fail); box-shadow: 0 0 0 3px var(--bt-fail-soft); }
.bt-field.is-error .bt-hint  { color: var(--bt-fail); }

/* Toggle switch — snaps with slight overshoot */
.bt-switch { position: relative; display: inline-flex; align-items: center; gap: var(--bt-space-3); cursor: pointer; min-height: var(--bt-hit-min); }
.bt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-switch__track {
  width: 44px; height: 24px; border-radius: 12px; background: var(--bt-line-strong); position: relative;
  transition: background-color var(--bt-dur-base) var(--bt-ease-std);
}
.bt-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bt-text); transition: transform var(--bt-dur-base) var(--bt-ease-snap);
}
.bt-switch input:checked + .bt-switch__track { background: var(--bt-accent); }
.bt-switch input:checked + .bt-switch__track::after { transform: translateX(20px); background: var(--bt-text-on-accent); }
.bt-switch input:focus-visible + .bt-switch__track { box-shadow: var(--bt-focus); }

/* Checklist item (QC) */
.bt-check {
  display: flex; align-items: center; gap: var(--bt-space-3);
  min-height: var(--bt-hit-floor); padding: 0 var(--bt-space-4);
  background: var(--bt-raised); border: 1px solid var(--bt-line); border-radius: var(--bt-radius-sm);
  cursor: pointer; transition: border-color var(--bt-dur-fast), background-color var(--bt-dur-fast);
}
.bt-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-check__box {
  flex: none; width: 26px; height: 26px; border-radius: var(--bt-radius-xs);
  border: 2px solid var(--bt-line-strong); display: grid; place-items: center;
  transition: background-color var(--bt-dur-fast), border-color var(--bt-dur-fast);
}
.bt-check__box svg { width: 16px; height: 16px; stroke: var(--bt-text-on-accent); stroke-width: 3; fill: none;
  stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--bt-dur-base) var(--bt-ease-out); }
.bt-check:has(input:checked) { border-color: color-mix(in srgb, var(--bt-pass) 45%, transparent); background: var(--bt-pass-soft); }
.bt-check input:checked + .bt-check__box { background: var(--bt-pass); border-color: var(--bt-pass); }
.bt-check input:checked + .bt-check__box svg { stroke-dashoffset: 0; }
.bt-check input:focus-visible + .bt-check__box { box-shadow: var(--bt-focus); }

/* ---------- Status: LED + badge ---------- */
.bt-led { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bt-idle); }
.bt-led--pass   { background: var(--bt-pass);   box-shadow: var(--bt-led-pass); }
.bt-led--fail   { background: var(--bt-fail);   box-shadow: var(--bt-led-fail); }
.bt-led--active { background: var(--bt-active); box-shadow: var(--bt-led-active); }
.bt-led--warn   { background: var(--bt-warn);   box-shadow: var(--bt-led-warn); }
.bt-led--live   { animation: bt-pulse 1.8s var(--bt-ease-std) infinite; }

.bt-badge {
  flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px; border-radius: var(--bt-radius-xs);
  font-size: var(--bt-text-xs); font-weight: 600; letter-spacing: .02em;
  background: var(--bt-idle-soft); color: var(--bt-text-muted);
}
.bt-badge--pass   { background: var(--bt-pass-soft);   color: var(--bt-pass); }
.bt-badge--fail   { background: var(--bt-fail-soft);   color: var(--bt-fail); }
.bt-badge--active { background: var(--bt-active-soft); color: var(--bt-active); }
.bt-badge--warn   { background: var(--bt-warn-soft);   color: var(--bt-accent-text); }
.bt-badge--blocked{ background: var(--bt-hazard); color: transparent; position: relative; padding: 0 2px; }
.bt-badge--blocked > span {
  color: var(--bt-text); background: var(--bt-surface); padding: 0 6px; height: 20px;
  display: inline-flex; align-items: center; border-radius: 1px;
}

/* ---------- KPI readout ---------- */
.bt-kpi { display: grid; gap: 2px; }
.bt-kpi__label { font-size: var(--bt-text-sm); color: var(--bt-text-muted); }
.bt-kpi__value {
  font-family: var(--bt-font-display); font-weight: 700; font-size: var(--bt-text-3xl);
  line-height: 1; letter-spacing: -0.01em;
}
.bt-kpi__unit { font-size: .45em; font-weight: 600; color: var(--bt-text-muted); margin-left: 4px; letter-spacing: 0; }
.bt-kpi__delta { font-size: var(--bt-text-xs); font-weight: 600; }
.bt-kpi__delta.up { color: var(--bt-pass); } .bt-kpi__delta.down { color: var(--bt-fail); }

/* Value-changed flash: add .bt-flash for one cycle when live data updates */
.bt-flash { animation: bt-flash var(--bt-dur-flash) var(--bt-ease-out); }

/* Meter / progress */
.bt-meter { height: 6px; background: var(--bt-raised); border-radius: 3px; overflow: hidden; }
.bt-meter > i { display: block; height: 100%; background: var(--bt-active); border-radius: inherit;
  transform-origin: left; transition: width var(--bt-dur-slow) var(--bt-ease-out); }
.bt-meter--pass > i { background: var(--bt-pass); }
.bt-meter--warn > i { background: var(--bt-warn); }

/* ---------- Table ---------- */
.bt-table-wrap { overflow-x: auto; border: 1px solid var(--bt-line); border-radius: var(--bt-radius-md); background: var(--bt-surface); }
.bt-table { width: 100%; border-collapse: collapse; font-size: var(--bt-text-sm); }
.bt-table th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  padding: 10px var(--bt-space-4); background: var(--bt-surface);
  color: var(--bt-text-muted); font-weight: 600; border-bottom: 1px solid var(--bt-line-strong);
}
.bt-table td { padding: 12px var(--bt-space-4); border-bottom: 1px solid var(--bt-line); white-space: nowrap; }
.bt-table tbody tr { transition: background-color var(--bt-dur-fast) var(--bt-ease-std); }
.bt-table tbody tr:hover { background: var(--bt-raised); }
.bt-table tbody tr.is-selected { background: var(--bt-accent-soft); box-shadow: inset 3px 0 0 var(--bt-accent); }
.bt-table td.num, .bt-table th.num { text-align: right; }

/* ---------- Tabs: sliding indicator ---------- */
.bt-tabs { position: relative; display: flex; gap: var(--bt-space-1); border-bottom: 1px solid var(--bt-line); }
.bt-tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  min-height: var(--bt-hit-min); padding: 0 var(--bt-space-4);
  font: 600 var(--bt-text-sm) var(--bt-font-ui); color: var(--bt-text-muted);
  transition: color var(--bt-dur-fast);
}
.bt-tab:hover { color: var(--bt-text); }
.bt-tab[aria-selected="true"] { color: var(--bt-text); }
.bt-tabs__ink {
  position: absolute; bottom: -1px; height: 2px; background: var(--bt-accent);
  transition: transform var(--bt-dur-base) var(--bt-ease-out), width var(--bt-dur-base) var(--bt-ease-out);
}

/* ---------- Overlays: modal, drawer, toast ---------- */
.bt-scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--bt-overlay);
  backdrop-filter: blur(3px); opacity: 0; pointer-events: none;
  transition: opacity var(--bt-dur-base) var(--bt-ease-std);
}
.bt-scrim.is-open { opacity: 1; pointer-events: auto; }

.bt-modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; width: min(520px, calc(100vw - 32px));
  background: var(--bt-surface); border: 1px solid var(--bt-line-strong); border-radius: var(--bt-radius-lg);
  box-shadow: var(--bt-shadow-3); padding: var(--bt-space-6);
  opacity: 0; transform: translate(-50%, -48%) scale(.97); pointer-events: none;
  transition: opacity var(--bt-dur-base) var(--bt-ease-in), transform var(--bt-dur-base) var(--bt-ease-in);
}
.bt-modal.is-open {
  opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto;
  transition: opacity var(--bt-dur-slow) var(--bt-ease-out), transform var(--bt-dur-slow) var(--bt-ease-out);
}

.bt-drawer {
  position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--bt-surface); border-left: 1px solid var(--bt-line-strong); box-shadow: var(--bt-shadow-3);
  padding: calc(var(--bt-space-6) + env(safe-area-inset-top, 0px)) var(--bt-space-6) var(--bt-space-6);
  transform: translateX(102%); transition: transform var(--bt-dur-base) var(--bt-ease-in);
  display: flex; flex-direction: column; gap: var(--bt-space-5); overflow-y: auto;
}
.bt-drawer.is-open { transform: translateX(0); transition: transform var(--bt-dur-slow) var(--bt-ease-out); }

.bt-toasts {
  position: fixed; z-index: 60; right: var(--bt-space-4);
  bottom: calc(var(--bt-space-4) + env(safe-area-inset-bottom, 0px));
  display: grid; gap: var(--bt-space-2); width: min(360px, calc(100vw - 32px));
}
.bt-toast {
  display: flex; align-items: flex-start; gap: var(--bt-space-3);
  padding: var(--bt-space-3) var(--bt-space-4); background: var(--bt-raised);
  border: 1px solid var(--bt-line-strong); border-left: 3px solid var(--bt-pass);
  border-radius: var(--bt-radius-sm); box-shadow: var(--bt-shadow-2); font-size: var(--bt-text-sm);
  animation: bt-toast-in var(--bt-dur-slow) var(--bt-ease-out) both;
}
.bt-toast--fail { border-left-color: var(--bt-fail); }
.bt-toast--warn { border-left-color: var(--bt-warn); }
.bt-toast.is-leaving { animation: bt-toast-out var(--bt-dur-base) var(--bt-ease-in) both; }
.bt-toast .bt-led { margin-top: 6px; }

/* ---------- Skeleton loader ---------- */
.bt-skel {
  display: block; border-radius: var(--bt-radius-xs); background: var(--bt-raised);
  background-image: linear-gradient(90deg, transparent 0, color-mix(in srgb, var(--bt-text) 6%, transparent) 50%, transparent 100%);
  background-size: 200% 100%; background-repeat: no-repeat;
  animation: bt-shimmer 1.4s linear infinite;
}

/* ---------- Dropzone ---------- */
.bt-drop {
  display: grid; place-items: center; gap: var(--bt-space-2); text-align: center;
  min-height: 140px; padding: var(--bt-space-5);
  border: 2px dashed var(--bt-line-strong); border-radius: var(--bt-radius-md);
  color: var(--bt-text-muted); cursor: pointer;
  transition: border-color var(--bt-dur-fast), background-color var(--bt-dur-fast);
}
.bt-drop:hover, .bt-drop.is-over { border-color: var(--bt-accent); background: var(--bt-accent-soft); color: var(--bt-text); }

/* ---------- Entrance choreography ----------
   Add .bt-enter to a container; children with .bt-enter__item stagger in.
   Use once per view change, never on scroll for every section.  */
.bt-enter .bt-enter__item {
  animation: bt-rise var(--bt-dur-slow) var(--bt-ease-out) both;
  animation-delay: calc(min(var(--i, 0), 8) * var(--bt-stagger));
}
.bt-view-enter { animation: bt-view-in var(--bt-dur-slow) var(--bt-ease-out) both; }

/* ---------- Keyframes ---------- */
@keyframes bt-rise    { from { opacity: 0; transform: translateY(var(--bt-rise)); } to { opacity: 1; transform: none; } }
@keyframes bt-view-in { from { opacity: 0; transform: translateY(calc(var(--bt-rise) * .75)); } to { opacity: 1; transform: none; } }
@keyframes bt-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes bt-pulse   { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bt-spin    { to { transform: rotate(360deg); } }
@keyframes bt-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@keyframes bt-flash   { 0% { background-color: var(--bt-accent-soft); box-shadow: inset 0 0 0 1px var(--bt-accent); } 100% { background-color: transparent; box-shadow: inset 0 0 0 1px transparent; } }
@keyframes bt-toast-in  { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes bt-toast-out { to { opacity: 0; transform: translateX(24px); } }

/* Theme switch crossfade (View Transitions API, progressive) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--bt-dur-slow); animation-timing-function: var(--bt-ease-std); }

@media (prefers-reduced-motion: reduce) {
  .bt-led--live, .bt-skel { animation: none; }
  .bt-btn:active { transform: none; }
}

/* ==========================================================================
   "Launch" layer — overrides and additions on top of the base components
   ========================================================================== */

body {
  background-image: var(--bt-mesh);
  background-attachment: fixed;
  background-size: auto;
}

/* Glass panels with a hover lift (opt in with .bt-panel--lift for interactive cards) */
.bt-panel {
  backdrop-filter: blur(var(--bt-glass-blur)); -webkit-backdrop-filter: blur(var(--bt-glass-blur));
  box-shadow: var(--bt-shadow-2);
  transition: transform var(--bt-dur-base) var(--bt-ease-out), box-shadow var(--bt-dur-base) var(--bt-ease-out), border-color var(--bt-dur-base);
}
.bt-panel--lift:hover { transform: translateY(-3px); box-shadow: var(--bt-shadow-lift); border-color: var(--bt-line-strong); }
.bt-panel--ticked::before, .bt-panel--ticked::after { display: none; }
.bt-panel--glow { position: relative; }
.bt-panel--glow::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 0;
  background: linear-gradient(135deg, rgba(107,145,255,.45), transparent 35%, transparent 65%, rgba(20,184,166,.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}

/* Buttons: pill, gradient primary, gold save */
.bt-btn { border-radius: var(--bt-radius-pill); padding: 0 var(--bt-space-5); font-weight: 700; letter-spacing: 0; }
.bt-btn--icon { padding: 0; }
.bt-btn:hover { transform: translateY(-1px); }
.bt-btn:active { transform: translateY(0) scale(.97); }
.bt-btn--primary { background: var(--bt-accent-grad); border-color: transparent; box-shadow: 0 8px 24px rgba(79,124,255,.35), 0 1px 0 rgba(255,255,255,.25) inset; }
.bt-btn--primary:hover { background: var(--bt-accent-grad); box-shadow: var(--bt-accent-glow), 0 1px 0 rgba(255,255,255,.3) inset; filter: brightness(1.06); }

.bt-btn--save {
  position: relative; overflow: hidden; isolation: isolate;
  --_bg: var(--bt-gold-grad); --_fg: var(--bt-gold-text-on); --_bd: transparent;
  background: var(--bt-gold-grad); color: var(--bt-gold-text-on);
  box-shadow: var(--bt-gold-glow), 0 1px 0 rgba(255,255,255,.55) inset, 0 -2px 0 rgba(0,0,0,.12) inset;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.bt-btn--save::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.75) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: bt-shine var(--bt-dur-shine) var(--bt-ease-std) infinite;
}
.bt-btn--save:hover { box-shadow: var(--bt-gold-glow-hover), 0 1px 0 rgba(255,255,255,.6) inset; filter: brightness(1.04); }
.bt-btn--save:hover::before { animation-duration: 900ms; }
.bt-btn--save[disabled] { animation: none; box-shadow: none; filter: saturate(.4); }
.bt-btn--save[disabled]::before { animation: none; }
.bt-btn--save.is-loading::after { border-color: var(--bt-gold-text-on); border-right-color: transparent; }

/* Inputs: softer, glow on focus */
.bt-input, .bt-select, .bt-textarea { border-radius: var(--bt-radius-sm); background: color-mix(in srgb, var(--bt-raised) 70%, transparent); }
.bt-input:focus, .bt-select:focus, .bt-textarea:focus { box-shadow: 0 0 0 4px var(--bt-accent-soft), 0 8px 24px rgba(79,124,255,.18); }
.bt-switch__track::after { box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.bt-switch input:checked + .bt-switch__track { background: var(--bt-accent-grad); box-shadow: 0 4px 14px rgba(79,124,255,.45); }
.bt-switch input:checked + .bt-switch__track::after { background: #fff; }
.bt-check { border-radius: var(--bt-radius-sm); }
.bt-check__box { border-radius: 8px; }
.bt-check:has(input:checked) { box-shadow: 0 8px 24px rgba(52,211,153,.18); }

/* Status: pills */
.bt-badge { border-radius: var(--bt-radius-pill); height: 26px; padding: 0 10px; }
.bt-badge--blocked { border-radius: var(--bt-radius-pill); padding: 0 3px; }
.bt-badge--blocked > span { border-radius: var(--bt-radius-pill); height: 20px; padding: 0 8px; }
.bt-led { width: 9px; height: 9px; }

/* KPI: gradient numerals, glow on change */
.bt-kpi__value {
  font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--bt-text) 30%, var(--bt-accent-text) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bt-kpi__unit { -webkit-text-fill-color: var(--bt-text-muted); }
.bt-kpi__value.bt-flash { animation: bt-flash-glow var(--bt-dur-flash) var(--bt-ease-out); }
@keyframes bt-flash-glow { 0% { filter: drop-shadow(0 0 18px rgba(107,145,255,.9)); } 100% { filter: drop-shadow(0 0 0 transparent); } }
.bt-meter { height: 8px; border-radius: 4px; }
.bt-meter > i { background: var(--bt-accent-grad); box-shadow: 0 0 12px rgba(79,124,255,.5); }
.bt-meter--pass > i { background: linear-gradient(90deg, #6EE7B7, var(--bt-pass)); box-shadow: 0 0 12px rgba(52,211,153,.5); }
.bt-meter--warn > i { background: linear-gradient(90deg, #FDE68A, var(--bt-warn)); box-shadow: 0 0 12px rgba(251,191,36,.5); }

/* Table */
.bt-table-wrap { border-radius: var(--bt-radius-md); backdrop-filter: blur(var(--bt-glass-blur)); box-shadow: var(--bt-shadow-2); }
.bt-table th { background: color-mix(in srgb, var(--bt-raised) 60%, transparent); backdrop-filter: blur(8px); }
.bt-table tbody tr:hover { background: var(--bt-accent-soft); }
.bt-table tbody tr.is-selected { background: var(--bt-accent-soft); box-shadow: inset 4px 0 0 var(--bt-accent), 0 0 24px rgba(79,124,255,.2); }

/* Tabs: pill segment instead of underline */
.bt-tabs { border-bottom: 0; background: color-mix(in srgb, var(--bt-raised) 55%, transparent); padding: 4px; border-radius: var(--bt-radius-pill); border: 1px solid var(--bt-line); }
.bt-tab { border-radius: var(--bt-radius-pill); min-height: 36px; position: relative; z-index: 1; }
.bt-tabs__ink { top: 4px; bottom: 4px; height: auto; border-radius: var(--bt-radius-pill); background: var(--bt-accent-grad); box-shadow: 0 6px 18px rgba(79,124,255,.4); transition: transform var(--bt-dur-base) var(--bt-ease-snap), width var(--bt-dur-base) var(--bt-ease-out); }
.bt-tab[aria-selected="true"] { color: #fff; }

/* Overlays */
.bt-scrim { backdrop-filter: blur(10px) saturate(1.2); }
.bt-modal { border-radius: var(--bt-radius-lg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); transform: translate(-50%, -46%) scale(.94); }
.bt-modal.is-open { transition-timing-function: var(--bt-ease-snap); }
.bt-drawer { border-radius: var(--bt-radius-lg) 0 0 var(--bt-radius-lg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.bt-toast { border-radius: var(--bt-radius-md); border-left-width: 1px; backdrop-filter: blur(16px); box-shadow: var(--bt-shadow-2), 0 0 0 1px var(--bt-line); padding: var(--bt-space-4) var(--bt-space-5); }
.bt-toast .bt-led { box-shadow: var(--bt-led-pass); }
.bt-toast--fail .bt-led { box-shadow: var(--bt-led-fail); }
.bt-toast--warn .bt-led { box-shadow: var(--bt-led-warn); }
@keyframes bt-toast-in { from { opacity: 0; transform: translateY(20px) scale(.94); } to { opacity: 1; transform: none; } }
.bt-toast { animation-timing-function: var(--bt-ease-snap); }

.bt-drop { border-radius: var(--bt-radius-md); }
.bt-drop:hover, .bt-drop.is-over { box-shadow: 0 0 0 4px var(--bt-accent-soft); }
.bt-skel { border-radius: var(--bt-radius-sm); }

/* Entrance: more travel, springier */
.bt-enter .bt-enter__item { animation-timing-function: var(--bt-ease-out); }
@keyframes bt-shine { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }

@media (prefers-reduced-motion: reduce) {
  .bt-btn--save::before { animation: none; }
  .bt-panel--lift:hover, .bt-btn:hover { transform: none; }
}


/* ===================== Style-guide page shell ===================== */
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
.app { display: grid; grid-template-columns: var(--bt-sidebar-w) 1fr; min-height: 100%; }

.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--bt-space-6);
  padding: var(--bt-space-5) var(--bt-space-3); background: var(--bt-surface); border-right: 1px solid var(--bt-line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--bt-space-2); }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { font-family: var(--bt-font-display); font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.brand__name b { color: var(--bt-accent-text); font-weight: 700; }
.nav { position: relative; display: grid; gap: 2px; }
.nav__group { font-size: var(--bt-text-xs); color: var(--bt-text-faint); padding: var(--bt-space-4) var(--bt-space-3) var(--bt-space-1); }
.nav__item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: var(--bt-space-3);
  min-height: 40px; padding: 0 var(--bt-space-3); border: 0; background: none; text-align: left;
  border-radius: var(--bt-radius-sm); cursor: pointer; color: var(--bt-text-muted);
  font: 600 var(--bt-text-sm) var(--bt-font-ui); transition: color var(--bt-dur-fast), background-color var(--bt-dur-fast);
}
.nav__item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav__item:hover { color: var(--bt-text); background: color-mix(in srgb, var(--bt-raised) 60%, transparent); }
.nav__item[aria-current="page"] { color: var(--bt-text); }
.nav__ink {
  position: absolute; left: 0; right: 0; top: 0; height: 40px; z-index: 0; border-radius: var(--bt-radius-sm);
  background: var(--bt-raised); box-shadow: inset 3px 0 0 var(--bt-accent);
  transition: transform var(--bt-dur-base) var(--bt-ease-out);
}
.side__foot { margin-top: auto; padding: var(--bt-space-3); font-size: var(--bt-text-xs); color: var(--bt-text-faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: var(--bt-topbar-h);
  display: flex; align-items: center; gap: var(--bt-space-4); padding: 0 var(--bt-space-6);
  background: color-mix(in srgb, var(--bt-bg) 82%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bt-line);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bt-bg); }
.top__title { font-family: var(--bt-font-display); font-size: var(--bt-text-lg); font-weight: 600; }
.top__spacer { flex: 1; }
.shift { display: flex; align-items: center; gap: 8px; font-size: var(--bt-text-sm); color: var(--bt-text-muted); }
.clock { color: var(--bt-text); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bt-raised); border: 1px solid var(--bt-line-strong); font-size: 12px; font-weight: 700; }
.theme-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.content { width: 100%; max-width: var(--bt-content-max); padding: var(--bt-space-6); display: grid; gap: var(--bt-space-6); }
.view[hidden] { display: none; }
.view { display: grid; gap: var(--bt-space-6); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bt-space-3); }
.grid-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--bt-space-4); }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--bt-space-4); }
.lede { color: var(--bt-text-muted); max-width: 64ch; }

/* ---------- Production line strip (the signature element) ---------- */
.line-panel { padding: var(--bt-space-5) 0 0; overflow: hidden; }
.line-panel .bt-panel__head { padding: 0 var(--bt-space-5); }
.line {
  position: relative; display: grid; grid-template-columns: repeat(8, minmax(132px, 1fr));
  gap: 1px; background: var(--bt-line); overflow-x: auto; border-top: 1px solid var(--bt-line);
}
.station { min-width: 0; position: relative; background: var(--bt-surface); padding: var(--bt-space-4) var(--bt-space-4) var(--bt-space-6); display: grid; gap: var(--bt-space-3); align-content: start; min-height: 178px; }
.station::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--bt-idle); transition: background-color var(--bt-dur-slow); }
.station[data-s="active"]::before { background: var(--bt-active); }
.station[data-s="warn"]::before   { background: var(--bt-warn); }
.station[data-s="blocked"]::before{ background: var(--bt-hazard); height: 6px; }
.station[data-s="pass"]::before   { background: var(--bt-pass); }
.station__head { display: flex; align-items: baseline; gap: 8px; }
.station__no { font-family: var(--bt-font-data); font-size: var(--bt-text-xs); color: var(--bt-text-faint); }
.station__name { font-family: var(--bt-font-display); font-size: var(--bt-text-md); font-weight: 600; line-height: 1.1; }
.chip { min-width: 0; display: grid; gap: 2px; padding: 10px; border-radius: var(--bt-radius-sm); background: var(--bt-raised); border: 1px solid var(--bt-line); }
.chip.is-new { animation: chip-in var(--bt-dur-slow) var(--bt-ease-out) both; }
.chip__id { display: flex; align-items: center; gap: 8px; font-family: var(--bt-font-data); font-size: 13px; font-weight: 600; }
.chip__job { font-size: var(--bt-text-xs); color: var(--bt-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station__time { display: flex; justify-content: space-between; font-size: var(--bt-text-xs); color: var(--bt-text-muted); }
.station__time .bt-data { color: var(--bt-text); }
.station--empty .chip { border-style: dashed; color: var(--bt-text-faint); font-size: var(--bt-text-xs); place-items: center; min-height: 58px; background: transparent; }
.conveyor {
  height: 10px; border-top: 1px solid var(--bt-line);
  background: repeating-linear-gradient(90deg, var(--bt-line) 0 14px, transparent 14px 28px);
  background-size: 28px 100%; animation: belt 1.6s linear infinite; opacity: .8;
}
@keyframes belt { to { background-position: 28px 0; } }
@keyframes chip-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

/* Throughput bars */
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--bt-space-3); align-items: end; height: 180px; padding-top: var(--bt-space-2); }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar__col { width: 100%; max-width: 34px; border-radius: 2px 2px 0 0; background: var(--bt-active); transform-origin: bottom; transform: scaleY(0); }
.bar__col.over { background: var(--bt-warn); }
.view.is-shown .bar__col { animation: grow var(--bt-dur-slow) var(--bt-ease-out) forwards; animation-delay: calc(var(--i) * 45ms + 120ms); }
.bar__v { font-family: var(--bt-font-data); font-size: 11px; color: var(--bt-text-muted); }
.bar__l { font-size: 11px; color: var(--bt-text-faint); }
@keyframes grow { to { transform: scaleY(1); } }
.legend { display: flex; gap: var(--bt-space-4); font-size: var(--bt-text-xs); color: var(--bt-text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Activity feed */
.feed { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--bt-space-3); align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--bt-line); font-size: var(--bt-text-sm); }
.feed li:last-child { border-bottom: 0; }
.feed li.is-new { animation: bt-rise var(--bt-dur-slow) var(--bt-ease-out) both; }
.feed .bt-led { transform: translateY(-1px); }
.feed time { color: var(--bt-text-faint); font-size: var(--bt-text-xs); }

/* Work orders */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--bt-space-3); align-items: center; justify-content: space-between; }
.search { position: relative; width: min(320px, 100%); }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); stroke: var(--bt-text-faint); fill: none; stroke-width: 2; }
.search .bt-input { padding-left: 36px; }
.bt-table tbody tr { cursor: pointer; }
.table-empty { padding: var(--bt-space-10); text-align: center; color: var(--bt-text-muted); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px var(--bt-space-5); margin: 0; font-size: var(--bt-text-sm); }
.dl dt { color: var(--bt-text-muted); } .dl dd { margin: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: start; gap: var(--bt-space-3); }
.drawer-foot { margin-top: auto; display: flex; gap: var(--bt-space-3); }
.drawer-foot .bt-btn { flex: 1; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--bt-line); display: grid; gap: var(--bt-space-3); font-size: var(--bt-text-sm); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--bt-surface); border: 2px solid var(--bt-line-strong); }
.timeline li.done::before { background: var(--bt-pass); border-color: var(--bt-pass); }
.timeline li.now::before  { background: var(--bt-active); border-color: var(--bt-active); box-shadow: var(--bt-led-active); }

/* QC tablet */
.qc { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--bt-space-4); align-items: start; }
.qc__list { display: grid; gap: var(--bt-space-2); }
.qc__group { font-family: var(--bt-font-display); font-size: var(--bt-text-md); font-weight: 600; margin: var(--bt-space-4) 0 var(--bt-space-1); }
.qc__group:first-child { margin-top: 0; }
.qc__progress { display: grid; gap: 8px; }
.qc__count { font-family: var(--bt-font-display); font-size: var(--bt-text-2xl); font-weight: 700; line-height: 1; }
.qc__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--bt-space-3); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--bt-space-2); }
.thumb { aspect-ratio: 4/3; border-radius: var(--bt-radius-sm); border: 1px solid var(--bt-line); position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bt-active) 22%, var(--bt-raised)), var(--bt-raised)); animation: bt-fade var(--bt-dur-base) both; }
.thumb span { position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: var(--bt-text-muted); }
.stage-done { display: grid; place-items: center; text-align: center; gap: var(--bt-space-3); padding: var(--bt-space-10) var(--bt-space-5); }
.stamp {
  font-family: var(--bt-font-display); font-weight: 700; font-size: var(--bt-text-3xl); color: var(--bt-pass);
  border: 3px solid var(--bt-pass); border-radius: var(--bt-radius-sm); padding: 4px 18px; transform: rotate(-4deg);
  animation: stamp var(--bt-dur-slow) var(--bt-ease-snap) both;
}
.stamp.fail { color: var(--bt-fail); border-color: var(--bt-fail); }
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(1.6); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

/* Phone */
.devices { display: grid; grid-template-columns: auto 1fr; gap: var(--bt-space-8); align-items: start; }
.phone {
  width: 360px; max-width: 100%; height: 720px; border-radius: 34px; padding: 10px;
  background: #0A0D11; box-shadow: var(--bt-shadow-3), inset 0 0 0 1px #2A333D;
}
.phone__screen { height: 100%; border-radius: 26px; overflow: hidden; background: var(--bt-bg); display: flex; flex-direction: column; }
.phone__bar { display: flex; justify-content: space-between; padding: 12px 22px 6px; font-size: 12px; font-weight: 600; }
.phone__head { padding: var(--bt-space-3) var(--bt-space-4) var(--bt-space-4); display: grid; gap: 4px; }
.phone__body { flex: 1; overflow-y: auto; padding: 0 var(--bt-space-4) var(--bt-space-4); display: grid; gap: var(--bt-space-3); align-content: start; }
.task { padding: var(--bt-space-4); display: grid; gap: var(--bt-space-3); }
.task.is-running { border-color: color-mix(in srgb, var(--bt-active) 50%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bt-active) 30%, transparent); }
.task__top { display: flex; justify-content: space-between; gap: var(--bt-space-3); }
.task__timer { font-family: var(--bt-font-data); font-size: var(--bt-text-lg); font-weight: 600; }
.phone__tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--bt-line); background: var(--bt-surface); padding-bottom: 6px; }
.phone__tabs button { min-height: 52px; background: none; border: 0; color: var(--bt-text-faint); font: 600 11px var(--bt-font-ui); display: grid; place-items: center; gap: 2px; cursor: pointer; }
.phone__tabs button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.phone__tabs button[aria-current="true"] { color: var(--bt-accent-text); }
.notes { display: grid; gap: var(--bt-space-4); max-width: 60ch; }
.notes h3 { margin-top: var(--bt-space-2); }
.notes ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--bt-text-muted); }

/* Foundations */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--bt-space-3); }
.sw { border: 1px solid var(--bt-line); border-radius: var(--bt-radius-sm); overflow: hidden; background: var(--bt-surface); font-size: var(--bt-text-xs); }
.sw__chip { height: 56px; border-bottom: 1px solid var(--bt-line); }
.sw__meta { padding: 8px 10px; display: grid; gap: 2px; }
.sw__meta b { font-size: var(--bt-text-sm); }
.sw__meta code { font-family: var(--bt-font-data); color: var(--bt-text-muted); }
.type-row { display: grid; grid-template-columns: 140px 1fr; gap: var(--bt-space-4); align-items: baseline; padding: var(--bt-space-3) 0; border-bottom: 1px solid var(--bt-line); }
.type-row:last-child { border: 0; }
.type-row code { font-family: var(--bt-font-data); font-size: var(--bt-text-xs); color: var(--bt-text-faint); }
.motion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--bt-space-3); }
.mo { display: grid; gap: var(--bt-space-3); }
.mo__track { position: relative; height: 34px; background: var(--bt-raised); border-radius: var(--bt-radius-sm); overflow: hidden; }
.mo__dot { position: absolute; top: 7px; left: 7px; width: 20px; height: 20px; border-radius: var(--bt-radius-xs); background: var(--bt-accent); }
.mo.go .mo__dot { transform: translateX(calc(var(--w) - 34px)); }
.mo code { font-family: var(--bt-font-data); font-size: var(--bt-text-xs); color: var(--bt-text-muted); }
.comp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bt-space-4); }
.stack { display: grid; gap: var(--bt-space-4); align-content: start; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .qc, .comp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: auto; flex-direction: row; align-items: center; gap: var(--bt-space-3); padding: var(--bt-space-2) var(--bt-space-3); border-right: 0; border-bottom: 1px solid var(--bt-line); overflow-x: auto; }
  .brand__name, .nav__group, .side__foot, .nav__ink { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav__item { white-space: nowrap; }
  .nav__item[aria-current="page"] { background: var(--bt-raised); box-shadow: inset 0 -2px 0 var(--bt-accent); }
  .top { top: calc(env(safe-area-inset-top, 0px) + 57px); padding: 0 var(--bt-space-4); }
  .shift .label { display: none; }
  .content { padding: var(--bt-space-4); }
  .devices { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 560px) {
  .grid-kpi { grid-template-columns: 1fr 1fr; gap: var(--bt-space-3); }
  .bt-kpi__value { font-size: var(--bt-text-2xl); }
  .qc__actions { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; gap: 4px; }
  .phone { height: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  .conveyor { animation: none; }
  .chip.is-new, .feed li.is-new, .stamp { animation-name: bt-fade; }
}

/* ===== Launch variant: shell tweaks ===== */
.side { background: color-mix(in srgb, var(--bt-surface) 85%, transparent); backdrop-filter: blur(var(--bt-glass-blur)); box-shadow: 8px 0 40px rgba(2,6,23,.25); }
.brand__name { font-weight: 800; letter-spacing: -0.02em; }
.brand__name b { background: linear-gradient(135deg, var(--bt-gold-1), var(--bt-gold-2) 60%, var(--bt-gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand__mark rect { fill: url(#goldGrad); }
.nav__item { border-radius: var(--bt-radius-pill); }
.nav__ink { border-radius: var(--bt-radius-pill); background: var(--bt-accent-grad); box-shadow: 0 8px 24px rgba(79,124,255,.4); transition: transform var(--bt-dur-base) var(--bt-ease-snap); }
.nav__item[aria-current="page"] { color: #fff; }
.top { background: color-mix(in srgb, var(--bt-bg) 55%, transparent); backdrop-filter: blur(20px) saturate(1.3); }
.avatar { background: var(--bt-accent-grad); color: #fff; border: 0; box-shadow: 0 6px 16px rgba(79,124,255,.4); }
.line-panel { overflow: hidden; }
.line { background: transparent; gap: var(--bt-space-2); padding: var(--bt-space-4) var(--bt-space-4) 0; border-top: 0; grid-template-columns: repeat(8, minmax(122px, 1fr)); }
.chip__id { white-space: nowrap; }
.line-panel .bt-panel__head { flex-wrap: wrap; }
.station { border-radius: var(--bt-radius-md); border: 1px solid var(--bt-line); background: color-mix(in srgb, var(--bt-raised) 55%, transparent); overflow: hidden; transition: transform var(--bt-dur-base) var(--bt-ease-out), box-shadow var(--bt-dur-base); }
.station:hover { transform: translateY(-3px); box-shadow: var(--bt-shadow-lift); }
.station::before { height: 4px; }
.station[data-s="active"]::before { box-shadow: 0 0 16px var(--bt-active); }
.station[data-s="warn"]::before { box-shadow: 0 0 16px var(--bt-warn); }
.chip { border-radius: var(--bt-radius-sm); }
.conveyor { height: 3px; margin: var(--bt-space-5) var(--bt-space-5) 0; border-top: 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--bt-accent), var(--bt-active), transparent); background-size: 50% 100%; background-repeat: no-repeat; opacity: 1; animation: sweep 2.4s var(--bt-ease-std) infinite; }
@keyframes sweep { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.bar__col { border-radius: 6px 6px 2px 2px; background: var(--bt-accent-grad); box-shadow: 0 0 18px rgba(79,124,255,.35); }
.bar__col.over { background: linear-gradient(180deg, #FDE68A, var(--bt-warn)); box-shadow: 0 0 18px rgba(251,191,36,.35); }
.legend i { border-radius: 3px; }
.feed li.is-new { animation-timing-function: var(--bt-ease-snap); }
.timeline li.now::before { box-shadow: 0 0 0 4px var(--bt-active-soft), var(--bt-led-active); }
.task { border-radius: var(--bt-radius-md); }
.task.is-running { box-shadow: 0 12px 32px rgba(56,189,248,.18), inset 0 0 0 1px color-mix(in srgb, var(--bt-active) 40%, transparent); }
.phone { border-radius: 44px; background: #05070D; box-shadow: var(--bt-shadow-3), inset 0 0 0 1px rgba(255,255,255,.12); }
.phone__screen { border-radius: 36px; background: var(--bt-bg); background-image: var(--bt-mesh); }
.phone__tabs button[aria-current="true"] { color: var(--bt-accent-text); }
.stamp { border-radius: var(--bt-radius-md); box-shadow: 0 0 40px color-mix(in srgb, currentColor 45%, transparent); }
.sw { border-radius: var(--bt-radius-sm); }
.mo__dot { background: var(--bt-accent-grad); border-radius: 6px; box-shadow: 0 4px 12px rgba(79,124,255,.5); }
.mo__dot.gold { background: var(--bt-gold-grad); box-shadow: var(--bt-gold-glow); }
.hero-save { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bt-space-4); }
@media (prefers-reduced-motion: reduce) { .conveyor { animation: none; } .station:hover { transform: none; } }


/* ===================== IT Support System: app additions ===================== */
.hidden { display: none !important; }
.side__sub { font-family: var(--bt-font-data); font-size: 10px; letter-spacing: .32em; color: var(--bt-accent-text); padding: 0 var(--bt-space-2) 0 48px; margin-top: -24px; }
.brand__name.mes { font-size: 17px; letter-spacing: .01em; white-space: nowrap; }
.content, .view, .view > *, .detail > *, .stack > *, .split > *, .two > * { min-width: 0; }
.content { padding-bottom: 96px; }
.bt-table-wrap { overflow-x: auto; }
.side { padding-bottom: 64px; }
.side__user { display: flex; align-items: center; gap: 10px; padding: var(--bt-space-3); border-top: 1px solid var(--bt-line); margin-top: auto; }
.side__user .who { min-width: 0; font-size: var(--bt-text-xs); color: var(--bt-text-muted); line-height: 1.35; }
.side__user .who b { display: block; color: var(--bt-text); font-size: var(--bt-text-sm); }
.side__user .bt-btn { margin-left: auto; }
.role-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--bt-radius-pill); background: var(--bt-accent-soft); color: var(--bt-accent-text); font-size: 11px; font-weight: 700; }
.nav__count { margin-left: auto; font-family: var(--bt-font-data); font-size: 11px; padding: 1px 7px; border-radius: var(--bt-radius-pill); background: color-mix(in srgb, var(--bt-raised) 80%, transparent); color: var(--bt-text-muted); }
.nav__item[aria-current="page"] .nav__count { background: rgba(255,255,255,.2); color: #fff; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--bt-space-8) var(--bt-space-4); gap: var(--bt-space-8); }
.logo { text-align: center; display: grid; gap: var(--bt-space-3); justify-items: center; }
.logo__word { display: flex; align-items: baseline; gap: 10px; font-family: var(--bt-font-display); font-weight: 800; letter-spacing: -0.01em; line-height: 1; }
.logo__word .bt { font-size: 40px; color: var(--bt-text); }
.logo__word .mes { font-size: 64px; letter-spacing: -0.02em; background: linear-gradient(135deg, var(--bt-gold-1), var(--bt-gold-2) 55%, var(--bt-gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 24px rgba(245,197,66,.35)); }
.logo__sub { font-family: var(--bt-font-data); font-size: 13px; letter-spacing: .42em; color: var(--bt-accent-text); padding-left: .42em; }
.login__card { width: min(420px, 100%); display: grid; gap: var(--bt-space-4); padding: var(--bt-space-8) var(--bt-space-6); }
.login__card h1 { font-size: var(--bt-text-lg); text-align: center; }
.login__card p.lede { text-align: center; font-size: var(--bt-text-sm); margin: 0 auto; }
.ms-btn { width: 100%; min-height: 48px; justify-content: center; gap: 12px; font-size: var(--bt-text-base); }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i { display: block; } .ms-logo i:nth-child(1){background:#F25022}.ms-logo i:nth-child(2){background:#7FBA00}.ms-logo i:nth-child(3){background:#00A4EF}.ms-logo i:nth-child(4){background:#FFB900}
.divider { display: flex; align-items: center; gap: var(--bt-space-3); color: var(--bt-text-faint); font-size: var(--bt-text-xs); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--bt-line); }
.local-toggle { width: 100%; justify-content: space-between; }
.local-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform var(--bt-dur-base) var(--bt-ease-snap); }
.local-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.local-form { display: grid; gap: var(--bt-space-3); overflow: hidden; }
.login__foot { font-size: var(--bt-text-xs); color: var(--bt-text-faint); text-align: center; letter-spacing: .02em; }
.demo-pick { display: grid; gap: var(--bt-space-2); }
.demo-pick button { display: flex; align-items: center; gap: var(--bt-space-3); text-align: left; width: 100%; padding: var(--bt-space-3); min-height: 56px; border-radius: var(--bt-radius-md); border: 1px solid var(--bt-line); background: color-mix(in srgb, var(--bt-raised) 60%, transparent); color: var(--bt-text); cursor: pointer; font: inherit; }
.demo-pick button:hover { border-color: var(--bt-accent); box-shadow: 0 0 0 3px var(--bt-accent-soft); }
.demo-pick small { display: block; color: var(--bt-text-muted); font-size: var(--bt-text-xs); }

/* ---------- Mockup banner ---------- */
.mock-flag { position: fixed; left: 12px; bottom: 12px; width: 216px; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: var(--bt-radius-pill); background: color-mix(in srgb, var(--bt-raised) 92%, transparent); border: 1px dashed var(--bt-line-strong); box-shadow: var(--bt-shadow-2); font-size: var(--bt-text-xs); color: var(--bt-text-muted); backdrop-filter: blur(12px); }
.mock-flag select { flex: 1; min-width: 0; height: 30px; min-height: 30px; padding: 0 28px 0 10px; font-size: var(--bt-text-xs); width: auto; }

/* ---------- Common bits ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--bt-space-4); }
.page-head h2 { font-size: var(--bt-text-xl); }
.page-head p { margin: 4px 0 0; color: var(--bt-text-muted); font-size: var(--bt-text-sm); }
.grid-kpi.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bt-kpi__value.sm { font-size: var(--bt-text-2xl); }
.shiftb { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--bt-radius-pill); font-size: 11px; font-weight: 700; border: 1px solid var(--bt-line-strong); color: var(--bt-text-muted); white-space: nowrap; }
.shiftb svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.shiftb.night { color: var(--bt-accent-text); border-color: color-mix(in srgb, var(--bt-accent) 45%, transparent); background: var(--bt-accent-soft); }
.qtag.REQ { color: var(--bt-accent-text); border-color: color-mix(in srgb, var(--bt-accent) 45%, transparent); background: var(--bt-accent-soft); }
.type-pick { grid-template-columns: 1fr 1fr !important; }
.type-pick b { display: flex; align-items: center; gap: 8px; } .type-pick b code { font-family: var(--bt-font-data); font-size: 11px; padding: 1px 6px; border-radius: var(--bt-radius-xs); border: 1px solid var(--bt-line-strong); color: var(--bt-text-muted); }
.qtag { font-family: var(--bt-font-data); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: var(--bt-radius-xs); border: 1px solid var(--bt-line-strong); color: var(--bt-text-muted); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: var(--bt-text-sm); font-weight: 600; }
.prio i { width: 8px; height: 8px; border-radius: 50%; background: var(--bt-idle); }
.prio.High i { background: var(--bt-fail); box-shadow: var(--bt-led-fail); } .prio.Medium i { background: var(--bt-warn); } .prio.Low i { background: var(--bt-idle); }
.sla { display: grid; gap: 4px; min-width: 120px; }
.sla__t { font-family: var(--bt-font-data); font-size: 12px; white-space: nowrap; }
.sla.risk .sla__t { color: var(--bt-warn); } .sla.breach .sla__t { color: var(--bt-fail); } .sla.paused .sla__t, .sla.met .sla__t { color: var(--bt-text-muted); }
.sla .bt-meter { height: 5px; }
.sla.breach .bt-meter > i { background: var(--bt-fail); } .sla.risk .bt-meter > i { background: var(--bt-warn); } .sla.paused .bt-meter > i { background: var(--bt-idle); }
.tid { font-family: var(--bt-font-data); font-weight: 700; white-space: nowrap; }
.subj { font-weight: 600; } .subj small { display: block; font-weight: 400; color: var(--bt-text-muted); font-size: var(--bt-text-xs); margin-top: 2px; }
.bt-badge.closed { background: transparent; border: 1px solid var(--bt-line-strong); color: var(--bt-text-faint); }
.bt-table td { vertical-align: middle; }
.cards { display: grid; gap: var(--bt-space-3); }
.tcard { display: grid; grid-template-columns: 84px 1fr auto; gap: var(--bt-space-4); align-items: center; cursor: pointer; padding: var(--bt-space-4) var(--bt-space-5); }
.tcard .meta { display: flex; flex-wrap: wrap; gap: var(--bt-space-2) var(--bt-space-4); color: var(--bt-text-muted); font-size: var(--bt-text-xs); margin-top: 6px; }
.empty { padding: var(--bt-space-10); text-align: center; color: var(--bt-text-muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bt-space-4); }
.form-grid .full { grid-column: 1 / -1; }
.prio-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--bt-space-2); }
.prio-pick label { cursor: pointer; }
.prio-pick input { position: absolute; opacity: 0; }
.prio-pick input + span { display: grid; gap: 2px; padding: var(--bt-space-3); border-radius: var(--bt-radius-md); border: 1px solid var(--bt-line-strong); background: color-mix(in srgb, var(--bt-raised) 50%, transparent); font-weight: 700; transition: all var(--bt-dur-fast); }
.prio-pick input + span small { font-weight: 400; color: var(--bt-text-muted); font-size: var(--bt-text-xs); }
.prio-pick input:checked + span { border-color: var(--bt-accent); box-shadow: 0 0 0 3px var(--bt-accent-soft); background: var(--bt-accent-soft); }
.prio-pick input:focus-visible + span { box-shadow: var(--bt-focus); }
.bt-drop { display: flex; justify-content: flex-start; text-align: left; align-items: center; gap: var(--bt-space-3); padding: var(--bt-space-5); border: 1.5px dashed var(--bt-line-strong); cursor: pointer; color: var(--bt-text-muted); }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--bt-space-2); }
.thumb { aspect-ratio: 4/3; border-radius: var(--bt-radius-sm); border: 1px solid var(--bt-line); position: relative; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--bt-active) 22%, var(--bt-raised)), var(--bt-raised)); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 6px; bottom: 4px; right: 6px; font-size: 10.5px; color: var(--bt-text); text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }
.thumb svg { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; stroke: var(--bt-text-faint); fill: none; stroke-width: 1.6; }

/* Ticket detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--bt-space-4); align-items: start; }
.crumbs { display: flex; align-items: center; gap: var(--bt-space-2); font-size: var(--bt-text-sm); color: var(--bt-text-muted); }
.crumbs a { color: var(--bt-accent-text); cursor: pointer; text-decoration: none; }
.dhead { display: grid; gap: var(--bt-space-3); }
.dhead h2 { font-size: var(--bt-text-xl); }
.dhead .row { gap: var(--bt-space-2); }
.desc { white-space: pre-wrap; line-height: 1.6; }
.conv { display: grid; gap: var(--bt-space-3); }
.msg { display: grid; grid-template-columns: 36px 1fr; gap: var(--bt-space-3); }
.msg .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--bt-raised); border: 1px solid var(--bt-line-strong); }
.msg.tech .av { background: var(--bt-accent-grad); color: #fff; border: 0; }
.msg .bub { padding: var(--bt-space-3) var(--bt-space-4); border-radius: var(--bt-radius-md); background: color-mix(in srgb, var(--bt-raised) 70%, transparent); border: 1px solid var(--bt-line); }
.msg .bub header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--bt-text-xs); color: var(--bt-text-muted); margin-bottom: 6px; }
.msg .bub header b { color: var(--bt-text); font-size: var(--bt-text-sm); }
.msg .bub p { margin: 0; font-size: var(--bt-text-sm); white-space: pre-wrap; }
.msg.internal .bub { background: var(--bt-warn-soft); border: 1px dashed color-mix(in srgb, var(--bt-warn) 55%, transparent); }
.msg.sys { grid-template-columns: 36px 1fr; align-items: center; font-size: var(--bt-text-xs); color: var(--bt-text-faint); }
.msg.sys .dot { width: 8px; height: 8px; margin: auto; border-radius: 50%; background: var(--bt-line-strong); }
.via { font-family: var(--bt-font-data); font-size: 10.5px; padding: 1px 6px; border-radius: var(--bt-radius-xs); border: 1px solid var(--bt-line); }
.composer { display: grid; gap: var(--bt-space-3); }
.composer.internal .bt-textarea { border-color: color-mix(in srgb, var(--bt-warn) 60%, transparent); background: var(--bt-warn-soft); }
.composer__foot { display: flex; flex-wrap: wrap; gap: var(--bt-space-3); align-items: center; justify-content: space-between; }
.props { display: grid; gap: var(--bt-space-4); }
.props .bt-field { gap: 4px; }
.props .bt-select { min-height: 40px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px var(--bt-space-4); margin: 0; font-size: var(--bt-text-sm); }
.dl dt { color: var(--bt-text-muted); } .dl dd { margin: 0; text-align: right; }
.sla-box { display: grid; gap: var(--bt-space-3); }
.sla-big { font-family: var(--bt-font-data); font-size: var(--bt-text-2xl); font-weight: 700; letter-spacing: -0.02em; }
.sla-box.breach .sla-big { color: var(--bt-fail); } .sla-box.risk .sla-big { color: var(--bt-warn); } .sla-box.paused .sla-big, .sla-box.met .sla-big { color: var(--bt-text-muted); }
.sla-box .bt-meter { height: 8px; }
.sla-box.breach .bt-meter > i { background: var(--bt-fail); } .sla-box.risk .bt-meter > i { background: var(--bt-warn); } .sla-box.paused .bt-meter > i { background: var(--bt-idle); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps div { display: grid; gap: 6px; font-size: var(--bt-text-xs); color: var(--bt-text-faint); font-weight: 600; }
.steps div::before { content: ""; height: 5px; border-radius: 3px; background: var(--bt-line-strong); }
.steps div.done { color: var(--bt-text-muted); } .steps div.done::before { background: var(--bt-pass); }
.steps div.now { color: var(--bt-text); } .steps div.now::before { background: var(--bt-active); box-shadow: var(--bt-led-active); }
.notice { display: flex; gap: var(--bt-space-3); align-items: flex-start; padding: var(--bt-space-3) var(--bt-space-4); border-radius: var(--bt-radius-md); background: var(--bt-accent-soft); border: 1px solid color-mix(in srgb, var(--bt-accent) 35%, transparent); font-size: var(--bt-text-sm); }
.notice.warn { background: var(--bt-warn-soft); border-color: color-mix(in srgb, var(--bt-warn) 40%, transparent); }
.notice.idle { background: var(--bt-idle-soft); border-color: var(--bt-line-strong); }
.notice svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; margin-top: 1px; }

/* Admin */
.designer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--bt-space-4); align-items: start; }
.lk-row { display: grid; grid-template-columns: 24px 1fr auto auto auto; gap: var(--bt-space-3); align-items: center; padding: 8px var(--bt-space-3); border-radius: var(--bt-radius-sm); border: 1px solid transparent; }
.lk-row:hover { background: color-mix(in srgb, var(--bt-raised) 55%, transparent); }
.lk-row.sub { grid-template-columns: 24px 1fr auto auto auto; padding-left: 44px; font-size: var(--bt-text-sm); color: var(--bt-text-muted); }
.lk-row .caret { width: 24px; height: 24px; border: 0; background: none; color: var(--bt-text-muted); cursor: pointer; border-radius: 6px; display: grid; place-items: center; }
.lk-row .caret svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; transition: transform var(--bt-dur-base) var(--bt-ease-snap); }
.lk-row .caret.open svg { transform: rotate(90deg); }
.lk-name { font-weight: 600; } .lk-name small { font-weight: 400; color: var(--bt-text-faint); margin-left: 6px; }
.qtog { display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--bt-radius-pill); border: 1px solid var(--bt-line); background: color-mix(in srgb, var(--bt-raised) 45%, transparent); }
.qtog button { height: 26px; padding: 0 10px; border-radius: var(--bt-radius-pill); border: 0; background: none; color: var(--bt-text-faint); font: 700 11px var(--bt-font-ui); cursor: pointer; transition: all var(--bt-dur-fast); }
.qtog button.on { background: var(--bt-accent-grad); color: #fff; box-shadow: 0 4px 12px rgba(79,124,255,.35); }
.icon-btn { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; border: 0; background: none; color: var(--bt-text-faint); cursor: pointer; }
.icon-btn:hover { color: var(--bt-fail); background: var(--bt-fail-soft); }
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.add-row { display: flex; gap: var(--bt-space-2); padding: var(--bt-space-3); }
.add-row .bt-input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: var(--bt-space-2); }
.chip-x { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: var(--bt-radius-pill); background: var(--bt-raised); border: 1px solid var(--bt-line-strong); font-family: var(--bt-font-data); font-size: 12px; }
.qchecks { display: flex; gap: var(--bt-space-3); flex-wrap: wrap; }
.qchecks label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--bt-text-sm); cursor: pointer; }
.qchecks input { accent-color: var(--bt-accent); width: 16px; height: 16px; }
.hol-row { display: grid; grid-template-columns: 158px minmax(0,1fr) 36px 32px; gap: var(--bt-space-3); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--bt-line); }
.hol-row .bt-input { min-height: 38px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bt-space-4); align-items: start; }
.mini-table { width: 100%; border-collapse: collapse; font-size: var(--bt-text-sm); }
.mini-table th { text-align: left; font-size: var(--bt-text-xs); color: var(--bt-text-faint); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--bt-line); }
.mini-table td { padding: 10px 6px; border-bottom: 1px solid var(--bt-line); }
.mini-table tr:last-child td { border-bottom: 0; }
.hbars { display: grid; gap: var(--bt-space-3); }
.hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: var(--bt-space-3); align-items: center; font-size: var(--bt-text-sm); }
.hbar__track { height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--bt-raised) 70%, transparent); overflow: hidden; }
.hbar__track i { display: block; height: 100%; border-radius: 6px; background: var(--bt-accent-grad); box-shadow: 0 0 12px rgba(79,124,255,.35); transform-origin: left; animation: hgrow var(--bt-dur-slow) var(--bt-ease-out) both; }
.hbar__track i.fac { background: linear-gradient(90deg, #2DD4BF, #14B8A6); box-shadow: 0 0 12px rgba(20,184,166,.35); }
.hbar b { font-family: var(--bt-font-data); font-size: 12px; text-align: right; }
@keyframes hgrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bars { grid-template-columns: repeat(var(--n, 10), 1fr); }
.bar__stack { width: 100%; max-width: 30px; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; justify-content: flex-start; }
.bar__stack i { display: block; border-radius: 4px 4px 2px 2px; transform-origin: bottom; animation: grow var(--bt-dur-slow) var(--bt-ease-out) both; animation-delay: calc(var(--i) * 40ms); }
.bar__stack i.it { background: var(--bt-accent-grad); box-shadow: 0 0 14px rgba(79,124,255,.3); }
.bar__stack i.fac { background: linear-gradient(180deg, #5EEAD4, #14B8A6); }
.slaq { display: grid; gap: var(--bt-space-4); }
.slaq__row { display: grid; gap: 6px; }
.slaq__row header { display: flex; justify-content: space-between; font-size: var(--bt-text-sm); }
.slaq__row header b { font-family: var(--bt-font-data); }
.audit-cat { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--bt-radius-pill); background: var(--bt-idle-soft); color: var(--bt-text-muted); }
.audit-cat.Admin { background: var(--bt-accent-soft); color: var(--bt-accent-text); }
.audit-cat.Email { background: var(--bt-active-soft); color: var(--bt-active); }
.audit-cat.Ticket { background: var(--bt-pass-soft); color: var(--bt-pass); }
.audit-cat.Security { background: var(--bt-idle-soft); color: var(--bt-text); }
.filters { display: flex; flex-wrap: wrap; gap: var(--bt-space-3); align-items: center; }
.filters .bt-select, .filters .bt-input { width: auto; min-width: 150px; }
.mb { display: grid; gap: var(--bt-space-3); }
.mb__addr { font-family: var(--bt-font-data); font-size: var(--bt-text-md); font-weight: 700; }
.arrow { color: var(--bt-text-faint); }
.pill-row { display: flex; gap: var(--bt-space-2); flex-wrap: wrap; align-items: center; }

@media (min-width: 1181px) { .toolbar > .row { flex-wrap: nowrap; } .toolbar > .row .search { width: 230px; } }
.sla__fr { font-family: var(--bt-font-data); font-size: 11px; color: var(--bt-text-muted); white-space: nowrap; }
.sla__fr.risk { color: var(--bt-warn); } .sla__fr.breach { color: var(--bt-fail); }
.sla-sec { display: grid; gap: 6px; padding-bottom: var(--bt-space-3); border-bottom: 1px solid var(--bt-line); }
.sla-sec .k { font-size: var(--bt-text-xs); font-weight: 700; color: var(--bt-text-muted); }
.sla-mid { font-family: var(--bt-font-data); font-size: var(--bt-text-lg); font-weight: 700; }
.sla-mid.met { color: var(--bt-pass); } .sla-mid.risk { color: var(--bt-warn); } .sla-mid.breach { color: var(--bt-fail); }
.watch { display: flex; flex-wrap: wrap; gap: 6px; }
.watch .chip-x { font-family: var(--bt-font-ui); font-size: var(--bt-text-xs); height: 28px; }
.res-box { display: grid; gap: 8px; padding: var(--bt-space-3) var(--bt-space-4); border-radius: var(--bt-radius-md); background: var(--bt-pass-soft); border: 1px solid color-mix(in srgb, var(--bt-pass) 40%, transparent); font-size: var(--bt-text-sm); }
.res-box b { color: var(--bt-pass); }
.merge-list { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; margin: 12px 0; }
.merge-list label { display: grid; grid-template-columns: 18px 80px 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: var(--bt-radius-sm); border: 1px solid var(--bt-line); cursor: pointer; font-size: var(--bt-text-sm); }
.merge-list label:has(input:checked) { border-color: var(--bt-accent); background: var(--bt-accent-soft); }
.merge-list input { accent-color: var(--bt-accent); width: 16px; height: 16px; }
.yes { color: var(--bt-pass); font-weight: 700; } .no { color: var(--bt-text-faint); }
.matrix td:not(:first-child), .matrix th:not(:first-child) { text-align: center; }
@media (max-width: 1180px) {
  .detail, .designer, .two { grid-template-columns: 1fr; }
  .grid-kpi.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .side__sub, .side__user .who { display: none; }
  .side__user { border: 0; margin: 0; padding: 0; }
  .side { padding-bottom: var(--bt-space-2); }
  .top__title { white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .bt-table-wrap { overflow-x: auto; }
  .hol-row { grid-template-columns: 1fr 1fr; }
  .hbar { grid-template-columns: 110px 1fr 36px; }
}
@media (max-width: 560px) {
  .grid-kpi.five { grid-template-columns: 1fr 1fr; }
  .tcard { grid-template-columns: 1fr; }
  .prio-pick { grid-template-columns: 1fr; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .logo__word .bt { font-size: 30px; } .logo__word .mes { font-size: 48px; }
  .shift { display: none; }
  .mock-flag { left: 8px; right: 8px; bottom: 8px; justify-content: space-between; }
  .mock-flag .lbl { display: none; }
}
[hidden] { display: none !important; }
a.bt-btn { text-decoration: none; }
.hol-row .bt-data { font-size: var(--bt-text-xs); }
