/* Design system for the incident register: VisualDesign.md §2 (the six themes), §3 (the type tokens) and §4 (the glass
   panels). The theme is set on <html data-theme="..."> by site.js before the first paint; obsidian is the default.
   Every colour is a token below, and a component names no colour directly. */

/* ---- Tokens: type and glass (the same in every theme) ----------------------------------------- */
:root {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --glass-blur: 16px;
}

/* ---- Tokens: the six themes -------------------------------------------------------------------- */
:root,
html[data-theme="obsidian"] {
  color-scheme: dark;
  --bg: #090d16;
  --surface: rgba(17, 24, 39, .72);
  --surface-2: rgba(30, 41, 59, .72);
  --input: rgba(17, 24, 39, .72);
  --text: #e6ebf5;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, .14);
  --shadow: 0 20px 30px -10px rgba(0, 0, 0, .5);
  --accent: #6366f1;
  --accent-2: #14b8a6;
  --sev-medium: #facc15;
  --sev-low: #4ade80;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
}

html[data-theme="radiant"] {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, .78);
  --surface-2: rgba(241, 245, 249, .9);
  --input: rgba(255, 255, 255, .78);
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, .1);
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 10px 28px -14px rgba(15, 23, 42, .22);
  --accent: #4f46e5;
  --accent-2: #0284c7;
  --sev-medium: #a16207;
  --sev-low: #15803d;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #b45309;
}

html[data-theme="emerald"] {
  color-scheme: dark;
  --bg: #06130d;
  --surface: rgba(10, 30, 20, .72);
  --surface-2: rgba(16, 44, 30, .72);
  --input: rgba(10, 30, 20, .72);
  --text: #e3f5ea;
  --muted: #8fb8a1;
  --border: rgba(16, 185, 129, .16);
  --shadow: 0 20px 30px -10px rgba(0, 0, 0, .5);
  --accent: #10b981;
  --accent-2: #06b6d4;
  --sev-medium: #facc15;
  --sev-low: #4ade80;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
}

html[data-theme="sapphire"] {
  color-scheme: dark;
  --bg: #030712;
  --surface: rgba(15, 23, 42, .72);
  --surface-2: rgba(30, 41, 59, .72);
  --input: rgba(15, 23, 42, .72);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(96, 165, 250, .14);
  --shadow: 0 20px 30px -10px rgba(0, 0, 0, .5);
  --accent: #2563eb;
  --accent-2: #8b5cf6;
  --sev-medium: #facc15;
  --sev-low: #4ade80;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
}

html[data-theme="amber"] {
  color-scheme: dark;
  --bg: #120b05;
  --surface: rgba(38, 24, 12, .72);
  --surface-2: rgba(56, 36, 18, .72);
  --input: rgba(38, 24, 12, .72);
  --text: #f5ebe0;
  --muted: #c9a88a;
  --border: rgba(245, 158, 11, .16);
  --shadow: 0 20px 30px -10px rgba(0, 0, 0, .5);
  --accent: #f59e0b;
  --accent-2: #ef4444;
  --sev-medium: #fde047;
  --sev-low: #86efac;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
}

html[data-theme="cyberpunk"] {
  color-scheme: dark;
  --bg: #080811;
  --surface: rgba(18, 18, 34, .72);
  --surface-2: rgba(30, 30, 54, .72);
  --input: rgba(18, 18, 34, .72);
  --text: #e6e6ff;
  --muted: #9a9ac0;
  --border: rgba(6, 182, 212, .18);
  --shadow: 0 20px 30px -10px rgba(0, 0, 0, .5);
  --accent: #06b6d4;
  --accent-2: #ec4899;
  --sev-medium: #fde047;
  --sev-low: #67e8f9;
  --danger: #fb7185;
  --ok: #34d399;
  --warn: #fbbf24;
}

/* ---- Base --------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at -5% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(800px 460px at 105% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 55%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: .92em; word-break: break-all; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 14px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 8px; }
.gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Shell: sidebar, top bar and content ------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; color: var(--text); font-weight: 750; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -10px var(--accent);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 9px; border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, .85); border-right-color: transparent; transform: rotate(-40deg);
}

/* A group heading is the size of the items under it (the owner asked, 2026/10/25): bold and in its own colour, so it still reads as a heading. */
.nav-group { margin: 14px 12px 4px; font-size: inherit; font-weight: 750; color: var(--muted); }
.nav-group .nav-toggle { width: 100%; padding: 7px 4px 7px 0; justify-content: flex-start; text-align: left; background: none; box-shadow: none; transform: none; }
.nav-group .nav-toggle:hover { background: none; box-shadow: none; transform: none; color: var(--text); }
.nav-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 0; margin: 0;
  background: none; border: 0; border-radius: 6px; cursor: pointer;
  font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit;
}
.nav-toggle:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.nav-chevron { display: inline-block; font-size: .8em; transition: transform .15s ease; }
.nav-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }
.nav-items[hidden] { display: none; }
.menu-editing .nav-items[hidden] { display: grid; }
.menu-editing .nav-toggle { pointer-events: none; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 11px;
  color: var(--text); font-weight: 550;
  transition: background-color .2s ease, transform .2s ease, color .2s ease;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; transform: translateX(3px); }
.nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav svg { width: 18px; height: 18px; flex: none; }

/* Presentation (SD-014 §5.7): the content fills the screen, with the navigation and the no-print controls left out. */
#content:fullscreen { background: var(--bg); overflow: auto; padding: clamp(18px, 3vw, 48px); }
#content:fullscreen .no-print, #content:fullscreen .topbar { display: none !important; }
#content:fullscreen .kpi-grid { grid-auto-rows: minmax(64px, 9vh); }

/* The menu editor (SD-014 §5.6): visible to an administrator who may change the menu. */
.nav-items { display: grid; gap: 2px; }
.menu-editing .nav-section { border: 1px dashed var(--border); border-radius: 12px; padding: 4px; margin-bottom: 8px; }
.menu-editing .nav-items { min-height: 30px; }
.menu-editing .nav a { cursor: default; }
/* Breadcrumbs (SD-014 §5.8): the trail above each page's title. */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "\203A"; margin-right: 6px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* Rename and drag controls exist only while the menu is being edited. */
.menu-edit-tools, .menu-rename, .menu-handle, .menu-move, .menu-group-tools { display: none !important; }
.menu-editing .menu-move, .menu-editing .menu-group-tools { display: inline-flex !important; align-items: center; gap: 2px; }
.menu-move { font-size: .62rem; padding: 1px 5px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; line-height: 1.2; }
.menu-editing .menu-edit-tools { display: inline-flex !important; }
.menu-editing .menu-rename { display: inline-block !important; }
.menu-editing .menu-handle { display: inline-block !important; }
.menu-editing .nav-group .menu-rename { display: inline-block !important; }
.menu-edit-tools { margin-left: auto; align-items: center; gap: 4px; }
.menu-handle { cursor: grab; border: 0; background: transparent; color: var(--muted); padding: 0 4px; touch-action: none; font-size: 1rem; line-height: 1; }
.menu-rename { font-size: .72rem; padding: 2px 7px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.nav-group .menu-rename { margin-left: 8px; text-transform: none; letter-spacing: normal; }
.menu-dragging { opacity: .75; box-shadow: 0 0 0 2px var(--accent); }
.menu-rename-input { width: 100%; font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--accent); background: var(--input); color: var(--text); }
.embed-rows { display: grid; gap: 10px; }
/* A web page to embed is one line: title, address, width, height and (for one saved) Remove; it wraps to a column on a narrow screen. */
.embed-row { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(200px, 3fr) 130px 110px auto; gap: 10px; align-items: end;
  padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.embed-row > label { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.embed-row > label.check-inline { flex-direction: row; align-items: center; padding-bottom: 10px; }
/* The widgets of a model to tick: a tick, the widget's name and its kind on one line, in as many columns as fit. */
.widget-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.widget-pick { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 8px; border-radius: 8px; text-align: left; justify-content: flex-start; }
.widget-pick:hover { background: var(--surface-2); }
.widget-pick > input { flex: none; width: auto; margin: 0; }
.widget-pick > span:first-of-type { flex: 1; min-width: 0; }
.widget-pick > .pill { flex: none; white-space: nowrap; }
@media (max-width: 860px) { .embed-row { grid-template-columns: 1fr 1fr; } .embed-row > label:nth-of-type(-n+2) { grid-column: 1 / -1; } }
.menu-link-form { display: grid; gap: 6px; padding: 6px 8px; }
.menu-link-form input { width: 100%; font: inherit; font-size: .85rem; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--accent); background: var(--input); color: var(--text); }
.menu-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.menu-tools .menu-status { width: 100%; font-size: .85rem; margin: 4px 0 0; }

.sidebar-foot { margin-top: auto; padding: 14px 6px 4px; border-top: 1px solid var(--border); }

/* The menu scrolls on its own between the brand and the foot (Experience plan, M1); fades say there is more above or below. Quick find (M3). */
.sidebar > .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; margin: 0 -6px; padding: 0 6px 8px; }
.sidebar > .nav::-webkit-scrollbar { width: 6px; }
.sidebar > .nav::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 6px; }
.sidebar > .nav.nav-more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.sidebar > .nav.nav-more-above { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px);
  mask-image: linear-gradient(to bottom, transparent, #000 28px); }
.sidebar > .nav.nav-more-above.nav-more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.sidebar > .sidebar-foot { flex: none; }
.nav-find { position: relative; display: flex; align-items: center; gap: 6px; margin: 0 4px 6px; flex: none; }
.nav-find input { flex: 1; min-width: 0; font: inherit; font-size: .88rem; padding: 7px 64px 7px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--input); color: var(--text); }
.nav-find input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-find-key { position: absolute; right: 40px; font-family: var(--font-mono); font-size: .66rem; color: var(--muted); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 4px; pointer-events: none; }
.nav-find input:focus ~ .nav-find-key, .nav-find input:not(:placeholder-shown) ~ .nav-find-key { display: none; }
.nav-fold { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer; font-size: .9rem; line-height: 1; padding: 0; }
.nav-fold:hover { color: var(--text); background: var(--surface-2); }
.nav-find-none { margin: 4px 12px; font-size: .85rem; }
.nav-finding .nav-toggle { pointer-events: none; }
.nav a.nav-found .menu-text { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); text-underline-offset: 3px; }
.menu-editing ~ .nav-find, .nav-find:has(~ .menu-editing) { opacity: .5; pointer-events: none; }
.who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.who strong { display: block; font-size: .92rem; line-height: 1.2; }
.who .muted { font-size: .78rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.main { min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.crumb { font-weight: 650; color: var(--muted); font-size: .92rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; position: relative; }

/* The content fills the window: its padding grows with the window, and a wide grid gets the width it needs. */
.content { padding: clamp(18px, 2.2vw, 36px); max-width: none; animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.content.narrow { max-width: 520px; margin: 40px auto; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Cards and layout --------------------------------------------------------------------------- */
.card {
  position: relative;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
.card.hero {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--accent-2) 10%, var(--surface)));
  overflow: hidden;
}
.card.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 35%, transparent), transparent 70%);
  pointer-events: none;
}

.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.split > .card { margin-bottom: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input { max-width: 340px; }

/* ---- Stats -------------------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  padding: 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
.stat:hover { transform: translateY(-3px); }
.stat .value { font-size: 1.9rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .84rem; margin-top: 4px; }

/* ---- Forms -------------------------------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .88rem; margin: 16px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
select option:disabled { color: var(--muted); }
textarea { min-height: 130px; resize: vertical; }
.field-hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 6px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }
.form-section { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--border); }
.form-section:first-of-type { margin-top: 6px; padding-top: 0; border-top: 0; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.counter { font-size: .8rem; color: var(--muted); text-align: right; margin-top: 6px; }

/* ---- Buttons ------------------------------------------------------------------------------------ */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; margin-top: 0;
  border: 0; border-radius: 11px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font: inherit; font-weight: 650;
  box-shadow: 0 12px 26px -14px var(--accent);
  transition: transform .15s ease, filter .2s ease, box-shadow .2s ease;
  text-decoration: none;
}
button:hover, .button:hover { transform: translateY(-1px); filter: brightness(1.06); text-decoration: none; }
button:active, .button:active { transform: translateY(0); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
button.quiet, .button.quiet {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: none;
}
button.quiet:hover, .button.quiet:hover { border-color: var(--accent); color: var(--accent); }
button.small { padding: 6px 12px; font-size: .84rem; border-radius: 9px; }
button.danger { background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 12px 26px -14px #ef4444; }

.iconbtn {
  width: 40px; height: 40px; padding: 0; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none;
}
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.iconbtn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }

/* ---- Appearance panel --------------------------------------------------------------------------- */
.appearance {
  position: absolute; right: 0; top: 50px; z-index: 40;
  width: 310px; padding: 18px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: rise .25s cubic-bezier(.2, .7, .2, 1) both;
}
.appearance[hidden] { display: none; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented button {
  background: transparent; color: var(--muted); box-shadow: none; padding: 8px 6px; font-size: .88rem; font-weight: 600; margin: 0;
}
.segmented button:hover { transform: none; filter: none; color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch {
  width: 100%; aspect-ratio: 1; padding: 0; border-radius: 50%; border: 2px solid transparent;
  background: linear-gradient(135deg, var(--sw1), var(--sw2)); box-shadow: none;
  transition: transform .2s ease;
}
.swatch:hover { transform: scale(1.08); filter: none; }
.swatch[aria-pressed="true"] { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
.swatch-obsidian { --sw1: #6366f1; --sw2: #14b8a6; }
.swatch-radiant { --sw1: #4f46e5; --sw2: #0284c7; }
.swatch-emerald { --sw1: #10b981; --sw2: #06b6d4; }
.swatch-sapphire { --sw1: #2563eb; --sw2: #8b5cf6; }
.swatch-amber { --sw1: #f59e0b; --sw2: #ef4444; }
.swatch-cyberpunk { --sw1: #06b6d4; --sw2: #ec4899; }
.swatch-label { display: block; text-align: center; font-size: .7rem; color: var(--muted); margin-top: 6px; }

/* ---- Tables, badges and states ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border-radius: 14px; }
/* A grid never squeezes its columns below their words: the card scrolls sideways instead of clipping them. */
.table-wrap > table { min-width: 1040px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background-color .2s ease; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td a.incident-link { font-weight: 650; }

.sev {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 650;
  background: var(--surface-2); color: var(--text);
}
.sev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev-Critical { background: color-mix(in srgb, #ef4444 16%, transparent); color: #ef4444; }
.sev-High { background: color-mix(in srgb, #f97316 16%, transparent); color: #f97316; }
.sev-Medium { background: color-mix(in srgb, var(--sev-medium) 18%, transparent); color: var(--sev-medium); }
.sev-Minor, .sev-Low { background: color-mix(in srgb, var(--sev-low) 16%, transparent); color: var(--sev-low); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650;
  background: var(--surface-2); color: var(--muted);
}
.pill-on { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill-off { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; margin: 3px 6px 3px 0; padding: 4px 11px;
  border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}

.error, .field-error.summary { color: var(--danger); margin: 10px 0; font-weight: 550; }
.notice { color: var(--ok); margin: 10px 0; font-weight: 550; word-break: break-all; }
.alert {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger); font-weight: 550;
}
.alert.ok {
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok);
}
.callout {
  padding: 16px 18px; border-radius: 14px; border: 1px dashed var(--border);
  color: var(--muted); background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 1.02rem; margin-bottom: 4px; }

.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0; }
.kv > div { padding: 12px 0; border-bottom: 1px solid var(--border); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.kv dd { margin: 0; }
.description { white-space: pre-wrap; background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }

.summary-list { display: grid; gap: 14px; }
.summary-list div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
.summary-list dt { color: var(--muted); font-size: .86rem; }
.summary-list dd { margin: 0; font-weight: 600; text-align: right; }

.table-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form > div { flex: 1 1 200px; }
.inline-form label { margin-top: 0; }

/* ---- Responsive --------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 272px; height: 100vh; z-index: 50;
    transform: translateX(-102%); transition: transform .3s cubic-bezier(.2, .7, .2, 1);
    box-shadow: 0 0 60px rgba(0, 0, 0, .25);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::before {
    content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35);
  }
  .menu-toggle { display: inline-grid; }
  .content { padding: 18px; }
  .topbar { padding: 10px 16px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding-top: 10px; }
  .kv > div { padding: 4px 0 10px; }
  .toolbar input { max-width: none; }
}

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

/* Filters, the EXCO dashboard and the combined report (SD-008). */
.filter-bar { margin-bottom: 22px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
/* The filter panel is collapsed by default: its summary is the only thing shown until it is opened (SD-011 §5.4.3). */
.filter-panel { margin-bottom: 22px; padding: 0; }
.filter-panel > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--text); list-style: none; }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary::before { content: "▸"; display: inline-block; width: 1.2em; color: var(--muted); }
.filter-panel[open] > summary::before { content: "▾"; }
.filter-panel > .filter-bar { padding: 0 18px 18px; margin-bottom: 0; }
/* A row action that opens a reason form in place (Delete): the form is wide enough to read, and it wraps. */
.row-action { display: inline-block; vertical-align: top; }
.row-action > summary { list-style: none; cursor: pointer; }
.row-action > summary::-webkit-details-marker { display: none; }
.row-action[open] > summary { opacity: .7; }
.row-action form { white-space: normal; min-width: 280px; margin-top: 8px; text-align: left; }
.row-action textarea { width: 100%; min-height: 64px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 0 0 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.kpi-value { font-size: 1.9rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-alert { border-color: var(--danger); }
.kpi-alert .kpi-value { color: var(--danger); }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 12px; }
.bar-label { color: var(--text); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-count { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.trend { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 10px; overflow-x: auto; }
.trend-col { flex: 1 0 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.trend-bar { width: 100%; max-width: 44px; min-height: 2px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.trend-count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.trend-label { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.report-summary { margin-bottom: 22px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
@media print {
  /* Every colour is a token, so the print page resets the tokens, not each element: a theme's light text would
     otherwise print white on white. The sidebar is hidden, so the shell is one column. */
  :root, html[data-theme] {
    --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --input: #fff; --text: #000; --muted: #333;
    --border: #999; --accent: #000; --accent-2: #000; --sev-medium: #000; --sev-low: #000;
    --danger: #000; --ok: #000; --warn: #000; --shadow: none;
  }
  html, body { background: #fff !important; color: #000 !important; background-image: none !important; }
  .shell { display: block; }
  .card, .sidebar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .no-print, nav, .nav, .sidebar, .sidebar-foot { display: none !important; }
  .card, .kpi { box-shadow: none; break-inside: avoid; border-color: #bbb; background: #fff; }
  .kpi-value, .kpi-label, .bar-label, .bar-count { color: #000; }
  .bar-fill, .trend-bar { background: #555; }
  .split { display: block; }
  .split > * + * { margin-top: 16px; }
  a { color: #000; text-decoration: none; }
}

/* ---- The incident grid (SD-011): column panel, inline assignment, keyboard focus ------------------ */
.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;
}

.columns-panel { margin-bottom: 18px; }
.column-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.column-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; }
.column-item label { flex: 1; cursor: pointer; }

.link-button {
  background: none; border: 0; padding: 2px 6px; color: var(--accent); font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-button:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.link-button:focus-visible, tr[data-row]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
tr[data-row]:focus-visible { background: var(--surface-2); }

.inline-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.inline-edit input { min-width: 180px; }
.inline-edit .button { padding: 6px 10px; }

/* ---- The incident grid: sorting, numbered pages and the row actions (SD-011, blueprint §5.4.2) ----- */
.sort-link { color: inherit; font-weight: 650; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link:focus-visible { color: var(--accent); text-decoration: underline; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--accent); }
.actions-col { white-space: nowrap; }
.actions-col .button { padding: 4px 9px; font-size: .85rem; }
.pager { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; margin-top: 16px; }
.pager-pages, .pager-size { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-link {
  min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none;
}
a.page-link:hover, a.page-link:focus-visible { border-color: var(--accent); color: var(--accent); }
span.page-link[aria-current] { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); font-weight: 650; }

/* ---- The column choice: each column is a row with its checkbox, its name and its two moves (SD-011 §5.4.4) ---- */
.column-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; }
.column-item input.column-check { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.column-item label { cursor: pointer; text-align: left; font-weight: 600; }
.column-move {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; padding: 0;
}
.column-move:hover:not(:disabled), .column-move:focus-visible { border-color: var(--accent); color: var(--accent); }
.column-move:disabled { opacity: .35; cursor: default; }
.column-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Presentation deck (SD-016): a slide show over the page; the slides are 16:9 and scale with the window. ---- */
.deck { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.deck-top { padding: 10px 18px 0; display: flex; flex-wrap: wrap; gap: 12px; }
.deck-top[hidden] { display: none; }
.deck-stage { flex: 1 1 auto; min-height: 0; position: relative; display: grid; place-items: center; overflow: hidden; }
.deck-slide {
  display: none; flex-direction: column; gap: 1.6%; padding: 2.4%; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden; font-size: var(--slide-unit, 12px);
}
.deck-slide.is-current { display: flex; }
.deck-slide.is-forward.is-current { animation: deck-forward 320ms ease-out; }
.deck-slide.is-back.is-current { animation: deck-back 320ms ease-out; }
@keyframes deck-forward { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes deck-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.deck-slide > * { margin: 0; max-height: 100%; min-height: 0; overflow: auto; box-sizing: border-box; }
.deck-title { justify-content: center; }
.deck-title h1 { font-size: 3.2em; line-height: 1.1; }
.deck-slide .hero button, .deck-slide .hero .button { display: none; }
.deck-slide .kpi-tools { display: none; }
/* A band is drawn at the dashboard's own size, then scaled as one picture to the slide (Presentation options P1); its text is the page's, not
   the slide's unit. */
.deck-band-slide { align-items: center; justify-content: center; }
.deck-band-frame { position: relative; flex: none; overflow: hidden; max-height: none; }
.deck-band { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); transform-origin: top left; font-size: 1rem; position: absolute;
  top: 0; left: 0; }
.deck-band .kpi-widget { min-height: 0; overflow: hidden; }
.deck-band .kind-break { display: none; }
.deck-foot { display: flex; align-items: center; gap: 12px; padding: 8px 18px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.deck-count { font-family: var(--font-mono); color: var(--text); min-width: 4.5em; text-align: center; }
.deck-hint { flex: 1 1 260px; }
.deck-progress { height: 4px; background: var(--surface-2); }
.deck-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 240ms ease; }
body.presenting { overflow: hidden; }
@media print { .deck { display: none !important; } }

/* The person picker (Option C): a search field, its results, and the add-a-person panel, on the form the person is filling. */
.person-picker { display: grid; gap: 6px; }
.person-picker-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.person-picker-row input[type="search"] { flex: 1 1 220px; min-width: 0; }
.person-picker-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-height: 240px; overflow: auto; }
.person-picker-results[hidden] { display: none; }
.person-picker-results li + li { border-top: 1px solid var(--border); }
.person-picker-choice { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; color: var(--text); cursor: pointer; font: inherit; }
.person-picker-choice:hover, .person-picker-choice:focus-visible { background: var(--surface-2); }
.person-picker-none { padding: 8px 10px; color: var(--muted); font-size: .88rem; }
.person-picker-badge { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; border: 1px solid currentColor; font-size: .72rem; color: var(--muted); }
.person-picker-add { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.person-picker-add[hidden] { display: none; }
.person-picker-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; }
.person-picker-add-grid label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.person-picker-error { margin: 6px 0 0; color: var(--danger); font-size: .85rem; }
.person-picker-error[hidden] { display: none; }

/* The costing grid: twelve month columns, each input narrow and right aligned (SD-020 Phase 2). */
.costing-grid input { width: 6.5rem; text-align: right; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.costing-grid .headcount-row input { width: 5rem; }
.costing-grid td.num, .costing-grid th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* The costing sheet (SD-020): a row per cost category, the category column stays in view as the months scroll (Excel-like). */
.costing-grid.sheet th.sheet-label { position: sticky; left: 0; z-index: 1; background: var(--surface, #fff); text-align: left; min-width: 15rem; }
.costing-grid.sheet thead th.sheet-label { z-index: 2; }
.costing-grid.sheet tbody tr:nth-child(even) td, .costing-grid.sheet tbody tr:nth-child(even) th { background: var(--surface-2, #f4f6f8); }
.costing-grid.sheet tbody tr:hover td, .costing-grid.sheet tbody tr:hover th { background: var(--surface-2, #eef3f8); }
.costing-grid.sheet input:focus { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; }
.costing-grid.sheet .row-save button { white-space: nowrap; }

/* The organisation's logos and reporting lines (SD-021, DEC-41). A logo sits on a light tile so a dark logo reads in the dark theme. */
.unit-heading { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.unit-logo { max-height: 64px; max-width: 180px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--border); }
.unit-logo.small { max-height: 28px; max-width: 90px; padding: 2px; border-radius: 4px; vertical-align: middle; margin-right: 8px; }
.reporting-lines, .reporting-lines ul { list-style: none; margin: 0; padding-left: 0; }
.reporting-lines ul { padding-left: 22px; border-left: 1px solid var(--border); margin-left: 8px; }
.reporting-lines li { padding: 4px 0; }
.reporting-lines .muted { font-size: .85rem; }

/* The widget picker of a composed dashboard (SD-023): a widget per line, in columns that fit the page. */
.widget-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 18px; }
.widget-pick { align-items: center; color: var(--text); }
.widget-pick .pill { margin-left: auto; font-size: .72rem; }

/* The "New dashboard" link at the end of each menu group, for an administrator (SD-024). Quieter than an item: it adds, it does not go. */
.nav-add { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); opacity: .85; }
.nav-add:hover { color: var(--text); opacity: 1; }

/* Projects (SD-027): the RAG of a weekly update, a field list, and text kept with its line breaks. */
.rag { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid var(--border); }
.rag-green { background: color-mix(in srgb, var(--ok) 22%, transparent); border-color: var(--ok); }
.rag-amber { background: color-mix(in srgb, var(--warn) 26%, transparent); border-color: var(--warn); }
.rag-red { background: color-mix(in srgb, var(--danger) 22%, transparent); border-color: var(--danger); }
.rag-none { color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 6px 16px; margin: 0; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; }
.pre-line { white-space: pre-line; margin: 0; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } .detail-grid dd { margin-bottom: 8px; } }

/* The weekly project reports (SD-027, PJ-08): a title band, the filters in one row, labelled fields, three period columns, the financial
   bars and the CRAIDS panel. Every colour is a theme token; the RAG is written as well as coloured. */
.report { display: grid; gap: 14px; }
.report-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px;
  border-radius: 12px; background: var(--accent); color: #fff; }
.report-head h1 { margin: 0; font-size: 1.25rem; color: #fff; }
.report-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.report-tools .button { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .4); }
.report-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.report-filter { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); min-width: 180px; }
.report-filter.wide { flex: 1 1 320px; }
.report-filter span, .report-field span, .report-band span, .report-hero span, .report-health span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.report-week { margin: 0; color: var(--muted); }
.report-tile-row { display: flex; justify-content: center; }
.report-hero { display: grid; justify-items: center; gap: 4px; padding: 12px 36px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.report-hero strong { font-size: 2.2rem; line-height: 1; }
.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.report-field, .report-band, .report-panel, .report-columns > article { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 4px; align-content: start; }
.report-rag { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.rag-block { display: block; padding: 6px 10px; border-radius: 8px; text-align: center; border: 1px solid var(--border); }
.rag-block.rag-green { background: color-mix(in srgb, var(--ok) 30%, transparent); }
.rag-block.rag-amber { background: color-mix(in srgb, var(--warn) 40%, transparent); }
.rag-block.rag-red { background: color-mix(in srgb, var(--danger) 30%, transparent); }
.report-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.report-columns h2, .report-panel h2 { margin: 0 0 6px; font-size: 1rem; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
.report-columns h3 { margin: 0 0 4px; font-size: .9rem; }
.report-span2 { grid-column: span 2; }
.report-health, .report-craids { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report-health > div { display: grid; justify-items: center; gap: 4px; padding: 18px 8px; border: 1px solid var(--border); border-radius: 10px; }
.report-bars { margin: 0 0 12px; display: grid; gap: 6px; }
.report-bars figcaption { font-weight: 600; font-size: .85rem; }
.report-bar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: .85rem; }
.report-bar-label { color: var(--muted); }
.report-bar-track { height: 12px; background: var(--surface-2, transparent); border-radius: 4px; overflow: hidden; }
.report-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.report-bar-value { font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-columns { grid-template-columns: 1fr; }
  .report-span2 { grid-column: auto; }
}
@media (max-width: 520px) { .report-grid, .report-rag, .report-health, .report-craids { grid-template-columns: 1fr; } }
@media print {
  .no-print { display: none !important; }
  .report-head { background: #fff; color: #000; border: 2px solid #000; }
  .report-head h1 { color: #000; }
  .report-columns > article, .report-field { break-inside: avoid; }
}

/* Tasks (SD-027 Phase 1b): the board's columns and cards, an overdue date, the checklist and the comments. */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { display: grid; align-content: start; gap: 8px; min-height: 140px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.kanban-column.is-target { outline: 2px dashed var(--accent); outline-offset: -4px; }
.kanban-column h2 { margin: 0; font-size: .95rem; display: flex; justify-content: space-between; }
.kanban-card { display: grid; gap: 4px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); cursor: grab; }
.kanban-card p { margin: 0; font-size: .82rem; }
.kanban-card.is-dragging { opacity: .5; }
.kanban-card.is-overdue { border-left: 4px solid var(--danger); }
.kanban-move { display: flex; flex-wrap: wrap; gap: 4px; }
.kanban-move select, .kanban-move input { font-size: .8rem; padding: 2px 6px; min-width: 0; flex: 1 1 90px; }
.overdue { color: var(--danger); font-weight: 600; }
.checklist, .comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.comments li { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
@media (max-width: 720px) { .kanban { grid-template-columns: repeat(6, minmax(220px, 80vw)); } }

/* Time (SD-027 Phase 2): the running timer in the top bar, and the timesheet's day columns. */
.timer-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--accent); font-weight: 600; font-size: .85rem; text-decoration: none; color: var(--text); }
.timesheet td.num, .timesheet th.num { text-align: right; font-variant-numeric: tabular-nums; }
.timesheet .off { color: var(--muted); font-size: .78rem; display: block; }
.timesheet tfoot td { font-weight: 600; }
.under { color: var(--warn); }

/* The Gantt and the roadmap (SD-027 Phase 3a): drawn as SVG on the server; every colour is a theme token, so the six themes and print follow. */
.gantt-frame { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.gantt-labels { flex: none; }
.gantt-wrap { overflow-x: auto; flex: 1 1 auto; min-width: 0; }
.gantt { display: block; font-family: var(--font-sans); }
.gantt-canvas { fill: var(--surface); }
.gantt-stripe { fill: color-mix(in srgb, var(--text) 3%, transparent); }
.gantt-off { fill: color-mix(in srgb, var(--muted) 12%, transparent); }
.gantt-axis { stroke: var(--border); stroke-width: 1; }
.gantt-tick { stroke: color-mix(in srgb, var(--border) 60%, transparent); stroke-width: 1; }
.gantt-tick-major { stroke: var(--border); stroke-width: 1; }
.gantt-scale { fill: var(--muted); font-size: 11px; }
.gantt-label { fill: var(--text); font-size: 12px; }
.gantt-label.done { fill: var(--muted); text-decoration: line-through; }
.gantt-group { font-weight: 600; }
a .gantt-label:hover { text-decoration: underline; }
.gantt-bar-body { fill: color-mix(in srgb, var(--accent) 70%, transparent); stroke: var(--accent); stroke-width: 1; }
.gantt-bar-body.critical { fill: color-mix(in srgb, var(--danger) 55%, transparent); stroke: var(--danger); stroke-width: 2; }
.gantt-bar-body.done { fill: color-mix(in srgb, var(--muted) 35%, transparent); stroke: var(--muted); }
.gantt-bar.movable { cursor: grab; }
.gantt-bar.movable:active { cursor: grabbing; }
.gantt-bar:focus { outline: none; }
.gantt-bar:focus .gantt-bar-body, .gantt-bar.movable:hover .gantt-bar-body { stroke: var(--text); stroke-width: 2; }
.gantt-handle { fill: transparent; cursor: ew-resize; }
.gantt-baseline { fill: color-mix(in srgb, var(--text) 45%, transparent); }
.gantt-diamond { fill: var(--warn); stroke: var(--text); stroke-width: 1; }
.gantt-diamond.done { fill: var(--ok); }
.gantt-diamond.baseline { fill: none; stroke: var(--muted); stroke-dasharray: 2 2; }
.gantt-link { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.gantt-link.critical { stroke: var(--danger); stroke-width: 2; }
.gantt-arrowhead { fill: var(--muted); }
.gantt-today { stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 4 3; }
.gantt-today-label { fill: var(--danger); font-weight: 600; }
.gantt-critical-label { fill: var(--text); font-size: 10px; font-weight: 600; pointer-events: none; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; font-size: .85rem; color: var(--muted); }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-dialog { max-width: 560px; width: calc(100% - 32px); color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.gantt-dialog::backdrop { background: rgb(0 0 0 / 40%); }
.roadmap-bar { stroke: var(--text); stroke-width: 1; }
.roadmap-bar.rag-green { fill: color-mix(in srgb, var(--ok) 55%, transparent); }
.roadmap-bar.rag-amber { fill: color-mix(in srgb, var(--warn) 60%, transparent); }
.roadmap-bar.rag-red { fill: color-mix(in srgb, var(--danger) 55%, transparent); }
.roadmap-bar.rag-none { fill: color-mix(in srgb, var(--muted) 30%, transparent); }
.roadmap-rag { fill: var(--text); font-size: 11px; font-weight: 600; pointer-events: none; }
.roadmap-baseline { stroke: var(--text); stroke-width: 2; stroke-dasharray: 3 2; }
@media print {
    .gantt-wrap { overflow: visible; }
    .gantt-frame { border: none; }
    .gantt-dialog { display: none; }
}
@media (max-width: 640px) {
    .gantt-labels { width: 170px; height: auto; }
}

/* The calendar view (SD-027 Phase 3b): a month a page, a week a row. */
.month { table-layout: fixed; width: 100%; min-width: 760px; }
.month th { text-align: left; }
.month-day { vertical-align: top; height: 104px; padding: 6px; border: 1px solid var(--border); }
.month-day.outside { opacity: .45; }
.month-day.off { background: color-mix(in srgb, var(--muted) 8%, transparent); }
.month-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.month-date { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.month-item { font-size: .8rem; line-height: 1.3; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-item.milestone { font-weight: 600; }
.month-item.leave, .month-item.holiday { color: var(--muted); }
.month-item.done a { text-decoration: line-through; color: var(--muted); }
.month-item.late a { color: var(--danger); font-weight: 600; }

/* A record's history (SD-028): closed until opened, in the card's own style. */
.history > summary { cursor: pointer; list-style: none; }
.history > summary::-webkit-details-marker { display: none; }
.history > summary h2 { display: inline; margin: 0; }
.history > summary::before { content: "▸ "; color: var(--muted); }
.history[open] > summary::before { content: "▾ "; }
.history-list { list-style: none; margin: 14px 0 0; padding: 0; }
.history-list > li { border-left: 2px solid var(--border); padding: 4px 0 12px 14px; margin-left: 4px; }
.history-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.history-why { margin: 4px 0; }
.history-changes { width: auto; margin-top: 6px; font-size: .85rem; }
.history-changes td, .history-changes th { padding: 3px 10px 3px 0; vertical-align: top; max-width: 420px; overflow-wrap: anywhere; }

/* The plan on a page (SD-027 Phase 4b): the steering slide's grid, in the theme's colours. */
.plan-page { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px 20px; margin-bottom: 22px; }
.plan-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 3px solid var(--accent); padding-bottom: 6px; }
.plan-title h2 { margin: 0; font-size: 1.6rem; letter-spacing: .02em; text-transform: uppercase; }
.plan-intent, .plan-banner { margin: 12px 0 0; padding: 10px 14px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 600; }
.plan-banner { text-align: center; }
.plan-grid { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 14px; table-layout: fixed; min-width: 760px; }
.plan-grid th, .plan-grid td { border: 1px solid var(--border); padding: 8px 10px; vertical-align: top; text-align: left; }
.plan-grid thead th { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); color: var(--text); text-align: center; }
.plan-grid .plan-corner { width: 17%; text-align: left; }
.plan-grid .plan-stream { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); width: 17%; color: var(--text); }
.plan-grid .plan-stream .plan-heading { font-size: 1rem; }
.plan-grid thead th { color: var(--text); }
.plan-heading { display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.plan-theme { display: block; font-size: .8rem; font-weight: 600; opacity: .85; text-transform: uppercase; }
.plan-cell.plan-now, .plan-grid thead th.plan-now { background-image: linear-gradient(color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent) 12%, transparent)); }
.plan-cell.plan-gate { background: color-mix(in srgb, var(--warn) 22%, transparent); }
.plan-milestone + .plan-milestone { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.plan-milestone-title { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .85rem; }
.plan-milestone ul { margin: 6px 0 0; padding-left: 16px; font-size: .85rem; }
.plan-milestone li a { color: var(--text); text-decoration: none; }
.plan-milestone li a:hover { text-decoration: underline; }
.plan-done a { color: var(--muted) !important; }
.plan-gate-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--text); background: color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 4px; padding: 0 6px; }
.plan-gates { margin-top: 14px; }
.plan-gates h3 { margin: 0; padding: 6px 12px; background: color-mix(in srgb, var(--ok) 45%, var(--surface)); text-transform: uppercase; font-size: .95rem; }
.plan-gate-boxes { display: grid; grid-template-columns: repeat(var(--plan-gates), minmax(0, 1fr)); border: 1px solid var(--border); border-top: none; }
.plan-gate-boxes > div { padding: 8px 12px; border-left: 1px solid var(--border); font-size: .85rem; }
.plan-gate-boxes > div:first-child { border-left: none; }
.plan-gate-boxes p { margin: 4px 0 0; }
@media (max-width: 760px) { .plan-gate-boxes { grid-template-columns: 1fr; } .plan-gate-boxes > div { border-left: none; border-top: 1px solid var(--border); } }
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    .plan-page { border: none; padding: 0; }
    .plan-grid { min-width: 0; }
}

/* Administration › System settings (SD-027 Phase 4e): the email form in rows that wrap, the secrets shown as set or not set. */
.settings-form { display: grid; gap: 14px; }
.settings-form > label, .settings-row > label { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.settings-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; align-items: end; }
.settings-row > label.check-inline { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; padding-bottom: 12px; }
.settings-row > label.check-inline input { width: auto; flex: none; margin: 0; }
.settings-group { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; }
.settings-group legend { padding: 0 6px; font-weight: 650; }
.settings-secret { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.settings-secret > span { font-size: .9rem; font-weight: 600; }
[data-email-settings] [hidden] { display: none; }

/* The "?" guide (SD-027 Phase 4e): a panel on the right, over the page, closed with ×, Escape or a click outside. */
[data-help-open] { font-weight: 700; font-size: 1rem; }
.help-panel { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(460px, 100vw); padding: 0; border: none; border-left: 1px solid var(--border);
  background: linear-gradient(var(--surface), var(--surface)), var(--bg); color: var(--text); box-shadow: var(--shadow); }
.help-panel::backdrop { background: color-mix(in srgb, #000 35%, transparent); }
.help-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 10px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: linear-gradient(var(--surface), var(--surface)), var(--bg); }
.help-head h2 { margin: 0; font-size: 1.15rem; }
.help-body { padding: 8px 20px 28px; line-height: 1.55; font-size: .93rem; }
.help-body h3 { margin: 18px 0 6px; font-size: 1rem; }
.help-body h4 { margin: 14px 0 4px; font-size: .95rem; }
.help-body ul, .help-body ol { padding-left: 20px; margin: 6px 0; }
.help-body li { margin: 3px 0; }
.help-body code { font-size: .85em; }
/* The guides in parts (G1): tabs, tables, a drawn process, a stage's state and the rules a step meets. A guide in parts opens wider. */
.help-panel-wide { width: min(760px, 100vw); }
.help-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 6px 0 12px; }
.help-tabs [role="tab"] { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; border-radius: 0; }
.help-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.help-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-table { overflow-x: auto; margin: 8px 0 12px; }
.help-table table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.help-table th, .help-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.help-table th { color: var(--muted); font-weight: 600; }
.help-process { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-wrap: wrap; gap: 10px 22px; counter-reset: step; }
.help-process li { position: relative; flex: 1 1 150px; max-width: 220px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin: 0;
  background: color-mix(in srgb, var(--accent) 5%, transparent); }
.help-process li strong { display: block; }
.help-process li:not(:last-child)::after { content: "→"; position: absolute; right: -17px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.help-who { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.help-state { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.help-state-available { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.help-state-partly { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.help-state-planned { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.help-rules code { margin-right: 3px; white-space: nowrap; }
.help-page { padding: 18px 26px 30px; }
@media print { .help-tabs { display: none; } .help-part[hidden] { display: block !important; } }

/* Working on tasks (the Work plan's W2, TK-12): progress bars, due badges, My Work's Today band and Log what I did, the task page's stepper,
   timer, quick time and activity feed, and the done tick. Motion is off for those who ask for less (the reduced-motion rule above). */
.meter { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s ease; }
.task-progress { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; vertical-align: middle; font-size: .78rem; color: var(--muted); }
.task-progress-bar { display: inline-block; width: 72px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.task-progress-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.task-progress[data-progress="100"] .task-progress-bar > span { background: var(--ok); }
.task-hero-progress { margin-top: 10px; }
.task-hero-progress .task-progress { margin-left: 0; font-size: .86rem; }
.task-hero-progress .task-progress-bar { width: 180px; height: 8px; }
.due-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 650; vertical-align: middle; }
.due-overdue { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.due-today { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--text); }
.due-week { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

.today-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.today-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); min-width: 0; }
.today-label { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.today-figure { font-size: 1.7rem; font-weight: 750; line-height: 1.2; }
.today-figure small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.today-hint { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-timer .today-figure { color: var(--accent); }
.today-stop { display: flex; gap: 6px; margin-top: 6px; }
.today-stop input { flex: 1 1 auto; min-width: 0; }

.log-form { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.4fr); gap: 10px 14px; align-items: end; }
.log-times { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.log-times .button.quiet { min-width: 64px; font-weight: 700; }
.log-duration { width: 90px; }
.log-today-title { margin: 18px 0 8px; font-size: 1rem; }
.activity-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.activity-list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.activity-time { font-weight: 700; min-width: 52px; color: var(--accent); }
@media (max-width: 640px) { .log-form { grid-template-columns: 1fr; } }

.done-toast { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; font-weight: 650;
  background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); color: var(--text);
  animation: done-in .35s ease-out; }
.done-tick { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800;
  animation: done-pop .5s cubic-bezier(.3, 1.6, .5, 1) .1s both; }
@keyframes done-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes done-pop { from { transform: scale(0); } to { transform: scale(1); } }

.next-step h2 { margin-bottom: 12px; }
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0; }
.stepper .step { flex: 1 1 120px; position: relative; margin: 0; }
.stepper .step form { margin: 0; }
.stepper .step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: 0; width: 14px; height: 2px; background: var(--border); }
.step-button { width: calc(100% - 14px); display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none; font-weight: 600; }
button.step-button:hover { border-color: var(--accent); color: var(--accent); }
button.step-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.step-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .78rem; font-weight: 750;
  background: var(--surface-2); color: var(--muted); flex: none; }
.step-past .step-button { color: var(--muted); }
.step-past .step-dot { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.step-current .step-button { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.step-current .step-dot { background: rgba(255, 255, 255, .25); color: #fff; }
.next-actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 16px; }
.timer-start { font-size: 1.05rem; padding: 12px 22px; }
.timer-face { font-size: 1.6rem; font-weight: 750; color: var(--accent); }
.timer-stop, .quick-time { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timer-stop input, .quick-time input { min-width: 220px; }
.quick-buttons { display: flex; gap: 6px; }
.quick-buttons .button.quiet { font-weight: 700; }
.checklist-complete { color: var(--ok); font-weight: 600; }
.more-status { margin-top: 14px; }
.more-status summary, .log-other-day summary, .remove-task summary { cursor: pointer; color: var(--muted); font-weight: 600; }

.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.comment-form textarea { flex: 1 1 auto; }
.log-other-day { margin-bottom: 12px; }
.activity-feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.activity { display: flex; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--border); }
.activity:first-child { border-top: none; }
.activity-icon { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: .9rem; }
.activity-kind-time .activity-icon { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.activity-kind-status .activity-icon { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.activity-kind-due .activity-icon { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.activity-line { margin: 0; }
.activity-body { margin: 4px 0 0; }
.activity-when { font-size: .78rem; }
.remove-task > p:first-of-type { margin-top: 10px; }

/* A project's tabs and its Milestones and Tasks views (the Work plan's W1). */
.project-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  overflow-x: auto; }
.project-tab { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.project-tab:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.project-tab.is-active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.milestone-card { margin-bottom: 14px; }
.milestone-card > summary { list-style: none; cursor: pointer; }
.milestone-card > summary::-webkit-details-marker { display: none; }
.milestone-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); gap: 4px 18px; align-items: center; }
.milestone-head::before { content: "▸"; grid-row: 1 / span 2; position: absolute; margin-left: -16px; color: var(--muted); transition: transform .2s ease; }
.milestone-card[open] > .milestone-head::before { transform: rotate(90deg); }
.milestone-card > summary { position: relative; padding-left: 16px; }
.milestone-title { font-size: 1.05rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.milestone-title .due-badge { margin-left: 0; }
.milestone-facts { grid-column: 1; font-size: .86rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.milestone-facts .rag { padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 650; border: 1px solid var(--border); color: var(--text); }
.milestone-progress { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; font-size: .8rem; }
.milestone-tasks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.milestone-task { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-2); }
.milestone-task.is-closed { opacity: .7; }
.milestone-task-main { min-width: 0; flex: 1 1 360px; }
.milestone-task-main .task-progress { margin-left: 8px; }
.milestone-task-actions { display: inline-flex; gap: 6px; margin: 0; }
.milestone-foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.milestone-change summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .86rem; }
.task-filters { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: end; padding: 12px 16px; margin-bottom: 14px; }
.task-filters label { font-size: .84rem; }
.kanban-card .task-progress { margin-left: 0; }
@media (max-width: 640px) { .milestone-head { grid-template-columns: 1fr; } .milestone-progress { grid-column: 1; grid-row: auto; } }

/* My Work's views (the Work plan's W3): the switch, and the timeline of the person's tasks. */
.view-switch { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.view-choice { padding: 7px 16px; border-radius: 9px; color: var(--muted); font-weight: 650; text-decoration: none; }
.view-choice:hover { color: var(--text); text-decoration: none; }
.view-choice.is-active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.mw-grid { display: grid; gap: 4px; overflow-x: auto; }
.mw-axis, .mw-row { display: grid; grid-template-columns: minmax(160px, 260px) minmax(480px, 1fr); gap: 10px; align-items: center; }
.mw-label { display: flex; gap: 6px; align-items: center; min-width: 0; font-size: .86rem; }
.mw-label a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-move { flex: none; padding: 0 6px; height: 22px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); box-shadow: none; font-size: .8rem; }
.mw-track { position: relative; height: 26px; border-radius: 6px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.mw-axis .mw-track { background: none; height: 20px; }
.mw-week { position: absolute; top: 0; font-size: .7rem; color: var(--muted); white-space: nowrap; transform: translateX(2px); }
.mw-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.mw-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--danger); opacity: .8; pointer-events: none; }
.mw-group { margin-top: 10px; font-weight: 700; font-size: .9rem; }
.mw-bar { position: absolute; top: 5px; height: 16px; min-width: 6px; border-radius: 5px; overflow: hidden; touch-action: none;
  background: color-mix(in srgb, var(--accent) 45%, transparent); border: 1px solid var(--accent); }
.mw-bar-fill { display: block; height: 100%; background: var(--accent); opacity: .7; }
.mw-bar.movable { cursor: grab; }
.mw-bar.is-dragging { cursor: grabbing; box-shadow: 0 6px 16px -6px var(--accent); z-index: 2; }
.mw-bar.is-overdue { background: color-mix(in srgb, var(--warn) 45%, transparent); border-color: var(--warn); }
.mw-bar.is-overdue .mw-bar-fill { background: var(--warn); }
.mw-bar.is-done { background: color-mix(in srgb, var(--ok) 30%, transparent); border-color: var(--ok); }
.mw-bar.is-done .mw-bar-fill { background: var(--ok); }
.mw-legend { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; margin: 14px 0 0; }
.mw-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 45%, transparent); border: 1px solid var(--accent); }
.mw-key.is-overdue { background: color-mix(in srgb, var(--warn) 45%, transparent); border-color: var(--warn); }
.mw-key.is-done { background: color-mix(in srgb, var(--ok) 30%, transparent); border-color: var(--ok); }
.mw-key-today { width: 2px; height: 14px; background: var(--danger); border: none; }

/* The risk register's R1: the classification checkboxes, the duplicate check, the owner's answer, the gate checks and the heat map. */
.risk-checks { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.risk-checks legend { font-weight: 650; padding: 0 6px; }
.risk-duplicates { border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent);
  border-radius: 12px; padding: 12px 16px; }
.risk-duplicates h2 { margin: 0 0 6px; font-size: 1.05rem; }
.risk-duplicates ul { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.ownership-answer { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ownership-decline { display: flex; gap: 8px; flex: 1 1 360px; }
.ownership-decline input { flex: 1 1 auto; }
.gate-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.gate { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.gate-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; flex: none; color: #fff; }
.gate-passed .gate-mark { background: var(--ok); }
.gate-blocked .gate-mark { background: var(--danger); }
.gate-warned .gate-mark { background: var(--warn); color: #000; }
.heatmap { border-collapse: separate; border-spacing: 4px; }
.heatmap th { text-align: center; font-size: .82rem; color: var(--muted); }
.heatmap th[scope="row"] { text-align: right; }
.heat-cell { text-align: center; font-weight: 700; border-radius: 8px; min-width: 96px; padding: 10px 6px; }
.heat-cell select { background: rgba(255, 255, 255, .85); color: #000; border-radius: 6px; font-size: .82rem; }
.scale-table input.pct { width: 84px; }
.scale-table textarea { min-width: 220px; }
.level-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; }

/* The risk register's R2: the assessment form and its preview, the figures, the heat map's marks. */
.assess-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.assess-layout h2 { margin: 6px 0 0; font-size: 1rem; }
.assess-preview { position: sticky; top: 12px; }
.assess-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.assess-figures > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.assess-money { font-weight: 700; }
.assess-formulas { margin: 6px 0 12px; padding-left: 18px; font-size: .84rem; color: var(--muted); }
.assess-flag { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 16%, transparent); font-weight: 600; }
.heatmap-small .heat-cell { min-width: 64px; padding: 8px 4px; height: 36px; }
.heat-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; font-size: .78rem; margin: 0 2px;
  background: #fff; color: #000; border: 2px solid #000; }
.heat-mark-R { background: #000; color: #fff; }
.heat-legend { font-size: .8rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) { .assess-layout { grid-template-columns: 1fr; } .assess-preview { position: static; } }

/* The risk register's R3: an action's RAG, and the acceptance. */
.rag-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1px solid var(--border); }
.rag-dot-green { background: var(--ok); }
.rag-dot-amber { background: var(--warn); }
.rag-dot-red { background: var(--danger); }
.rag-dot-grey { background: var(--muted); }
.acceptance { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }

/* The My Work dashboard and the Work report (WR-01 to WR-05): the filters in one row, compact tiles, hours against the working calendar, the
   priorities, and charts of one measure each: status as one stacked bar with a legend, hours by task as bars, hours by day as columns with the
   day's target as a line. Every mark names its figure on hover and focus; the tables hold the same figures. */
.wr-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 16px; }
.wr-filter { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--muted); }
.wr-filter select, .wr-filter input { min-width: 0; }
.wr-step { font-size: 1.1rem; line-height: 1; padding-inline: 10px; }
.wr-tiles .today-tile { padding: 12px 14px; }
.wr-tiles .today-figure { font-size: 1.5rem; }
.wr-sub { font-size: .8rem; font-weight: 500; }
.wr-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.wr-pair > .card { margin: 0; }
.wr-hours { border-left: 4px solid var(--accent); }
.wr-hours-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.wr-hours-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); text-align: center; }
.wr-hours-tile .meter { align-self: stretch; }
.wr-hours-figure { font-size: 1.8rem; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.wr-hours-figure.wr-average { color: var(--ok); }
.wr-hours-foot { align-self: stretch; display: flex; justify-content: space-between; gap: 8px; font-size: .76rem; color: var(--muted); }
.wr-priorities { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.wr-priority-tile { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 10px; }
.wr-priority-figures strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.wr-priority-figures small { color: var(--muted); }
.wr-priority-critical { border-left-color: var(--danger); }
.wr-priority-high { border-left-color: var(--warn); }
.wr-priority-medium { border-left-color: var(--accent); }
.wr-priority-low { border-left-color: var(--ok); }
span.wr-priority { padding-left: 8px; border-left: 3px solid var(--muted); }
span.wr-priority-critical { border-left-color: var(--danger); }
span.wr-priority-high { border-left-color: var(--warn); }
span.wr-priority-medium { border-left-color: var(--accent); }
span.wr-priority-low { border-left-color: var(--ok); }
.wr-chart h2 { margin-top: 0; }
.wr-stack { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; margin: 6px 0 12px; }
.wr-stack-part { min-width: 4px; }
.wr-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; font-size: .86rem; }
.wr-legend li { display: flex; align-items: center; gap: 6px; }
.wr-swatch { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.wr-status-not_started { background: var(--muted); }
.wr-status-in_progress { background: var(--accent); }
.wr-status-on_hold { background: var(--warn); }
.wr-status-in_review { background: var(--accent-2); }
.wr-status-completed { background: var(--ok); }
.wr-status-cancelled { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.wr-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wr-bars li { display: grid; grid-template-columns: minmax(120px, 42%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.wr-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-bar-track { height: 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.wr-bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.wr-bar-value { font-variant-numeric: tabular-nums; color: var(--muted); }
.wr-columns { display: grid; grid-template-columns: repeat(var(--days), minmax(2px, 1fr)); gap: 2px; align-items: end; height: 140px; padding-top: 6px;
  border-bottom: 1px solid var(--border); }
.wr-column { position: relative; height: 100%; display: flex; align-items: flex-end; }
.wr-column-bar { display: block; width: 100%; min-height: 1px; border-radius: 4px 4px 0 0; background: var(--accent); }
.wr-column-off .wr-column-bar { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.wr-column-target { position: absolute; left: 0; right: 0; border-top: 2px solid var(--text); opacity: .55; }
.wr-column:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wr-axis { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: 4px; }
@media print { .wr-pair { grid-template-columns: 1fr; } .wr-columns { break-inside: avoid; } }
/* Side by side on the dashboard, a table's cells wrap, so every column stays in view without scrolling. */
.wr-pair table td, .wr-pair table th { white-space: normal; overflow-wrap: anywhere; }
.wr-pair table td:first-child { min-width: 12em; }

/* The risk portfolio (the Risk plan's V1, V2): the heat map's counted cells, the process board and the action Gantt. */
.heat-count a { display: block; text-decoration: none; font-size: 1.05rem; }
.heat-selected { outline: 3px solid var(--text); outline-offset: -3px; }
body.framed { padding: 10px; background: transparent; }
body.framed .wr-pair { margin-bottom: 8px; }
.risk-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.risk-lane { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); min-height: 120px; }
.risk-lane h2 { margin: 0 0 4px; font-size: .9rem; display: flex; justify-content: space-between; gap: 6px; }
.risk-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 10px;
  background: var(--surface); text-decoration: none; color: inherit; }
.risk-card:hover, .risk-card:focus-visible { border-color: var(--accent); }
.risk-card-title { font-weight: 600; font-size: .9rem; }
.risk-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .78rem; color: var(--muted); }
.risk-card-next { font-size: .78rem; color: var(--muted); }
.risk-gantt { display: grid; grid-template-columns: minmax(200px, 30%) 1fr; gap: 6px 12px; align-items: center; font-size: .86rem; }
.risk-gantt-head { position: relative; height: 22px; border-bottom: 1px solid var(--border); font-size: .76rem; color: var(--muted); }
.risk-gantt-head span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.risk-gantt-track { position: relative; height: 24px; border-radius: 6px; background: var(--surface-2); }
.risk-gantt-bar { position: absolute; top: 3px; bottom: 3px; min-width: 4px; border-radius: 4px; background: var(--accent); color: #fff; font-size: .7rem; overflow: hidden;
  white-space: nowrap; padding: 0 4px; line-height: 18px; text-decoration: none; }
.risk-gantt-bar.is-done { background: var(--ok); }
.risk-gantt-bar.is-late { background: var(--danger); }
.risk-gantt-target { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: var(--warn); border: 1px solid var(--text); }
.risk-gantt-today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .5; }
.risk-gantt-risk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-gantt-action { padding-left: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.framed .project-tabs { display: none; }
/* The portfolio's heat maps share the width side by side: equal columns, no minimum, so the whole grid is in view. */
[data-risk-heat-map] .heatmap { width: 100%; table-layout: fixed; }
[data-risk-heat-map] .heat-cell { min-width: 0; padding: 12px 2px; }
[data-risk-heat-map] .heatmap th { font-size: .72rem; overflow: hidden; text-overflow: ellipsis; }
[data-risk-heat-map] .heatmap th[scope="row"] { width: 18%; }
/* The risk matrix (the Risk plan's V3): the Group's matrix layout, bands over vertical column heads, an x per rating, the scores coloured. */
.risk-matrix { border-collapse: collapse; font-size: .78rem; }
.risk-matrix th, .risk-matrix td { border: 1px solid var(--border); padding: 4px 6px; vertical-align: middle; }
.risk-matrix .rm-band { text-align: center; font-weight: 700; }
.risk-matrix .rm-impact, .risk-matrix .rm-chance { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.risk-matrix .rm-ce { background: color-mix(in srgb, var(--muted) 22%, transparent); }
.risk-matrix .rm-score { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.risk-matrix .rm-assurance { background: color-mix(in srgb, var(--sev-medium) 25%, transparent); }
.risk-matrix .rm-vertical th { height: 120px; white-space: nowrap; vertical-align: bottom; }
.risk-matrix .rm-vertical th span { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 600; }
.risk-matrix .rm-x { text-align: center; width: 22px; }
.risk-matrix .rm-def { min-width: 220px; }
.risk-matrix .rm-plans { min-width: 320px; }
.risk-matrix td.rm-score { font-weight: 700; text-align: center; }
@media print { .risk-matrix-card { padding: 0; border: none; box-shadow: none; } .risk-matrix { font-size: .62rem; } @page { size: A3 landscape; } }

/* My Work's quick add (the Work plan's W4): one line and Enter; chips for when and how urgent; add and start its timer at once. */
.quick-add { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin-bottom: 14px; }
.quick-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-add-row input { flex: 1 1 320px; font-size: 1.02rem; padding: 10px 14px; }
.quick-add-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick-add-gap { width: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .82rem; }
.chip input[type="radio"], .chip input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-date span { border: 0; background: none; padding: 0 2px; color: var(--muted); }
.chip-date input[type="date"] { padding: 3px 8px; font-size: .82rem; }
.chip-high input:checked + span { background: var(--warn); border-color: var(--warn); }
.chip-low input:checked + span { background: var(--ok); border-color: var(--ok); }
.span-tabs { margin-bottom: 10px; }

/* The Solution design page (Administration): the figures, the architecture, the models and how they work together, and the days. */
.sol-hero h1 { font-size: 2rem; }
.sol-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sol-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.sol-figure { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.sol-figure strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sol-figure span { font-weight: 700; }
.sol-figure small { color: var(--muted); }
.sol-arch-wrap { overflow-x: auto; }
.sol-arch { width: 100%; min-width: 760px; height: auto; display: block; }
.sol-box { stroke-width: 1.5; }
.sol-box-people { fill: var(--surface-2); stroke: var(--border); }
.sol-box-web { fill: color-mix(in srgb, var(--accent) 16%, var(--surface)); stroke: var(--accent); }
.sol-box-write { fill: color-mix(in srgb, var(--accent-2) 18%, var(--surface)); stroke: var(--accent-2); }
.sol-box-read { fill: color-mix(in srgb, var(--ok) 16%, var(--surface)); stroke: var(--ok); }
.sol-box-audit { fill: color-mix(in srgb, var(--warn) 18%, var(--surface)); stroke: var(--warn); }
.sol-box-side { fill: var(--surface-2); stroke: var(--border); }
.sol-box-text { fill: var(--text); font-size: 14px; text-anchor: middle; }
.sol-box-sub { fill: var(--muted); font-size: 11.5px; text-anchor: middle; }
.sol-strong { font-weight: 800; font-size: 15px; }
.sol-tier-label { fill: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sol-flow { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.sol-flow-write { stroke: var(--accent-2); }
.sol-flow-read { stroke: var(--ok); }
.sol-flow-label { fill: var(--muted); font-size: 11px; }
.sol-arrowhead { fill: var(--muted); }
.sol-legend { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; padding: 0; margin: 10px 0 0; color: var(--muted); }
.sol-legend li { display: flex; align-items: center; gap: 8px; }
.sol-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1.5px solid; }
.sol-swatch.sol-box-write { background: color-mix(in srgb, var(--accent-2) 18%, var(--surface)); border-color: var(--accent-2); }
.sol-swatch.sol-box-read { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); border-color: var(--ok); }
.sol-swatch.sol-box-audit { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); border-color: var(--warn); }
.sol-org { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "root root" "branches detail"; gap: 16px; }
.sol-root { grid-area: root; justify-self: center; padding: 10px 26px; border-radius: 999px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow); position: relative; }
.sol-branches { grid-area: branches; display: grid; gap: 18px; }
.sol-branch { border-left: 3px solid var(--border); padding-left: 14px; }
.sol-branch-title { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.sol-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sol-node { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: none; transition: transform .15s ease, opacity .15s ease, border-color .15s ease; }
.sol-node strong { font-size: 0.98rem; }
.sol-node span { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.sol-node-base { border-left: 4px solid var(--accent-2); }
.sol-node-module { border-left: 4px solid var(--accent); }
.sol-node:hover { transform: translateY(-2px); background: var(--surface-2); }
.sol-node.is-chosen { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.sol-node.is-related { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.sol-node.is-faded { opacity: 0.38; }
.sol-detail { grid-area: detail; position: sticky; top: 16px; align-self: start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.sol-detail h3 { margin: 4px 0 8px; }
.sol-detail h4 { margin: 14px 0 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sol-detail ul { padding-left: 18px; margin: 0; display: grid; gap: 6px; }
.sol-elements { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sol-element { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.sol-element h3 { margin: 0 0 6px; font-size: 1rem; }
.sol-element p { margin: 0; }
.sol-evidence { margin-top: 8px !important; font-size: 0.78rem; color: var(--muted); font-family: var(--font-mono); }
.sol-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.sol-day { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; }
.sol-day-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 1.05rem; }
.sol-highlights { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; }
.sol-changes { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.86rem; max-height: 360px; overflow: auto; }
@media (max-width: 900px) { .sol-org { grid-template-columns: 1fr; grid-template-areas: "root" "detail" "branches"; } .sol-detail { position: static; } }
/* The heat maps side by side show every probability: a cell of the pair is not held to the pair's first-column width. */
[data-risk-heat-map] .heatmap { min-width: 0; }
[data-risk-heat-map] .heatmap td:first-child { min-width: 0; }
[data-risk-heat-map] .heatmap th { overflow-wrap: normal; word-break: normal; white-space: normal; line-height: 1.25; }
[data-risk-heat-map] .heatmap thead th { overflow: visible; text-overflow: clip; font-size: .66rem; letter-spacing: 0; }
