/* REQ-126: the base. Tokens (colours, fonts), layout, navigation and shared components
   (buttons, chips, tabs, dialogs). Each feature's rules are in css/<feature>.css, linked
   after this file in index.html; a new feature adds its own file and one link line (AGENTS.md). */
/* Layout: summary strip (counts + everything waiting on you), then a responsive grid of agent cards fed live from db `agents/*`. */
:root {
  /* REQ-139: the comarondo theme (bg, ink, accent, status, font families, light and dark) comes from
     tokens/comarondo.css, linked before this file: a pinned copy of the court-apps tokens release
     (scripts/comarondoTokens.test.mjs). Change those values in court-apps tokens/comarondo.json, never here.
     What stays here is the back office's own: the office building, the robots and the like. */
  /* REQ-148.2: the fixed light and dark grounds the building sign is previewed on, in either theme */
  --sign-ground-light: #F4F1FA; --sign-ink-light: #1C0B36; --sign-ground-dark: #160829; --sign-ink-dark: #F3EEFF;
  /* REQ-216.12.7: Steven's own items ('Waiting on you'), amber in Pablo's m1 v3; text >= 4.5:1 on its ground */
  --you: #B45309; --you-soft: #FEF3C7;
  /* REQ-216.1: the shadow of a popover (the ⋯ menu), in either theme */
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.18);
  /* office.* (REQ-28 3D building): light stage. Status dots >= 3:1 on floor and hall. */
  --office-bg: #ECE9F4; --office-floor: #DCD6EC; --office-wall: #C9C2DE; --office-wall-2: #BDB5D6;
  --office-hall: #CDC3EE; --office-trim: #007A5A;
  /* REQ-168.2: the Sports complex world's colours (Pablo's d1, room 09), for walls, floors, hall and props. */
  --office-world-sports-floor: #E6EEF3; --office-world-sports-wall: #E7EDF3; --office-world-sports-wall-2: #D2DCE6;
  --office-world-sports-hall: #C6D2DE; --office-world-sports-court: #2F6DB5; --office-world-sports-line: #FFFFFF;
  --office-world-sports-net: #1C2433; --office-world-sports-glass: #B9DEF5; --office-world-sports-board: #17131F;
  --office-world-sports-chair: #C8925A; --office-world-sports-table: #C8925A; --office-world-sports-hard: #D9A066;
  --office-world-sports-key: #E0662B; --office-world-sports-rim: #D9481F; --office-world-sports-water: #3FA9DD;
  --office-world-sports-tile: #F4F7FA; --office-world-sports-rope: #DC2626; --office-world-sports-mat: #F2795F;
  --office-world-sports-iron: #2A2A33; --office-world-sports-plate: #DC2626; --office-world-sports-plate-2: #2563EB;
  --office-world-sports-pad: #1C0B36; --office-world-sports-turf: #5FAE6C; --office-world-sports-turf-2: #56A363;
  --office-world-sports-flood: #FFF3B0;
  /* REQ-168.2: the avenue, the plaza and the grass between the facilities (Pablo, m3 v1) */
  --office-world-sports-road: #6B7482; --office-world-sports-road-line: #F4F7FA; --office-world-sports-sand: #E9D7AE; --office-world-sports-park: #8CC27A;
  --office-world-sports-sign: #FFFFFF; --office-world-sports-sign-ink: #B13A0A;
  /* REQ-193: the Castle world (castleWorld.mjs), Pablo's mockup m1 v5 palette */
  --office-world-castle-floor: #7DAE62; --office-world-castle-wall: #BDBFC6; --office-world-castle-wall-2: #A2A6B0; --office-world-castle-hall: #CFC6AE;
  --office-world-castle-grass: #7DAE62; --office-world-castle-earth: #5B4636; --office-world-castle-stone: #BDBFC6;
  --office-world-castle-wood: #9C5D3E; --office-world-castle-path: #CFC6AE; --office-world-castle-water: #6FA39A;
  --office-world-castle-roof: #A04C3C; --office-world-castle-torch: #FF9A4A; --office-world-castle-banner: #4C6FA5;
  --office-world-castle-awning: #C9A24A; --office-world-castle-forge: #FF7A2E; --office-world-castle-flower: #E8A0B4;
  --office-world-castle-glass: #6FB3D9; --office-world-castle-label: #2A2620;
  /* REQ-160: the Galaxy world (Pablo's mockup m1 v3) */
  --office-world-galaxy-plate: #C9CBD8; --office-world-galaxy-ring: #D9B98C; --office-world-galaxy-moon: #C7C3D6; --office-world-galaxy-star: #FFFFFF;
  --office-world-galaxy-suit: #F2F2F5; --office-world-galaxy-metal: #A6ADBB; --office-world-galaxy-hull: #E4E6EE; --office-world-galaxy-dark: #3A3F52;
  --office-world-galaxy-visor: #2A3550; --office-world-galaxy-glass: #9FD8E8; --office-world-galaxy-glow: #3DF5B0; --office-world-galaxy-hazard: #F2B33D;
  --office-world-galaxy-solar: #2F4C8A; --office-world-galaxy-crystal: #B98CF0; --office-world-galaxy-fin: #B5443A; --office-world-galaxy-label: #FFFFFF;
  --office-world-galaxy-label-ink: #1C0B36; --office-world-galaxy-tree: #5FA05C; --office-world-galaxy-panel-blue: #2F6DB5; --office-world-galaxy-panel-gold: #D4A72C; --office-world-galaxy-lilac-low: #8E93B8; --office-world-galaxy-lilac-high: #B4B6D2; --office-world-galaxy-lilac-crater: #6E7398;
  --office-world-galaxy-teal-low: #6FA8A6; --office-world-galaxy-teal-high: #94C4C0; --office-world-galaxy-teal-crater: #4D8584; --office-world-galaxy-rust-low: #C08A70;
  --office-world-galaxy-rust-high: #D6A88E; --office-world-galaxy-rust-crater: #9A6650; --office-world-galaxy-ice-low: #9DB6D6; --office-world-galaxy-ice-high: #C3D3E8;
  --office-world-galaxy-ice-crater: #7894BC; --office-world-galaxy-moss-low: #86A970; --office-world-galaxy-moss-high: #A6C48E; --office-world-galaxy-moss-crater: #66874F;
  --office-hud: rgba(255, 255, 255, 0.88); --office-hud-ink: #17151F; --office-line: rgba(23, 21, 31, 0.14);
  --office-spot-dim: rgba(23, 21, 31, 0.45);   /* REQ-76: the floor around a located agent */
  --spot-dim: rgba(23, 21, 31, 0.45);          /* REQ-82: the tour's scrim, the same dim as REQ-76's Locate */
  --office-status-working: #1D4ED8; --office-status-idle: #635779; --office-status-blocked: #B91C1C;
  --office-status-waiting: #B13A0A; --office-status-meeting: #BE185D; --office-status-review: #6D28D9;
  --office-status-done: #0A7550;
  /* office.celebrate.* (REQ-38 release celebration): confetti, from the brand accent bases; decoration only. */
  --office-confetti-1: #007A5A; --office-confetti-2: #0E8A5F; --office-confetti-3: #F97257; --office-confetti-4: #C28A2B;
  /* office.* physical parts (REQ-28 28.6.4): the same in light and dark, so set once here.
     Sign = the COURT.LIVE roof letters; king = Steven's office; board = whiteboard status inks
     (light inks on a white board, >= 4.5:1). Furniture and props stay literal by design. */
  /* office.weather.* (REQ-81, Pablo): the sky and its weather behind the building; physical, so the same
     in light and dark like the other parts. Decoration only: the HUD keeps its own colours. */
  --office-sky-clear-day: #8CC8F2; --office-sky-clear-night: #141B3A;
  --office-sky-cloudy-day: #A9B4C4; --office-sky-cloudy-night: #1E2230;
  --office-sky-rain: #6F7D90; --office-sky-snow: #C7D0DC; --office-sky-fog: #B7BCC4; --office-sky-thunder: #3B3F52;
  --office-cloud: rgba(255, 255, 255, 0.78); --office-rain: rgba(214, 228, 245, 0.55); --office-snow: rgba(255, 255, 255, 0.9);
  /* the agent popover's card, light in both themes (REQ-137.3.2: its rank badge) */
  --office-pop-card: #FFFFFF; --office-pop-ink: #17131F;
  --office-sign-panel: #FFFFFF; --office-sign-letter: #17131F; --office-sign-live-panel: #3DF5B0; --office-sign-live-letter: #1C0B36;
  --office-sign-frame: #111018; --office-sign-post: #3F3A55;
  --office-king-gold: #FBBF24; --office-king-velvet: #9F1239;
  /* REQ-84.2: the Human Pod (a playful prison; physical parts, the same in light and dark). */
  --office-pod-bars: #94A3B8; --office-pod-stripe-1: #F5F5F4; --office-pod-stripe-2: #27272A; --office-pod-floor: #A8A29E;
  /* REQ-78.2: the robot assistant in Steven's office (a physical part, the same in light and dark). */
  --office-robot-body: #D4D4D8; --office-robot-trim: #3DF5B0; --office-robot-face: #17131F; --office-robot-glyph: #FFFFFF;
  /* REQ-101.1: a new agent's welcome sash and its star (a physical part, the same in light and dark). */
  --office-newcomer-sash: #3DF5B0; --office-newcomer-star: #FBBF24;
  /* REQ-221.1.3: the helpers badge over an agent with working helper sub-agents (the same in light and dark). */
  --office-helpers-badge: #334155;
  --office-board-status-working: #2563EB; --office-board-status-idle: #6B6880; --office-board-status-done: #0A7550;
  --office-board-status-blocked: #B91C1C; --office-board-status-waiting: #B13A0A; --office-board-status-meeting: #BE185D;
  --office-board-status-review: #6D28D9;
  /* REQ-139: comarondo type (Steven, 9 Oct): Outfit for display, Figtree for text, IBM Plex Mono for ids and labels. */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --you: #FBBF24; --you-soft: #3A2A0A;
    --office-bg: #160829; --office-floor: #2A1650; --office-wall: #22123F; --office-wall-2: #1C0B36;
    --office-hall: #34205C; --office-trim: #3DF5B0;
    /* REQ-168.2: the Sports complex world's colours (Pablo's d1, room 09), for walls, floors, hall and props. */
    --office-world-sports-floor: #26303D; --office-world-sports-wall: #1F2A3A; --office-world-sports-wall-2: #182230;
    --office-world-sports-hall: #0F1622; --office-world-sports-court: #1F4F8A; --office-world-sports-line: #E8EEF6;
    --office-world-sports-net: #070A10; --office-world-sports-glass: #3A5A74; --office-world-sports-board: #0B0912;
    --office-world-sports-chair: #8A5E3C; --office-world-sports-table: #8A5E3C; --office-world-sports-hard: #7A5232;
    --office-world-sports-key: #B4501F; --office-world-sports-rim: #FF7A45; --office-world-sports-water: #1F5F8A;
    --office-world-sports-tile: #34404F; --office-world-sports-rope: #E5484D; --office-world-sports-mat: #9E4636;
    --office-world-sports-iron: #4A4A57; --office-world-sports-plate: #E5484D;
    --office-world-sports-plate-2: #5B8DEF; --office-world-sports-pad: #3B2A5E; --office-world-sports-turf: #2D6B3A;
    --office-world-sports-turf-2: #28603A; --office-world-sports-flood: #FFE58A;
    --office-world-sports-road: #3A414C; --office-world-sports-road-line: #C9D2DC; --office-world-sports-sand: #7A6A48; --office-world-sports-park: #3F7A45;
    --office-world-sports-sign: #1C0B36; --office-world-sports-sign-ink: #FFA26B;
    --office-world-castle-floor: #4E8A50; --office-world-castle-wall: #7D818E; --office-world-castle-wall-2: #646977; --office-world-castle-hall: #6F6A5C;
    --office-world-castle-grass: #4E8A50; --office-world-castle-earth: #30251D; --office-world-castle-stone: #7D818E;
    --office-world-castle-wood: #75432D; --office-world-castle-path: #6F6A5C; --office-world-castle-water: #3A6B66;
    --office-world-castle-roof: #7A3A2D; --office-world-castle-torch: #F08A3C; --office-world-castle-banner: #6F8FC9;
    --office-world-castle-awning: #A8843A; --office-world-castle-forge: #FF8A45; --office-world-castle-flower: #B97A8C;
    --office-world-castle-glass: #4F8DB3; --office-world-castle-label: #EDE6D6;
    /* REQ-160: the Galaxy world (Pablo's mockup m1 v3) */
    --office-world-galaxy-plate: #8A8DA2; --office-world-galaxy-ring: #A88C66; --office-world-galaxy-moon: #8E8AA2; --office-world-galaxy-star: #E8ECFF;
    --office-world-galaxy-suit: #D6D7DE; --office-world-galaxy-metal: #7A8090; --office-world-galaxy-hull: #B4B7C4; --office-world-galaxy-dark: #242838;
    --office-world-galaxy-visor: #1A2238; --office-world-galaxy-glass: #6FB0C4; --office-world-galaxy-glow: #3DF5B0; --office-world-galaxy-hazard: #F2B33D;
    --office-world-galaxy-solar: #24407A; --office-world-galaxy-crystal: #A57CE0; --office-world-galaxy-fin: #B95247; --office-world-galaxy-label: #1E1433;
    --office-world-galaxy-label-ink: #F2EEFF; --office-world-galaxy-tree: #3C7442; --office-world-galaxy-panel-blue: #4C7FC2; --office-world-galaxy-panel-gold: #C9A23A; --office-world-galaxy-lilac-low: #5E6390; --office-world-galaxy-lilac-high: #7E82AA; --office-world-galaxy-lilac-crater: #444870;
    --office-world-galaxy-teal-low: #3E6F70; --office-world-galaxy-teal-high: #568A88; --office-world-galaxy-teal-crater: #2B5152; --office-world-galaxy-rust-low: #8A5A46;
    --office-world-galaxy-rust-high: #A2735C; --office-world-galaxy-rust-crater: #66402F; --office-world-galaxy-ice-low: #5E7598; --office-world-galaxy-ice-high: #7B91B2;
    --office-world-galaxy-ice-crater: #455A7C; --office-world-galaxy-moss-low: #567A48; --office-world-galaxy-moss-high: #6E9160; --office-world-galaxy-moss-crater: #3F5C34;
    --office-hud: rgba(28, 11, 54, 0.88); --office-hud-ink: #F2F0F7; --office-line: rgba(255, 255, 255, 0.18);
    --office-spot-dim: rgba(0, 0, 0, 0.55);
    --spot-dim: rgba(0, 0, 0, 0.55);
    --office-status-working: #8DB4FF; --office-status-idle: #C3B8DA; --office-status-blocked: #FF8A93;
    --office-status-waiting: #FFA26B; --office-status-meeting: #FF8AC8; --office-status-review: #CDB0FF;
    --office-status-done: #7CF2C9;
    --office-confetti-1: #C4A9F2; --office-confetti-2: #5FD3A3; --office-confetti-3: #FDB4A3; --office-confetti-4: #E6C779;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --you: #FBBF24; --you-soft: #3A2A0A;
  --office-bg: #160829; --office-floor: #2A1650; --office-wall: #22123F; --office-wall-2: #1C0B36;
  --office-hall: #34205C; --office-trim: #3DF5B0;
  /* REQ-168.2: the Sports complex world's colours (Pablo's d1, room 09), for walls, floors, hall and props. */
  --office-world-sports-floor: #26303D; --office-world-sports-wall: #1F2A3A; --office-world-sports-wall-2: #182230;
  --office-world-sports-hall: #0F1622; --office-world-sports-court: #1F4F8A; --office-world-sports-line: #E8EEF6;
  --office-world-sports-net: #070A10; --office-world-sports-glass: #3A5A74; --office-world-sports-board: #0B0912;
  --office-world-sports-chair: #8A5E3C; --office-world-sports-table: #8A5E3C; --office-world-sports-hard: #7A5232;
  --office-world-sports-key: #B4501F; --office-world-sports-rim: #FF7A45; --office-world-sports-water: #1F5F8A;
  --office-world-sports-tile: #34404F; --office-world-sports-rope: #E5484D; --office-world-sports-mat: #9E4636;
  --office-world-sports-iron: #4A4A57; --office-world-sports-plate: #E5484D; --office-world-sports-plate-2: #5B8DEF;
  --office-world-sports-pad: #3B2A5E; --office-world-sports-turf: #2D6B3A; --office-world-sports-turf-2: #28603A;
  --office-world-sports-flood: #FFE58A;
  --office-world-sports-road: #3A414C; --office-world-sports-road-line: #C9D2DC; --office-world-sports-sand: #7A6A48; --office-world-sports-park: #3F7A45;
  --office-world-sports-sign: #1C0B36; --office-world-sports-sign-ink: #FFA26B;
  --office-world-castle-floor: #4E8A50; --office-world-castle-wall: #7D818E; --office-world-castle-wall-2: #646977; --office-world-castle-hall: #6F6A5C;
  --office-world-castle-grass: #4E8A50; --office-world-castle-earth: #30251D; --office-world-castle-stone: #7D818E;
  --office-world-castle-wood: #75432D; --office-world-castle-path: #6F6A5C; --office-world-castle-water: #3A6B66;
  --office-world-castle-roof: #7A3A2D; --office-world-castle-torch: #F08A3C; --office-world-castle-banner: #6F8FC9;
  --office-world-castle-awning: #A8843A; --office-world-castle-forge: #FF8A45; --office-world-castle-flower: #B97A8C;
  --office-world-castle-glass: #4F8DB3; --office-world-castle-label: #EDE6D6;
  /* REQ-160: the Galaxy world (Pablo's mockup m1 v3) */
  --office-world-galaxy-plate: #8A8DA2; --office-world-galaxy-ring: #A88C66; --office-world-galaxy-moon: #8E8AA2; --office-world-galaxy-star: #E8ECFF;
  --office-world-galaxy-suit: #D6D7DE; --office-world-galaxy-metal: #7A8090; --office-world-galaxy-hull: #B4B7C4; --office-world-galaxy-dark: #242838;
  --office-world-galaxy-visor: #1A2238; --office-world-galaxy-glass: #6FB0C4; --office-world-galaxy-glow: #3DF5B0; --office-world-galaxy-hazard: #F2B33D;
  --office-world-galaxy-solar: #24407A; --office-world-galaxy-crystal: #A57CE0; --office-world-galaxy-fin: #B95247; --office-world-galaxy-label: #1E1433;
  --office-world-galaxy-label-ink: #F2EEFF; --office-world-galaxy-tree: #3C7442; --office-world-galaxy-panel-blue: #4C7FC2; --office-world-galaxy-panel-gold: #C9A23A; --office-world-galaxy-lilac-low: #5E6390; --office-world-galaxy-lilac-high: #7E82AA; --office-world-galaxy-lilac-crater: #444870;
  --office-world-galaxy-teal-low: #3E6F70; --office-world-galaxy-teal-high: #568A88; --office-world-galaxy-teal-crater: #2B5152; --office-world-galaxy-rust-low: #8A5A46;
  --office-world-galaxy-rust-high: #A2735C; --office-world-galaxy-rust-crater: #66402F; --office-world-galaxy-ice-low: #5E7598; --office-world-galaxy-ice-high: #7B91B2;
  --office-world-galaxy-ice-crater: #455A7C; --office-world-galaxy-moss-low: #567A48; --office-world-galaxy-moss-high: #6E9160; --office-world-galaxy-moss-crater: #3F5C34;
  --office-hud: rgba(28, 11, 54, 0.88); --office-hud-ink: #F2F0F7; --office-line: rgba(255, 255, 255, 0.18);
  --office-spot-dim: rgba(0, 0, 0, 0.55);
  --spot-dim: rgba(0, 0, 0, 0.55);
  --office-status-working: #8DB4FF; --office-status-idle: #C3B8DA; --office-status-blocked: #FF8A93;
  --office-status-waiting: #FFA26B; --office-status-meeting: #FF8AC8; --office-status-review: #CDB0FF;
  --office-status-done: #7CF2C9;
  --office-confetti-1: #C4A9F2; --office-confetti-2: #5FD3A3; --office-confetti-3: #FDB4A3; --office-confetti-4: #E6C779;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
.wrap { margin: 0 auto; padding-inline: 20px; padding-block: 32px 64px; display: flex; flex-direction: column; gap: 28px; }

header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 5vw, 42px); line-height: 1.05; letter-spacing: -0.02em; margin: 6px 0 0; }
.live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--mute); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live.on i { background: var(--done); box-shadow: 0 0 0 0 var(--done); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--done) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live.on i { animation: none; } }
/* REQ-101.1: a new agent's badge for its first 24 hours (Pablo's neutral chip, accent outline). */
.chip.newcomer { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--ink); font-weight: 700; }
.chip.newcomer .nc-star { color: var(--accent); }
.chip.works-with { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--ink); font-weight: 700; }
.pill { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; color: var(--st); background: var(--st-soft); white-space: nowrap; align-self: flex-start; }
.chip { font-family: var(--font-mono); font-size: 11.5px; padding: 3px 8px; border-radius: 8px; background: var(--sunken); color: var(--mute); overflow-wrap: anywhere; }
.chip a { color: var(--accent); text-decoration: none; }
.chip a:hover { text-decoration: underline; }
pre { margin: 0; overflow-x: auto; background: var(--sunken); border-radius: 10px; padding: 12px 14px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; color: var(--ink); }

.st-working { --st: var(--working); --st-soft: var(--working-soft); }
.st-review  { --st: var(--review);  --st-soft: var(--review-soft); }
.st-meeting { --st: var(--meeting); --st-soft: var(--meeting-soft); }
.st-needs-you { --st: var(--needs); --st-soft: var(--needs-soft); }
.st-done    { --st: var(--done);    --st-soft: var(--done-soft); }
.st-idle    { --st: var(--idle);    --st-soft: var(--idle-soft); }
.st-blocked { --st: var(--blocked); --st-soft: var(--blocked-soft); }
.k-pkg { --k: var(--release); } 
.k-deploy { --k: var(--qa); } 
.k-celebrate { --k: var(--release); } 
.k-uat-pass { --k: var(--done); } 
.k-uat-fail { --k: var(--blocked); }

/* Sign-in gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { max-width: 420px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.gate-card h1 { font-size: 32px; }
.gate-card p { margin: 0; color: var(--mute); }
.btn { font: 700 15px/1 var(--font-body); border: 0; border-radius: 12px; padding: 14px 18px; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn.ghost { background: transparent; color: var(--mute); border: 1px solid var(--line); padding: 8px 12px; font-size: 13px; }
.err { color: var(--blocked); font-size: 14px; }
.userbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: var(--mute); }

[hidden] { display: none !important; }
.btn.danger { color: var(--blocked); border-color: color-mix(in srgb, var(--blocked) 40%, transparent); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.gate-card .btn.ghost { align-self: flex-start; }
.gate-card .back { font-size: 14px; }
.gate-card .back a { color: var(--mute); text-decoration: none; }
.gate-card .back a:hover { color: var(--ink); }
.note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.field { font: 600 14px/1.2 var(--font-body); padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-width: 0; flex: 1 1 160px; }
.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
}

/* Back office navigation: Dashboard · Project plan · System settings */
/* REQ-134: robot parts (Pablo). The same in light and dark: avatars are pictures. Kept equal to looks.mjs METAL_TONES / ROBOT by scripts/looks.test.mjs. */
:root { --robot-metal-1: #F4F4F5; --robot-metal-2: #E4E4E7; --robot-metal-3: #D4D4D8; --robot-metal-4: #C4C4CC; --robot-metal-5: #A1A1AA; --robot-metal-6: #8B8B96; --robot-metal-7: #71717A; --robot-metal-8: #5E5E68; --robot-metal-9: #52525B; --robot-metal-10: #3F3F46; --robot-visor: #17131F; --robot-led: #FFFFFF; --robot-rim: #D4D4D8; }
.topnav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topnav-in { margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.topnav .brand { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-word { font: 700 18px/1 var(--font-display); letter-spacing: -0.01em; }
.brand-word b { font-weight: 700; color: var(--accent); }
.gate-card .brand-mark { width: 56px; height: 56px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--sunken); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tab { flex: none; padding: 8px 14px; border-radius: 10px; color: var(--mute); font: 700 14px/1 var(--font-body); text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topnav .userbar { margin-left: auto; }
@media (max-width: 600px) {
  .topnav-in { padding: 8px 16px; }
  .topnav .brand { display: none; }
  .tabs { order: 2; flex: 1 1 100%; }
  .tab { flex: 1 1 auto; text-align: center; padding: 9px 8px; font-size: 13px; }
  .topnav .userbar { margin-left: 0; width: 100%; justify-content: space-between; }
}
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--sunken); max-width: 100%; overflow-x: auto; }
.seg button { flex: none; border: 0; background: transparent; color: var(--mute); padding: 8px 12px; border-radius: 10px; font: 700 13.5px/1 var(--font-body); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-app { --t: var(--app); --t-soft: var(--app-soft); }
.t-website { --t: var(--web); --t-soft: var(--web-soft); }
.t-both { --t: var(--both); --t-soft: var(--both-soft); }
.pill-t, .pill-s { font: 700 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.pill-t { color: var(--t); background: var(--t-soft); }
.pill-s { color: var(--mute); background: var(--sunken); }
.pill-s.s-done { color: var(--done); background: var(--done-soft); }
.pill-s.s-doing { color: var(--working); background: var(--working-soft); }
.pill-s.s-review { color: var(--review); background: var(--review-soft); }
.dim { opacity: .45; }
.tab-short { display: none; }
/* Five tabs: above phone width the signed-in email moves into the Sign out
   button's tooltip so the bar stays on one line. */
@media (min-width: 601px) { .topnav #who { display: none; } }
/* Five tabs with long labels need about 560 px; below that, the short ones. */
@media (max-width: 560px) { .tab-long { display: none; } .tab-short { display: inline; } }
/* Plan filter: short labels on the narrowest phones. */
.lbl-short { display: none; }
@media (max-width: 359px) { .lbl-long { display: none; } .lbl-short { display: inline; } }
@media (max-width: 420px) { .tab { padding: 9px 6px; } .tabs { gap: 2px; } .tab-badge { margin-left: 3px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; } }
@media (max-width: 360px) { .tab { padding: 9px 6px; font-size: 12.5px; } .tabs { gap: 2px; padding: 3px; } }

/* Requirements (#requirements): board, table, detail panel, new form */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn.icon { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; font-size: 11px; border-radius: 8px; }
.btn.ghost.icon:hover:not(:disabled) { color: var(--ink); background: var(--accent-soft); }
.btn.ghost:disabled { opacity: .35; cursor: default; }
.rq-panel { margin: 0 0 0 auto; padding: 0; width: min(680px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--line); background: var(--bg); color: var(--ink); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25); }
.rq-panel[open] { display: flex; flex-direction: column; }
.rq-panel::backdrop { background: rgba(8, 6, 14, 0.5); }
.rq-panel > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.btn.ghost.warn { color: var(--needs); border-color: color-mix(in srgb, var(--needs) 45%, transparent); }
@media (max-width: 760px) {
  .rq-panel { width: 100vw; border-left: 0; }
}

/* Social (#social): one card per proposal, EN and NL side by side; on a
   phone the languages are tabs. */
.tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--needs); color: var(--on-needs, #fff); font: 700 11px/1 var(--font-mono); vertical-align: 1px; }
.tab-badge[hidden] { display: none; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn.danger-solid { background: var(--blocked); }
/* Dark: white on the light red was ~2.8:1; dark text on it is well over 4.5:1. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger-solid { color: var(--bg); } }
:root[data-theme="dark"] .btn.danger-solid { color: var(--bg); }
/* Toasts (ISS-66): one look for the board's notice (.rq-toast), the bulk bar's
   toast (.bk-toast, REQ-176) and the removal toast (.rm-toast, REQ-184.2). */
.rq-toast, .bk-toast, .rm-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); box-sizing: border-box; margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--panel); font: 600 14px/1.35 var(--font-body); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.rq-toast[hidden], .bk-toast[hidden], .rm-toast[hidden] { display: none; }

/* REQ-42: the office on its own page, and Waiting on you. */
.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; }
/* REQ-42 (Pablo): six tabs, every one a 44 px target. Under 600 px, where
   the tabs take a full row, they wrap into a 3-column grid (two rows), so no
   destination hides behind a scroll; the text stays 13.5 px and the short
   labels show (full name in aria-label). Above 600 px: one row, with the
   overflow scroll only as a safety net for very narrow desktop windows. */
.tab { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; padding-block: 0; }
@media (max-width: 600px) {
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-x: visible; }
  .tab { min-width: 0; font-size: 13.5px; padding-inline: 4px; }
  .tab-long { display: none; } .tab-short { display: inline; }
}
/* 601–800 px: one row only fits with the short labels (no tab out of view). */
@media (min-width: 601px) and (max-width: 800px) { .tab-long { display: none; } .tab-short { display: inline; } }
/* REQ-70.3: ten tabs with the Team calendar; a little less side padding keeps them all on one row up to 1400 px. */
@media (min-width: 801px) and (max-width: 1400px) { .tab { padding-inline: 8px; } .tabs { gap: 2px; } }

/* Back-office version (REQ-39.1): one footer line on every page, and the new-version notice. */
.bo-foot { margin: 0 auto; padding: 0 20px 28px; box-sizing: border-box; }
.bo-foot a { font: 12px/1.5 var(--font-mono); color: var(--faint); text-decoration: none; overflow-wrap: anywhere; }
.bo-foot a:hover { text-decoration: underline; }
.bo-foot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.bo-update { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; max-width: calc(100vw - 32px); box-sizing: border-box; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); font-weight: 700; font-size: 14px; }
.bo-update[hidden] { display: none; }
.bo-update .btn { min-height: 44px; padding-block: 0; }
.btn.pa-btn { min-height: 44px; padding-block: 0; } /* REQ-184.1.2: a person's agents (Access row) */
.bo-update span { flex: 1 1 auto; min-width: 0; }
.bo-update .btn { flex: none; }
.bo-update .bo-dismiss { min-width: 44px; }
@media (max-width: 700px) {
  .bo-foot { padding-inline: 16px; }
  .bo-update { left: 16px; right: 16px; transform: none; max-width: none; }
}
.t-done { color: var(--done); background: var(--done-soft); }
.t-blocked { color: var(--blocked); background: var(--blocked-soft); }
.t-needs { color: var(--needs); background: var(--needs-soft); }
.t-idle { color: var(--idle); background: var(--idle-soft); }

/* REQ-56.1.4: Gus's card, auto-merge turned off for a repository (neutral: ring + text). */
.chip.am-off { background: var(--idle-soft); color: var(--idle); box-shadow: inset 0 0 0 1.5px currentColor; }

/* REQ-56.2.2 / 56.3: Gus's card, a deploy waiting for Steven and a direct push (needs: ring + word). */
.chip.dep-wait, .chip.push-warn { background: var(--needs-soft); box-shadow: inset 0 0 0 1.5px var(--needs); }
.chip.dep-wait a, .chip.push-warn a { color: var(--needs); font-weight: 700; }
/* The badge in the page bar: the number only (its name says what it counts),
   a 44 px target, opening the quick list. */
.wait-badge { min-width: 44px; min-height: 44px; padding: 0 8px; }
.wait-badge[hidden] { display: none; }
.wait-badge .tab-badge { margin: 0; min-width: 22px; height: 22px; font-size: 12px; }

/* Count badges: white on --needs is 6:1 in light mode but 2.3:1 on the dark
   theme's lighter orange, so dark mode uses dark ink (Quinn, REQ-62 UAT): --on-needs,
   --on-done and --on-blocked come from tokens/comarondo.css. */
/* REQ-47: every page and the top navigation use the full window width with
   a 20 px gutter (16 px on phones, unchanged); the old 1120 px column is gone.
   What reads badly when very wide keeps Pablo's max widths: running text
   72ch, the Dashboard summary strip 1440 px (centred), panels and dialogs
   880 px. Boards, cards, tables and the
   plan take the extra room through their auto-fill grids. */
.wrap, .topnav-in, .bo-foot { width: 100%; box-sizing: border-box; }
/* The browser's 8 px body margin would make the desktop gutter 28 px; the
   office's is 20 px. Phones keep theirs (unchanged). */
@media (min-width: 601px) { body { margin: 0; } }
.rq-panel { max-width: min(880px, 100vw); }

/* REQ-80: the seasons' two accents (Pablo will review the values). Physical
   parts of the 3D office, like the sign and board parts: the same in light
   and dark, set once here and read by office.js. */
:root {
  --office-season-newyear-1: #E3B341;     --office-season-newyear-2: #1E2A5A;
  --office-season-valentine-1: #D7263D;   --office-season-valentine-2: #F49AC2;
  --office-season-carnival-1: #F59E0B;    --office-season-carnival-2: #10B981;
  --office-season-easter-1: #FDE047;      --office-season-easter-2: #86EFAC;
  --office-season-summer-1: #0EA5E9;      --office-season-summer-2: #F4D19B;
  --office-season-halloween-1: #F97316;   --office-season-halloween-2: #4C1D95;
  --office-season-sinterklaas-1: #C81E1E; --office-season-sinterklaas-2: #D4A017;
  --office-season-christmas-1: #DC2626;   --office-season-christmas-2: #166534;
}

/* REQ-71.3.3: an overdue meeting action on its owner's card (warning style, icon + words). */
.chip.overdue { border: 1px solid var(--needs); color: var(--needs); background: var(--needs-soft); font-weight: 700; }
.chip.pk-req { font-size: 11px; padding: 1px 7px; box-shadow: inset 0 0 0 1px var(--line); }
.topnav .take-tour { min-height: 36px; font-family: var(--font-body); font-weight: 700; }
@media (max-width: 600px) {
  .topnav .take-tour { min-height: 44px; }
}

/* REQ-88 (Pablo): on phones a slim pinned bar (page name, the For you count,
   Menu) instead of the 12-tab grid; Menu drops the tab bar (.topnav-in) down
   under it as a sheet, with the account row at its bottom, over the shared
   --office-spot-dim scrim. --nav-h is the bar's measured height (navMenu.js):
   focus scrolls clear of it and the other sticky bars stick under it
   (WCAG 2.4.11). Since 7 Oct (Pablo, UAT-57) it is the compact bar up to
   1180 px, where 13 tabs stop fitting on one row. `.topnav .nav-close`
   outranks `.btn.icon`, so the sheet's ✕ never shows on desktop. */
.topnav-bar, .topnav .nav-close { display: none; }
.nav-scrim { position: fixed; inset: 0; z-index: 19; background: var(--office-spot-dim); }
.nav-scrim[hidden] { display: none; }
@media (max-width: 1180px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  html { scroll-padding-top: calc(var(--nav-h, 56px) + 8px); }
  .topnav-bar { display: flex; align-items: center; gap: 8px; max-height: 55px; padding: 6px 12px 6px 16px; box-sizing: border-box; }
  .nav-page { flex: 1 1 auto; min-width: 0; font: 800 17px/1.2 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-wait { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; border-radius: 10px; color: var(--ink); font: 700 13px/1 var(--font-body); text-decoration: none; }
  .nav-wait[hidden] { display: none; }
  .nav-wait:focus-visible, .nav-menu:focus-visible, .nav-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-menu { flex: none; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-weight: 800; }
  .nav-menu-ic { font-size: 16px; line-height: 1; }
  .topnav .topnav-in { display: none; }
  .topnav.open .topnav-in { display: flex; flex-direction: column; align-items: stretch; gap: 10px; position: absolute; left: 0; right: 0; top: 100%; max-height: 80dvh; overflow-y: auto; box-sizing: border-box; padding: 52px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25); }
  .topnav.open .nav-close { display: inline-grid; place-items: center; position: absolute; top: 4px; right: 12px; width: 44px; height: 44px; }
  .topnav.open .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); order: 0; flex: none; overflow: visible; }
  .topnav.open .tab { min-height: 46px; }
  .topnav.open .tab.on { background: var(--accent); color: var(--bg); box-shadow: none; }
  .topnav.open .tab-long { display: none; } .topnav.open .tab-short { display: inline; }
  .topnav.open .userbar { order: 1; width: 100%; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); justify-content: space-between; }
  /* The account menu is the sheet's account row: who, Take the tour, Sign out. */
  .topnav .acct-btn { display: none; }
  .topnav .acct-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
}
/* Tablets and small laptops: the sheet is a panel at the right, not full width. */
@media (min-width: 601px) and (max-width: 1180px) {
  .topnav.open .topnav-in { left: auto; width: min(100%, 520px); border-left: 1px solid var(--line); border-bottom-left-radius: 14px; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 1180px) {
  .topnav.open .topnav-in { animation: nav-drop 160ms ease-out; }
}
@keyframes nav-drop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── REQ-86.2: the Help button and the knowledge base panel ───────────
   Pablo: a pill (help icon + 'Help'), 44 px, the neutral raised style, fixed
   to the viewport 16 px from the bottom-right corner (plus the safe area);
   the office's zoom stack moves up by --fab-clearance so it is never covered. */
:root { --fab-clearance: 60px; }
/* Pablo: no Help button while the phone Menu sheet is open (Ivy, REQ-88: #topnav.open). */
body:has(#topnav.open) .help-fab { display: none; }

/* REQ-88 (Pablo, 7 Oct): above 1180 px two fixed rows: the brand with the
   For you count and the account button, then the tabs on one row that never
   wraps (short labels up to 1679 px, the long ones from 1680 px: 13 tabs
   with their counts need about 1560 px, UAT-57 re-test). The whole bar is
   pinned, so scroll-padding keeps focus clear of it (--nav-pin). The
   account button opens a menu: the name, Take the tour, Sign out. */
@media (min-width: 1181px) {
  html { scroll-padding-top: calc(var(--nav-pin, 120px) + 8px); }
  .topnav-in { flex-wrap: wrap; row-gap: 4px; padding-top: 6px; padding-bottom: 6px; }
  .topnav .brand { order: 0; }
  .topnav .userbar { order: 1; margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px; }
  .topnav .tabs { order: 2; flex: 1 1 100%; flex-wrap: nowrap; }
  .acct-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px; font-weight: 700; }
  .acct-av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--bg); font: 800 14px/1 var(--font-body); }
  .acct-caret { color: var(--mute); font-size: 11px; }
  .acct-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .topnav .acct-menu { display: none; }
  .topnav .acct-menu.open { display: flex; flex-direction: column; align-items: stretch; gap: 4px; position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 240px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2); }
  .topnav .acct-menu .acct-who { display: block; padding: 8px 10px 0; font-weight: 800; color: var(--ink); }
  .topnav .acct-menu #who { display: block; padding: 2px 10px 10px; border-bottom: 1px solid var(--line); color: var(--mute); font-size: 13px; overflow-wrap: anywhere; }
  .acct-menu .btn { justify-content: flex-start; min-height: 44px; }
}
@media (min-width: 1181px) and (max-width: 1679px) {
  .topnav .tab-long { display: none; }
  .topnav .tab-short { display: inline; }
}
@media print {
  @page { size: landscape; margin: 12mm; }
}
.err-summary { padding: 12px 14px; border: 2px solid var(--blocked); border-radius: 12px; background: var(--blocked-soft); color: var(--blocked); }
.err-summary p { margin: 0 0 4px; font-weight: 700; }
.err-summary a { color: inherit; }
/* REQ-118: a person's last sign-in, for admins. Muted words (also 'Never signed
   in', Pablo's note 3), the full date on tap or focus (note 1), 'Inactive' as a
   chip in words (note 2). */
.si { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--mute); font-size: 13px; }
.si-t[role="button"] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; border-radius: 4px; }
.si-t[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.si-full { color: var(--ink); }
.si-inactive { font-size: 12px; }

/* ISS-54 (Steven, 27 Oct): iOS Safari zooms the page when a form field under
   16 px gets focus. On phones and touch screens every text-like field is at
   least 16 px; the desktop keeps its sizes. Zoom itself stays allowed. */
@media (max-width: 760px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]):not([type="image"]),
  select, textarea { font-size: max(16px, 1em) !important; }
}
