/* ============================================================
   TAN — one stylesheet for the TAN app.
   Tokens come from tokens.css (--bg-page, --ink, --ok, --ai …).
   Plain CSS, no build step, no framework. Every class is tan-*.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* v11: flush with the floating bar's bottom edge (#12d). Desk: space-3 + 52 = 64; + 28px TEST band = 92. Phone (≤640): space-2 + 48 = 56; with the band 88 (the bar keeps top 40). */
:root { --tan-sticky-top: 64px; --tan-sticky-top-test: 92px; }
[data-tan-band="test"] { --tan-sticky-top: 92px; } /* tan.js sets data-tan-band="test" on <html> when a .tan-band-test is on the page; the server may render it too */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 20px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a.tan-btn, a.tan-tab, a.tan-tile { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--ink-inverse); }
/* The light field the glass refracts: two faint monochrome blooms, fixed to the viewport. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 55% at 15% -5%, rgba(255,255,255,1), transparent 65%),
    radial-gradient(45% 40% at 95% 15%, rgba(0,0,0,0.12), transparent 65%),
    radial-gradient(60% 45% at 55% 105%, rgba(0,0,0,0.10), transparent 65%),
    radial-gradient(30% 30% at 80% 70%, rgba(255,255,255,0.9), transparent 70%),
    linear-gradient(120deg, rgba(255,255,255,0.5), transparent 45%, rgba(0,0,0,0.05));
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(70% 55% at 15% -5%, rgba(255,255,255,0.16), transparent 65%),
    radial-gradient(45% 40% at 95% 15%, rgba(255,255,255,0.07), transparent 65%),
    radial-gradient(60% 45% at 55% 105%, rgba(255,255,255,0.09), transparent 65%);
}
/* Liquid glass, the material: translucent ground, blur, bright rim, specular top line */
.tan-glass, .tan-tile, .tan-kpi, .tan-card, .tan-signin__card, .tan-tabs--seg, .tan-tour, .tan-stats, .tan-confirm {
  background: linear-gradient(135deg, var(--glass), var(--glass-2));
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-glass);
}

/* Focus: the framed square — square corners, 2px, offset 2px, visible in both themes */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 0;
}

/* ------------------------------------------------------------
   Page, headings, muted
   ------------------------------------------------------------ */
.tan-page {
  padding: var(--space-5) var(--space-8) var(--space-16);
  max-width: 1680px;
  margin: 0 auto;
}
.tan-h1 {
  font-family: var(--font-brand);
  font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}
.tan-h2 {
  font-family: var(--font-brand);
  font-size: 18px; line-height: 24px; font-weight: 600;
  margin: 0;
}
.tan-muted { color: var(--ink-2); font-size: 12px; line-height: 16px; }
.tan-eyebrow {
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-2);
}
.tan-page__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  margin-bottom: var(--space-5);
}
/* One page head for every module: title with its icon, a meta line (updated 06:12 · run picker · mode badge), then the module tab bar. */
.tan-page__title { display: flex; align-items: center; gap: 10px; }
.tan-page__title .tan-h1 { margin: 0; }
.tan-page__title .tan-icon { color: var(--ink-2); }
.tan-page__meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.tan-page__meta .tan-select { height: 28px; }
.tan-tabs--module { margin: -4px -4px calc(var(--space-5) - 4px); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 4px; } /* v11 #19: 4px keeps the 2px ring at 2px offset; given back as margin */
.tan-tabs--module::-webkit-scrollbar { display: none; }
.tan-section { margin-top: var(--space-6); }
.tan-section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  padding-bottom: var(--space-2); border-bottom: 1px solid var(--hairline); margin-bottom: var(--space-3);
}
.tan-hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--space-6) 0; }
.tan-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.tan-spacer { flex: 1; }
.tan-card {
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ------------------------------------------------------------
   Numbers and codes
   ------------------------------------------------------------ */
.tan-num {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}
.tan-num--neg { color: var(--bad); }
.tan-num--neg::before { content: "−"; }
.tan-num--over::after { content: " ▲"; font-size: 10px; }
.tan-num.is-updating { animation: tan-settle var(--dur-slow) var(--ease-out); }
@keyframes tan-settle { from { opacity: 0.35; transform: translateY(2px); } to { opacity: 1; transform: none; } }

.tan-code {
  font-family: var(--font-mono);
  font-size: 12.5px; line-height: 18px; font-weight: 500;
  white-space: nowrap;
  overflow: visible;
  letter-spacing: 0;
}
.tan-code--chip {
  display: inline-block; padding: 0 6px; border-radius: var(--radius-sm);
  background: var(--bg-well); border: 1px solid var(--hairline);
}
.tan-code--shop { font-weight: 700; letter-spacing: 0.04em; }

/* ------------------------------------------------------------
   Module icons — the one icon set. Outline, 1.75 stroke, currentColor; only beside a module's word.
   ------------------------------------------------------------ */
.tan-icon {
  width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.tan-icon--24 { width: 24px; height: 24px; vertical-align: -6px; }
.tan-tab .tan-icon { color: var(--ink-2); }
.tan-tab.is-active .tan-icon, .tan-tab:hover .tan-icon { color: var(--ink); }
.tan-tile .tan-icon { color: var(--ink-2); }
.tan-tile__name { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------
   App mark, TEST band, top bar, tabs
   ------------------------------------------------------------ */
.tan-mark {
  width: var(--size, 28px); height: var(--size, 28px); flex: none;
  background: var(--bg-page); position: relative;
  box-shadow: inset 0 0 0 calc(var(--size, 28px) * 0.039) var(--ink);
  border-radius: 0;
}
/* The site favicon, reproduced: a frame of 7/180 and a bold T — bar 130×19 at (26,35), stem 21×116 at (81,35) */
.tan-mark::before {
  content: ""; position: absolute;
  left: calc(var(--size, 28px) * 0.144); top: calc(var(--size, 28px) * 0.194);
  width: calc(var(--size, 28px) * 0.722); height: calc(var(--size, 28px) * 0.106);
  background: var(--ink);
}
.tan-mark::after {
  content: ""; position: absolute;
  left: calc(var(--size, 28px) * 0.45); top: calc(var(--size, 28px) * 0.194);
  width: calc(var(--size, 28px) * 0.117); height: calc(var(--size, 28px) * 0.644);
  background: var(--ink);
}
.tan-mark--lg { width: 64px; height: 64px; box-shadow: inset 0 0 0 2.5px var(--ink); }
.tan-mark--lg::before { left: 9.2px; top: 12.4px; width: 46.2px; height: 6.8px; }
.tan-mark--lg::after { left: 28.8px; top: 12.4px; width: 7.5px; height: 41.2px; }
/* The full logo (assets/tan-logo.svg, vector): only where it can be ≥ 64px — sign-in cards, the portal greeting, documents. Below that, the T mark. */
.tan-logo { display: block; flex: none; border-radius: 0; box-shadow: 0 0 0 1px var(--hairline); }

.tan-band-test {
  position: sticky; top: 0; z-index: var(--z-topbar);
  height: 28px; display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  background: var(--test); color: var(--on-test);
  font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}

.tan-topbar {
  position: sticky; top: var(--space-3); z-index: var(--z-topbar);
  height: 52px; margin: var(--space-3) var(--space-4) 0;
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-3) 0 var(--space-4);
  background: var(--bg-float);
  -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid var(--glass-edge); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.tan-topbar.is-scrolled { box-shadow: var(--shadow-float); }
.tan-band-test + .tan-topbar, body:has(.tan-band-test) .tan-topbar { top: calc(28px + var(--space-3)); } /* v11 #12c: no longer depends on DOM adjacency */
.tan-topbar__brand {
  display: flex; align-items: center; gap: var(--space-3); text-decoration: none; flex: none;
}
.tan-topbar__module {
  font-family: var(--font-brand); font-size: 15px; line-height: 20px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tan-topbar__meta { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.tan-topbar__user { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; }
.tan-topbar__user b { font-weight: 600; }
.tan-topbar__profile {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
  padding: 2px 6px; border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm); white-space: nowrap;
}

.tan-tabs { display: flex; align-items: center; gap: 2px; }
.tan-tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-pill);
  color: var(--ink-2); font-size: 13px; line-height: 20px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.tan-tab:hover { background: var(--bg-hover); color: var(--ink); }
.tan-tab.is-active, .tan-tab[aria-selected="true"] { background: linear-gradient(135deg, var(--glass), var(--glass-2)); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-glass); border: 1px solid var(--glass-edge); padding: 5px 13px; }
.tan-topbar .tan-tab.is-active { background: var(--bg-raised); }
.tan-tab__count {
  font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 600; color: var(--ink-2);
  padding: 0 5px; border-radius: 999px; background: var(--bg-well); border: 1px solid var(--hairline);
}
.tan-tab.is-active .tan-tab__count { background: var(--bg-raised); }
/* Segmented variant: scope / view controls inside a page */
.tan-tabs--seg { padding: 3px; border-radius: var(--radius-pill); }
.tan-tabs--seg .tan-tab { padding: 3px 12px; }
.tan-tabs--seg .tan-tab.is-active { background: var(--ink); color: var(--ink-inverse); border-color: transparent; padding: 3px 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.tan-tabs--seg .tan-tab.is-active .tan-tab__count { background: transparent; border-color: rgba(128,128,128,0.4); color: inherit; }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.tan-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--glass), var(--glass-2)); color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.tan-btn:hover { background: var(--bg-hover); }
.tan-btn:active { background: var(--bg-selected); }
.tan-btn:disabled, .tan-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.tan-btn--quiet { border-color: transparent; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; font-weight: 500; color: var(--ink-2); }
.tan-btn--quiet:hover { color: var(--ink); background: var(--bg-hover); }
.tan-btn--act {
  background: linear-gradient(180deg, var(--act-sheen), transparent 55%), var(--act); color: var(--on-act); border-color: var(--act);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 6px 16px rgba(0,0,0,0.18);
}
.tan-btn--act:hover { background: linear-gradient(180deg, var(--act-sheen), transparent 55%), var(--act-hover); border-color: var(--act-hover); }
.tan-btn--act:active { background: var(--act); }
.tan-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.tan-btn--lg { height: 40px; padding: 0 18px; font-size: 14px; }
.tan-btn--block { width: 100%; }
.tan-btn__glyph { font-size: 14px; line-height: 1; }
.tan-btn--act .tan-btn__glyph { font-weight: 700; }
/* An icon-only quiet button (refresh, close) */
.tan-btn--icon { width: 32px; padding: 0; }

/* ------------------------------------------------------------
   Inputs, selects, checks, switch
   ------------------------------------------------------------ */
.tan-field { display: flex; flex-direction: column; gap: 4px; }
.tan-field__label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); }
.tan-field__hint { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.tan-field__hint--scored { color: var(--ink); font-weight: 600; }
.tan-input, .tan-select {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: var(--bg-raised); color: var(--ink);
  box-shadow: inset 0 1px 2px var(--glass-shade);
  font-size: 13px; line-height: 20px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.tan-input::placeholder { color: var(--ink-3); }
.tan-input:hover, .tan-select:hover { border-color: var(--ink-2); }
.tan-input:focus, .tan-select:focus { border-color: var(--ink); outline-offset: 1px; }
.tan-input:disabled, .tan-select:disabled { opacity: 0.45; }
.tan-input--num { text-align: right; font-variant-numeric: tabular-nums; width: 88px; }
.tan-input--sm, .tan-select--sm { height: 28px; font-size: 12px; padding: 0 8px; }
.tan-select--sm { padding-right: 24px; background-position: calc(100% - 13px) 11px, calc(100% - 8px) 11px; }
.tan-input--code { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; text-transform: uppercase; }
.tan-input--cell { height: 26px; width: 72px; padding: 0 6px; font-size: 13px; }
.tan-input[aria-invalid="true"] { border-color: var(--bad); }
.tan-select {
  appearance: none; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.tan-search { position: relative; display: inline-flex; }
.tan-search .tan-input { padding-left: 28px; width: 260px; }
.tan-search::before {
  content: "⌕"; position: absolute; left: 9px; top: 5px; font-size: 16px; color: var(--ink-3); pointer-events: none;
}
.tan-textarea { min-height: 72px; padding: 8px 10px; resize: vertical; }
.tan-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tan-check input {
  appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--control-border); border-radius: 3px;
  background: var(--bg-raised); display: grid; place-items: center; cursor: pointer;
}
.tan-check input:checked { background: var(--ink); border-color: var(--ink); }
.tan-check input:checked::after { content: "✓"; color: var(--ink-inverse); font-size: 11px; font-weight: 700; line-height: 1; }
.tan-check input:disabled { opacity: 0.4; cursor: not-allowed; }
.tan-check--muted { color: var(--ink-3); }

/* One switch, one vocabulary: On / Off written next to it */
.tan-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tan-switch__track {
  width: 32px; height: 18px; border-radius: 999px; position: relative;
  border: 1px solid var(--control-border); background: var(--bg-well);
  transition: background var(--dur-fast) var(--ease-out);
}
.tan-switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink-2); transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.tan-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tan-switch input:checked + .tan-switch__track { background: var(--ink); border-color: var(--ink); }
.tan-switch input:checked + .tan-switch__track::after { transform: translateX(14px); background: var(--ink-inverse); }
.tan-switch input:focus-visible + .tan-switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }
.tan-switch__word { font-weight: 600; min-width: 24px; }
.tan-switch__word::after { content: "Off"; }
.tan-switch input:checked ~ .tan-switch__word::after { content: "On"; }

/* ------------------------------------------------------------
   Badges, live stamp, banners
   ------------------------------------------------------------ */
.tan-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: var(--radius-sm);
  font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
  color: var(--ink-2); background: var(--bg-well); border: 1px solid var(--hairline);
}
.tan-badge::before { font-weight: 700; font-size: 11px; }
.tan-badge--ok { color: var(--ok); background: var(--ok-tint); border-color: transparent; }
.tan-badge--ok::before { content: "✓"; }
.tan-badge--warn { color: var(--warn); background: var(--warn-tint); border-color: transparent; }
.tan-badge--warn::before { content: "!"; }
.tan-badge--bad { color: var(--bad); background: var(--bad-tint); border-color: transparent; }
.tan-badge--bad::before { content: "✕"; }
.tan-badge--info { color: var(--info); background: var(--info-tint); border-color: transparent; }
.tan-badge--info::before { content: "i"; font-family: var(--font-brand); }
.tan-badge--stale { color: var(--stale); background: var(--stale-tint); border-color: transparent; }
.tan-badge--stale::before { content: "◷"; }
.tan-badge--none::before { content: none; }
/* Provenance — engine / human / auto — always distinguishable, glyph + word */
.tan-badge--engine { color: var(--prov-engine); background: var(--ai-tint); border-color: transparent; }
.tan-badge--engine::before { content: "◆"; color: var(--ai); font-size: 9px; }
.tan-badge--human { color: var(--ink-inverse); background: var(--prov-human); border-color: transparent; }
.tan-badge--human::before { content: "✎"; }
.tan-badge--auto { color: var(--prov-auto); background: transparent; border: 1px dashed var(--control-border); }
.tan-badge--auto::before { content: "◷"; }
.tan-badge--count { font-variant-numeric: tabular-nums; }
.tan-badge--solid.tan-badge--bad { color: #ffffff; background: var(--bad); }
[data-theme="dark"] .tan-badge--solid.tan-badge--bad { color: #000000; }

/* Freshness stamp and the engine pulse */
.tan-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-2); white-space: nowrap; }
.tan-live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.tan-live--stale .tan-live__dot { background: var(--stale); }
.tan-live--stale { color: var(--stale); }
.tan-live--bad .tan-live__dot { background: var(--bad); }
.tan-live--bad { color: var(--bad); }
.tan-live--running { color: var(--ai-ink); }
.tan-live--running .tan-live__dot { background: var(--ai); animation: tan-pulse var(--pulse-period) var(--ease-out) infinite; }
@keyframes tan-pulse {
  0% { box-shadow: 0 0 0 0 var(--ai-glow); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.tan-banner {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--info-tint); color: var(--ink);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow-glass);
  font-size: 14px; line-height: 20px;
}
.tan-banner::before { content: "i"; font-family: var(--font-brand); font-weight: 700; color: var(--info); width: 16px; text-align: center; flex: none; }
.tan-banner--ok { background: var(--ok-tint); } .tan-banner--ok::before { content: "✓"; color: var(--ok); }
.tan-banner--warn { background: var(--warn-tint); } .tan-banner--warn::before { content: "!"; color: var(--warn); }
.tan-banner--bad { background: var(--bad-tint); border-color: var(--bad); } .tan-banner--bad::before { content: "✕"; color: var(--bad); }
.tan-banner--stale { background: var(--stale-tint); } .tan-banner--stale::before { content: "◷"; color: var(--stale); }
.tan-banner__body { flex: 1; min-width: 0; }
.tan-banner__title { font-weight: 600; }
.tan-banner__actions { display: flex; gap: var(--space-2); flex: none; }
.tan-banners { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }

/* ------------------------------------------------------------
   Tiles (portal) and KPIs
   ------------------------------------------------------------ */
.tan-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.tan-tile {
  display: flex; flex-direction: column; gap: var(--space-2);
  min-height: 132px; padding: var(--space-5);
  border-radius: var(--radius-md);
  color: inherit; text-decoration: none; text-align: left; cursor: pointer; position: relative;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tan-tile:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-float); }
.tan-tile:active { transform: translateY(0); }
.tan-tile__kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.tan-tile__name { font-family: var(--font-brand); font-size: 20px; line-height: 24px; font-weight: 600; }
.tan-tile__desc { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.tan-tile__state { margin-top: auto; padding-top: var(--space-2); border-top: 1px solid var(--hairline); white-space: normal; }
.tan-tile__state.tan-live { display: flex; align-items: flex-start; }
.tan-tile__state .tan-live__dot { margin-top: 4px; }
.tan-tile__arrow { position: absolute; top: var(--space-4); right: var(--space-4); color: var(--ink-3); font-size: 16px; }
.tan-tile--outside .tan-tile__arrow::after { content: "↗"; }
.tan-tile--unavailable { cursor: default; color: var(--ink-2); border-style: dashed; border-color: var(--hairline-strong); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.tan-tile--unavailable:hover { border-color: var(--hairline-strong); transform: none; box-shadow: none; }
.tan-tile--unavailable .tan-tile__name { color: var(--ink-2); }
.tan-tile--unavailable .tan-tile__desc { color: var(--ink-2); }
.tan-tile--unavailable .tan-tile__state { color: var(--ink-2); }

.tan-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.tan-kpi {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.tan-kpi__label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.tan-kpi__value {
  font-family: var(--font-brand); font-size: 32px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tan-kpi__value small { font-size: 16px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.tan-kpi__sub { font-size: 12px; line-height: 16px; color: var(--ink-2); }
.tan-kpi--hero { grid-column: span 2; }
.tan-kpi--hero .tan-kpi__value { font-size: 44px; line-height: 48px; }
.tan-kpi--warn .tan-kpi__value { color: var(--warn); }
.tan-kpi--warn .tan-kpi__value::before { content: "! "; font-size: 0.6em; vertical-align: 0.3em; }
.tan-kpi--bad .tan-kpi__value { color: var(--bad); }
.tan-kpi--bad .tan-kpi__value::before { content: "✕ "; font-size: 0.5em; vertical-align: 0.35em; }
.tan-kpi--ok .tan-kpi__value { color: var(--ok); }
.tan-kpi--quiet .tan-kpi__value { color: var(--ink-3); }
.tan-kpi--compact .tan-kpi__value { font-size: 24px; line-height: 30px; }

/* Small horizontal bar (progress, threshold, relative size). Never colour alone: a number sits beside it. */
.tan-bar { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tan-bar__track { flex: 1; height: 4px; min-width: 40px; border-radius: 2px; background: var(--hairline-strong); overflow: hidden; }
.tan-bar__fill { height: 100%; background: var(--ink-2); border-radius: 2px; }
.tan-bar--ok .tan-bar__fill { background: var(--ok); }
.tan-bar--warn .tan-bar__fill { background: var(--warn); }
.tan-bar--bad .tan-bar__fill { background: var(--bad); }
.tan-bar__label { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Two- or three-part split bar with a legend (urgent vs level-up, lateness distribution) */
.tan-split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--hairline); }
.tan-split > span { display: block; height: 100%; }
.tan-split__a { background: var(--ink); } .tan-split__b { background: var(--ink-2); } .tan-split__c { background: var(--hairline-strong); }
.tan-legend { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.tan-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* ------------------------------------------------------------
   Toolbar (controls row above a table)
   ------------------------------------------------------------ */
.tan-toolbar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-4) 0 var(--space-3); }
.tan-toolbar__count { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tan-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tan-chip {
  appearance: none; cursor: pointer; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--glass-edge); background: linear-gradient(135deg, var(--glass), var(--glass-2)); color: var(--ink-2); box-shadow: var(--shadow-glass);
  font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.tan-chip:hover { color: var(--ink); background: var(--bg-hover); }
.tan-chip.is-active { background: var(--ink); color: var(--ink-inverse); border-color: var(--ink); }
.tan-chip--bad { color: var(--bad); }
.tan-chip--warn { color: var(--warn); }

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */
.tan-table-wrap {
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  background: var(--bg-raised); overflow: auto; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tan-table-wrap--scroll { max-height: 560px; }
/* Long table that scrolls with the page: no inner scroll; the header sticks under the floating top bar. */
.tan-table-wrap--page { overflow: visible; }
/* v11 #12b: only the wrap's OWN header sticks; tables inside an expanded row are not caught. */
.tan-table-wrap--page > .tan-table > thead th { position: sticky; top: var(--tan-sticky-top); z-index: var(--z-sticky); background: var(--bg-well); }
.tan-table-wrap--page > .tan-table > thead th:first-child { border-top-left-radius: var(--radius-md); }
.tan-table-wrap--page > .tan-table > thead th:last-child { border-top-right-radius: var(--radius-md); }
.tan-table-wrap--page > .tan-table__foot { position: static; }
/* v11 #12a: inside a modal or drawer the panel body scrolls, not the page — the head sticks at its top. */
/* Belt and braces: with the band on the page the head clears it even before tan.js has marked <html>. */
body:has(.tan-band-test) .tan-table-wrap--page > .tan-table > thead th { top: var(--tan-sticky-top-test); }
body .tan-modal .tan-table-wrap--page > .tan-table > thead th, body .tan-drawer .tan-table-wrap--page > .tan-table > thead th { top: 0; }
/* Wide table that must scroll sideways: its own screen-high box; header sticks inside it. */
.tan-table-wrap--viewport { overflow: auto; max-height: calc(100vh - var(--tan-sticky-top) - var(--space-6)); }
.tan-table-wrap--viewport > .tan-table > thead th { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg-well); }
/* v11 #12e: --viewport may be added on top of --page (TAN.fitTables does it when the table is wider than its wrap); together, --viewport wins. */
.tan-table-wrap--page.tan-table-wrap--viewport { overflow: auto; }
.tan-table-wrap--page.tan-table-wrap--viewport > .tan-table > thead th { top: 0; }
/* v11.1 #29: TEST-band twin — the band rule above weighs (0,3,3) and would beat the line before at (0,3,2); this one weighs (0,4,3). */
body:has(.tan-band-test) .tan-table-wrap--page.tan-table-wrap--viewport > .tan-table > thead th { top: 0; }
.tan-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 18px; }
.tan-table th {
  position: relative; text-align: left; vertical-align: bottom;
  padding: 8px 12px; background: var(--bg-well);
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1px solid var(--hairline-strong); white-space: nowrap;
}
.tan-table--sticky > thead th { position: sticky; top: 0; z-index: var(--z-sticky); }
/* v11 #12b: a nested head (table inside tr.tan-table__detail) is static; a nested --sticky one sticks at top 0 of its own --scroll box, one layer below the page head. */
.tan-table__detail .tan-table > thead th { position: static; }
.tan-table__detail .tan-table--sticky > thead th { position: sticky; top: 0; z-index: calc(var(--z-sticky) - 1); }
.tan-table td { padding: 6px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; white-space: nowrap; }
.tan-table td.wrap { white-space: normal; min-width: 220px; }
.tan-table td.tan-num, .tan-table th.tan-num { text-align: right; }
.tan-table th.tan-num { font-weight: 600; }
.tan-table tbody tr:last-child td { border-bottom: 0; }
.tan-table tbody tr:hover td { background: var(--bg-hover); }
.tan-table tbody tr.is-selected td { background: var(--bg-selected); }
.tan-table tbody tr.is-clickable { cursor: pointer; }
.tan-table--dense td { padding: 4px 10px; }
.tan-table--dense th { padding: 6px 10px; }
.tan-table--auto { width: auto; }
.tan-table .tan-code { font-size: 12px; }
.tan-table th.is-sortable { cursor: pointer; padding-right: 20px; }
.tan-table th.is-sortable::after { content: "↕"; position: absolute; right: 8px; color: var(--ink-3); font-weight: 400; }
.tan-table th[aria-sort="descending"]::after { content: "↓"; color: var(--ink); }
.tan-table th[aria-sort="ascending"]::after { content: "↑"; color: var(--ink); }
.tan-table__check { width: 32px; padding-right: 0 !important; }
.tan-table__caret { width: 24px; color: var(--ink-3); padding-right: 0 !important; }
.tan-table tr[aria-expanded="true"] .tan-table__caret { color: var(--ink); }
.tan-table tr[aria-expanded="true"] td { background: var(--bg-well); border-bottom-color: transparent; }
.tan-table__detail > td { padding: 0 !important; white-space: normal; background: var(--bg-well); }
.tan-table__detail > td > div { padding: var(--space-4) var(--space-5) var(--space-5) 44px; border-bottom: 1px solid var(--hairline-strong); }
.tan-table__sub { font-size: 11px; color: var(--ink-2); display: block; line-height: 14px; }
.tan-table__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 8px 12px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--hairline); background: var(--bg-well);
  position: sticky; bottom: 0; font-variant-numeric: tabular-nums;
}
.tan-table__empty { padding: var(--space-8); text-align: center; color: var(--ink-2); }
.tan-table__mark { background: var(--warn-tint); color: inherit; padding: 0 2px; border-radius: 2px; }
.tan-table td .tan-badge { vertical-align: middle; }
/* Row-level actions appear on hover only for people who can act; view users get no cell at all */
.tan-table__actions { text-align: right; width: 64px; }
.tan-table__actions .tan-btn { opacity: 0; }
.tan-table tr:hover .tan-table__actions .tan-btn, .tan-table__actions .tan-btn:focus-visible { opacity: 1; }

/* Bulk bar: sticky at the bottom once a line is ticked */
.tan-bulkbar {
  position: sticky; bottom: var(--space-4); z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  background: var(--bg-float); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-float);
  margin-top: var(--space-4);
}
.tan-bulkbar__count { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Steps / stat strip (drawer, tour card, PO block) */
.tan-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); border-radius: var(--radius-md); overflow: hidden; }
.tan-stats > div { padding: 10px 12px; min-width: 0; border-left: 1px solid var(--hairline); }
.tan-stats > div:first-child { border-left: 0; }
.tan-stats__label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.tan-stats__value { font-family: var(--font-brand); font-size: 20px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tan-stats__value small { font-family: var(--font-ui); font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 3px; }

.tan-steps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.tan-steps > li { display: grid; grid-template-columns: 112px 1fr; gap: var(--space-3); padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.tan-steps > li:last-child { border-bottom: 0; }
.tan-steps__label { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-top: 2px; }
.tan-steps__value { font-size: 14px; }
.tan-steps__value b { font-weight: 600; }
.tan-steps__note { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
/* Gate list: ✓ passed / ✕ blocked / ! warn, word always beside the glyph */
.tan-gates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.tan-gates > li { display: flex; gap: 8px; align-items: baseline; }
.tan-gates > li::before { content: "✓"; color: var(--ok); font-weight: 700; width: 14px; flex: none; }
.tan-gates > li.is-blocked::before { content: "✕"; color: var(--bad); }
.tan-gates > li.is-warn::before { content: "!"; color: var(--warn); }
.tan-gates > li.is-skipped::before { content: "–"; color: var(--ink-3); }
.tan-gates__meta { color: var(--ink-2); margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------
   Confidence — one component, three sizes, four bands
   ------------------------------------------------------------ */
.tan-confidence { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }
.tan-confidence__bar { width: 56px; height: 4px; border-radius: 2px; background: var(--hairline-strong); overflow: hidden; flex: none; }
.tan-confidence__fill { height: 100%; background: var(--ai); }
.tan-confidence__score { font-weight: 600; min-width: 20px; }
.tan-confidence__band { font-weight: 500; }
.tan-confidence[data-band="high"] .tan-confidence__band { color: var(--ok); }
.tan-confidence[data-band="medium"] .tan-confidence__band { color: var(--warn); }
.tan-confidence[data-band="low"] .tan-confidence__band { color: var(--bad); }
.tan-confidence[data-band="manual"] { color: var(--stale); font-style: italic; }
.tan-confidence[data-band="manual"] .tan-confidence__fill { background: var(--stale); }
.tan-confidence--badge { height: 24px; padding: 0 8px 0 6px; border-radius: var(--radius-sm); background: var(--bg-well); border: 1px solid var(--hairline); }
.tan-confidence--full { display: block; }
.tan-confidence--full .tan-confidence__head { display: flex; align-items: baseline; gap: 10px; }
.tan-confidence--full .tan-confidence__score { font-family: var(--font-brand); font-size: 32px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; }
.tan-confidence--full .tan-confidence__bar { width: 100%; height: 6px; margin: 8px 0 12px; }
.tan-confidence__factors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tan-confidence__factors > li { display: grid; grid-template-columns: 120px 1fr 56px; gap: 10px; align-items: center; font-size: 12px; }
.tan-confidence__factors .tan-bar__track { height: 4px; }
.tan-confidence__factors .tan-bar__fill { background: var(--ai); }
.tan-confidence__weak { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.tan-confidence__weak b { color: var(--ink); }
/* Evidence split: € share by strength. Fill strengths differ by lightness, and the legend names every share. */
.tan-confidence--evidence .tan-confidence__bar { display: flex; width: 100%; height: 6px; }
.tan-confidence--evidence .tan-confidence__bar > span { display: block; height: 100%; }
.tan-confidence__strong { background: var(--ai); }
.tan-confidence__fair { background: var(--ai); opacity: 0.45; }
.tan-confidence__thin { background: var(--stale); }

/* ------------------------------------------------------------
   Output — the structured result of an action
   ------------------------------------------------------------ */
.tan-output { border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--bg-raised); overflow: hidden; }
.tan-output__head { display: flex; align-items: center; gap: var(--space-3); padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.tan-output__glyph { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; background: var(--info-tint); color: var(--info); }
.tan-output--ok .tan-output__glyph { background: var(--ok-tint); color: var(--ok); }
.tan-output--bad .tan-output__glyph { background: var(--bad-tint); color: var(--bad); }
.tan-output--blocked .tan-output__glyph { background: var(--warn-tint); color: var(--warn); }
.tan-output--running .tan-output__glyph { background: var(--ai-tint); color: var(--ai-ink); }
.tan-output__title { font-weight: 600; }
.tan-output__meta { margin-left: auto; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tan-output__body { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.tan-output__lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tan-output__lines > li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.tan-output__lines > li:last-child { border-bottom: 0; }
.tan-output__lines .tan-badge { margin-left: auto; }
.tan-output__next { font-size: 13px; color: var(--ink-2); }
.tan-output__next b { color: var(--ink); }
.tan-output__cmd {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-well); border: 1px solid var(--hairline);
  font-family: var(--font-mono); font-size: 12px; line-height: 18px; white-space: pre-wrap; word-break: break-all; color: var(--ink);
}
.tan-output__cmd .tan-btn { margin-left: auto; flex: none; }
.tan-output__stderr { font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: var(--bad); white-space: pre-wrap; margin: 0; }

/* ------------------------------------------------------------
   Floating layers: modal, drawer, toast, assistant
   ------------------------------------------------------------ */
.tan-scrim { position: fixed; inset: 0; background: var(--bg-scrim); z-index: var(--z-modal); animation: tan-fade var(--dur-fast) var(--ease-out); }
.tan-scrim--drawer { z-index: var(--z-drawer); }
@keyframes tan-fade { from { opacity: 0; } }

.tan-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--bg-float); -webkit-backdrop-filter: blur(32px) saturate(1.5); backdrop-filter: blur(32px) saturate(1.5);
  border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-float);
  z-index: calc(var(--z-modal) + 1);
  animation: tan-modal-in var(--dur-base) var(--ease-out);
}
.tan-modal--inline { position: relative; left: auto; top: auto; transform: none; margin: 0 auto; animation: none; }
.tan-modal--wide { width: min(880px, calc(100vw - 32px)); }
@keyframes tan-modal-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.98); } }
.tan-modal__head { padding: var(--space-5) var(--space-5) var(--space-3); display: flex; align-items: flex-start; gap: var(--space-3); }
.tan-modal__head .tan-h2 { flex: 1; }
.tan-modal__body { padding: 0 var(--space-5) var(--space-5); overflow: auto; display: flex; flex-direction: column; gap: var(--space-4); font-size: 14px; }
.tan-modal__foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--hairline); display: flex; align-items: center; gap: var(--space-2); }
.tan-modal__foot .tan-btn--act { margin-left: auto; }
.tan-modal__step { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }

/* Typed confirmation — the last rung of every gate */
.tan-confirm { display: flex; flex-direction: column; gap: 8px; padding: var(--space-4); border-radius: var(--radius-md); }
.tan-confirm__label { font-size: 13px; }
.tan-confirm__label code { font-family: var(--font-mono); font-weight: 700; padding: 0 5px; border-radius: 3px; background: var(--bg-raised); border: 1px solid var(--hairline); }
.tan-confirm__row { display: flex; gap: 8px; }
.tan-confirm .tan-input { flex: 1; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.tan-confirm__hint { font-size: 12px; color: var(--ink-2); }

/* Before → after, for the admin confirm step and any edit review */
.tan-diff { border: 1px solid var(--hairline); border-radius: var(--radius-md); overflow: hidden; font-size: 13px; }
.tan-diff__row { display: grid; grid-template-columns: 1.2fr 1fr 24px 1fr; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--hairline); }
.tan-diff__row:last-child { border-bottom: 0; }
.tan-diff__row--head { background: var(--bg-well); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.tan-diff__key { font-weight: 500; }
.tan-diff__before { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.tan-diff__arrow { color: var(--ink-3); text-align: center; }
.tan-diff__after { font-weight: 600; }

.tan-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw);
  display: flex; flex-direction: column;
  background: var(--bg-float); -webkit-backdrop-filter: blur(32px) saturate(1.5); backdrop-filter: blur(32px) saturate(1.5);
  border-left: 1px solid var(--glass-edge); box-shadow: var(--shadow-float);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg); top: var(--space-3); bottom: var(--space-3);
  z-index: calc(var(--z-drawer) + 1);
  animation: tan-drawer-in var(--dur-base) var(--ease-out);
}
@keyframes tan-drawer-in { from { transform: translateX(24px); opacity: 0; } }
.tan-drawer--inline { position: relative; inset: auto; width: 100%; height: 100%; animation: none; border-radius: var(--radius-lg); }
.tan-drawer__head { padding: var(--space-5) var(--space-5) var(--space-4); border-bottom: 1px solid var(--hairline); display: flex; gap: var(--space-3); align-items: flex-start; }
.tan-drawer__head .tan-btn--icon { margin-left: auto; flex: none; }
.tan-drawer__eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ai-ink); margin-bottom: 4px; }
.tan-drawer__eyebrow::before { content: "◆"; color: var(--ai); font-size: 9px; }
.tan-drawer__title { font-family: var(--font-brand); font-size: 17px; line-height: 22px; font-weight: 600; }
.tan-drawer__sub { margin-top: 4px; }
.tan-drawer__body { flex: 1; overflow: auto; padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); }
.tan-drawer__section .tan-eyebrow { margin-bottom: 8px; }
.tan-drawer__foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--hairline); font-size: 12px; color: var(--ink-2); }
.tan-drawer__thumb { width: 88px; height: 88px; border-radius: var(--radius-md); border: 1px solid var(--hairline); object-fit: cover; background: #fff; flex: none; }

.tan-toasts { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; }
.tan-toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--bg-float); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow-float);
  font-size: 13px; line-height: 18px;
  animation: tan-toast-in var(--dur-base) var(--ease-out);
}
@keyframes tan-toast-in { from { transform: translateY(8px); opacity: 0; } }
.tan-toast::before { content: "✓"; color: var(--ok); font-weight: 700; }
.tan-toast--bad::before { content: "✕"; color: var(--bad); }
.tan-toast--warn::before { content: "!"; color: var(--warn); }
.tan-toast--engine::before { content: "◆"; color: var(--ai); font-size: 10px; padding-top: 3px; }
.tan-toast__meta { display: block; color: var(--ink-2); font-size: 12px; }
.tan-toast .tan-btn--icon { margin-left: auto; height: 20px; width: 20px; }

/* Packshot preview: floats beside a hovered code; the frame is themed, the photo keeps its white paper */
.tan-packshot {
  position: fixed; z-index: var(--z-toast); width: 180px; padding: 8px;
  background: var(--bg-float); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-edge); border-radius: var(--radius-md); box-shadow: var(--shadow-float); pointer-events: none;
  animation: tan-fade var(--dur-fast) var(--ease-out);
}
.tan-packshot img { display: block; width: 164px; height: 164px; object-fit: contain; background: #ffffff; border-radius: var(--radius-sm); border: 1px solid var(--hairline); }
.tan-packshot__code { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-2); text-align: center; }
[data-packshot] { cursor: zoom-in; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }

/* Assistant / chat — one pattern for the plan assistant, Christie and Margot */
.tan-assistant {
  display: flex; flex-direction: column; width: 100%; max-width: 420px; height: 560px;
  background: linear-gradient(135deg, var(--glass), var(--glass-2)); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-glass);
}
.tan-assistant--float { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--z-drawer); background: var(--bg-float); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: var(--shadow-float); }
.tan-assistant__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.tan-assistant__avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--ai-tint); display: grid; place-items: center; color: var(--ai); font-size: 10px; flex: none; }
.tan-assistant__avatar.is-thinking { animation: tan-pulse var(--pulse-period) var(--ease-out) infinite; box-shadow: 0 0 0 0 var(--ai-glow); }
.tan-assistant__name { font-weight: 600; }
.tan-assistant__context { font-size: 12px; color: var(--ink-2); }
.tan-assistant__thread { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tan-msg { max-width: 92%; font-size: 13px; line-height: 19px; }
.tan-msg--user { align-self: flex-end; padding: 8px 12px; border-radius: var(--radius-md); background: var(--bg-raised); border: 1px solid var(--hairline-strong); }
.tan-msg--ai { align-self: flex-start; }
.tan-msg__body { padding: 8px 12px; border-radius: var(--radius-md); background: var(--ai-tint); color: var(--ink); }
.tan-msg__body p { margin: 0 0 6px; } .tan-msg__body p:last-child { margin: 0; }
.tan-msg.is-streaming .tan-msg__body::after { content: "▍"; color: var(--ai); animation: tan-blink 1s steps(2) infinite; }
@keyframes tan-blink { to { opacity: 0; } }
.tan-msg__steps { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ai-ink); }
.tan-msg__steps > li::before { content: "✓ "; }
.tan-msg__steps > li.is-running::before { content: "◆ "; color: var(--ai); animation: tan-blink 1.2s steps(2) infinite; }
.tan-msg__sources { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tan-msg__sources > span { font-size: 11px; padding: 1px 6px; border-radius: var(--radius-sm); border: 1px solid var(--hairline-strong); color: var(--ink-2); background: var(--bg-raised); }
.tan-msg__proposal { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-raised); border: 1px solid var(--hairline-strong); display: flex; align-items: center; gap: 10px; }
.tan-msg__proposal .tan-btn { margin-left: auto; }
.tan-assistant__suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.tan-assistant__composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hairline); }
.tan-assistant__composer .tan-input { flex: 1; }
.tan-assistant__foot { padding: 6px 16px 10px; font-size: 11px; color: var(--ink-3); }
.tan-assistant__launcher {
  position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--z-drawer);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hairline-strong);
  background: var(--bg-float); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5); box-shadow: var(--shadow-float); border-color: var(--glass-edge);
  display: grid; place-items: center; color: var(--ai); font-size: 14px; cursor: pointer;
}

/* ------------------------------------------------------------
   Sign-in pages, empty states, misc
   ------------------------------------------------------------ */
.tan-signin { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6); }
.tan-signin__card { width: min(400px, 100%); display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-10); border-radius: var(--radius-lg); text-align: center; align-items: center; }
.tan-signin__title { font-family: var(--font-brand); font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.tan-signin__foot { font-size: 12px; color: var(--ink-3); }
.tan-ms { width: 16px; height: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.tan-ms i { background: currentColor; }
.tan-empty { padding: var(--space-16) var(--space-6); text-align: center; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.tan-empty__title { font-family: var(--font-brand); font-size: 20px; font-weight: 600; color: var(--ink); }
.tan-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--hairline-strong); border-top-color: var(--ink); animation: tan-spin 0.8s linear infinite; }
@keyframes tan-spin { to { transform: rotate(360deg); } }
.tan-kbd { font-family: var(--font-mono); font-size: 11px; padding: 0 5px; border: 1px solid var(--control-border); border-bottom-width: 2px; border-radius: 4px; }

/* Tour board (replenishment): a tile variant */
.tan-tours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: var(--space-3); overflow-x: auto; padding: 12px 12px 4px; margin: -12px -12px 0; } /* v11 #18: room for the 2px lift, the float shadow and the focus ring */
.tan-tour { padding: var(--space-4); cursor: pointer; }
.tan-tour.is-today { border-color: var(--ink); box-shadow: var(--shadow-glass), 0 0 0 1px var(--ink); }
.tan-tour.is-past { opacity: 0.6; cursor: default; }
.tan-tour__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tan-tour__name { font-family: var(--font-brand); font-size: 16px; font-weight: 700; white-space: nowrap; }
.tan-tour__dates { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.tan-tour__shops { font-size: 12px; color: var(--ink-2); margin: 4px 0 10px; }
.tan-tour__sofar { font-size: 12px; color: var(--ink-2); padding: 6px 8px; background: var(--bg-well); border-radius: var(--radius-sm); margin-bottom: 10px; }
.tan-tour__sofar b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tan-tour__steps { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tan-tour__step { display: flex; gap: 8px; align-items: center; }
.tan-tour__step::before { content: "○"; color: var(--ink-3); width: 14px; }
.tan-tour__step.is-done::before { content: "✓"; color: var(--ok); font-weight: 700; }
.tan-tour__step.is-warn::before { content: "!"; color: var(--warn); font-weight: 700; }
.tan-tour__step small { color: var(--ink-2); }
.tan-tour .tan-btn { margin-top: 10px; align-self: flex-start; }

/* Admin profiles grid: none / view / act as a segmented radio */
.tan-access { display: inline-flex; border: 1px solid var(--control-border); border-radius: var(--radius-sm); overflow: hidden; }
.tan-access label { padding: 3px 10px; font-size: 12px; font-weight: 500; color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--hairline); }
.tan-access label:last-child { border-right: 0; }
.tan-access input { position: absolute; opacity: 0; width: 0; height: 0; }
/* v11.2 #30: every selected choice is a solid ink pill, whatever its value, so each row shows exactly one filled pill. */
.tan-access input:checked + span { font-weight: 700; color: var(--ink-inverse); }
.tan-access label:has(input:checked) { background: var(--ink); }
.tan-access label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
/* Read-only (disabled radios): the chosen pill keeps its full fill so the value stays legible; the other choices recede. */
.tan-access label:has(input:disabled) { cursor: not-allowed; }
.tan-access label:has(input:disabled:not(:checked)) span { color: var(--ink-3); }

/* Theme + reduced motion */
.tan-theme-toggle { font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------
   Phone (≤ 640px): read KPIs, banners and single records; tables scroll
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .tan-page { padding: var(--space-4) var(--space-4) var(--space-12); }
  .tan-topbar { padding: 0 var(--space-2) 0 var(--space-3); gap: var(--space-2); height: 48px; margin: var(--space-2) var(--space-2) 0; top: var(--space-2); }
  .tan-topbar .tan-tabs { overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 96px; padding: 4px; margin: -4px; } /* v11 #19a */
  .tan-topbar__meta { flex: none; }
  .tan-topbar__meta .tan-select { display: none; }
  .tan-section__head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .tan-topbar .tan-tabs::-webkit-scrollbar { display: none; }
  .tan-topbar__module { display: none; }
  .tan-tabs--module { margin-left: calc(-1 * var(--space-4)); margin-right: calc(-1 * var(--space-4)); padding-top: 4px; padding-bottom: 4px; padding-left: var(--space-4); padding-right: var(--space-4); }
  .tan-topbar__user span:not(.tan-topbar__profile) { display: none; }
  .tan-topbar__meta .tan-live, .tan-topbar__meta .tan-badge { display: none; }
  .tan-kpis { grid-template-columns: repeat(2, 1fr); }
  .tan-kpi--hero { grid-column: span 2; }
  .tan-kpi__value { font-size: 26px; line-height: 30px; }
  .tan-kpi--hero .tan-kpi__value { font-size: 36px; line-height: 40px; }
  .tan-tours { grid-auto-columns: 82%; }
  :root { --tan-sticky-top: 56px; --tan-sticky-top-test: 88px; }
  [data-tan-band="test"] { --tan-sticky-top: 88px; }
  .tan-topbar__theme-word { display: none; }
  .tan-topbar__theme::before { content: "◐"; font-size: 14px; line-height: 1; }
  .tan-topbar__theme { width: 28px; padding: 0; }
  .tan-panes { grid-template-columns: minmax(0, 1fr); }
  .tan-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: -4px; }
  .tan-ask { padding-left: 14px; }
  .tan-ask__input { font-size: 15px; }
  .tan-toolbar { gap: var(--space-2); }
  .tan-search .tan-input { width: 100%; }
  .tan-search { flex: 1; }
  .tan-table-wrap--scroll { max-height: 70vh; }
  .tan-drawer { width: 100vw; border-left: 0; }
  .tan-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .tan-toasts { left: var(--space-4); right: var(--space-4); }
  .tan-assistant--float { left: var(--space-2); right: var(--space-2); max-width: none; height: 70vh; }
  .tan-steps > li { grid-template-columns: 88px 1fr; }
  .tan-diff__row { grid-template-columns: 1fr 1fr 16px 1fr; font-size: 12px; }
  .tan-page__head { flex-direction: column; align-items: flex-start; }
}


/* ============================================================
   v11 — 2026-09-23. Additions only; every v10 class keeps working.
   ============================================================ */

/* #19 Focus on an ink ground: a ring drawn INSIDE an ink-filled control uses --focus-inverse. The segmented pill keeps its 3px: its ring sits 1px out. */
.tan-tabs--seg .tan-tab:focus-visible { outline-offset: 1px; }
.tan-access label:has(input:checked:focus-visible) { outline-color: var(--focus-inverse); }

/* #18b Busy: a write in flight. aria-busy + disabled; keeps full ink (it is working, not invalid); spinner replaces the glyph. */
.tan-btn[aria-busy="true"], .tan-btn[aria-busy="true"]:disabled { opacity: 1; cursor: progress; }
.tan-btn__spinner { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tan-spin 0.8s linear infinite; }

/* #18c / #25 Row toggles: a real button in the 24px caret column. ▸/▾ expands the row (aria-expanded); ◆ opens the engine-rationale drawer (aria-haspopup="dialog"). */
.tan-table__toggle {
  appearance: none; border: 0; background: none; padding: 0; margin: -3px 0; cursor: pointer;
  width: 24px; height: 24px; border-radius: var(--radius-sm); display: inline-grid; place-items: center;
  font: inherit; font-size: 12px; line-height: 1; color: inherit;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.tan-table__toggle:hover { background: var(--bg-hover); color: var(--ink); }
.tan-table__toggle::before { content: "▸"; }
.tan-table__toggle[aria-expanded="true"]::before { content: "▾"; }
.tan-table__toggle--why::before, .tan-table__toggle--why[aria-expanded]::before { content: "◆"; color: var(--ai); font-size: 10px; }
.tan-table--dense .tan-table__toggle { width: 22px; height: 22px; margin: -2px 0; }

/* #21 Theme switch: its own slot in .tan-topbar__meta, before the user. Labelled with its destination; ◐ only on a phone. */
.tan-topbar__theme { flex: none; }

/* #23 Inline text link: a word inside a sentence that acts like a control. <a> or <button>. */
.tan-link { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.tan-link:hover { text-decoration-thickness: 2px; }
.tan-link[aria-disabled="true"] { color: var(--ink-2); cursor: not-allowed; text-decoration-style: dotted; }

/* #24 A tile that states a setting, not a measured figure. */
.tan-kpi__value--sm { font-size: 22px; line-height: 26px; letter-spacing: -0.01em; }
.tan-kpi__value--sm small { font-size: 13px; }

/* #22 The portal greeting / display line: 32/36 (the reference's pixels, now the token). */
.tan-display { font-family: var(--font-brand); font-size: 32px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }

/* #26 tan-textarea is a modifier: always "tan-input tan-textarea"; rows decides the height. */
.tan-input.tan-textarea { height: auto; line-height: 20px; }

/* #10 Home ask bar: a hero input over an inline assistant. */
.tan-ask {
  display: flex; align-items: center; gap: var(--space-2); width: min(720px, 100%); margin: 0 auto;
  padding: 6px 6px 6px 18px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--glass), var(--glass-2));
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--control-border); box-shadow: var(--shadow-glass);
}
.tan-ask:focus-within { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 2px; }
.tan-ask__glyph { color: var(--ai); font-size: 11px; flex: none; }
.tan-ask__input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 24px; }
.tan-ask__input::placeholder { color: var(--ink-3); }
.tan-ask__input:focus-visible { outline: none; }
.tan-ask .tan-btn { height: 40px; flex: none; }
.tan-ask + .tan-chips { justify-content: center; margin-top: var(--space-3); }
.tan-assistant--inline { max-width: none; height: auto; }
.tan-assistant--inline .tan-assistant__thread { max-height: 480px; }

/* #11 Two-pane list / detail and the settings row (Security). */
.tan-panes { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.tan-list { display: flex; flex-direction: column; gap: 2px; }
.tan-list__item {
  appearance: none; border: 0; background: none; cursor: pointer; text-align: left; text-decoration: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 7px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font: inherit; font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap;
}
.tan-list__item:hover { background: var(--bg-hover); color: var(--ink); }
.tan-list__item.is-active, .tan-list__item[aria-current="page"], .tan-list__item[aria-selected="true"] { background: var(--bg-selected); color: var(--ink); font-weight: 600; }
.tan-detail { min-width: 0; }
.tan-setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-4); align-items: center; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.tan-setting:last-child { border-bottom: 0; }
.tan-setting__label { font-size: 14px; line-height: 20px; font-weight: 600; }
.tan-setting__hint { grid-column: 1; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.tan-setting__control { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: var(--space-2); }

/* #27 TAN's own date field: dd/mm/yyyy text + the browser's calendar popup (a grid names the month, so it is unambiguous). The hidden native input holds the ISO value that is submitted. */
.tan-date { position: relative; display: inline-flex; align-items: center; }
.tan-date__text { width: 136px; padding-right: 32px; font-variant-numeric: tabular-nums; }
.tan-date__pick {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  appearance: none; border: 0; background: none; cursor: pointer; width: 26px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; color: var(--ink-2); font: inherit; font-size: 11px;
}
.tan-date__pick:hover { background: var(--bg-hover); color: var(--ink); }
.tan-date__native { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; margin: 0; }
.tan-date .tan-input--sm + .tan-date__pick { height: 22px; }
