/* Sentiva Team Retro — styles. Owner: UI/UX Designer (T11, T12). Ported from docs/prototype-v6.html, then made production-ready:
   prototype-only rules removed, AA fixes (segmented tabs, hidden cards, inactive roster), Actions/History grids no longer
   widen the page at 375/768, system banner (NFR-11), loading and error states. Theme: js/theme.js sets
   <html data-theme="light|dark"> before first paint; no attribute = System (follows prefers-color-scheme). */
/* Layout: sticky app bar, DS aurora hero band for the retro, summary strip, carry-over card, then four lanes (4 side by side, tabbed below 1024px); search bar and lane headings stick under the app bar.
   All values follow the Sentiva Design System (colors_and_type.css). Column and status hues use DS families;
   where the DS step is too faint for text, a darker (light mode) or lighter (dark mode) step of the same family is used. */
:root {
  /* DS neutrals (light) */
  --bg: #FFFFFF;            /* --background */
  --surface: #FFFFFF;       /* --card */
  --surface-1: #FAFAFA;     /* --surface-1 */
  --surface-2: #F4F4F5;     /* --muted / --secondary */
  --surface-3: #E4E4E7;     /* --surface-3 */
  --lane: #FAFAFA;
  --fg: #1C1917;            /* --foreground hsl(24 6% 10%) */
  --fg-strong: #09090B;     /* --card-foreground hsl(240 10% 4%) */
  --fg-2: #71717A;          /* --muted-foreground */
  --fg-3: #A1A1AA;          /* --fg-3 */
  --border: #E4E4E7;        /* --border */
  --border-strong: #D4D4D8;
  --input: #E4E4E7;         /* --input */
  --ring: #18181B;          /* --ring */
  --primary: #18181B;       /* --primary hsl(240 6% 10%) */
  --primary-hover: rgb(24 24 27 / 0.9);
  --on-primary: #FAFAFA;    /* --primary-foreground */
  --link: #18181B;
  --danger: #DC2626;        /* --destructive hsl(0 72% 51%) */
  --on-danger: #FFFFFF;
  /* DS brand */
  --sentiva-purple: #6A1B9A;
  --sentiva-pink: #FF4081;
  --aurora-base: #2E1065;   /* --sentiva-deep */
  --aurora-pink: rgb(236 72 153 / 0.5);
  --aurora-violet: rgb(139 92 246 / 0.55);
  --aurora-haze: rgb(255 255 255 / 0.12);
  --on-aurora: #FFFFFF;
  --on-aurora-2: rgb(255 255 255 / 0.78);
  --on-aurora-3: rgb(255 255 255 / 0.55);
  --glass: rgb(255 255 255 / 0.1);
  --glass-hover: rgb(255 255 255 / 0.2);
  --glass-border: rgb(255 255 255 / 0.3);
  --logo-ink: #16132A;
  /* Retro columns: DS hue families, AA text steps */
  --well: #15803D;    --well-soft: #DCFCE7;    /* green-700 on green-100 (DS success family) */
  --wrong: #B91C1C;   --wrong-soft: #FEE2E2;   /* red-700 on red-100 (DS danger family) */
  --improve: #A16207; --improve-soft: #FEF9C3; /* yellow-700 on yellow-100 (DS warn family) */
  --ideas: #7C3AED;   --ideas-soft: #EDE9FE;   /* violet-600 on violet-100 (DS violet) */
  --kudos: #BE185D;   --kudos-soft: #FCE7F3;   /* pink-700 on pink-100 (DS magenta) */
  /* Action status: DS status palette */
  --st-open: #1C1917;  --st-open-soft: #F4F4F5;   /* DS Draft badge */
  --st-prog: #1D4ED8;  --st-prog-soft: #DBEAFE;   /* info, blue-700 on blue-100 */
  --st-done: #15803D;  --st-done-soft: #DCFCE7;   /* success, green-700 on green-100 */
  --st-drop: #DC2626;                              /* DS Disqualified: red border, ink text */
  --overdue: #B91C1C;  --overdue-soft: #FEE2E2;    /* danger, red-700 on red-100 */
  --stripe: #DC2626;
  --mark: #FEF9C3;     --mark-ink: #1C1917;
  --flash: #F4F4F5;    --flash-ring: #7C3AED;
  --scrim: rgb(9 9 11 / 0.5);
  --proto-bg: #18181B; --proto-fg: #FAFAFA; --proto-muted: #A1A1AA; --proto-btn: rgb(255 255 255 / 0.1);
  --chart-bar: #D946EF;  /* --sentiva-fuchsia */
  --chart-grid: #E4E4E7;
  --dot-draft: rgb(255 255 255 / 0.6); --dot-open: #4ADE80; --dot-disc: #60A5FA; --dot-closed: rgb(255 255 255 / 0.6);
  /* DS AVATAR_COLORS */
  --av1-bg: #DDD6FE; --av1-fg: #5B21B6;
  --av2-bg: #BBF7D0; --av2-fg: #166534;
  --av3-bg: #FBCFE8; --av3-fg: #9D174D;
  --av4-bg: #BAE6FD; --av4-fg: #075985;
  --av5-bg: #FECACA; --av5-fg: #991B1B;
  --av6-bg: #C7D2FE; --av6-fg: #3730A3;
  --av7-bg: #FDE68A; --av7-fg: #92400E;
  --av8-bg: #A7F3D0; --av8-fg: #065F46;
  /* DS shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  /* DS type */
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --t-xs: 0.75rem; --t-sm: 0.875rem; --t-base: 1rem; --t-lg: 1.125rem; --t-xl: 1.25rem; --t-2xl: 1.5rem; --t-3xl: 1.875rem; --t-4xl: 2.25rem;
  --tracking-tight: -0.025em;
  /* DS radius ladder */
  --r-sm: 0.25rem; --r-md: 0.375rem; --r-lg: 0.5rem; --r-full: 9999px;
  /* Muted text on --surface-2 (segmented controls): DS --muted-foreground is 4.4:1 there, so one zinc step darker */
  --fg-on-muted: #52525B;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090B; --surface: #18181B; --surface-1: #18181B; --surface-2: #27272A; --surface-3: #3F3F46; --lane: #09090B;
    --fg: #FAFAFA; --fg-strong: #FAFAFA; --fg-2: #A1A1AA; --fg-3: #71717A;
    --border: #27272A; --border-strong: #3F3F46; --input: #27272A; --ring: #D4D4D8;
    --primary: #FAFAFA; --primary-hover: rgb(250 250 250 / 0.9); --on-primary: #18181B;
    --link: #FAFAFA; --danger: #7F1D1D; --on-danger: #FEF2F2;
    --logo-ink: #FFFFFF; --fg-on-muted: #A1A1AA;
    --well: #4ADE80;    --well-soft: #052E16;
    --wrong: #F87171;   --wrong-soft: #450A0A;
    --improve: #FACC15; --improve-soft: #422006;
    --ideas: #A78BFA;   --ideas-soft: #2E1065;
    --kudos: #F472B6;   --kudos-soft: #500724;
    --st-open: #FAFAFA; --st-open-soft: #27272A;
    --st-prog: #60A5FA; --st-prog-soft: #172554;
    --st-done: #4ADE80; --st-done-soft: #052E16;
    --st-drop: #F87171;
    --overdue: #F87171; --overdue-soft: #450A0A;
    --stripe: #F87171;
    --mark: #422006; --mark-ink: #FEF9C3;
    --flash: #27272A; --flash-ring: #A78BFA;
    --scrim: rgb(0 0 0 / 0.65);
    --proto-bg: #27272A; --proto-fg: #FAFAFA; --proto-muted: #A1A1AA; --proto-btn: rgb(255 255 255 / 0.08);
    --chart-bar: #D946EF; --chart-grid: #27272A;
    --av1-bg: #2E1065; --av1-fg: #C4B5FD;
    --av2-bg: #14532D; --av2-fg: #86EFAC;
    --av3-bg: #500724; --av3-fg: #F9A8D4;
    --av4-bg: #0C4A6E; --av4-fg: #7DD3FC;
    --av5-bg: #450A0A; --av5-fg: #FCA5A5;
    --av6-bg: #1E1B4B; --av6-fg: #A5B4FC;
    --av7-bg: #422006; --av7-fg: #FCD34D;
    --av8-bg: #022C22; --av8-fg: #6EE7B7;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090B; --surface: #18181B; --surface-1: #18181B; --surface-2: #27272A; --surface-3: #3F3F46; --lane: #09090B;
  --fg: #FAFAFA; --fg-strong: #FAFAFA; --fg-2: #A1A1AA; --fg-3: #71717A;
  --border: #27272A; --border-strong: #3F3F46; --input: #27272A; --ring: #D4D4D8;
  --primary: #FAFAFA; --primary-hover: rgb(250 250 250 / 0.9); --on-primary: #18181B;
  --link: #FAFAFA; --danger: #7F1D1D; --on-danger: #FEF2F2;
  --logo-ink: #FFFFFF; --fg-on-muted: #A1A1AA;
  --well: #4ADE80;    --well-soft: #052E16;
  --wrong: #F87171;   --wrong-soft: #450A0A;
  --improve: #FACC15; --improve-soft: #422006;
  --ideas: #A78BFA;   --ideas-soft: #2E1065;
  --kudos: #F472B6;   --kudos-soft: #500724;
  --st-open: #FAFAFA; --st-open-soft: #27272A;
  --st-prog: #60A5FA; --st-prog-soft: #172554;
  --st-done: #4ADE80; --st-done-soft: #052E16;
  --st-drop: #F87171;
  --overdue: #F87171; --overdue-soft: #450A0A;
  --stripe: #F87171;
  --mark: #422006; --mark-ink: #FEF9C3;
  --flash: #27272A; --flash-ring: #A78BFA;
  --scrim: rgb(0 0 0 / 0.65);
  --proto-bg: #27272A; --proto-fg: #FAFAFA; --proto-muted: #A1A1AA; --proto-btn: rgb(255 255 255 / 0.08);
  --chart-bar: #D946EF; --chart-grid: #27272A;
  --av1-bg: #2E1065; --av1-fg: #C4B5FD;
  --av2-bg: #14532D; --av2-fg: #86EFAC;
  --av3-bg: #500724; --av3-fg: #F9A8D4;
  --av4-bg: #0C4A6E; --av4-fg: #7DD3FC;
  --av5-bg: #450A0A; --av5-fg: #FCA5A5;
  --av6-bg: #1E1B4B; --av6-fg: #A5B4FC;
  --av7-bg: #422006; --av7-fg: #FCD34D;
  --av8-bg: #022C22; --av8-fg: #6EE7B7;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: var(--t-sm); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--fg-strong); font-weight: 600; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 4px; }
.num, table, .stat-value { font-variant-numeric: tabular-nums; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 14px; height: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.inner { max-width: 1440px; margin-inline: auto; }

/* App bar */
.appbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.appbar .inner { display: flex; align-items: center; gap: 12px 20px; min-height: 56px; padding-block: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg-2); }
.brand svg { height: 22px; width: auto; display: block; }
.brand .lg-ink { fill: var(--logo-ink); }
.brand-sep { width: 1px; height: 18px; background: var(--border-strong); }
.brand-name { font-weight: 500; color: var(--fg-2); font-size: var(--t-sm); white-space: nowrap; }
.nav { display: flex; gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-md); color: var(--fg-2); text-decoration: none; font-weight: 500; transition: background-color .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--fg-strong); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fac-name { color: var(--fg-2); font-size: var(--t-xs); white-space: nowrap; }
.fac-name b { color: var(--fg); font-weight: 500; }
.me-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: background-color .15s; }
.me-btn:hover { background: var(--surface-2); }
.me-btn .not-you { color: var(--fg-2); font-size: var(--t-xs); text-decoration: underline; text-underline-offset: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: var(--r-full); background: var(--primary); color: var(--on-primary); font-size: var(--t-xs); font-weight: 600; }

/* Buttons: DS (h-10 default, h-9 sm, rounded-md, weight 500) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid transparent; font-weight: 500; font-size: var(--t-sm); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-link { background: transparent; color: var(--link); padding: 0 4px; height: 28px; text-decoration: underline; text-underline-offset: 4px; }
.btn-danger { background: var(--danger); color: var(--on-danger); }
.btn-sm { height: 36px; padding: 0 12px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: var(--t-xs); gap: 6px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon.btn-xs { width: 28px; height: 28px; }
/* Glass buttons: DS dashboard-hero treatment */
.btn-glass { background: var(--glass); border-color: var(--glass-border); color: var(--on-aurora); backdrop-filter: blur(12px); }
.btn-glass:hover:not(:disabled) { background: var(--glass-hover); }
.btn-light { background: var(--on-aurora); color: var(--aurora-base); }
.btn-light:hover:not(:disabled) { background: var(--on-aurora-2); }

/* Fields: DS inputs (h-10) */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: var(--t-sm); font-weight: 500; color: var(--fg); }
.hint { font-size: var(--t-xs); color: var(--fg-2); }
.err { font-size: var(--t-xs); color: var(--overdue); }
.input, .select, .textarea { width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--input); border-radius: var(--r-md); background: var(--surface); color: var(--fg); transition: box-shadow .15s, border-color .15s; }
.textarea { height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring); }
.select option { color: var(--fg); background: var(--surface); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--t-sm); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.search { position: relative; flex: 1 1 260px; min-width: 0; max-width: 380px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-2); }
.search .input { padding-left: 36px; }

/* Badges: DS (rounded-full, 12/600, 1px border) */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: var(--r-full); font-size: var(--t-xs); font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--fg); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.st-open { color: var(--st-open); background: var(--st-open-soft); border-color: var(--border); }
.chip.st-prog { color: var(--st-prog); background: var(--st-prog-soft); border-color: transparent; }
.chip.st-done { color: var(--st-done); background: var(--st-done-soft); border-color: transparent; }
.chip.st-drop { color: var(--fg); background: var(--surface); border-color: var(--st-drop); }
.chip.st-drop .dot { background: var(--st-drop); }
.chip.overdue { color: var(--overdue); background: var(--overdue-soft); border-color: transparent; }
.chip.muted { color: var(--fg); background: var(--surface-2); border-color: transparent; }
.chip.id { font-weight: 600; color: var(--fg-2); background: transparent; border-color: var(--border); }
.phase-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-full); font-size: var(--t-xs); font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--fg); }
.phase-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.phase-Draft { border-style: dashed; background: var(--surface-2); }
.phase-Draft .dot, .phase-Closed .dot { background: var(--fg-3); }
.phase-Open { color: var(--st-done); background: var(--st-done-soft); border-color: transparent; }
.phase-Discussing { color: var(--st-prog); background: var(--st-prog-soft); border-color: transparent; }
.phase-Closed { color: var(--fg); background: var(--surface-2); border-color: transparent; }

/* Retro band: DS dashboard aurora (same in both themes), fading into the page */
.band { position: relative; isolation: isolate; color: var(--on-aurora);
  background:
    radial-gradient(36% 140% at 88% 0%, var(--aurora-pink) 0%, transparent 70%),
    radial-gradient(42% 150% at 62% 10%, var(--aurora-violet) 0%, transparent 70%),
    radial-gradient(30% 90% at 75% 60%, var(--aurora-haze) 0%, transparent 60%),
    var(--aurora-base); }
.band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28px; background: linear-gradient(to bottom, transparent, var(--bg)); z-index: -1; pointer-events: none; }
.band .inner { padding-block: 24px 44px; display: grid; gap: 16px; }
.band :focus-visible { outline-color: var(--on-aurora); }
.band-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; justify-content: space-between; }
.band-title { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.eyebrow { font-size: var(--t-xs); font-weight: 500; color: var(--on-aurora-2); }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.retro-title { font-size: var(--t-4xl); font-weight: 700; letter-spacing: var(--tracking-tight); line-height: 1.1; color: var(--on-aurora); }
.select-glass { height: 32px; width: auto; padding: 0 28px 0 10px; font-size: var(--t-xs); background-color: var(--glass); border-color: var(--glass-border); color: var(--on-aurora); }
.select-glass:focus { border-color: var(--on-aurora); box-shadow: none; }
.band .phase-pill { background: var(--glass); border: 1px solid var(--glass-border); color: var(--on-aurora); }
.band .phase-Draft .dot { background: var(--dot-draft); }
.band .phase-Open .dot { background: var(--dot-open); }
.band .phase-Discussing .dot { background: var(--dot-disc); }
.band .phase-Closed .dot { background: var(--dot-closed); }
.phase-help { color: var(--on-aurora-2); max-width: 62ch; }
.fac-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.confirm-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.confirm-box p { flex: 1 1 260px; min-width: 0; }
.confirm-box :focus-visible { outline-color: var(--ring); }
.stepper { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; row-gap: 8px; }
.stepper li { display: flex; align-items: center; gap: 8px; color: var(--on-aurora-3); font-size: var(--t-xs); font-weight: 500; }
.stepper li + li::before { content: ""; width: 28px; height: 1px; background: var(--glass-border); margin: 0 10px; }
.stepper .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--glass-border); font-size: 11px; }
.stepper .done { color: var(--on-aurora-2); }
.stepper .done .n { background: var(--glass); }
.stepper .cur { color: var(--on-aurora); }
.stepper .cur .n { background: var(--on-aurora); color: var(--aurora-base); border-color: var(--on-aurora); }

/* Main */
main { padding-block: 20px 56px; }
#view-board main { padding-top: 4px; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; } /* minmax: wide tables scroll inside .table-wrap, never the page */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-title { font-size: var(--t-2xl); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; }

/* Stats */
.stats { display: flex; flex-wrap: wrap; align-items: stretch; }
.stat { padding: 12px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-right: 1px solid var(--border); flex: 1 1 auto; }
.stat:last-child { border-right: 0; }
.stat-label { font-size: var(--t-xs); color: var(--fg-2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat-value { font-size: var(--t-xl); font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--fg-strong); line-height: 1.3; }
.stat-value small { font-size: var(--t-xs); font-weight: 500; color: var(--fg-2); letter-spacing: 0; }
.col-counts { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.col-count { display: flex; align-items: center; gap: 6px; }
.vote-dots { display: inline-flex; gap: 4px; align-items: center; }
.vote-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--fg); }
.vote-dots i.on { background: var(--fg); }

/* Column identity: icon + name + colour together */
.cbadge { width: 22px; height: 22px; border-radius: var(--r-md); display: inline-grid; place-items: center; flex: none; }
.cbadge .ic { width: 14px; height: 14px; }
.cb-well { color: var(--well); background: var(--well-soft); }
.cb-wrong { color: var(--wrong); background: var(--wrong-soft); }
.cb-improve { color: var(--improve); background: var(--improve-soft); }
.cb-ideas { color: var(--ideas); background: var(--ideas-soft); }
.cb-kudos { color: var(--kudos); background: var(--kudos-soft); }

/* Carry-over */
.carry { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); }
.carry-head { display: flex; align-items: center; gap: 10px 14px; padding: 14px 16px; flex-wrap: wrap; }
.carry-head h2 { font-size: var(--t-lg); }
.carry-head .hint { flex: 1 1 200px; }
.carry-list { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; gap: 6px; }
.carry-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 12px 14px; display: grid; gap: 10px; }
.carry-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.carry-title { font-weight: 500; color: var(--fg-strong); flex: 1 1 240px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.carry-title:hover { text-decoration: underline; text-underline-offset: 4px; }
.meta { color: var(--fg-2); font-size: var(--t-xs); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-form { display: grid; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.seg { display: inline-flex; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--fg-on-muted); font-weight: 500; font-size: var(--t-xs); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s, color .15s; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--fg-strong); box-shadow: var(--shadow-sm); }
.reviewed { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: var(--t-xs); color: var(--fg-2); }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.sort { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: var(--t-xs); }
.sort .select { width: auto; }
.col-tabs { display: none; width: 100%; overflow-x: auto; }
.col-tabs .seg { width: 100%; min-width: 300px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex-wrap: nowrap; }
.col-tabs .seg button { flex-direction: column; justify-content: center; gap: 2px; height: 48px; padding: 0 2px; font-size: 11px; line-height: 1.15; text-align: center; white-space: nowrap; }
.col-tabs .seg button .ic { width: 14px; height: 14px; }
.col-tabs .t-well .ic { color: var(--well); } .col-tabs .t-wrong .ic { color: var(--wrong); } .col-tabs .t-improve .ic { color: var(--improve); }
.col-tabs .t-ideas .ic { color: var(--ideas); } .col-tabs .t-kudos .ic { color: var(--kudos); }

.toolbar.sticky-bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--appbar-h, 57px)); z-index: 12; background: var(--bg); padding-block: 10px; margin-block: -10px; }
.toolbar.sticky-bar.is-stuck { box-shadow: 0 1px 0 var(--border); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); color: var(--fg); }
.banner .ic { margin-top: 2px; color: var(--fg-2); }

/* Columns */
.columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.lane { background: var(--lane); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-width: 0; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--appbar-h, 57px) + var(--toolbar-h, 60px)); z-index: 6; background: var(--lane); border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; margin-bottom: 8px; }
.lane-head h2 { font-size: var(--t-sm); white-space: nowrap; }
.lane-head .count { color: var(--fg-2); font-size: var(--t-xs); font-weight: 500; }
.lane-head .btn { margin-left: auto; }
.lane-body { display: grid; gap: 8px; padding: 0 8px 10px; align-content: start; }
.empty { color: var(--fg-2); font-size: var(--t-xs); padding: 14px 10px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }

.composer { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 10px; display: grid; gap: 8px; }
.composer .textarea { min-height: 76px; }
.composer-meta { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-xs); color: var(--fg-2); flex-wrap: wrap; }
.composer-meta .over { color: var(--overdue); font-weight: 600; }
.composer-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.composer-actions .btns { display: flex; gap: 6px; margin-left: auto; }

.cmt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 10px 12px; display: grid; gap: 8px; position: relative; transition: background-color .6s, box-shadow .6s; }
.cmt.flash { background: var(--flash); box-shadow: 0 0 0 2px var(--flash-ring); }
/* Hidden (facilitator view): no opacity, so text keeps AA contrast and the card's "…" menu is not trapped under the next card */
.cmt.is-hidden { background: var(--surface-1); border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.cmt.is-hidden .cmt-text { color: var(--fg-2); }
.cmt-tag { font-size: var(--t-xs); font-weight: 600; color: var(--kudos); display: flex; align-items: center; gap: 6px; }
.cmt-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
.cmt-text mark, .act-title mark { background: var(--mark); color: var(--mark-ink); border-radius: 2px; padding: 0 1px; }
.cmt-foot { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.cmt-by { font-size: var(--t-xs); color: var(--fg-2); flex: 1 1 0; min-width: 0; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cmt-by .anon { font-style: italic; }
.cmt-by .you { color: var(--fg); font-weight: 600; }
.cmt-links { display: flex; gap: 6px; flex-wrap: wrap; }
.act-link { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface-2); color: var(--fg); font-size: var(--t-xs); font-weight: 600; cursor: pointer; }
.act-link:hover { border-color: var(--border-strong); }
.vote { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--fg); font-weight: 600; font-size: var(--t-xs); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.vote:hover:not(:disabled) { background: var(--surface-2); }
.vote[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.vote[aria-pressed="true"]:hover { background: var(--primary-hover); }
.vote:disabled { cursor: default; opacity: 0.5; }
.vote.frozen { border-style: dashed; cursor: default; }
.more { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 4px; display: grid; }
.menu button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; text-align: left; color: var(--fg); font-size: var(--t-sm); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu .danger { color: var(--overdue); }
.menu button[aria-checked="true"] { font-weight: 600; }
.menu .tick { margin-left: auto; }
.theme-menu .menu { min-width: 170px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px -4px; }
.inline-confirm { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); }
.inline-confirm .row { display: flex; gap: 6px; flex-wrap: wrap; }
.merged { font-size: var(--t-xs); color: var(--fg-2); }
.merged summary { cursor: pointer; color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.merged ul { margin: 6px 0 0; padding-left: 16px; display: grid; gap: 4px; }
.hidden-note { font-size: var(--t-xs); color: var(--fg-2); display: flex; align-items: center; gap: 6px; }

/* Page heads: DS PageTitle 20/600 */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.page-head h1 { font-size: var(--t-xl); line-height: 1.2; }
.page-head p { color: var(--fg-2); margin-top: 6px; }
.page-head .btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Actions */
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sum-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 500; transition: background-color .15s; }
.sum-chip:hover { background: var(--surface-2); }
.sum-chip .n { font-weight: 600; color: var(--fg-strong); }
.sum-chip[aria-pressed="true"] { border-color: var(--ring); box-shadow: inset 0 0 0 1px var(--ring); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; padding: 16px; }
.filters .check { height: 40px; }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: var(--t-xs); font-weight: 500; color: var(--fg-2); background: var(--surface-1); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-1); }
tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--stripe); }
.act-title { background: none; border: 0; padding: 0; text-align: left; color: var(--fg-strong); font-weight: 500; cursor: pointer; }
.act-title:hover { text-decoration: underline; text-underline-offset: 4px; }
.due-over { color: var(--overdue); font-weight: 600; }
.owner { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 500; flex: none; }
.av-lg { width: 32px; height: 32px; font-size: 12px; }
.av1 { background: var(--av1-bg); color: var(--av1-fg); } .av2 { background: var(--av2-bg); color: var(--av2-fg); }
.av3 { background: var(--av3-bg); color: var(--av3-fg); } .av4 { background: var(--av4-bg); color: var(--av4-fg); }
.av5 { background: var(--av5-bg); color: var(--av5-fg); } .av6 { background: var(--av6-bg); color: var(--av6-fg); }
.av7 { background: var(--av7-bg); color: var(--av7-fg); } .av8 { background: var(--av8-bg); color: var(--av8-fg); }
.status-select { height: 30px; border-radius: var(--r-full); padding: 0 26px 0 10px; font-size: var(--t-xs); font-weight: 600; border: 1px solid transparent; cursor: pointer; }
.status-select[data-s="Open"] { color: var(--st-open); background-color: var(--st-open-soft); border-color: var(--border); }
.status-select[data-s="In Progress"] { color: var(--st-prog); background-color: var(--st-prog-soft); }
.status-select[data-s="Done"] { color: var(--st-done); background-color: var(--st-done-soft); }
.status-select[data-s="Dropped"] { color: var(--fg); background-color: var(--surface); border-color: var(--st-drop); }
.status-select:focus { outline: 2px solid var(--ring); outline-offset: 2px; }
.status-select option { color: var(--fg); background: var(--surface); }
.sub-meta { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--fg-2); font-size: var(--t-xs); }
.empty-row { text-align: center; color: var(--fg-2); padding: 28px 12px; }

/* History */
.charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
.chart-card { padding: 24px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.chart-card .hint { font-size: var(--t-sm); margin-top: -4px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-t { fill: var(--fg-2); font-size: 11px; font-family: var(--font); }
.chart .val-t { fill: var(--fg-strong); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .sub-t { fill: var(--fg-2); font-size: 10.5px; font-family: var(--font); }
.chart .bar { fill: var(--chart-bar); }
.chart .bar-well { fill: var(--well); } .chart .bar-wrong { fill: var(--wrong); } .chart .bar-improve { fill: var(--improve); }
.chart .bar-ideas { fill: var(--ideas); } .chart .bar-kudos { fill: var(--kudos); }
.chart .hit { fill: transparent; }
.chart g:hover path { opacity: 0.85; }
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 18px; }
.mult h3 { font-size: var(--t-xs); font-weight: 500; color: var(--fg); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

/* Dialogs & sheets: DS (rounded-lg dialog, square sheet) */
dialog { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--fg); padding: 0; box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog::backdrop { background: var(--scrim, rgb(9 9 11 / 0.5)); }
.dlg { display: grid; gap: 16px; padding: 24px; }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; }
.dlg-head h2 { font-size: var(--t-lg); }
.dlg-head p { color: var(--fg-2); margin-top: 4px; }
.dlg-head .btn-icon { margin-left: auto; flex: none; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); border-radius: 0; border-width: 0 0 0 1px; }
dialog.drawer .dlg { padding: calc(24px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 24px; }
.section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.section h3 { font-size: var(--t-base); }
.proto-hint { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--st-prog-soft); color: var(--st-prog); font-size: var(--t-xs); }
.proto-hint code { font-family: inherit; font-weight: 700; }
.name-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; max-height: 50dvh; overflow: auto; }
.name-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--r-md); background: transparent; cursor: pointer; text-align: left; }
.name-list button:hover { background: var(--surface-2); }
.name-list button[aria-current="true"] { border-color: var(--ring); }
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.roster li { display: flex; gap: 8px; align-items: center; }
.roster .input { height: 36px; }
.roster .inactive .input { color: var(--fg-2); text-decoration: line-through; }
.quote { border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px 10px; display: grid; gap: 4px; background: var(--surface-1); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; }
.timeline .tdot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; border: 2px solid var(--fg); background: var(--surface); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: var(--t-sm); }
.kv dt { color: var(--fg-2); }
.kv dd { margin: 0; min-width: 0; }

/* Toasts */
.toasts { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: none; max-width: 520px; background: var(--primary); color: var(--on-primary); border-radius: var(--r-lg); padding: 12px 16px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-size: var(--t-sm); animation: toastIn .2s ease-out; }
.toast.err { background: var(--danger); color: var(--on-danger); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 1023px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .columns .lane:not(.is-active) { display: none; }
  .col-tabs { display: block; }
}
@media (max-width: 1099px) {
  .charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  .lane-head h2 { font-size: var(--t-base); }
  .retro-title { font-size: var(--t-3xl); }
  .stat { border-right: 0; border-bottom: 1px solid var(--border); flex: 1 1 50%; }
  .stat:last-child { border-bottom: 0; }
  .stat.wide { flex-basis: 100%; }
  .col-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .fac-name { display: none; }
  .nav { order: 3; width: 100%; }
  .nav a { flex: 1; justify-content: center; }
  .me-btn .me-name { display: none; }
  .brand-name, .brand-sep { display: none; }
  .appbar .inner { gap: 8px 10px; }
  .search { max-width: none; flex: 1 1 0; }
  .toolbar .spacer { display: none; }
  .sort-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .unlock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* icon-only, keeps its name */
  .stepper li + li::before { width: 12px; margin: 0 6px; }
  .chart-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- System banner (#sysBanner, rendered by js/main.js) ----
   .sysbar          : mock-mode "Sample data" strip
   .sysbar.is-error : NFR-11 error banner (database unreachable / config.js unfilled), role=alert */
.sysbar { background: var(--proto-bg); color: var(--proto-fg); font-size: var(--t-xs); }
.sysbar .inner { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding-block: 6px; }
.sysbar strong { font-weight: 600; }
.sysbar .pb-note { color: var(--proto-muted); flex: 1 1 240px; min-width: 0; }
.sysbar.is-error { background: var(--overdue-soft); color: var(--overdue); border-bottom: 1px solid var(--overdue); font-size: var(--t-sm); }
.sysbar.is-error .inner { padding-block: 12px; align-items: flex-start; }
.sysbar.is-error .ic { margin-top: 3px; width: 16px; height: 16px; }
.sysbar.is-error .pb-note { color: var(--fg); flex-basis: 320px; }
/* Error state: nothing to show in the retro band, so hide the empty purple strip */
body:has(.sysbar.is-error) .band { display: none; }
body:has(.sysbar.is-error) .loading::before { display: none; }

/* Loading / empty states */
.loading { color: var(--fg-2); padding: 48px 16px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.loading::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--fg); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { border-top-color: var(--border-strong); } }
.empty-row { font-size: var(--t-sm); }
