/* Agent Office Lab — mockup styles.
   Direction: a calm, well-lit operations room. Navy for structure, safety amber
   only where a human must decide, one hue per division for identity.
   Rationale and sources: docs/design-research.md */

:root {
  --ground: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --ink: #0e1a2b;
  --ink-2: #1f3049;
  --muted: #536175;
  --line: #d6dce4;
  --line-strong: #b4bfcc;

  --signal: #b45309;
  --signal-fill: #f59e0b;
  --signal-soft: #fef3c7;
  --alert: #c81e1e;
  --alert-soft: #fbe3e3;

  --c-koor: #0e1a2b;
  --c-it: #2563eb;
  --c-sec: #7c3aed;
  --c-proc: #0f766e;
  --c-adm: #be185d;

  --font-sans: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --r-control: 4px;
  --r-panel: 10px;
  --r-floor: 16px;
  --float: 0 18px 40px -16px rgb(14 26 43 / 0.35);

  --walk: 1100ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font-sans); color: var(--ink); background: var(--ground); font-size: 15px; line-height: 1.55; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- Prototype nav ----------
   Review aid only: a compact bar in the bottom-left corner that stays out of the content. */
.proto-nav {
  position: fixed; bottom: 12px; left: 12px; z-index: 50;
  display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  padding: 3px; background: rgb(14 26 43 / 0.92); border-radius: 999px; box-shadow: var(--float); max-width: calc(100vw - 24px);
  opacity: 0.85; transition: opacity 150ms;
}
.proto-nav:hover, .proto-nav:focus-within { opacity: 1; }
.proto-label { color: #94a3b8; font-size: 11px; padding: 0 8px 0 10px; white-space: nowrap; }
.proto-nav a, .proto-nav button { color: #e2e8f0; font-size: 12px; font-weight: 500; text-decoration: none; padding: 0 10px; min-height: 30px; display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; }
.proto-nav button { border: 0; background: transparent; cursor: pointer; }
.proto-nav a:hover, .proto-nav button:hover { background: rgb(255 255 255 / 0.1); }
.proto-nav button[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; }
/* Collapsed to the label and the current screen; opens on hover or keyboard focus. */
.proto-nav:not(:hover):not(:focus-within) :is(a, button:not([aria-current="page"])) { display: none; }

/* ---------- Controls ---------- */
.screen { min-height: 100vh; padding-bottom: 56px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-control);
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; cursor: pointer;
  transition: background-color 120ms, border-color 120ms, transform 120ms;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
:is(.btn, .tab, .chip, .proto-nav button, .scenario-list button, .doc-list button, input, select):focus-visible {
  outline: 3px solid rgb(37 99 235 / 0.5); outline-offset: 2px;
}

input[type="text"], input[type="email"], input[type="number"], select {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-control); background: var(--surface);
}
input::placeholder { color: #6b7789; }
label { display: block; font-size: 14px; font-weight: 600; margin: 18px 0 6px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 10px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.field-error { color: var(--alert); font-size: 14px; margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 0 14px; min-height: 36px; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); }

/* ---------- Brand + top bar ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 20px; height: 20px; border-radius: 5px; background: var(--ink); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 2px; background: var(--signal-fill); }
.brand-dot { color: var(--signal); margin-left: -8px; }
.brand-sub { margin-left: 4px; font-weight: 500; color: var(--muted); font-size: 13px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; }
.brand-on-dark .brand-mark { background: #fff; }
.brand-on-dark .brand-dot { color: var(--signal-fill); }
.brand-on-dark .brand-sub { color: #cbd5e1; border-color: #334155; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quota { font-size: 14px; color: var(--muted); }
.quota strong { color: var(--ink); font-family: var(--font-mono); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; flex: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Duotone icon tile: tinted square, icon in the team colour. Shared by the
   landing page and the app; set --accent on the tile or an ancestor. */
.icon-tile {
  flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: var(--accent, var(--c-koor));
  background: color-mix(in srgb, var(--accent, var(--c-koor)) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent, var(--c-koor)) 28%, transparent);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--accent, var(--c-koor)) 18%, transparent);
}
.icon-tile svg { width: 28px; height: 28px; fill: currentColor; }

/* ---------- 1. Sign in ----------
   Form first and plain; the light side shows the live office, nothing to read. */
#screen-login { padding-bottom: 0; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(360px, 520px) 1fr; background: var(--ground); }
.login-panel {
  display: flex; flex-direction: column; gap: 32px; padding: 32px clamp(24px, 4vw, 56px);
  background: var(--surface); border-right: 1px solid var(--line); box-shadow: 12px 0 40px -32px rgb(14 26 43 / 0.35); position: relative; z-index: 1;
}
.login-panel .brand { color: var(--ink); text-decoration: none; align-self: flex-start; }
.login-form { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 380px; margin: 0 auto; }
.invite-pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--c-sec); background: color-mix(in srgb, var(--c-sec) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c-sec) 25%, transparent);
}
.invite-pill svg { width: 14px; height: 14px; fill: currentColor; }
.login-form h1 { font-size: clamp(28px, 2.6vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 16px 0 8px; }
.login-lead { color: var(--muted); margin-bottom: 24px; }
.login-step { display: flex; flex-direction: column; }
.login-step label { margin-top: 0; }
.login-step input { height: 48px; font-size: 16px; }
.login-step #code { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-step .btn { margin-top: 20px; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.login-step .btn svg { width: 18px; height: 18px; fill: currentColor; }
.signed-as strong { color: var(--ink); font-weight: 600; word-break: break-all; }
.link-btn { background: none; border: 0; padding: 0 2px; font: inherit; font-weight: 600; color: var(--c-it); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.link-btn:focus-visible { outline: 2px solid var(--c-it); outline-offset: 2px; border-radius: 2px; }
.fineprint { font-size: 13px; color: var(--muted); text-align: center; }

.login-scene { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 48px clamp(24px, 4vw, 64px); overflow: hidden; }
.scene-kicker { font: 500 13px var(--font-mono); color: var(--muted); letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 8px; }
.scene-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 4px rgb(22 163 74 / 0.15); }
.login-scene .office-hero { flex: none; width: 100%; max-width: 820px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-panel { border-right: 0; box-shadow: none; }
  .login-scene { display: none; }
}

/* ---------- 2. Lobby ---------- */
.lobby { max-width: 1180px; margin: 0 auto; padding: 40px 24px; }
.lobby > h1 { font-size: clamp(28px, 3.2vw, 38px); letter-spacing: -0.025em; margin-bottom: 24px; max-width: 22em; }
/* The recommended run: one light card, copy on the left, the four beats on the right. */
.hero-scenario {
  display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: 0 24px 48px -32px rgb(14 26 43 / 0.35);
}
.hero-copy { flex: 999 1 460px; padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 14px; }
.hero-copy h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.025em; }
.hero-copy p { color: var(--ink-2); max-width: 36em; }
.hero-copy .scene-kicker { color: var(--muted); }
.hero-copy .hero-facts { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
.hero-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.hero-actions .btn svg { width: 18px; height: 18px; fill: currentColor; }
.hero-actions .check { margin: 0; }
.hero-steps {
  flex: 1 1 320px; list-style: none; margin: 0; padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 4px;
  background: var(--surface-2); border-left: 1px solid var(--line);
}
.hero-steps li { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: center; padding: 8px 0; position: relative; }
.hero-steps li:not(:last-child)::after { content: ""; position: absolute; left: 21px; top: 52px; bottom: -12px; border-left: 2px dotted var(--line-strong); }
.hero-steps .icon-tile { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; }
.hero-steps .icon-tile svg { width: 22px; height: 22px; }
.hero-steps .is-decision .icon-tile { color: var(--signal); background: var(--signal-soft); border-color: var(--signal-fill); box-shadow: inset 0 -3px 0 rgb(245 158 11 / 0.35); }
.hero-steps strong { font-weight: 600; align-self: end; }
.hero-steps li > span:last-child { color: var(--muted); font-size: 14px; align-self: start; }

.lobby-grid { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 40px; }
.lobby-grid > section { flex: 1 1 360px; min-width: 0; }
.section-title { font-size: 18px; margin: 0 0 12px; }
.scenario-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.scenario-list button {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface);
  padding: 12px 16px 12px 12px; display: flex; align-items: center; gap: 14px; cursor: pointer; min-height: 44px;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.scenario-list button:hover { border-color: var(--line-strong); box-shadow: 0 10px 24px -18px rgb(14 26 43 / 0.45); transform: translateY(-1px); }
.scenario-list .icon-tile { width: 44px; height: 44px; border-radius: 12px; }
.scenario-list .icon-tile svg { width: 22px; height: 22px; }
.sc-text { flex: 1; display: flex; flex-direction: column; }
.scenario-list strong { font-weight: 600; font-size: 16px; }
.sc-text span { color: var(--muted); font-size: 14px; }
.sc-arrow { width: 18px; height: 18px; fill: var(--muted); flex: none; transition: transform 150ms; }
.scenario-list button:hover .sc-arrow { transform: translateX(3px); fill: var(--ink); }
.free-ask { display: flex; gap: 8px; }

.lobby > section { margin-top: 44px; }
.team { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 32px; }
.member { display: flex; gap: 12px; align-items: center; min-width: 200px; }
.member .disc { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 3px solid var(--surface); box-shadow: 0 2px 6px rgb(14 26 43 / 0.2); }
.member .disc svg { width: 18px; height: 18px; fill: currentColor; }
.member strong { display: block; font-weight: 600; }
.member span { font-size: 14px; color: var(--muted); }

/* ---------- 3. Office ---------- */
.run-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.run-title h1 { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.badge { font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.player { display: flex; align-items: center; gap: 8px; }
.speed { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.speed select { width: auto; min-height: 36px; }

.office-layout { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; max-width: 1600px; margin: 0 auto; }
.office-col { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.request-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 14px 18px; }
.request { flex: 999 1 380px; display: flex; gap: 12px; align-items: baseline; }
.request-label { flex: none; font-size: 14px; color: var(--muted); }
#request-text { font-weight: 600; font-size: 16px; }
.progress { flex: 1 1 220px; }
.progress-text { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.progress-text strong { color: var(--ink); font-family: var(--font-mono); }
.clock { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 500ms var(--ease); }

.office { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-floor); overflow: hidden; background: #e3e8ee; border: 1px solid var(--line); transition: background-color 400ms; }
.office::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#cdd4dd 1px, transparent 1px); background-size: 24px 24px; }
.office.is-alert { background-color: var(--alert-soft); }
.office.is-alert .room { border-color: #e9a8a8; }
.room { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); }
.room-quiet { background: #f8fafb; }
.room-server { background: #f3f1fb; }
.room-name { position: absolute; left: 12px; top: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.room-name i, .doc-list i, .task i, .approvals i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.desk { position: absolute; left: 16%; right: 16%; bottom: 13%; height: 20%; border-radius: 6px; background: #e2e7ed; }
.table { position: absolute; left: 22%; right: 22%; top: 42%; height: 30%; border-radius: 999px; background: #e2e7ed; }
.rack { position: absolute; right: 10%; top: 28%; width: 11%; height: 58%; border-radius: 4px; background: #d9d3f1; }
.rack.r2 { right: 25%; }
.cabinet { position: absolute; right: 6%; top: 24%; width: 10%; height: 32%; border-radius: 3px; background: #d3e7e4; }
.printer { position: absolute; right: 6%; top: 26%; width: 13%; height: 17%; border-radius: 4px; background: #f2d7e3; }
.printer.is-printing { animation: print 0.5s ease-in-out 4; }
@keyframes print { 50% { transform: translateY(-3px); } }
.alert-banner { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); z-index: 5; background: var(--alert); color: #fff; font-weight: 600; padding: 7px 16px; border-radius: 999px; box-shadow: var(--float); white-space: nowrap; font-size: 14px; }

#agents-layer { position: absolute; inset: 0; z-index: 4; }
.agent { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform var(--walk) var(--ease); }
.agent-body { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; border: 3px solid #fff; box-shadow: 0 2px 6px rgb(14 26 43 / 0.25); }
.agent-name { font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; white-space: nowrap; }
.agent-role { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.agent.is-working .agent-body { animation: work 0.9s ease-in-out infinite; }
.agent.is-thinking .agent-body { animation: think 1.6s ease-in-out infinite; }
.agent.is-waiting .agent-body { box-shadow: 0 0 0 4px var(--signal-fill); }
@keyframes work { 50% { transform: translateY(-3px); } }
@keyframes think { 50% { box-shadow: 0 0 0 7px rgb(14 26 43 / 0.14); } }
.agent-bubble { position: absolute; bottom: calc(100% + 4px); max-width: 230px; width: max-content; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.35; padding: 6px 10px; border-radius: 8px; opacity: 0; transform: translateY(4px); transition: opacity 180ms, transform 180ms; pointer-events: none; }
.agent-bubble.is-visible { opacity: 1; transform: none; }
.agent[data-side="left"] .agent-bubble { left: -6px; }
.agent[data-side="right"] .agent-bubble { right: -6px; }
/* Phones: a taller floor so rooms keep room for their names and the agents. */
@media (max-width: 600px) {
  .office { aspect-ratio: 3 / 4; }
  .room-name { font-size: 12px; left: 8px; top: 6px; }
  .agent-role { display: none; }
  .agent-bubble { max-width: 160px; font-size: 12px; }
}

.ask { display: flex; gap: 8px; }
.ask input { flex: 1; }
.office-col > .chips { margin-top: -2px; }

.panel { flex: 1 1 340px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); display: flex; flex-direction: column; max-height: 780px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; }
.tab { border: 0; background: none; padding: 0 12px; min-height: 48px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.count { font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 4px; }
.tabpanel { overflow-y: auto; padding: 14px 16px; flex: 1; }
.empty { color: var(--muted); font-size: 14px; padding: 24px 4px; }

.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.log li { display: grid; grid-template-columns: 48px 1fr; gap: 8px; font-size: 14px; }
.log li:first-child { animation: arrive 260ms var(--ease); }
.log time { font: 400 13px var(--font-mono); color: var(--muted); padding-top: 1px; }
.log .who { font-weight: 600; margin-right: 6px; }
.log .sys { color: var(--muted); }
.log .alert { color: var(--alert); font-weight: 600; }
.log .decision { color: var(--signal); font-weight: 600; }
@keyframes arrive { from { opacity: 0; transform: translateY(-4px); } }

.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kanban h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.kanban ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.task { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 13px; font-weight: 500; line-height: 1.35; }
.task small { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-weight: 400; color: var(--muted); font-size: 12px; }
#col-done .task { color: var(--muted); background: var(--surface); }

.docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.docs li { border-bottom: 1px solid var(--line); padding: 8px 2px 10px; }
.docs strong { display: block; font-size: 14px; font-weight: 600; }
.docs span { font-size: 13px; color: var(--muted); }

.modal { border: 0; border-radius: var(--r-floor); padding: 28px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--float); color: var(--ink); }
.modal::backdrop { background: rgb(14 26 43 / 0.5); }
.signal-tag { display: inline-block; background: var(--signal-soft); color: #7c2d12; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }
.modal h2 { font-size: 24px; margin-bottom: 6px; }
.approvals { list-style: none; margin: 18px 0 22px; padding: 0; border-top: 1px solid var(--line); }
.approvals li { display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); padding: 12px 0; }
.approvals i { margin-top: 7px; }
.approvals strong { display: block; font-weight: 600; }
.approvals span { font-size: 14px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.done-toast { position: fixed; right: 24px; bottom: 80px; display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 10px 10px 10px 18px; box-shadow: var(--float); font-weight: 600; z-index: 30; }

/* ---------- 4. Results ---------- */
.results { max-width: 1180px; margin: 0 auto; padding: 48px 24px; }
.results-head { max-width: 46em; margin-bottom: 36px; }
.results-head h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.03em; }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.results-sub { font-size: 18px; color: var(--ink-2); margin-top: 14px; }
.results-stats { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.results-stats li { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.results-stats strong { font-size: 24px; font-weight: 500; }
.results-stats span { font-size: 14px; color: var(--muted); }
.results-stats .is-decision { background: var(--signal-soft); border-color: var(--signal-fill); }
.results-stats .is-decision strong, .results-stats .is-decision span { color: var(--signal); }
.results-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.doc-list { flex: 1 1 280px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.doc-list button { display: flex; gap: 12px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 14px 8px; cursor: pointer; border-radius: 0; }
.doc-list button:hover { background: var(--surface); }
.doc-list button.is-active { background: var(--surface); box-shadow: inset 3px 0 0 var(--ink); }
.doc-list .icon-tile { width: 40px; height: 40px; border-radius: 10px; }
.doc-list .icon-tile svg { width: 20px; height: 20px; }
.doc-list strong { display: block; font-weight: 600; }
.doc-list small { font-size: 14px; color: var(--muted); }
.doc-preview { flex: 999 1 480px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: clamp(20px, 3vw, 36px); display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.doc-preview header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.doc-type { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.doc-preview h2 { font-size: 22px; }
.doc-preview code { font-family: var(--font-mono); font-size: 14px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.sig { color: var(--muted); font-size: 14px; margin-top: 8px; }
.results-actions { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- 5. Admin ---------- */
.admin { max-width: 1180px; margin: 0 auto; padding: 32px 24px; }
.budget { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-end; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 24px 28px; margin-bottom: 20px; }
.budget > div { flex: 1 1 320px; }
.budget h2 { font-size: 15px; font-weight: 600; color: var(--muted); }
.budget-num { margin: 6px 0 12px; }
.budget-num .mono { font-size: 44px; font-weight: 500; letter-spacing: -0.04em; }
.meter { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; max-width: 420px; }
.meter span { display: block; height: 100%; background: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 0; }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 24px; font-weight: 500; }
.admin-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 24px; }
.admin-grid .box:first-child { flex: 999 1 560px; min-width: 0; }
.admin-grid .box:last-child { flex: 1 1 300px; }
.box h2 { font-size: 17px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line-strong); }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.num { text-align: right; }
.pill { font-size: 13px; font-weight: 500; padding: 2px 9px; border-radius: 999px; }
.pill.ok { background: #e2f3ef; color: #0b5d52; }
.pill.warn { background: var(--signal-soft); color: #7c2d12; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
}

/* ---------- Division colours and fixed positions (classes, so the CSP needs no inline styles) ---------- */
.tone-koor { --accent: var(--c-koor); }
.fill-koor { background: var(--c-koor); }
.ink-koor { color: var(--c-koor); }
.tone-it { --accent: var(--c-it); }
.fill-it { background: var(--c-it); }
.ink-it { color: var(--c-it); }
.tone-sec { --accent: var(--c-sec); }
.fill-sec { background: var(--c-sec); }
.ink-sec { color: var(--c-sec); }
.tone-proc { --accent: var(--c-proc); }
.fill-proc { background: var(--c-proc); }
.ink-proc { color: var(--c-proc); }
.tone-adm { --accent: var(--c-adm); }
.fill-adm { background: var(--c-adm); }
.ink-adm { color: var(--c-adm); }
.room-at-1 { --x:3%; --y:6%; --w:26%; --h:38%; }
.room-at-2 { --x:33%; --y:6%; --w:30%; --h:38%; }
.room-at-3 { --x:67%; --y:6%; --w:30%; --h:38%; }
.room-at-4 { --x:3%; --y:52%; --w:28%; --h:42%; }
.room-at-5 { --x:36%; --y:52%; --w:28%; --h:42%; }
.room-at-6 { --x:69%; --y:52%; --w:28%; --h:42%; }
.meter-41 { width: 41%; }
