/* tumt.css: the one stylesheet for TUMT.
   Sections 1-8 are copied from the TAK Fusion design system (corp/brand 9b32a32); do not edit them here.
   Section 9 is the TUMT t- layer. */

/* ===== 1. design-system/tokens/fonts.css ===== */
/* TAK Fusion vendored webfonts (closes kit gap #2: air-gapped safe, no CDN).
   Latin subset woff2 from the OFL-licensed families the kit specifies.
   Aliased "Fusion Sans" / "Fusion Mono" so this file is the only place the real face is chosen. */
@font-face{font-family:"Fusion Sans";src:url("../fonts/IBMPlexSans-Regular.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Fusion Sans";src:url("../fonts/IBMPlexSans-Medium.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:"Fusion Sans";src:url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"Fusion Mono";src:url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Fusion Mono";src:url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
/* display faces. Saira Condensed: marketing headlines only. Archivo Black: badge banners only. */
@font-face{font-family:"Saira Condensed";src:url("../fonts/SairaCondensed-SemiBold.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"Saira Condensed";src:url("../fonts/SairaCondensed-Bold.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:"Archivo Black";src:url("../fonts/ArchivoBlack-Regular.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}

/* ===== 2. design-system/tokens/brand.css ===== */
/* TAK Fusion palette. Brand surfaces only.
   The product's own token set lives in ui-system/. Do not mix the two reds. */

:root{
  /* the two reds */
  --takfusion-brand-red: #ED1C24;   /* logo art, backdrops, sign-in, marketing */
  --takfusion-ui-accent: #e02b26;   /* product --accent; tenant-configurable */

  /* ground */
  --takfusion-bg:            #07080a;
  --takfusion-surface:       #0d0f12;
  --takfusion-surface-input: #111418;

  /* lines */
  --takfusion-line:        #1c2026;
  --takfusion-line-strong: #262c33;
  --takfusion-line-focus:  #3a424a;

  /* text */
  --takfusion-text:       #e6e8ea;
  --takfusion-text-2:     #c3c9cf;
  --takfusion-text-muted: #9aa2a9;
  --takfusion-text-faint: #5c646c;

  /* status: fixed, never themed, never the accent */
  --takfusion-ok:    #57a773;
  --takfusion-warn:  #c9973f;
  --takfusion-fault: #d1453f;
  --takfusion-idle:  #6b737c;
}

/* ===== 3. design-system/tokens/colors.css ===== */
:root {
  /* ground: near-neutral, faintly cool. Flat planes, no gradients. */
  --bg:            #0a0b0d;
  --surface:       #0d0f12;
  --surface-sunk:  #0b0c0f;
  --surface-input: #111418;
  --surface-hover: #14181c;
  --surface-lift:  #101216;

  /* lines: three weights plus a hover, used deliberately */
  --line-faint:    #14181c;
  --line:          #1c2026;
  --line-strong:   #262c33;
  --line-focus:    #3a424a;

  /* text: five steps */
  --text:          #e6e8ea;
  --text-2:        #c3c9cf;
  --text-muted:    #8a9299;
  --text-faint:    #5c646c;
  --text-ghost:    #3f464d;

  /* accent: deployment-configurable, ships red. Derivatives computed server-side. */
  --accent:        #e02b26;
  --accent-text:   #f0645c;
  --accent-wash:   rgba(224, 43, 38, .08);
  --accent-press:  rgba(224, 43, 38, .12);
  --accent-marker: rgba(224, 43, 38, .035);

  /* status: fixed, never themed, disjoint from the accent */
  --ok:            #57a773;
  --warn:          #c9973f;
  --fault:         #d1453f;
  --idle:          #6b737c;

  /* affiliation: MIL-STD-2525, never themed, never restyled */
  --aff-friend:    #6fa8dc;
  --aff-hostile:   #d1453f;
  --aff-neutral:   #57a773;
  --aff-unknown:   #c9973f;

  /* map symbology fills: standard 2525 values, fixed everywhere they appear */
  --sym-friend:    #80e0ff;
  --sym-hostile:   #ff8080;
  --sym-neutral:   #aaffaa;
  --sym-unknown:   #ffff80;
  --sym-stroke:    #0b0c0f;
}

/* ===== 4. design-system/tokens/typography.css ===== */
:root {
  --font-sans: "Fusion Sans", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "Fusion Mono", "IBM Plex Mono", ui-monospace, monospace;

  --t-micro: 10px;  /* uppercase column headers, .14em tracking */
  --t-xs:    11px;  /* hints, chip text, overlay chrome */
  --t-sm:    12px;  /* labels, secondary rows */
  --t-base:  13px;  /* nav, body, table values */
  --t-md:    14px;  /* row primary text */
  --t-lg:    15px;  /* section heading */
  --t-xl:    20px;  /* page heading */
  --t-num:   30px;  /* headline metric */

  --w-regular: 400; /* @kind font */
  --w-medium:  500; /* @kind font */
  --w-semi:    600; /* @kind font */

  --track-micro: .14em;
  --track-chip:  .08em;
  --track-mark:  .06em;
}

/* ===== 5. design-system/tokens/spacing.css ===== */
:root {
  /* 4px base, dense */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 22px; --sp-6: 28px; --sp-7: 40px; --sp-8: 56px;

  --radius:    3px;   /* controls only */
  --radius-lg: 4px;   /* dialogs */

  --row-h: 50px;      /* list row, wall density */
  --bar-h: 46px;      /* top bar */
  --dur:   120ms; /* @kind other */

  --pane-pad: 26px 28px 0 32px;
  --rail-w:   340px;
  --subnav-w: 212px;
}

/* ===== 6. design-system/tokens/modes.css ===== */
/* density: only these tokens move. A density mode that changes colors is a bug. */
:root[data-density="desk"]    { --row-h: 44px; --t-md: 13px; --t-num: 26px; --sp-6: 22px; }
:root[data-density="compact"] { --row-h: 34px; --t-base: 12px; --t-md: 12px; --t-num: 22px; --sp-6: 14px; }

/* night: the same design with the lamps down. Not a second theme. */
:root[data-theme="night"] {
  --bg: #050608;
  --surface: #080a0c;
  --surface-sunk: #060709;
  --surface-input: #0b0e11;
  --surface-hover: #0d1013;
  --surface-lift: #0a0c0f;
  --line-faint: #0d0f11;
  --line: #0f1215;
  --line-strong: #16191d;
  --line-focus: #21262b;
  --text: #c9ccd0;
}

/* day: feeder consoles only. The ramp flips; spacing, type and mono numerals do not. */
:root[data-theme="day"] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-sunk: #ffffff;
  --surface-input: #ffffff;
  --surface-hover: #eef0f3;
  --surface-lift: #f8f9fa;
  --line-faint: #e6eaee;
  --line: #d9dee3;
  --line-strong: #b8bfc6;
  --line-focus: #8f979f;
  --text: #14181c;
  --text-2: #2c343b;
  --text-muted: #4d555d;
  --text-faint: #7a828a;
  --text-ghost: #a8b0b7;
  --accent: #c41c17;
  --accent-text: #c41c17;
  --ok: #2f7d4f;
}

/* ===== 7. design-system/ui/base.css ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--w-regular) var(--t-base)/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: var(--w-medium); letter-spacing: -0.005em; }
h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-lg); }
p  { margin: 0; }

a { color: var(--accent-text); text-decoration: none; transition: color var(--dur); }
a:hover { color: var(--text); }

::selection { background: var(--accent-wash); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* type utilities: numbers are mono and tabular, prose is sans */
.f-mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.f-num   { font: var(--w-regular) var(--t-base)/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-2); }
.f-dash  { color: var(--text-ghost); }
.f-micro { font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint); }
.f-hint  { font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-faint); }
.f-prose { font-size: var(--t-base); color: var(--text-muted); max-width: 62ch; text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ===== 8. design-system/ui/components.css ===== */
/* fusion-ui v1.0.0 component layer: semantic classes prefixed f-, no utility framework.
   Plugin-specific rules go in a later app.css and may only use var(--*). */

/* ---------- page ---------- */

.f-page  { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.f-plane { flex: 1; min-height: 0; display: grid; background: var(--surface); }
.f-plane--rail   { grid-template-columns: 1fr var(--rail-w); }
.f-plane--subnav { grid-template-columns: var(--subnav-w) 1fr; }
.f-main  { min-width: 0; display: flex; flex-direction: column; padding: var(--pane-pad); }
.f-main--flush { padding: 0; }
.f-rail {
  border-left: 1px solid var(--line);
  background: var(--surface-sunk);
  padding: 26px 24px 0;
  display: flex; flex-direction: column; gap: var(--sp-6);
  min-width: 0;
}
.f-subnav { border-right: 1px solid var(--line); background: var(--surface-sunk); padding: 26px 0 0; display: flex; flex-direction: column; }
.f-subnav a { padding: 9px 16px 9px 20px; font-size: var(--t-base); color: var(--text-muted); transition: color var(--dur), box-shadow var(--dur); }
.f-subnav a:hover { color: var(--text); }
.f-subnav a[aria-current] { color: var(--text); font-weight: var(--w-medium); box-shadow: inset 2px 0 0 var(--accent); }

@media (max-width: 1280px) { .f-plane--rail { grid-template-columns: 1fr; } .f-rail { display: none; } }

/* ---------- top bar ---------- */

.f-bar {
  height: var(--bar-h); flex: none;
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 0 18px;
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line);
}
.f-brand { display: flex; align-items: center; gap: 9px; }
.f-brand img { width: 22px; height: 22px; object-fit: contain; }
.f-wordmark   { font: var(--w-semi) var(--t-base)/1 var(--font-sans); letter-spacing: var(--track-mark); color: var(--text); }
.f-deployment { font: var(--w-regular) var(--t-xs)/1 var(--font-mono); letter-spacing: .12em; color: var(--text-faint); }
.f-div    { width: 1px; height: 14px; background: var(--line); flex: none; }
.f-spacer { flex: 1; }

.f-nav { display: flex; align-items: stretch; align-self: stretch; }
.f-nav a { display: flex; align-items: center; padding: 0 13px; font-size: var(--t-base); color: var(--text-muted); transition: color var(--dur), box-shadow var(--dur); }
.f-nav a:hover { color: var(--text); }
.f-nav a[aria-current] { color: var(--text); font-weight: var(--w-medium); box-shadow: inset 0 -2px 0 var(--accent); }

.f-bar-meta { display: flex; align-items: center; gap: var(--sp-4); font: var(--w-regular) var(--t-sm)/1 var(--font-mono); color: var(--text-faint); }
.f-bar-user { display: flex; align-items: center; gap: 9px; font-size: var(--t-sm); color: var(--text-2); }

/* the only permitted variation: a 4px hairline on full-bleed operator surfaces */
.f-bar--collapsed { height: 4px; padding: 0; gap: 0; overflow: hidden; }
.f-bar--collapsed > * { display: none; }
.f-bar--collapsed::after { content: ""; width: 96px; height: 100%; background: var(--accent); }

/* ---------- section head + rules ---------- */

.f-head  { display: flex; align-items: baseline; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.f-head h3 { flex: none; }
.f-count { font: var(--w-regular) var(--t-sm)/1 var(--font-mono); color: var(--text-faint); }
.f-rule  { flex: 1; height: 1px; background: linear-gradient(to right, var(--line), transparent); }
.f-rule--both {
  height: 1px; border: 0; margin: var(--sp-6) 0;
  background: linear-gradient(to right, transparent, var(--line) 48px, var(--line) calc(100% - 48px), transparent);
}
.f-pagehead { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-6); }

/* ---------- list rows ---------- */

.f-rows { display: flex; flex-direction: column; }
.f-rowhead, .f-row { display: grid; gap: 0 16px; align-items: center; padding: 0 4px; }
.f-rowhead {
  height: 28px; border-bottom: 1px solid var(--line);
  font: var(--w-medium) var(--t-micro)/1 var(--font-mono);
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint);
}
.f-row { height: var(--row-h); border-bottom: 1px solid var(--line-faint); transition: background var(--dur), box-shadow var(--dur); }
.f-row:hover { background: var(--surface-hover); }
.f-row[aria-selected="true"], .f-row--marked { box-shadow: inset 2px 0 0 var(--accent); background: var(--accent-marker); }
.f-row--warn  { box-shadow: inset 2px 0 0 var(--warn); }
.f-row--fault { box-shadow: inset 2px 0 0 var(--fault); }
.f-row--off   { opacity: .5; }
.f-row--off img, .f-row--off .f-mark { filter: grayscale(1); }
.f-row-primary { font-size: var(--t-md); color: var(--text); }
.f-row-sub     { font: var(--w-regular) var(--t-xs)/1.3 var(--font-mono); color: var(--text-faint); }
.f-row-cell    { min-width: 0; display: flex; align-items: center; gap: 8px; font: var(--w-regular) var(--t-base)/1 var(--font-mono); color: var(--text-2); }
.f-mark { width: 22px; height: 22px; object-fit: contain; flex: none; }

/* a proportion is a 2px bar, never a donut, never a radial gauge */
.f-bar-track { height: 2px; background: var(--line); width: 100%; }
.f-bar-fill  { height: 2px; background: var(--ok); display: block; }
.f-bar-fill--warn  { background: var(--warn); }
.f-bar-fill--fault { background: var(--fault); }

/* ---------- metric strip ---------- */

.f-metrics {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.f-metric { padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: 7px; border-left: 1px solid var(--line); min-width: 0; }
.f-metric:first-child { border-left: 0; padding-left: 0; }
.f-metric-label { font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint); }
.f-metric-value { font: var(--w-regular) var(--t-num)/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.f-metric-qual  { font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); }
.f-metric--warn  .f-metric-value, .f-metric--warn  .f-metric-qual { color: var(--warn); }
.f-metric--fault .f-metric-value, .f-metric--fault .f-metric-qual { color: var(--fault); }
.f-metric--ok    .f-metric-value { color: var(--ok); }

/* ---------- status: one dot, never a filled pill ---------- */

.f-status { display: inline-flex; align-items: center; gap: 7px; font: var(--w-regular) var(--t-sm)/1 var(--font-mono); color: var(--text-muted); }
.f-status > i { width: 6px; height: 6px; border-radius: 50%; background: var(--idle); flex: none; }
.f-status--ok > i    { background: var(--ok); }
.f-status--warn > i  { background: var(--warn); }
.f-status--fault > i { background: var(--fault); }
.f-status--idle > i  { background: transparent; box-shadow: inset 0 0 0 1px var(--idle); }
.f-status--warn  { color: var(--warn); }
.f-status--fault { color: var(--fault); }

/* ---------- chip ---------- */

.f-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 7px; border: 1px solid var(--line-strong); background: transparent;
  font: var(--w-medium) var(--t-micro)/1.4 var(--font-mono);
  letter-spacing: var(--track-chip); text-transform: uppercase; color: var(--text-2);
}
.f-chip--accent { border-color: var(--accent); color: var(--accent-text); }
.f-chip--staged { border-style: dashed; border-color: var(--accent); color: var(--accent-text); }

/* ---------- buttons: nothing in this system is filled ---------- */

.f-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text-2);
  font: var(--w-medium) var(--t-sm)/1 var(--font-sans);
  cursor: pointer; transition: color var(--dur), border-color var(--dur), background var(--dur);
}
.f-btn--primary { border-color: var(--accent); color: var(--accent-text); }
.f-btn--primary:hover  { background: var(--accent-wash); }
.f-btn--primary:active { background: var(--accent-press); }
.f-btn--secondary { border-color: var(--line-strong); color: var(--text-2); }
.f-btn--secondary:hover { border-color: var(--line-focus); color: var(--text); }
.f-btn--ghost { color: var(--text-muted); }
.f-btn--ghost:hover { color: var(--text); }
.f-btn--danger { border-color: var(--line-strong); color: var(--text-2); }
.f-btn--danger:hover { border-color: var(--fault); color: var(--fault); }
.f-btn[disabled] { opacity: .45; cursor: default; }
.f-btn--sm { padding: 6px 12px; }
.f-btn--block { width: 100%; }

/* ---------- inputs ---------- */

.f-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f-field > label { font: var(--w-medium) var(--t-sm)/1 var(--font-sans); color: var(--text-muted); }
.f-input {
  width: 100%; padding: 10px 12px;
  background: var(--surface-input); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--text); font: var(--w-regular) var(--t-base)/1.2 var(--font-sans);
  transition: border-color var(--dur);
}
.f-input--mono { font-family: var(--font-mono); }
.f-input:hover { border-color: var(--line-focus); }
.f-input::placeholder { color: var(--text-ghost); }
.f-input[disabled] { opacity: .45; }
.f-select { appearance: none; padding-right: 28px; }

/* ---------- icons: Phosphor sprite, 24 grid, 1.7 stroke, currentColor ---------- */

.f-ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.f-ic--sm { width: 14px; height: 14px; }
.f-ic--lg { width: 19px; height: 19px; }

/* ---------- video cell: all chrome is corner overlay text ---------- */

.f-cell { position: relative; background: var(--surface-sunk); border: 1px solid var(--line); overflow: hidden; }
.f-cell-ov {
  position: absolute; display: flex; align-items: center; gap: 6px;
  font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-2);
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
}
.f-cell-ov--tl { top: 8px; left: 9px; }
.f-cell-ov--tr { top: 8px; right: 9px; }
.f-cell-ov--bl { bottom: 8px; left: 9px; }
.f-cell-ov--br { bottom: 8px; right: 9px; }
.f-cell-rec { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.f-cell--dead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.f-cell--dead .f-mark { opacity: .22; width: 34px; height: 34px; }
.f-cell-nosignal { font: var(--w-regular) var(--t-sm)/1 var(--font-mono); letter-spacing: .16em; color: var(--text-faint); }

/* ---------- staged-change bar: docked to the pane, names every change ---------- */

.f-staged {
  margin-top: auto; flex: none;
  border-top: 1px solid var(--accent); background: var(--surface-lift);
  padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-5);
}
.f-staged-body    { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f-staged-title   { font: var(--w-medium) var(--t-md)/1 var(--font-sans); color: var(--text); }
.f-staged-diff    { font: var(--w-regular) var(--t-xs)/1.5 var(--font-mono); color: var(--text-muted); }
.f-staged-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }

/* ---------- dialog: the only component permitted a shadow ---------- */

.f-dialog-backdrop { position: fixed; inset: 0; background: rgba(6, 7, 9, .7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.f-dialog {
  width: min(560px, 92vw); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px -24px #000;
  padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4);
}
.f-dialog-title   { font: var(--w-medium) var(--t-lg)/1.2 var(--font-sans); }
.f-dialog-body    { font-size: var(--t-base); color: var(--text-muted); }
.f-dialog-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }

/* ---------- grant matrix ---------- */

.f-matrix { width: 100%; border-collapse: collapse; }
.f-matrix th {
  text-align: left; padding: 8px; border-bottom: 1px solid var(--line);
  font: var(--w-medium) var(--t-micro)/1 var(--font-mono);
  letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint);
}
.f-matrix td { padding: 10px 8px; border-bottom: 1px solid var(--line-faint); font: var(--w-regular) var(--t-base)/1.3 var(--font-mono); color: var(--text-2); vertical-align: middle; }
.f-matrix tr:hover td { background: var(--surface-hover); }
.f-matrix tr[data-staged] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.f-was { font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); margin-left: 7px; }
.f-cell-staged { color: var(--accent-text); background: var(--accent-marker); }

/* ===== 9. TUMT t- layer ===== */
/* ==========================================================================
   TUMT t- layer. Everything below is TUMT's own; everything above is copied
   verbatim from the TAK Fusion design system (tokens, base, f- components).
   Only var(--*) values, except the sign-in seam, which is the brand register.
   ========================================================================== */

:root { --t-scrim: rgba(6, 7, 9, .7); --t-shadow: 0 24px 64px -24px #000; }
:root[data-theme="day"] { --t-scrim: rgba(20, 24, 28, .32); --t-shadow: 0 24px 64px -24px rgba(20, 24, 28, .45); }

body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }
abbr[title] { text-decoration: none; }
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app frame ---------- */

.t-app { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.t-bar { position: relative; z-index: 20; min-width: 0; }
.t-bar .f-nav a { white-space: nowrap; }
.t-barbtn > span { white-space: nowrap; }
@media (max-width: 1320px) { .t-barbtn-sub { display: none; } .t-bar .f-nav a { padding: 0 9px; } }
/* narrow: the nav drops to its own full-width row so every entry stays reachable */
@media (max-width: 1180px) {
  .t-bar { flex-wrap: wrap; row-gap: 0; height: auto; min-height: var(--bar-h); }
  .t-bar .f-brand, .t-bar-tools { min-height: var(--bar-h); }
  .t-bar .f-nav { order: 9; flex-basis: 100%; flex-wrap: wrap; height: auto; min-height: 40px; border-top: 1px solid var(--line-faint); }
  .t-bar .f-nav a { min-height: 40px; }
  .t-bar .f-chip { display: none; }
}
.t-bar .f-brand { color: var(--text); }
.t-bar .f-brand:hover { color: var(--text); }
.t-bar-tools { display: flex; align-items: center; gap: var(--sp-2); align-self: stretch; }
.t-pop { position: relative; display: flex; align-items: center; align-self: stretch; }

.t-barbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent;
  color: var(--text-2); font: var(--w-regular) var(--t-sm)/1 var(--font-sans);
  cursor: pointer; transition: color var(--dur), border-color var(--dur);
}
.t-barbtn:hover, .t-barbtn[aria-expanded="true"] { border-color: var(--line-strong); color: var(--text); }
.t-barbtn .f-ic { color: var(--text-faint); }
.t-barbtn-sub { font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); }
.t-barbtn .f-status { font-size: var(--t-xs); }

/* menus and popovers: the dialog shadow is the only elevation */
.t-menu {
  position: absolute; top: 100%; margin-top: 4px; min-width: 264px; z-index: 40;
  display: flex; flex-direction: column; padding: var(--sp-1) 0;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--t-shadow);
}
.t-menu--left { left: 0; }
.t-menu--right { right: 0; }
.t-menu-head { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 12px; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-1); }
.t-menu-name { font-size: var(--t-md); color: var(--text); }
.t-menu-label { padding: 10px 14px 6px; }
.t-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px;
  border: 0; background: transparent; text-align: left; cursor: pointer;
  font: var(--w-regular) var(--t-base)/1.2 var(--font-sans); color: var(--text-2);
  transition: background var(--dur), color var(--dur);
}
.t-menu-item:hover { background: var(--surface-hover); color: var(--text); }
.t-menu-item[aria-checked="true"], .t-menu-item[aria-current] { color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.t-menu-sub { margin-left: auto; font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); }
.t-menu-sep { height: 1px; background: var(--line); margin: var(--sp-1) 0; }
.t-menu-foot { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 10px 14px 8px; border-top: 1px solid var(--line); margin-top: var(--sp-1); font-size: var(--t-sm); }
.t-menu-conn { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }

/* notices (shell-standalone--notices) */
.t-notices { width: 420px; max-height: 560px; overflow: auto; }
.t-notice { display: flex; flex-direction: column; gap: 5px; padding: 11px 14px; border-bottom: 1px solid var(--line-faint); }
.t-notice:last-of-type { border-bottom: 0; }
.t-notice-line { display: flex; align-items: baseline; gap: var(--sp-2); }
.t-notice-title { font-size: var(--t-base); color: var(--text); }
.t-notice-line .f-count { margin-left: auto; }
.t-notice p { font-size: var(--t-sm); color: var(--text-muted); text-wrap: pretty; }
.t-notice-acts { display: flex; gap: var(--sp-4); font-size: var(--t-sm); }
.t-linkbtn { border: 0; padding: 0; background: transparent; cursor: pointer; color: var(--text-muted); font-size: var(--t-sm); transition: color var(--dur); }
.t-linkbtn:hover { color: var(--text); }

/* banners: a strip under the bar, a dot and one line; status by dot and word */
.t-banners { display: flex; flex-direction: column; }
.t-banner {
  display: flex; align-items: center; gap: var(--sp-3); padding: 9px 32px;
  background: var(--surface-lift); border-bottom: 1px solid var(--line);
  font-size: var(--t-sm); color: var(--text-2);
}
.t-banner p { flex: 1; min-width: 0; text-wrap: pretty; }
.t-banner .f-status { flex: none; min-width: 64px; }
.t-banner a { flex: none; }
.t-banner--fault { box-shadow: inset 2px 0 0 var(--fault); }
.t-banner--warn { box-shadow: inset 2px 0 0 var(--warn); }
.t-banner--glass { box-shadow: inset 2px 0 0 var(--warn), inset 0 -2px 0 var(--warn); color: var(--text); font-weight: var(--w-medium); }
.t-banner--quiet { background: transparent; color: var(--text-muted); }
.t-receipt { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 32px; border-bottom: 1px solid var(--line-faint); font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-faint); }
.t-receipt .f-status { font-size: var(--t-xs); }
.t-receipt .t-linkbtn { margin-left: auto; font-size: var(--t-xs); }

/* ---------- main pane ---------- */

.t-plane { flex: 1; min-height: 0; display: flex; }
.t-plane--subnav { display: grid; grid-template-columns: var(--subnav-w) minmax(0, 1fr); }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: var(--pane-pad); }
.t-main-end { height: var(--sp-7); flex: none; }
.t-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); }
.t-pagehead-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.t-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.t-reason { display: flex; align-items: center; gap: var(--sp-2); flex-basis: 100%; justify-content: flex-end; font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-muted); }
.t-readonly { font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-faint); }
.t-foot { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); padding: 12px 32px; border-top: 1px solid var(--line-faint); background: var(--surface); font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-faint); }

/* embedded shell (shell-embedded): TUMT's nav as the design system's SubNav */
.t-subnav-tools { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 12px var(--sp-4) 14px; margin-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.t-subnav-tools .t-barbtn { width: 100%; justify-content: flex-start; height: 34px; border-color: var(--line-strong); }
.t-subnav-tools .t-barbtn .f-ic:last-child { margin-left: auto; }
.t-subnav-label { padding: 0 20px 8px; }
.f-subnav .t-subnav-group { margin-top: var(--sp-4); }

/* ---------- filters ---------- */

.t-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.t-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.t-search > .f-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.t-search .f-input { padding-left: 34px; }
.t-selectwrap { position: relative; display: inline-flex; }
.t-selectwrap .f-input { width: auto; min-width: 150px; }
.t-selectwrap::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; pointer-events: none;
  border-right: 1.5px solid var(--text-faint); border-bottom: 1.5px solid var(--text-faint);
  transform: translateY(-70%) rotate(45deg);
}
.t-check {
  appearance: none; -webkit-appearance: none; width: 14px; height: 14px; margin: 0; flex: none;
  display: inline-grid; place-content: center; cursor: pointer;
  background: var(--surface-input); border: 1px solid var(--line-focus); border-radius: 2px;
  transition: border-color var(--dur);
}
.t-check:hover { border-color: var(--text-faint); }
.t-check:checked, .t-check--mixed { border-color: var(--accent); }
.t-check:checked::after { content: ""; width: 6px; height: 6px; background: var(--accent); }
.t-check--mixed::after { content: ""; width: 8px; height: 2px; background: var(--accent); }
.t-check[disabled] { opacity: .4; cursor: default; }
.t-inline-label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--text-2); cursor: pointer; }
.t-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); margin-bottom: var(--sp-3); font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-faint); }
.t-legend b { font-weight: var(--w-medium); color: var(--text-muted); letter-spacing: var(--track-chip); margin-right: 6px; }

/* ---------- the one table ---------- */

/* Positioned, so what a table's rows place absolutely (the rows' screen reader
   labels, a cell's menu) is contained by the scrolling wrapper. Without it their
   containing block is the pane, and the labels of the rows below the wrapper's
   fold extend the pane's scroll past the page's end: the docked bar then stops
   above the bottom with nothing under it. */
.t-tablewrap { position: relative; overflow: auto; }
.t-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.t-table th {
  position: sticky; top: 0; z-index: 1; height: 32px; padding: 6px 10px; text-align: left; vertical-align: middle;
  background: var(--surface); border-bottom: 1px solid var(--line);
  font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint);
}
.t-table th[aria-sort] { color: var(--text-2); }
.t-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.t-sort:hover { color: var(--text); }
.t-sort .f-ic { width: 12px; height: 12px; }
.t-table td { height: var(--row-h); padding: 0 10px; vertical-align: middle; border-bottom: 1px solid var(--line-faint); font-size: var(--t-base); color: var(--text-2); transition: background var(--dur), box-shadow var(--dur); }
.t-table tbody tr:hover td { background: var(--surface-hover); }
.t-table tbody tr[aria-selected="true"] td { background: var(--accent-marker); }
.t-table tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.t-table .t-col-check { width: 38px; padding-right: 0; }
.t-table .t-col-act { width: 40px; padding-right: 4px; white-space: nowrap; text-align: right; }
.t-table td .t-groups { min-width: 0; }
.t-table .t-col-num { text-align: right; }
.t-primary { font: var(--w-regular) var(--t-md)/1.2 var(--font-mono); color: var(--text); }
a.t-primary:hover { color: var(--accent-text); }
.t-sub { display: block; margin-top: 3px; font: var(--w-regular) var(--t-xs)/1.3 var(--font-mono); color: var(--text-faint); }
.t-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t-table td.t-mono, .t-table td .f-status { white-space: nowrap; }
.t-groups { display: flex; flex-wrap: wrap; gap: 3px 14px; font: var(--w-regular) var(--t-sm)/1.3 var(--font-mono); color: var(--text-2); }
.t-grp { white-space: nowrap; }
.t-dir { margin-left: 5px; font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-chip); color: var(--text-faint); cursor: help; }
.t-more { color: var(--text-faint); }
.t-iconbtn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: color var(--dur), border-color var(--dur);
}
.t-iconbtn:hover { border-color: var(--line-strong); color: var(--text); }
.t-iconbtn[disabled] { opacity: .35; cursor: default; }
.t-skel { display: block; height: 8px; background: var(--line); border-radius: 1px; }
.t-skel--20 { width: 20%; } .t-skel--40 { width: 40%; } .t-skel--60 { width: 60%; } .t-skel--80 { width: 80%; }
.t-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-7) 4px; }
.t-empty h2 { font-size: var(--t-md); color: var(--text); }
.t-table td.t-empty-cell { height: auto; }
.t-table tbody tr:hover td.t-empty-cell { background: transparent; }

.t-pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); padding: var(--sp-3) 0 0; font: var(--w-regular) var(--t-sm)/1 var(--font-mono); color: var(--text-muted); }
.t-pager .t-selectwrap .f-input { min-width: 72px; padding-top: 6px; padding-bottom: 6px; font-family: var(--font-mono); }
.t-pager-pos { color: var(--text-2); }
.t-pager-nav { margin-left: auto; display: flex; gap: var(--sp-2); }

/* staged bar used as the bulk bar: docked to the bottom of the pane */
.t-staged { position: sticky; bottom: 0; z-index: 5; margin: var(--sp-5) -28px 0 -32px; padding-left: 32px; padding-right: 28px; }

/* ---------- dialogs ---------- */

.t-scrim { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: var(--t-scrim); }
.t-scrim > dialog { position: static; margin: 0; }
dialog.f-dialog { color: var(--text); }
dialog.f-dialog::backdrop { background: var(--t-scrim); }
.t-dialog-eyebrow { display: flex; align-items: center; gap: var(--sp-2); }
.t-dialog-list { display: flex; flex-wrap: wrap; gap: 4px 14px; font: var(--w-regular) var(--t-sm)/1.4 var(--font-mono); color: var(--text-2); list-style: none; }
.t-dialog-kept { font: var(--w-regular) var(--t-xs)/1.5 var(--font-mono); color: var(--text-faint); }
.t-dialog-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.t-btn--armed { border-color: var(--fault); color: var(--fault); }
.t-btn--armed:hover { background: transparent; border-color: var(--fault); color: var(--text); }
.t-countdown { display: flex; align-items: baseline; gap: 14px; padding: var(--sp-3) 0 6px; }
.t-countdown-n { font: var(--w-regular) 72px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.t-countdown-n--xl { font-size: 84px; }
.t-countdown-n--off { color: var(--text-ghost); }
.t-countdown-of { font: var(--w-regular) var(--t-base)/1 var(--font-mono); color: var(--text-faint); }
.t-countdown-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.t-countdown-row .f-spacer { flex: 1; }

/* the proportion bar widths used by countdowns and progress (server writes the class) */
.t-w-0 { width: 0; } .t-w-8 { width: 8%; } .t-w-39 { width: 39%; } .t-w-78 { width: 78%; } .t-w-80 { width: 80%; } .t-w-87 { width: 87%; } .t-w-100 { width: 100%; }

/* ---------- toasts ---------- */

.t-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: 400px; max-width: calc(100vw - 36px); display: flex; flex-direction: column; gap: var(--sp-2); list-style: none; }
.t-toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px;
  background: var(--surface-lift); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--t-shadow);
  font-size: var(--t-sm); color: var(--text-2);
}
.t-toast .f-status { flex: none; padding-top: 3px; }
.t-toast p { flex: 1; min-width: 0; text-wrap: pretty; }
.t-toast .t-iconbtn { width: 22px; height: 22px; margin: -3px -2px 0 0; }

/* ==========================================================================
   Sign-in: the seam. Brand register (backdrop, glow, brand red, one filled
   button) around the product's own fields and type. Brand red is fixed here
   and never follows the tenant accent.
   ========================================================================== */

.t-signin {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 48px 24px 72px clamp(24px, 7vw, 150px);
  background:
    linear-gradient(100deg, #07080a 0%, rgba(7, 8, 10, .94) 26%, rgba(7, 8, 10, .55) 52%, rgba(7, 8, 10, .15) 74%, rgba(7, 8, 10, 0) 100%),
    url("../assets/brand/takfusion-backdrop-1920x1080.jpg") center / cover no-repeat, #07080a;
}
:root[data-theme="day"] .t-signin {
  background:
    linear-gradient(100deg, #f4f5f7 0%, rgba(244, 245, 247, .96) 30%, rgba(244, 245, 247, .72) 56%, rgba(244, 245, 247, .45) 100%),
    url("../assets/brand/takfusion-backdrop-1920x1080.jpg") center / cover no-repeat, #f4f5f7;
}
.t-signin-panel {
  width: 100%; max-width: 496px; display: flex; flex-direction: column; gap: var(--sp-5);
  padding: 34px 36px 28px;
  background: linear-gradient(160deg, rgba(20, 22, 26, .93), rgba(9, 10, 12, .9));
  border: 1px solid var(--line-strong); border-top: 2px solid var(--takfusion-brand-red); border-radius: var(--radius-lg);
  box-shadow: 0 40px 120px -40px #000, 0 0 90px -30px rgba(237, 28, 36, .35);
}
.t-signin-panel--wide { max-width: 560px; }
:root[data-theme="day"] .t-signin-panel { background: rgba(255, 255, 255, .97); border-color: var(--line); border-top-color: var(--takfusion-brand-red); box-shadow: 0 40px 120px -40px rgba(20, 24, 28, .35); }
.t-signin-brand { display: flex; flex-direction: column; gap: 12px; }
.t-lockup { width: 300px; max-width: 100%; margin-left: -4px; filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .75)) drop-shadow(0 0 30px rgba(237, 28, 36, .3)); }
.t-lockup--day { display: none; filter: none; }
:root[data-theme="day"] .t-lockup--dark { display: none; }
:root[data-theme="day"] .t-lockup--day { display: block; }
.t-signin-product { display: flex; align-items: center; gap: 9px; }
.t-signin-head { display: flex; flex-direction: column; gap: 8px; }
.t-signin-title { font: var(--w-medium) 22px/1.2 var(--font-sans); color: var(--text); }
.t-signin-title--xl { font-size: 26px; }
.t-signin-who { display: flex; align-items: baseline; gap: var(--sp-3); font: var(--w-regular) var(--t-sm)/1 var(--font-mono); color: var(--text-muted); }
.t-signin-who a { font-family: var(--font-sans); color: var(--text-faint); }
.t-signin-who a:hover { color: var(--text); }
.t-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.t-entry {
  padding: 11px 18px; border: 1px solid var(--takfusion-brand-red); color: #fff;
  background: linear-gradient(180deg, rgba(237, 28, 36, .92), rgba(160, 14, 20, .92));
  font-weight: var(--w-semi); letter-spacing: .03em; box-shadow: 0 0 26px -6px rgba(237, 28, 36, .7);
}
.t-entry:hover { background: linear-gradient(180deg, #ed1c24, rgba(180, 16, 22, .96)); color: #fff; }
.t-entry[disabled] { box-shadow: none; }
:root[data-theme="day"] .t-entry { box-shadow: 0 6px 18px -8px rgba(237, 28, 36, .6); }
.t-or { display: flex; align-items: center; gap: var(--sp-3); font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint); }
.t-or::before, .t-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.t-methods { display: flex; flex-direction: column; gap: var(--sp-2); }
.t-method { justify-content: flex-start; padding: 11px 14px; font-size: var(--t-base); }
.t-method .t-method-sub { margin-left: auto; font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); }
.t-method .f-ic { color: var(--text-muted); }
.t-signin-foot { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); font-size: var(--t-sm); }
.t-signin-foot a { color: var(--text-muted); }
.t-signin-foot a:hover { color: var(--text); }
.t-signin-legal { margin-top: var(--sp-5); max-width: 496px; font: var(--w-regular) var(--t-xs)/1.5 var(--font-mono); color: var(--text-faint); }
:root:not([data-theme="day"]) .t-signin-legal { color: #8a9299; }
.t-msg { display: flex; align-items: flex-start; gap: 10px; font-size: var(--t-sm); color: var(--text-2); text-wrap: pretty; }
.t-msg .f-status { flex: none; padding-top: 4px; }
.t-consent { max-height: 300px; overflow: auto; padding: 14px 16px; background: var(--surface-input); border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: var(--t-sm); line-height: 1.55; color: var(--text-2); }
.t-consent p + p { margin-top: 10px; }
.t-code-input { font: var(--w-regular) 26px/1 var(--font-mono); letter-spacing: .32em; padding: 12px 14px; }
.t-code-input--sm { font-size: 18px; letter-spacing: .18em; }
.t-steps { display: flex; gap: var(--sp-5); list-style: none; font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint); }
.t-steps li { padding-bottom: 8px; }
.t-steps li[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--takfusion-brand-red); }
.t-steps li.t-done { color: var(--text-muted); }
.t-choices { display: flex; flex-direction: column; list-style: none; border-top: 1px solid var(--line); }
.t-choice {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; width: 100%; padding: 13px 4px;
  border: 0; border-bottom: 1px solid var(--line-faint); background: transparent; text-align: left; cursor: pointer;
  transition: background var(--dur), box-shadow var(--dur);
}
.t-choice:hover { background: var(--surface-hover); box-shadow: inset 2px 0 0 var(--accent); }
.t-choice-name { font-size: var(--t-md); color: var(--text); }
.t-choice-sub { grid-column: 1; font: var(--w-regular) var(--t-xs)/1.3 var(--font-mono); color: var(--text-faint); }
.t-choice .f-ic { grid-column: 2; grid-row: 1 / span 2; color: var(--text-faint); }
.t-qr-row { display: grid; grid-template-columns: 168px 1fr; gap: var(--sp-5); align-items: start; }
.t-qr { position: relative; width: 168px; height: 168px; background: #fff; border: 10px solid #fff; border-radius: 2px; }
.t-qr i { position: absolute; width: 38px; height: 38px; border: 7px solid #0a0b0d; }
.t-qr i::after { content: ""; position: absolute; inset: 5px; background: #0a0b0d; }
.t-qr i:nth-child(1) { top: 0; left: 0; } .t-qr i:nth-child(2) { top: 0; right: 0; } .t-qr i:nth-child(3) { bottom: 0; left: 0; }
.t-qr b { position: absolute; inset: 48px; background: repeating-linear-gradient(90deg, #0a0b0d 0 6px, transparent 6px 11px), repeating-linear-gradient(0deg, transparent 0 7px, #fff 7px 12px); }
.t-secret { font: var(--w-medium) var(--t-md)/1.7 var(--font-mono); letter-spacing: .1em; word-spacing: .35em; color: var(--text); }
.t-secret-block { display: flex; flex-direction: column; gap: var(--sp-2); }
.t-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; padding: 16px 18px; list-style: none; counter-reset: code; background: var(--surface-input); border: 1px solid var(--line-strong); border-radius: var(--radius); font: var(--w-regular) 15px/1.4 var(--font-mono); letter-spacing: .06em; color: var(--text); }
.t-codes li { counter-increment: code; display: flex; gap: 12px; }
.t-codes li::before { content: counter(code, decimal-leading-zero); color: var(--text-ghost); font-size: var(--t-xs); padding-top: 3px; }
.t-secret-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.t-once { font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--warn); }
.t-rules { display: flex; flex-direction: column; gap: 7px; list-style: none; }
.t-kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 14px; }
.t-kv dt { font: var(--w-medium) var(--t-micro)/1.6 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint); }
.t-kv dd { font: var(--w-regular) var(--t-sm)/1.45 var(--font-mono); color: var(--text-2); word-break: break-word; }
.t-disclose summary { cursor: pointer; font-size: var(--t-sm); color: var(--text-muted); list-style: none; }
.t-disclose summary::-webkit-details-marker { display: none; }
.t-disclose summary:hover { color: var(--text); }
.t-disclose[open] summary { margin-bottom: var(--sp-4); }
.t-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.t-row-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.t-row-actions .f-spacer { flex: 1; }

/* menus exist in every page; closed ones carry hidden */
.t-menu[hidden] { display: none; }
/* tenant mark: optional, set under Admin > Branding. Beside the product label, never replacing the shield */
.t-tenant-mark { width: 22px; height: 22px; object-fit: contain; margin-left: 10px; flex: none; }
.t-signin-product .t-tenant-mark { width: 28px; height: 28px; margin-left: 4px; }

/* color schemes: a super admin picks one for the deployment under Admin > Branding; data-accent on <html>.
   No per-operator override. Red ships. Every scheme stays clear of the
   fixed status colors. Only --accent and its derivatives change; the shield stays red. */
:root[data-accent="blue"]   { --accent: #3d7fd9; --accent-text: #74a6ea; --accent-wash: rgba(61,127,217,.08); --accent-press: rgba(61,127,217,.12); --accent-marker: rgba(61,127,217,.045); }
:root[data-accent="violet"] { --accent: #8b6fd6; --accent-text: #ae98ea; --accent-wash: rgba(139,111,214,.08); --accent-press: rgba(139,111,214,.12); --accent-marker: rgba(139,111,214,.045); }
:root[data-accent="steel"]  { --accent: #7f9bb3; --accent-text: #a7bfd2; --accent-wash: rgba(127,155,179,.08); --accent-press: rgba(127,155,179,.12); --accent-marker: rgba(127,155,179,.045); }
:root[data-theme="day"][data-accent="blue"]   { --accent: #1f5fb8; --accent-text: #1f5fb8; }
:root[data-theme="day"][data-accent="violet"] { --accent: #6547b8; --accent-text: #6547b8; }
:root[data-theme="day"][data-accent="steel"]  { --accent: #4a6780; --accent-text: #4a6780; }
.t-swatch { width: 10px; height: 10px; border-radius: 1px; flex: none; }
.t-swatch--red { background: #e02b26; } .t-swatch--blue { background: #3d7fd9; } .t-swatch--violet { background: #8b6fd6; } .t-swatch--steel { background: #7f9bb3; }

/* ---------- batch 2: detail pages, forms, group editor, packages ---------- */
.t-section { margin-top: var(--sp-6); }
.t-section:first-of-type { margin-top: 0; }
.t-head-tools { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }
.t-live { font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); display: inline-flex; gap: 8px; align-items: center; }
.t-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: var(--sp-6) var(--sp-7); align-items: start; }
@media (max-width: 1100px) { .t-cols { grid-template-columns: minmax(0, 1fr); } }
.t-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 28px; }
.t-facts div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.t-facts dt { font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--text-faint); }
.t-facts dd { font: var(--w-regular) var(--t-base)/1.4 var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; }
.t-facts dd.t-prose { font-family: var(--font-sans); }
.t-facts .t-wide { grid-column: 1 / -1; }
.t-metrics { margin-bottom: var(--sp-6); border-bottom: 1px solid var(--line); }
.t-list { display: flex; flex-direction: column; list-style: none; }
.t-list li { display: flex; align-items: baseline; gap: var(--sp-3); padding: 10px 4px; border-bottom: 1px solid var(--line-faint); font-size: var(--t-base); color: var(--text-2); }
.t-list li > .f-status { flex: none; min-width: 96px; }
.t-list li p { flex: 1; min-width: 0; text-wrap: pretty; }
.t-list li .t-when { flex: none; font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); }
.t-list li a:not(.t-primary) { flex: none; font-size: var(--t-sm); }
.t-off { display: flex; align-items: baseline; gap: 8px; font: var(--w-regular) var(--t-xs)/1.5 var(--font-mono); color: var(--text-faint); }
.t-off .f-status { flex: none; }

/* group editor: the same component on user-detail, user-new and group-detail */
.t-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.t-lane { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; border-left: 1px solid var(--line); min-height: 120px; transition: box-shadow var(--dur); }
.t-lane:first-child { border-left: 0; padding-left: 4px; }
.t-lane-head { display: flex; align-items: baseline; gap: 8px; }
.t-lane-name { font: var(--w-medium) var(--t-micro)/1 var(--font-mono); letter-spacing: var(--track-chip); color: var(--text); }
.t-lane-def { font-size: var(--t-xs); color: var(--text-faint); }
.t-lane-head .f-count { margin-left: auto; }
.t-lane--drop { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-marker); }
.t-tokens { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.t-token { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font: var(--w-regular) var(--t-sm)/1 var(--font-mono); color: var(--text-2); cursor: grab; transition: border-color var(--dur), color var(--dur); }
.t-token:hover { border-color: var(--line-focus); color: var(--text); }
.t-token[aria-selected="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-marker); }
.t-token--staged { border-style: dashed; border-color: var(--accent); color: var(--accent-text); }
.t-token--removed { border-style: dashed; color: var(--text-ghost); text-decoration: line-through; }
.t-token--ro { cursor: default; }
.t-token--ro:hover { border-color: var(--line-strong); color: var(--text-2); }
.t-token .f-was { margin-left: 0; }
.t-grip { width: 6px; height: 10px; flex: none; background: radial-gradient(circle, var(--text-ghost) 1px, transparent 1.2px) 0 0 / 3px 3.4px; }
.t-lane-empty { font-size: var(--t-xs); color: var(--text-ghost); }
.t-pool { display: flex; flex-direction: column; gap: 10px; padding: 14px 0 0; }
.t-pool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.t-pool-bar .t-search { max-width: 280px; }
.t-movebar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: 10px 0; font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-muted); }

/* forms */
.t-formpage { max-width: 880px; }
.t-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.t-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.t-span-2 { grid-column: 1 / -1; }
@media (max-width: 900px) { .t-form-grid, .t-form-grid--3 { grid-template-columns: minmax(0, 1fr); } }
.t-inputrow { display: flex; gap: var(--sp-2); }
.t-inputrow .f-input { flex: 1; min-width: 0; }
.t-field-err { display: flex; align-items: baseline; gap: 8px; font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-2); }
.t-field-err .f-status { flex: none; }
.f-input[aria-invalid="true"] { border-color: var(--fault); }
.t-errsum { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; margin-bottom: var(--sp-5); border-left: 2px solid var(--fault); background: var(--surface-lift); font-size: var(--t-sm); color: var(--text-2); }
.t-errsum ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.t-radios { display: flex; flex-direction: column; list-style: none; border-top: 1px solid var(--line-faint); }
.t-radio { display: grid; grid-template-columns: 18px 1fr; gap: 3px 10px; padding: 11px 4px; border-bottom: 1px solid var(--line-faint); cursor: pointer; transition: background var(--dur); }
.t-radio:hover { background: var(--surface-hover); }
.t-radio input { margin: 3px 0 0; accent-color: var(--accent); grid-row: 1 / span 2; }
.t-radio-name { font-size: var(--t-base); color: var(--text); }
.t-radio-sub { grid-column: 2; font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-faint); }
.t-radio--off { cursor: default; }
.t-radio--off .t-radio-name { color: var(--text-faint); }
.t-radio--off:hover { background: transparent; }
.t-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.t-seg button { padding: 7px 12px; border: 0; border-left: 1px solid var(--line-strong); background: transparent; color: var(--text-muted); font-size: var(--t-sm); cursor: pointer; transition: color var(--dur), box-shadow var(--dur); }
.t-seg button:first-child { border-left: 0; }
.t-seg button:hover { color: var(--text); }
.t-seg button[aria-pressed="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.t-callout { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-left: 2px solid var(--warn); background: var(--surface-lift); font-size: var(--t-sm); color: var(--text-2); }
.t-callout p { text-wrap: pretty; }

/* package builder */
.t-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; padding: var(--sp-5) 0; border-top: 1px solid var(--line); }
.t-step-n { font: var(--w-medium) var(--t-sm)/1.6 var(--font-mono); color: var(--text-faint); }
.t-step-body { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.t-step-title { font-size: var(--t-md); color: var(--text); }
.t-step--done .t-step-n { color: var(--text-muted); }
.t-preview { font: var(--w-regular) var(--t-sm)/1.7 var(--font-mono); color: var(--text-2); }
.t-preview span { color: var(--text-faint); }
.t-handover { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5) 0 var(--sp-5) 18px; border-left: 2px solid var(--accent); margin-bottom: var(--sp-6); }
.t-handover-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* pages with a docked staged bar keep room under the last section */
.t-main:has(.t-staged) .t-main-end { height: 96px; }

/* ==========================================================================
   Fluid layout. The pane is a container; content responds to the space it has,
   not the window, so the same markup works in the standalone shell, beside the
   Core sub-nav, and on a half-width window. Rule: drop secondary information
   before shrinking type; never truncate an identifier.
   ========================================================================== */
.t-main { container: main / inline-size; padding: clamp(18px, 2.2vw, 26px) clamp(16px, 2.2vw, 28px) 0 clamp(16px, 2.6vw, 32px); }
.t-banner, .t-receipt, .t-foot { padding-left: clamp(16px, 2.6vw, 32px); padding-right: clamp(16px, 2.2vw, 28px); }
.t-staged { margin-left: calc(-1 * clamp(16px, 2.6vw, 32px)); margin-right: calc(-1 * clamp(16px, 2.2vw, 28px)); padding-left: clamp(16px, 2.6vw, 32px); padding-right: clamp(16px, 2.2vw, 28px); }
.t-pagehead-text .f-prose { max-width: 68ch; }
.t-pop--inline { align-self: auto; }
.t-pop--inline .t-menu { top: calc(100% + 2px); }
.t-opinit { display: none; font: var(--w-medium) var(--t-xs)/1 var(--font-mono); letter-spacing: .06em; }
.t-narrow { display: none; }

/* metrics wrap into rows instead of crushing their labels */
.t-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.t-metrics .f-metric { border-left: 1px solid var(--line); padding-left: var(--sp-5); }
.t-metrics .f-metric-label, .t-metrics .f-metric-qual { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* legend sits with the pager, out of the way of the table */
.t-legend--pager { margin: 0 0 0 auto; order: 5; }
.t-pager-nav { order: 6; margin-left: var(--sp-4); }

/* the detail page columns follow the pane, not the window */
.t-cols { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
@container main (max-width: 1040px) { .t-cols { grid-template-columns: minmax(0, 1fr); } .t-cols > aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 var(--sp-7); } .t-cols > aside .t-section { margin-top: var(--sp-6); } }

/* medium pane: drop the second optional column, fold its value under the primary one */
@container main (max-width: 900px) {
  .t-table .t-opt2 { display: none; }
  .t-legend--pager { display: none; }
  .t-pagehead { align-items: flex-start; }
}
/* narrow pane: drop the first optional column too; identifiers stay whole */
@container main (max-width: 680px) {
  .t-table .t-opt { display: none; }
  .t-table .t-narrow { display: inline; }
  .t-table .t-sub.t-narrow { display: block; }
  .t-lanes { grid-template-columns: minmax(0, 1fr); }
  .t-lane { border-left: 0; border-top: 1px solid var(--line-faint); padding-left: 4px; }
  .t-lane:first-child { border-top: 0; }
  .t-filters .t-search { flex-basis: 100%; max-width: none; }
  .t-step { grid-template-columns: minmax(0, 1fr); }
  .t-step-n { margin-bottom: 4px; }
  .t-facts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .t-list li { flex-wrap: wrap; }
  .t-list li p { flex-basis: calc(100% - 120px); }
  .f-staged { flex-wrap: wrap; gap: var(--sp-3); }
}

/* top bar at small windows: initials instead of the name, the deployment code folds away */
@media (max-width: 860px) {
  .t-opname, .t-bar .f-brand .f-deployment, .t-bar .f-brand .f-div { display: none; }
  .t-opinit { display: inline; }
  .t-bar-tools .f-div { display: none; }
  .t-barbtn > span:not(.f-status):not(.t-opinit) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 560px) {
  .t-bar [data-t-action="connection-menu"] > span:not(.f-status) { display: none; }
  .t-toasts { right: 8px; left: 8px; width: auto; }
  .t-signin { padding: 24px 16px 48px; }
  .t-signin-panel { padding: 24px 20px 20px; }
  .t-qr-row { grid-template-columns: minmax(0, 1fr); }
  .t-codes { grid-template-columns: minmax(0, 1fr); }
}

/* in-place edit on user-detail: the section swaps to a form, nothing opens over it */
.t-inline-edit { padding: 4px 0 var(--sp-3); }
.t-inline-edit .t-form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container main (max-width: 1040px) { .t-inline-edit .t-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container main (max-width: 680px) { .t-inline-edit .t-form-grid { grid-template-columns: minmax(0, 1fr); } }

/* batch 3 */
.t-subtabs { display: flex; flex-wrap: wrap; gap: 0 var(--sp-5); margin: -6px 0 var(--sp-5); border-bottom: 1px solid var(--line); }
.t-subtabs a { padding: 10px 0 9px; font-size: var(--t-sm); color: var(--text-muted); box-shadow: inset 0 -2px 0 transparent; transition: color var(--dur), box-shadow var(--dur); }
.t-subtabs a:hover { color: var(--text); }
.t-subtabs a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.t-queue .t-list li { align-items: center; flex-wrap: wrap; }
.t-row--warn td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.t-row--fault td:first-child { box-shadow: inset 2px 0 0 var(--fault); }
.f-matrix th[scope="row"] { text-align: left; font: var(--w-regular) var(--t-base)/1.3 var(--font-sans); color: var(--text); text-transform: none; letter-spacing: normal; padding: 10px 8px; vertical-align: middle; border-bottom: 1px solid var(--line-faint); }
.f-matrix th[scope="row"] .t-sub { font: var(--w-regular) var(--t-xs)/1.3 var(--font-mono); color: var(--text-faint); text-transform: none; letter-spacing: normal; }
.f-matrix .t-sub { display: block; }
.t-radio-cell, .t-check { accent-color: var(--accent); width: 15px; height: 15px; }
.t-textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; font-family: var(--font-sans); }
.t-callout--plain { border-left-color: var(--accent); }
.t-detail { position: sticky; top: var(--sp-4); }
.t-progress { appearance: none; -webkit-appearance: none; width: 100%; height: 2px; border: 0; margin: var(--sp-4) 0 var(--sp-5); background: var(--line); color: var(--accent); }
.t-progress::-webkit-progress-bar { background: var(--line); }
.t-progress::-webkit-progress-value { background: var(--accent); }
.t-progress::-moz-progress-bar { background: var(--accent); }
.t-progress--fault::-webkit-progress-value { background: var(--fault); }
.t-progress--fault::-moz-progress-bar { background: var(--fault); }

/* page-level notes above the columns keep their distance from the first section */
.t-main > .t-off, .t-main > .t-field-err { margin: 0 0 var(--sp-5); }

/* ==========================================================================
   Sign-in, adopted from the TAK Fusion sign-in template (templates/takfusion-signin).
   Layers: backdrop image (drifts), scrim, canvas field (scan line, pings, CoT tracks),
   then the panel and the footer. Cinematic register; brand red is fixed here.
   ========================================================================== */
.t-signin { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-start; padding: 0; overflow: hidden; background: #07080a; }
@supports (min-height: 100svh) { .t-signin { min-height: 100svh; } }
:root[data-theme="day"] .t-signin { background: #f4f5f7; }
.t-signin-bg { position: absolute; inset: 0; overflow: hidden; }
.t-signin-img { position: absolute; inset: -4%; background: #07080a url("../assets/brand/takfusion-backdrop-1920x1080.jpg") 70% center / cover no-repeat; transform: scale(1.02); will-change: transform; }
.t-signin-scrim { position: absolute; inset: 0; background: linear-gradient(100deg, #07080a 0%, rgba(7,8,10,.94) 26%, rgba(7,8,10,.55) 52%, rgba(7,8,10,.15) 74%, rgba(7,8,10,0) 100%); }
:root[data-theme="day"] .t-signin-scrim { background: linear-gradient(100deg, #f4f5f7 0%, rgba(244,245,247,.96) 30%, rgba(244,245,247,.72) 56%, rgba(244,245,247,.4) 100%); }
.t-signin-fx { position: absolute; inset: 0; pointer-events: none; }
:root[data-theme="day"] .t-signin-fx { opacity: .55; }
.t-signin-main { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vh, 96px) 24px clamp(40px, 8vh, 96px) clamp(24px, 7vw, 150px); }
.t-signin-panel { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.t-signin-tenant { font-size: 15px; line-height: 1.4; color: var(--text-2); }
.t-signin-host { margin-top: -8px; font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-faint); }
.t-signin-footer { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 28px; padding: 16px clamp(24px, 7vw, 150px); border-top: 1px solid var(--line); background: rgba(7,8,10,.8); font-size: var(--t-xs); color: #9aa2a9; }
:root[data-theme="day"] .t-signin-footer { background: rgba(244,245,247,.92); color: var(--text-muted); }
.t-signin-footer-line { max-width: 640px; line-height: 1.5; text-wrap: pretty; }
.t-signin-footer-meta { font-family: var(--font-mono); }
@media (max-width: 720px) {
  .t-signin-scrim { background: linear-gradient(180deg, rgba(7,8,10,.4) 0%, rgba(7,8,10,.75) 40%, rgba(7,8,10,.95) 100%); }
  :root[data-theme="day"] .t-signin-scrim { background: linear-gradient(180deg, rgba(244,245,247,.5) 0%, rgba(244,245,247,.85) 40%, rgba(244,245,247,.97) 100%); }
  .t-signin-main { padding: 40px 16px 24px; }
  .t-signin-footer { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 20px 20px; }
}

/* branding (screens: branding, branding--footer-set) */
.t-brcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: var(--sp-7); align-items: start; }
@media (max-width: 1100px) { .t-brcols { grid-template-columns: minmax(0, 1fr); } }
.t-brfields { min-width: 0; }
.t-brpreviews { position: sticky; top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.t-brprev { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; }
.t-brprev--bar { display: flex; align-items: center; gap: var(--sp-5); height: 40px; padding: 0 12px; background: var(--surface); font-size: var(--t-sm); }
.t-brprev-brand { display: flex; align-items: center; gap: 8px; }
.t-brprev-brand img { width: 18px; height: 18px; object-fit: contain; }
.t-brprev-brand .t-tenant-mark { width: 18px; height: 18px; }
.t-brprev-nav { display: flex; gap: var(--sp-4); color: var(--text-muted); }
.t-brprev-nav [aria-current] { color: var(--text); text-decoration: underline 2px var(--accent); text-underline-offset: 13px; }
.t-brprev--signin { min-height: 250px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(100deg, #07080a 0%, rgba(7,8,10,.9) 40%, rgba(7,8,10,.3) 100%), url("../assets/brand/takfusion-backdrop-1920x1080.jpg") 70% center / cover no-repeat, #07080a; }
:root[data-theme="day"] .t-brprev--signin { background: linear-gradient(100deg, #f4f5f7 0%, rgba(244,245,247,.94) 40%, rgba(244,245,247,.5) 100%), url("../assets/brand/takfusion-backdrop-1920x1080.jpg") 70% center / cover no-repeat, #f4f5f7; }
.t-brprev-panel { margin: 18px 0 18px 18px; width: 200px; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: linear-gradient(160deg, rgba(20,22,26,.93), rgba(9,10,12,.9)); border: 1px solid var(--line-strong); border-top: 2px solid var(--takfusion-brand-red); border-radius: 3px; }
:root[data-theme="day"] .t-brprev-panel { background: rgba(255,255,255,.97); }
.t-brprev-panel .t-lockup { width: 140px; }
.t-brprev-tenant { font-size: 10px; line-height: 1.35; color: var(--text-2); }
.t-brprev-btn { display: block; padding: 5px; border-radius: 2px; background: var(--takfusion-brand-red); color: #fff; font-size: 10px; font-weight: 600; text-align: center; }
.t-brprev-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 12px; border-top: 1px solid var(--line); background: rgba(7,8,10,.8); font-size: 10px; line-height: 1.4; color: #9aa2a9; }
:root[data-theme="day"] .t-brprev-foot { background: rgba(244,245,247,.92); color: var(--text-muted); }
.t-brprev-default { font-style: italic; }
.t-brmark { display: flex; gap: var(--sp-4); align-items: flex-start; }
.t-brmark img { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
/* setup (screens: setup, setup--*) */
.t-setup { max-width: 920px; }
.t-setup > .t-steps { margin-bottom: var(--sp-6); flex-wrap: wrap; row-gap: var(--sp-3); }
.t-steps--product li[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
.t-setup-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); padding-top: var(--sp-5); margin-top: var(--sp-5); border-top: 1px solid var(--line); }
.t-setup-list { list-style: none; margin: 0; padding: 0; }
.t-setup-list li { display: grid; grid-template-columns: 28px 200px minmax(0, 1fr); gap: var(--sp-4); align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line-faint); }
.t-setup-list .t-mono { color: var(--text-faint); }
@media (max-width: 720px) { .t-setup-list li { grid-template-columns: 28px minmax(0, 1fr); } .t-setup-list .t-sub { grid-column: 2; } }

/* accent picker (screen: branding) */
.t-accents { display: flex; flex-wrap: wrap; gap: var(--sp-2); border: 0; margin: 0; padding: 0; }
.t-accents label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: var(--t-sm); color: var(--text-muted); cursor: pointer; transition: color 120ms, border-color 120ms; }
.t-accents label:hover { color: var(--text); border-color: var(--line-bright, #3a424a); }
.t-accents input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.t-accents label:has(input:checked) { color: var(--text); border-color: var(--accent); }
.t-accents label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-brmark .t-stack { gap: var(--sp-2); }
.t-brfields .f-hint { font-family: var(--font-sans); }
.t-brfields .t-section > .f-field + .f-field, .t-brfields .t-section > .f-field + .t-row-actions { margin-top: var(--sp-4); }

/* public-safety accents (Admin > Branding). Accent is only ever a line or marker, never a dot,
   so orange and gold cannot be read as the warn status. */
:root[data-accent="navy"]   { --accent: #4a74c9; --accent-text: #86a6e3; --accent-wash: rgba(74,116,201,.08); --accent-press: rgba(74,116,201,.12); --accent-marker: rgba(74,116,201,.045); }
:root[data-accent="orange"] { --accent: #e8702a; --accent-text: #f29a62; --accent-wash: rgba(232,112,42,.08); --accent-press: rgba(232,112,42,.12); --accent-marker: rgba(232,112,42,.045); }
:root[data-accent="gold"]   { --accent: #d4a73a; --accent-text: #e3c273; --accent-wash: rgba(212,167,58,.08); --accent-press: rgba(212,167,58,.12); --accent-marker: rgba(212,167,58,.045); }
:root[data-accent="teal"]   { --accent: #2fa3a8; --accent-text: #6cc3c7; --accent-wash: rgba(47,163,168,.08); --accent-press: rgba(47,163,168,.12); --accent-marker: rgba(47,163,168,.045); }
:root[data-theme="day"][data-accent="navy"]   { --accent: #1d3f8a; --accent-text: #1d3f8a; }
:root[data-theme="day"][data-accent="orange"] { --accent: #b24c12; --accent-text: #b24c12; }
:root[data-theme="day"][data-accent="gold"]   { --accent: #8a6a14; --accent-text: #8a6a14; }
:root[data-theme="day"][data-accent="teal"]   { --accent: #13767a; --accent-text: #13767a; }
.t-swatch--navy { background: #4a74c9; } .t-swatch--orange { background: #e8702a; } .t-swatch--gold { background: #d4a73a; } .t-swatch--teal { background: #2fa3a8; }
.t-accents label { flex-direction: row; }

/* staged bar: full pane width, docked just above the page footer (all screens with a staged bar) */
.t-staged { position: sticky; bottom: 0; width: calc(100cqw + clamp(16px, 2.6vw, 32px) + clamp(16px, 2.2vw, 28px)); max-width: none; box-sizing: border-box; margin: var(--sp-6) 0 0 calc(-1 * clamp(16px, 2.6vw, 32px)); border-left: 0; border-right: 0; border-radius: 0; }
.t-main:has(.t-staged) { padding-bottom: 0; }
.t-main:has(.t-staged) .t-main-end { height: 0; }

/* docked frame: top bar, save bar and footer stay put; only the pane scrolls */
.t-app { height: 100vh; min-height: 0; overflow: hidden; }
.t-plane { overflow: hidden; }
.t-main { overflow-y: auto; overscroll-behavior: contain; }
.t-plane--subnav > nav { overflow-y: auto; }
.t-staged { margin-top: auto; }

/* staged bar spans the pane by negative margins, so a pane scrollbar never causes sideways scroll */
.t-main { overflow-x: hidden; }
.t-staged { width: auto; margin-left: calc(-1 * clamp(16px, 2.6vw, 32px)); margin-right: calc(-1 * clamp(16px, 2.2vw, 28px)); }

/* staged bar escapes any max-width form: full width of the scrolling pane */
.t-main { position: relative; }
.t-main :is(form, div, section):has(> .t-staged) { max-width: none; }
.t-main :is(form, div, section):has(> .t-staged) > :not(.t-staged) { max-width: var(--t-form-max, 880px); }

/* batch 5: groups, certificates, connections, errors */
.t-col-sel { width: 32px; padding-right: 0; }
.t-selectwrap--sm .f-input { min-width: 96px; height: 30px; padding-top: 0; padding-bottom: 0; }
.t-dlg-lose { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0; font: var(--w-regular) var(--t-xs)/1.4 var(--font-mono); color: var(--text-muted); }
.t-addpanel { border-bottom: 1px solid var(--line); padding-bottom: var(--sp-4); }
.t-addpanel .t-filters { align-items: flex-end; }
.t-checks li { align-items: flex-start; }
.t-checks li > .f-status { min-width: 190px; }
.t-file { padding-top: 7px; font: var(--w-regular) var(--t-sm)/1.4 var(--font-mono); }
.t-file::file-selector-button { margin-right: var(--sp-3); padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.t-form-actions { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-5) 0; border-top: 1px solid var(--line-faint); }
/* error-pages, error-backend: left-aligned statement, no box */
.t-errpage { max-width: 62ch; padding: var(--sp-8, 56px) 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.t-errpage .t-actions { margin-top: var(--sp-3); }

/* the pane scrolls, never its children: blocks keep their height inside the docked frame */
.t-main > * { flex-shrink: 0; }
.t-pagehead .t-actions { flex-wrap: nowrap; }

/* batch 6: email, template editor, bulk grid */
.t-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }
.t-inline-form .f-field { flex: 1 1 280px; max-width: 420px; }
.t-formpage--wide { max-width: none; }
.t-editor-cols { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--sp-6); align-items: start; }
@container main (max-width: 820px) { .t-editor-cols { grid-template-columns: minmax(0, 1fr); } }
.t-editor { border: 1px solid var(--line-strong); border-radius: 3px; background: var(--bg); }
.t-editor-bar { display: flex; align-items: center; min-height: 36px; padding: 0 var(--sp-3); border-bottom: 1px solid var(--line); }
.t-editor-slot { font: var(--w-regular) var(--t-xs)/1 var(--font-mono); color: var(--text-ghost); }
.t-editor-area { min-height: 260px; padding: var(--sp-4); color: var(--text); font: var(--w-regular) var(--t-sm)/1.6 var(--font-sans); outline: none; }
.t-editor-area p, .t-mailbody p { margin: 0 0 var(--sp-3); }
.t-editor:focus-within { border-color: var(--accent); }
.t-mailbody { max-width: 64ch; padding: var(--sp-4) 0; border-top: 1px solid var(--line-faint); color: var(--text); font: var(--w-regular) var(--t-sm)/1.6 var(--font-sans); }
.t-vars { position: sticky; top: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.t-varlist { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.t-var { padding: 3px 7px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--text-muted); font: var(--w-regular) var(--t-xs)/1.2 var(--font-mono); cursor: pointer; transition: color 120ms, border-color 120ms; }
.t-var:hover { color: var(--text); border-color: var(--line-strong); }
.t-var:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-gridbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-2); }
.t-gridcount { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--t-xs); color: var(--text-muted); }
.t-grid td { padding: 0; height: 34px; border-right: 1px solid var(--line-faint); }
.t-grid th { white-space: nowrap; }
.t-grid td.t-col-num { padding: 0 8px; color: var(--text-ghost); width: 44px; }
.t-cell { width: 100%; height: 34px; padding: 0 8px; border: 0; background: transparent; color: var(--text); font-size: var(--t-sm); }
.t-cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface-hover); }
.t-cell[readonly] { color: var(--text-muted); }
.t-grid td[aria-invalid="true"] { box-shadow: inset 0 -2px 0 var(--fault); }
.t-cell-msg { padding: 0 8px !important; font: var(--w-regular) var(--t-xs)/1.3 var(--font-mono); color: var(--text-muted); min-width: 160px; max-width: 240px; }
.t-cell-msg .f-status { margin-right: 6px; }
.t-row--err td:first-child { box-shadow: inset 2px 0 0 var(--fault); }
.t-progress--inline { width: 140px; margin: 0 var(--sp-2) 0 0; vertical-align: middle; }

.t-checkstack { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-3) 0; }
.t-form-grid .t-selectwrap, .t-form-grid .t-selectwrap .f-input { width: 100%; }
.t-section > .t-row-actions { margin-top: var(--sp-3); }

/* users-bulk: the username is the row's identity; the grid scrolls before it clips */
.t-grid { min-width: 820px; }
.t-grid th:nth-child(2), .t-grid td:nth-child(2) { min-width: 18ch; }
.t-grid th:nth-child(4), .t-grid td:nth-child(4) { min-width: 14ch; }

/* components.html only */
.t-spec { padding-bottom: var(--sp-5); }
.t-spec-body { display: flex; flex-direction: column; gap: var(--sp-3); }
.t-spec-dialogs { display: flex; flex-wrap: wrap; gap: var(--sp-5); align-items: flex-start; }
.t-dialog-static { position: static; margin: 0; max-width: 460px; }
.t-staged--inline { position: static; width: auto; }
.t-toasts--inline { position: static; }
