/* Suhail design system. One file, no framework. RTL-first: use logical properties (inline-start/end).

   Suhail's own identity: white pages and true ink, one petrol colour that means "you can act here", headings in
   Kufi (the geometric Arabic of official Saudi lettering) and text in Readex Pro. Few boxes: lists are separated by
   space and hairlines; only things that float (search, menus, Suhail's box) get a shadow. Status is a coloured word.
   The raw scales below are the DGA Platforms Code (كود المنصات) palettes; an organization that wants the DGA look
   only has to remap the names in this block (accent -> --sa-600, font -> IBM Plex Sans Arabic). */
:root {
  --sa-25: #f7fdf9;  --sa-50: #f3fcf6;  --sa-100: #dff6e7; --sa-200: #b8eacb; --sa-300: #88d8ad;
  --sa-400: #54c08a; --sa-500: #25935f; --sa-600: #1b8354; --sa-700: #166a45; --sa-800: #14573a; --sa-900: #104631;
  --gold-50: #fffef2; --gold-100: #fffce6; --gold-200: #fcf3bd; --gold-300: #fae996; --gold-600: #dba102;
  --gold-700: #b87b02; --gold-900: #6e3c00;
  --lav-50: #f9f5fa; --lav-100: #f2e9f5; --lav-500: #80519f; --lav-600: #6d428f;
  --n-25: #fcfcfd; --n-50: #f9fafb; --n-100: #f3f4f6; --n-200: #e5e7eb; --n-300: #d2d6db; --n-400: #9da4ae;
  --n-500: #6c727e; --n-600: #4d5761; --n-700: #384250; --n-800: #1f2a37; --n-900: #111927; --black: #161616;
  --green-50: #ecfdf3; --green-100: #dcfae6; --green-600: #069454; --green-700: #067647; --green-800: #085d3a;
  --yellow-50: #fffaeb; --yellow-200: #fedf89; --yellow-500: #f79009; --yellow-600: #dc6803; --yellow-700: #b54707;
  --orange-200: #f9dbaf; --orange-800: #932f19;
  --red-50: #fef3f2; --red-100: #fee4e2; --red-200: #fecdca; --red-700: #b42318;
  --blue-50: #eff8ff; --blue-700: #175cd3;

  --petrol-50: #e9f3f4; --petrol-100: #cfe6e8; --petrol-300: #7cc3c9; --petrol-600: #00666e; --petrol-700: #00535a;
  --g-0: #ffffff; --g-25: #fafafa; --g-50: #f7f7f7; --g-100: #f0f0f0; --g-200: #e2e2e2; --g-300: #cccccc;
  --g-500: #5c5c5c; --g-700: #2e2e2e; --g-900: #111111;

  --paper: var(--g-0);
  --surface: var(--g-0);
  --tint: var(--g-25);
  --rail-bg: var(--g-0);
  --sunk: var(--g-50);
  --ink: var(--g-900);
  --ink-2: var(--g-700);
  --ink-3: var(--g-500);
  --line: var(--g-200);
  --line-strong: var(--g-300);
  --on-color: #ffffff;
  --shade: 16, 24, 40;

  --accent: var(--petrol-600);
  --accent-hover: var(--petrol-700);
  --accent-soft: var(--petrol-50);
  --accent-ink: var(--petrol-600);   /* accent used as text: links, active labels */
  --on-status: #ffffff;          /* text on a solid status colour */
  --tint-low: var(--green-100);   --tint-low-ink: var(--green-800);
  --tint-medium: var(--gold-200); --tint-medium-ink: var(--gold-900);
  --tint-high: var(--orange-200); --tint-high-ink: var(--orange-800);
  --tint-critical: var(--red-200);
  --topbar-bg: rgba(255, 255, 255, .92);
  --brand-2: var(--gold-600);

  --ok: var(--green-700);    --ok-bg: var(--green-50);
  --warn: var(--yellow-700); --warn-bg: var(--yellow-50);
  --bad: var(--red-700);     --bad-bg: var(--red-50);
  --info: var(--blue-700);   --info-bg: var(--blue-50);
  --idle: var(--n-600);      --idle-bg: var(--n-100);
  --done: var(--lav-600);    --done-bg: var(--lav-50);

  --lv-low: var(--green-700);
  --lv-medium: var(--gold-600);
  --lv-high: var(--yellow-700);
  --lv-critical: var(--red-700);

  --radius: 6px;          /* controls: buttons, fields */
  --radius-lg: 10px;      /* panels, menus */
  --radius-pill: 999px;   /* floating search and Suhail's box */
  --elev: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .05);    /* the one shadow: things that float */
  --elev-hi: 0 2px 4px rgba(0, 0, 0, .08), 0 10px 28px rgba(0, 0, 0, .12);
  --font: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  --font-head: "Noto Kufi Arabic", "Readex Pro", "Segoe UI", sans-serif;
  --fs-sm: 13px;
  --fs: 15px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --fs-2xl: 30px;
  --rail: 76px;
  --ctx: 236px;
  --topbar: 64px;
}

/* Dark mode: DGA Platforms Code dark theme (body neutral-900, cards neutral-800, borders neutral-500/700).
   Text colours on dark use the lighter steps of each DGA scale so they pass WCAG AA. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {   color-scheme: dark;
  --paper: #181818; --surface: #202020; --tint: #1c1c1c; --rail-bg: #181818; --sunk: #2a2a2a;
  --ink: #f2f2f2; --ink-2: #d4d4d4; --ink-3: #a3a3a3;
  --line: #333333; --line-strong: #474747;
  --shade: 0, 0, 0; --topbar-bg: rgba(24, 24, 24, .92);
  --elev: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .35); --elev-hi: 0 10px 30px rgba(0, 0, 0, .55);
  --accent: #0b7c85; --accent-hover: var(--petrol-600); --accent-soft: rgba(124, 195, 201, .14); --accent-ink: var(--petrol-300);
  --brand-2: #f7d54d;
  --ok: #47cd89;   --ok-bg: rgba(6, 148, 84, .16);
  --warn: #fdb022; --warn-bg: rgba(254, 200, 75, .12);
  --bad: #f97066;  --bad-bg: rgba(217, 44, 32, .18);
  --info: #53b0fd; --info-bg: rgba(21, 111, 238, .18);
  --idle: var(--n-400); --idle-bg: #2b3543;
  --done: #ccadd9; --done-bg: rgba(128, 81, 159, .22);
  --on-status: var(--n-900);
  --lv-low: #47cd89; --lv-medium: #f7d54d; --lv-high: #fdb022; --lv-critical: #f97066;
  --tint-low: rgba(6, 148, 84, .28);   --tint-low-ink: #75e0a7;
  --tint-medium: rgba(219, 161, 2, .26); --tint-medium-ink: #fae996;
  --tint-high: rgba(239, 104, 32, .3);  --tint-high-ink: #f7b27a;
  --tint-critical: rgba(217, 44, 32, .38); } }
:root[data-theme="dark"] {   color-scheme: dark;
  --paper: #181818; --surface: #202020; --tint: #1c1c1c; --rail-bg: #181818; --sunk: #2a2a2a;
  --ink: #f2f2f2; --ink-2: #d4d4d4; --ink-3: #a3a3a3;
  --line: #333333; --line-strong: #474747;
  --shade: 0, 0, 0; --topbar-bg: rgba(24, 24, 24, .92);
  --elev: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .35); --elev-hi: 0 10px 30px rgba(0, 0, 0, .55);
  --accent: #0b7c85; --accent-hover: var(--petrol-600); --accent-soft: rgba(124, 195, 201, .14); --accent-ink: var(--petrol-300);
  --brand-2: #f7d54d;
  --ok: #47cd89;   --ok-bg: rgba(6, 148, 84, .16);
  --warn: #fdb022; --warn-bg: rgba(254, 200, 75, .12);
  --bad: #f97066;  --bad-bg: rgba(217, 44, 32, .18);
  --info: #53b0fd; --info-bg: rgba(21, 111, 238, .18);
  --idle: var(--n-400); --idle-bg: #2b3543;
  --done: #ccadd9; --done-bg: rgba(128, 81, 159, .22);
  --on-status: var(--n-900);
  --lv-low: #47cd89; --lv-medium: #f7d54d; --lv-high: #fdb022; --lv-critical: #f97066;
  --tint-low: rgba(6, 148, 84, .28);   --tint-low-ink: #75e0a7;
  --tint-medium: rgba(219, 161, 2, .26); --tint-medium-ink: #fae996;
  --tint-high: rgba(239, 104, 32, .3);  --tint-high-ink: #f7b27a;
  --tint-critical: rgba(217, 44, 32, .38); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs)/1.65 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; }
h1, h2, .page-head h1 { font-family: var(--font-head); font-weight: 700; letter-spacing: 0; }
h2 { font-weight: 600; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs); }
p { margin: 0 0 .5em; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* "No value": a quiet dash on screen; the hidden words say «غير محدد» to screen readers. */
.nil { color: var(--ink-3); }
/* Anything you can press shows the hand; anything switched off says so. */
button, summary, select, label[for], [role="button"], [role="tab"], input[type="checkbox"], input[type="radio"], input[type="file"] { cursor: pointer; }
:is(button, select, input, textarea):disabled, [aria-disabled="true"] { cursor: not-allowed; }

/* ---------- Shared bits that used to live in the sidebar ---------- */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 13px;
}
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-3); cursor: pointer; }
.linkish:hover { color: var(--bad); }

/* ---------- Page head ---------- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel-head .muted, .panel-head a { font-size: var(--fs-sm); white-space: nowrap; }
.panel-body { padding: 16px 18px; }
.panel-empty { padding: 22px 18px; color: var(--ink-3); }

.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }

/* Summary line: plain numbers in a row, not big tiles */
.tally { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: -6px 0 22px; color: var(--ink-2); }
.tally > span { display: inline-flex; align-items: baseline; gap: 6px; }
.tally b { font-size: var(--fs-lg); font-weight: 600; color: var(--ink); }
.tally a { color: inherit; }
.tally .is-bad b { color: var(--bad); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: start; font-weight: 500; font-size: var(--fs-sm); color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--tint); }
.table .title { font-weight: 500; color: var(--ink); }
.table .title:hover { color: var(--accent-ink); }
.table .meta { display: block; font-size: var(--fs-sm); color: var(--ink-3); margin-top: 2px; }
.table td.end, .table th.end { text-align: end; }
.scroll-x { overflow-x: auto; }

/* ---------- Status pills: always a word, colour is secondary ---------- */
.st {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border-radius: 0; background: none !important; box-shadow: none !important;
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.st-on_track, .st-approved, .st-ok { color: var(--ok); background: var(--ok-bg); }
.st-late, .st-submitted, .st-watching, .st-in_progress { color: var(--warn); background: var(--warn-bg); }
.st-very_late, .st-rejected, .st-occurred, .st-overdue { color: var(--bad); background: var(--bad-bg); }
.st-no_reading, .st-returned { color: var(--bad); background: transparent; box-shadow: inset 0 0 0 1px var(--bad-bg); }
.st-not_started, .st-draft, .st-closed, .st-paused, .st-open-plain { color: var(--idle); background: var(--idle-bg); }
.st-complete, .st-done { color: var(--done); background: var(--done-bg); }
.st-open { color: var(--ink-2); background: var(--sunk); }

.st-issue-open { color: var(--ink-2); background: var(--sunk); }
.st-issue-in_progress { color: var(--warn); background: var(--warn-bg); }
.st-issue-escalated { color: var(--bad); background: var(--bad-bg); }
.st-issue-resolved { color: var(--ok); background: var(--ok-bg); }
.st-issue-closed { color: var(--idle); background: var(--idle-bg); }

/* Issue priority: weight and colour grow with urgency */
.prio { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.prio-normal { color: var(--ink-3); font-weight: 500; }
.prio-urgent { color: var(--warn); }
.prio-critical { color: var(--on-status); background: var(--bad); padding: 1px 8px; border-radius: 4px; }

/* Risk level chip: score + word */
.lv { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.lv i { font-style: normal; display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 4px; color: var(--on-status); font-weight: 600; }
.lv-low i { background: var(--lv-low); }
.lv-medium i { background: var(--lv-medium); color: var(--black); }
.lv-high i { background: var(--lv-high); }
.lv-critical i { background: var(--lv-critical); }

/* ---------- Heat map ---------- */
.heat { display: grid; grid-template-columns: 22px repeat(5, 1fr); gap: 4px; }
.heat .axis { font-size: 11px; color: var(--ink-3); display: grid; place-items: center; }
.heat .cell {
  aspect-ratio: 1.35; border-radius: 4px; display: grid; place-items: center;
  font-weight: 600; color: var(--ink); text-decoration: none; position: relative;
}
.heat .cell.lv-low { background: var(--tint-low); }
.heat .cell.lv-medium { background: var(--tint-medium); }
.heat .cell.lv-high { background: var(--tint-high); }
.heat .cell.lv-critical { background: var(--tint-critical); }
.heat .cell.has { box-shadow: inset 0 0 0 2px rgba(var(--shade), .55); }
.heat .cell.empty { color: transparent; }
.heat .cell.is-on { outline: 2px solid var(--accent); outline-offset: 1px; }
.heat a.cell:hover { text-decoration: none; filter: brightness(.96); }
.heat-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 6px; }

.levels { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.levels a { display: flex; justify-content: space-between; color: var(--ink-2); padding: 4px 0; }
.levels a[aria-current="true"] { color: var(--accent-ink); font-weight: 600; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.filters input[type="search"] { width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg a { padding: 5px 12px; color: var(--ink-2); font-size: var(--fs-sm); border-inline-start: 1px solid var(--line); }
.seg a:first-child { border-inline-start: 0; }
.seg a:hover { background: var(--sunk); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Forms ---------- */
input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 7px 10px; min-height: 38px; width: 100%;
}
textarea { min-height: auto; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; padding: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.filters input, .filters select { width: auto; min-height: 34px; padding: 5px 10px; font-size: var(--fs-sm); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--ink-3); }
.field .err, .form-error { color: var(--bad); font-size: var(--fs-sm); }
.form-error { background: var(--bad-bg); padding: 10px 12px; border-radius: var(--radius); margin-bottom: 14px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.fieldset-title { grid-column: 1 / -1; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; }
.form-foot { display: flex; gap: 8px; margin-top: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius);
  font: 500 var(--fs-sm)/1 var(--font); cursor: pointer;
  border: 1px solid var(--ink); background: var(--surface); color: var(--ink);
}
.btn:hover { background: var(--sunk); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-color); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-bad { color: var(--bad); border-color: var(--red-200); }
.btn-bad:hover { background: var(--bad-bg); }
.btn-sm { min-height: 30px; padding: 4px 10px; }

/* ---------- Rich text editor ---------- */
.rte { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.rte.is-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rte.is-invalid { border-color: var(--bad); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); background: var(--tint); border-radius: var(--radius) var(--radius) 0 0; }
.rte-btn {
  display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0;
  border: 0; border-radius: 4px; background: transparent; color: var(--ink-2);
  font: 600 14px/1 var(--font); cursor: pointer;
}
.rte-btn:hover { background: var(--sunk); color: var(--ink); }
.rte-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.rte-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.rte-btn svg circle, .rte-btn svg text { fill: currentColor; stroke: none; font-family: var(--font); }
.rte-sep { width: 1px; margin: 4px 4px; background: var(--line); }
.rte-area { padding: 8px 12px; outline: none; line-height: 1.7; overflow-wrap: anywhere; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--ink-3); pointer-events: none; }

/* Shared look for editor content and saved rich text */
.rte-area p, .rich p { margin: 0 0 .5em; }
.rte-area > :last-child, .rich > :last-child { margin-bottom: 0; }
.rte-area ul, .rte-area ol, .rich ul, .rich ol { margin: 0 0 .5em; padding-inline-start: 1.4em; }
.rte-area li, .rich li { margin: .15em 0; }
.rte-area blockquote, .rich blockquote {
  margin: 0 0 .5em; padding: 4px 12px; border-inline-start: 3px solid var(--line-strong); color: var(--ink-2); background: var(--sunk);
}
.rte-area a, .rich a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.rich { color: var(--ink-2); overflow-wrap: anywhere; }
.facts dd .rich { font-weight: 400; color: inherit; }
.facts dd { color: var(--ink); }

/* ---------- Messages ---------- */
.flash { list-style: none; margin: 0 0 18px; padding: 0; }
.flash li { padding: 10px 14px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.flash li.error { background: var(--bad-bg); color: var(--bad); }

/* ---------- Lists inside panels ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .title { font-weight: 500; color: var(--ink); }
.rows .meta { font-size: var(--fs-sm); color: var(--ink-3); }
.due { font-size: var(--fs-sm); white-space: nowrap; color: var(--ink-2); }
.due.is-late { color: var(--bad); font-weight: 600; }

/* ---------- Definition grid ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 22px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: var(--fs-sm); color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 500; }

/* ---------- Timeline (risk log, approval trail) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; padding: 0 22px 18px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; padding-inline-start: 20px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; inset-inline-start: -7px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong);
}
.timeline .when { font-size: var(--fs-sm); color: var(--ink-3); }
.timeline .text { margin-top: 4px; }
.delta-up { color: var(--bad); }
.delta-down { color: var(--ok); }

/* ---------- KPI pieces ---------- */
.meter { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; min-width: 80px; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter.st-late span { background: var(--warn); }
.meter.st-very_late span { background: var(--bad); }
.perf { display: flex; align-items: center; gap: 10px; }
.perf .num { min-width: 52px; font-weight: 600; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; background: var(--sunk); border-bottom: 1px solid var(--line); }
.group-head h3 { font-size: var(--fs); }
.objective-row td { background: var(--tint); font-weight: 500; }
.explain { background: var(--sunk); border-radius: var(--radius); padding: 12px 14px; font-size: var(--fs-sm); line-height: 1.9; }
.explain code { font-family: inherit; font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.big-number { font-size: 34px; font-weight: 600; line-height: 1.1; }

/* ---------- Project shell ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -6px 0 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 9px 14px; color: var(--ink-2); font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; color: var(--ink-3); margin-inline-start: 4px; }

/* Actual (fill) against planned (tick) on one track */
.pva { position: relative; height: 8px; background: var(--sunk); border-radius: 4px; min-width: 90px; }
.pva .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; background: var(--accent); }
.pva .plan { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.pva.st-late .fill { background: var(--warn); }
.pva.st-very_late .fill { background: var(--bad); }
.pva.st-complete .fill, .pva.st-closed .fill { background: var(--done); }
.pva-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.pva-legend i { display: inline-block; width: 10px; height: 8px; border-radius: 2px; background: var(--accent); margin-inline-end: 4px; vertical-align: middle; }
.pva-legend i.tick { width: 2px; height: 12px; background: var(--ink); }

/* Timeline strip: project start at the reading start (right in Arabic, left in English) */
.tl { position: relative; height: 54px; margin: 8px 6px 4px; }
.tl .bar { position: absolute; top: 24px; inset-inline: 0; height: 6px; background: var(--sunk); border-radius: 3px; }
.tl .elapsed { position: absolute; top: 24px; inset-inline-start: 0; height: 6px; background: var(--line-strong); border-radius: 3px; }
.tl .today { position: absolute; top: 8px; bottom: 6px; width: 2px; background: var(--accent); }
.tl .today::after { content: attr(data-label); position: absolute; top: -8px; inset-inline-start: 4px; font-size: 11px; color: var(--accent-ink); white-space: nowrap; }
.tl .ms {
  position: absolute; top: 20px; width: 14px; height: 14px; margin-inline-start: -7px;
  transform: rotate(45deg); background: var(--surface); border: 2px solid var(--ink-3);
}
.tl .ms.done { background: var(--ok); border-color: var(--ok); }
.tl .ms.late { border-color: var(--bad); }
.tl .ms.pending { border-color: var(--warn); background: var(--warn-bg); }
.tl-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }

.mini-tl { position: relative; height: 14px; }
.mini-tl .bar { position: absolute; top: 6px; inset-inline: 0; height: 3px; background: var(--sunk); }
.mini-tl .ms { position: absolute; top: 3px; width: 8px; height: 8px; margin-inline-start: -4px; transform: rotate(45deg); background: var(--surface); border: 1.5px solid var(--ink-3); }
.mini-tl .ms.done { background: var(--ok); border-color: var(--ok); }
.mini-tl .ms.late { border-color: var(--bad); }
.mini-tl .today { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--accent); }

.ms-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 140px 170px 130px; gap: 14px; align-items: center; padding: 12px 18px; }
.health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.health > div { padding: 16px 18px; border-inline-start: 1px solid var(--line); }
.health > div:first-child { border-inline-start: 0; }
.health dt { font-size: var(--fs-sm); color: var(--ink-3); }
.health dd { margin: 4px 0 0; font-size: var(--fs-lg); font-weight: 600; }
.health dd small { font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); }

.inline-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 18px; background: var(--tint); border-top: 1px solid var(--line); }
.inline-forms form { display: grid; gap: 8px; align-content: start; }
.inline-forms h3 { font-size: var(--fs-sm); color: var(--ink-2); }
details.more > summary { cursor: pointer; list-style: none; color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 500; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 10px; }
.radio-row ul, .check-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.radio-row input, .check-list input { width: auto; min-height: 0; margin-inline-end: 6px; }
.check-list ul { flex-direction: column; gap: 6px; max-height: 180px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.health-green { color: var(--ok); } .health-amber { color: var(--warn); } .health-red { color: var(--bad); }
.callout { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: var(--fs-sm); margin-bottom: 16px; }

/* ---------- Reports ---------- */
.statusbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--sunk); gap: 2px; }
.statusbar span { display: block; height: 100%; }
.statusbar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.statusbar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px; }
.statusbar-legend b { font-weight: 600; color: var(--ink); margin-inline-start: 2px; }
.sb-on_track { background: var(--ok); }
.sb-late { background: var(--gold-600); }
.sb-very_late { background: var(--bad); }
.sb-no_reading { background: var(--red-200); }
.sb-not_started { background: var(--n-300); }
.sb-complete { background: var(--done); }
.sb-paused { background: var(--n-400); }
.sb-closed { background: var(--n-200); }
.kind-tag { flex: none; min-width: 52px; text-align: center; font-size: 12px; color: var(--ink-2); background: var(--sunk); border-radius: 4px; padding: 2px 6px; }
.st-lv-low { color: var(--tint-low-ink); background: var(--tint-low); }
.st-lv-medium { color: var(--tint-medium-ink); background: var(--tint-medium); }
.st-lv-high { color: var(--tint-high-ink); background: var(--tint-high); }
.st-lv-critical { color: var(--on-status); background: var(--lv-critical); }
.report-table td, .report-table th { padding: 9px 12px; white-space: nowrap; }
.report-table td.wrap { white-space: normal; min-width: 240px; }
.print-only { display: none; }

/* ---------- Account, notifications, administration ---------- */

.notes { margin-bottom: 16px; }
.notes .rows > li { align-items: flex-start; }
.notes .rows > li.is-unread { background: var(--accent-soft); }
.notes .rows > li.is-unread .title { font-weight: 600; }
.note-body { color: var(--ink-2); margin: 2px 0; overflow-wrap: anywhere; }
.note-kind { flex: none; min-width: 74px; text-align: center; font-size: 12px; color: var(--ink-2); background: var(--sunk); border-radius: 4px; padding: 2px 6px; margin-top: 2px; }
.note-approval { color: var(--accent-ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
.note-decision { color: var(--done); background: var(--done-bg); }
.note-reminder, .note-issue { color: var(--warn); background: var(--warn-bg); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 9px; }

.role { font-size: var(--fs-sm); color: var(--ink-2); }
.role-admin, .role-pmo { color: var(--accent-ink); font-weight: 500; }
.table tr.is-off td { color: var(--ink-3); }
.table tr.is-off .title { color: var(--ink-3); text-decoration: line-through; }
.tree-indent { display: inline-block; width: calc(var(--depth, 0) * 22px); }
.tree-indent[style*="--depth:0"] { display: none; }

.callout { border-inline-start: 3px solid var(--warn); margin-bottom: 16px; max-width: 820px; }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; min-width: 0; font-size: var(--fs-sm); background: var(--sunk); }
.field .label { font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); }
.field label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: var(--fs); }
.choice.choice-4 { grid-template-columns: repeat(2, 1fr); }
.choice-4 label span { line-height: 1.5; }
[dir="rtl"] input[dir="ltr"] { text-align: right; }
[dir="ltr"] .flow li + li::before { content: "→"; transform: translate(-50%, -50%); }
.flow { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.flow li { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.flow li + li::before { content: "←"; position: absolute; inset-inline-start: -12px; top: 50%; transform: translate(50%, -50%); color: var(--ink-3); font-size: 12px; }
.flow li + li { margin-inline-start: 12px; }
.flow li span { font-size: 12px; color: var(--ink-3); }
.flow .flow-end { background: var(--sunk); border-style: dashed; color: var(--ink-2); font-size: var(--fs-sm); }
.steps-edit { list-style: none; margin: 0; padding: 0; }
.step-row { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.step-row:last-child { border-bottom: 0; }
.step-row.is-new { background: var(--sunk); }
.step-move { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.step-no { font-weight: 600; font-size: var(--fs-lg); color: var(--accent-ink); min-height: 28px; }
.step-fields { flex: 1; display: grid; grid-template-columns: 2fr 1.4fr 1.4fr .7fr; gap: 10px 14px; align-items: start; }
.step-flags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.step-flags label.check { font-size: var(--fs-sm); font-weight: 400; }
.step-user[hidden] { display: block; visibility: hidden; }
/* Project: team, deliverables, documents, closure */
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; }
.sh-cell { padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 80px; }
.sh-cell:nth-child(odd) { border-inline-end: 1px solid var(--line); }
.sh-cell h3 { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 500; margin-bottom: 6px; }
.sh-manage h3 { color: var(--bad); }
.sh-satisfy h3 { color: var(--warn); }
.sh-item { padding: 4px 0; }
.sh-item form { display: inline; }
.deliv { display: block !important; }
.deliv-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.criteria { margin: 8px 0; padding: 8px 12px; background: var(--sunk); border-radius: var(--radius); font-size: var(--fs-sm); }
.criteria b, .lesson-body b { display: block; color: var(--ink-3); font-weight: 500; }
.review { border-inline-start: 2px solid var(--line-strong); padding-inline-start: 10px; margin: 6px 0; }
.deliv-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; }
.decide { margin-top: 10px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius); display: grid; gap: 8px; }
.st-dl-planned { color: var(--idle); background: var(--idle-bg); }
.st-dl-in_progress, .st-dl-submitted { color: var(--warn); background: var(--warn-bg); }
.st-dl-accepted { color: var(--ok); background: var(--ok-bg); }
.st-dl-rejected { color: var(--bad); background: var(--bad-bg); }
.file-ext { flex: none; width: 44px; text-align: center; font-size: 11px; font-weight: 600; color: var(--done); background: var(--done-bg); border-radius: 4px; padding: 6px 0; direction: ltr; }
.lesson { flex: none; font-size: 12px; border-radius: 4px; padding: 2px 8px; }
.lesson-worked { color: var(--ok); background: var(--ok-bg); }
.lesson-improve { color: var(--warn); background: var(--warn-bg); }
.lesson-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; font-size: var(--fs-sm); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: grid; grid-template-columns: 20px auto 1fr; gap: 8px; align-items: baseline; }
.checklist li.ok > span:first-child { color: var(--ok); font-weight: 600; }
.checklist li.no > span:first-child { color: var(--warn); font-weight: 600; }
.checklist li > span:last-child { text-align: end; }
.callout-inline { padding: 8px 12px; background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); }
.closure-past { border-top: 1px solid var(--line); }
.file-pick { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; min-width: 0; }
.file-pick:hover { border-color: var(--accent); }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Language */
.foot-links { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lang-switch { display: inline; }
.lang-switch .linkish:hover { color: var(--accent-ink); }
.login-lang { text-align: center; margin-top: 14px; font-size: var(--fs-sm); }
[dir="ltr"] .num { unicode-bidi: normal; }

/* Plan, costs, exports */
.plan-badge { font-size: 12px; padding: 1px 8px; border-radius: 4px; background: var(--sunk); color: var(--ink-2); }
a.plan-badge:hover { text-decoration: none; }
.plan-approved { background: var(--ok-bg); color: var(--ok); }
.plan-submitted { background: var(--warn-bg); color: var(--warn); }
.slip { display: block; font-size: 11px; color: var(--ink-3); }
.slip.is-late { color: var(--bad); }
.charter { display: grid; gap: 14px; }
.charter h3 { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 500; margin-bottom: 4px; }
.checklist li.soft > span:first-child { color: var(--ink-3); font-weight: 600; }
.checklist-stacked li { grid-template-columns: 20px 1fr; row-gap: 0; }
.checklist-stacked li > span:last-child { grid-column: 2; text-align: start; }
.cost-cats { font-size: var(--fs-sm); }
.curve { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.curve li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.curve li.is-future { opacity: .55; }
.curve .bars { position: relative; display: grid; gap: 2px; }
.curve .bars i { display: block; height: 7px; border-radius: 2px; min-width: 1px; }
.bar-plan, .key-plan { background: var(--line-strong); }
.bar-paid, .key-paid { background: var(--accent); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 8px 0 4px; vertical-align: middle; }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; cursor: pointer; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 15; list-style: none; margin: 0; padding: 6px 0; min-width: 270px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(var(--shade), .12); }
.export-menu li a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 14px; color: var(--ink); font-size: var(--fs-sm); }
.export-menu li a:hover { background: var(--accent-soft); text-decoration: none; }
.export-menu li a span { color: var(--ink-3); font-size: 11px; direction: ltr; }
.export-menu li.sep { border-top: 1px solid var(--line); margin: 4px 0; }

/* Search */
.quick-search { position: relative; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--elev); }
.quick-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--elev-hi); }
.quick-search svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.quick-search input { border: 0; box-shadow: none; padding: 7px 0; min-height: 34px; background: transparent; font-size: var(--fs-sm); }
.quick-search input:focus { outline: none; box-shadow: none; }
.quick-search input::-webkit-search-cancel-button { display: none; }
.quick-search kbd { font: 11px var(--font); color: var(--ink-3); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
.suggest { position: absolute; top: calc(100% + 4px); inset-inline-start: 0; width: 360px; max-width: 80vw; z-index: 20; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(var(--shade), .12); padding: 6px 0; }
.suggest a { display: block; padding: 6px 12px; color: var(--ink); }
.suggest a:hover, .suggest a.is-active { background: var(--accent-soft); text-decoration: none; }
.suggest a b { display: block; font-weight: 500; font-size: var(--fs-sm); }
.suggest a span { display: block; font-size: 12px; color: var(--ink-3); }
.suggest-group { display: block; padding: 8px 12px 2px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.suggest-all { border-top: 1px solid var(--line); margin-top: 4px; color: var(--accent-ink) !important; font-size: var(--fs-sm); }
.suggest-empty { padding: 8px 12px; margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
.search-page { display: flex; gap: 8px; padding: 12px; margin-bottom: 18px; max-width: 720px; }
.search-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }

/* Import */
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.import-form { display: flex; gap: 8px; align-items: center; }
.import-form .file-pick { flex: 1; padding: 6px 8px; }
.col-req { font-weight: 600; }
.import-confirm { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.import-table td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.import-table tr.is-err td { background: var(--bad-bg); }
.import-table tr.is-err td:nth-child(2) { white-space: normal; min-width: 240px; }
.row-errors { margin: 0; padding-inline-start: 16px; color: var(--bad); font-size: var(--fs-sm); }

/* Audit trail */
.audit { list-style: none; margin: 0; padding: 0; }
.audit > li { padding: 10px 18px; border-bottom: 1px solid var(--line); }
.audit > li:last-child { border-bottom: 0; }
.audit-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.audit-head .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.audit-act { flex: none; font-size: 12px; border-radius: 4px; padding: 1px 8px; background: var(--sunk); color: var(--ink-2); }
.audit-create .audit-act { background: var(--ok-bg); color: var(--ok); }
.audit-delete .audit-act { background: var(--bad-bg); color: var(--bad); }
.audit-diff { margin: 6px 0 0; border-collapse: collapse; font-size: var(--fs-sm); }
.audit-diff td.old, .audit-diff td.new { max-width: 360px; }
.audit-diff th { font-weight: 500; color: var(--ink-3); text-align: start; padding: 2px 0 2px 12px; width: 1%; white-space: nowrap; vertical-align: top; }
.audit-diff td { padding: 2px 6px; vertical-align: top; overflow-wrap: anywhere; }
.audit-diff .old { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.audit-diff td[aria-hidden] { color: var(--ink-3); width: 1%; }
.audit-compact > li { padding: 8px 18px; }
.audit-compact .audit-diff th { white-space: normal; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px; border-top: 1px solid var(--line); }
.error-page { max-width: 560px; }
.error-page h1 { font-size: var(--fs-lg); margin-bottom: 8px; }
.error-page p { color: var(--ink-2); margin-bottom: 18px; }

/* ---------- Strategy ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 2px; margin: -8px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 4px 10px; border-radius: var(--radius); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; }
.subnav a:hover { background: var(--sunk); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.plan-card + .plan-card { margin-top: 14px; }
.plan-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.plan-card-head h2 a { color: var(--ink); }
.plan-card-head p { margin: 2px 0 0; }
.plan-card-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; padding: 14px 18px 16px; align-items: center; }
.state-pair { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.perf-line .pva { height: 10px; }
.perf-nums { display: flex; gap: 26px; margin: 10px 0 0; }
.perf-nums dt { font-size: 12px; color: var(--ink-3); }
.perf-nums dd { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.counts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px 14px; }
.counts li { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-3); }
.counts b { font-size: var(--fs-lg); font-weight: 600; color: var(--ink); }
.swatch { flex: none; width: 10px; height: 10px; border-radius: 2px; margin-top: 7px; }
.rows.numbered > li > .num { min-width: 18px; }
.so { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.so:last-child { border-bottom: 0; }
.so-sub { padding-inline-start: 44px; background: var(--tint); }
.so-head { display: flex; gap: 18px; align-items: flex-start; }
.so-head h3 { margin: 2px 0 4px; }
.so-head p { margin: 0 0 2px; }
.so-score { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.so-links { list-style: none; margin: 8px 0 0; padding: 8px 12px; background: var(--sunk); border-radius: var(--radius); font-size: var(--fs-sm); display: grid; gap: 2px; }
.so-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 8px; }
.so-actions form { display: inline; }
.inline-update { display: grid; grid-template-columns: 110px 1fr; gap: 8px; margin-top: 8px; }
.inline-update .rte, .inline-update textarea, .inline-update button { grid-column: 1 / -1; }
.inline-update button { justify-self: start; }
.st-in_progress::before, .st-cancelled::before { background: currentColor; }
.st-cancelled { color: var(--idle); background: var(--idle-bg); }

/* Strategy map: perspectives as bands, objectives as cards coloured by pillar, bordered by status */
.map { display: grid; gap: 10px; }
.map-band { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.map-identity > div { background: var(--accent-soft); color: var(--ink); border-inline-start: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; font-size: var(--fs-sm); line-height: 1.7; }
.map-label { display: block; font-size: 11px; font-weight: 600; opacity: .75; margin-bottom: 2px; }
.map-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; }
.map-persp { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 12px; background: var(--sunk); border-radius: var(--radius); }
.map-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.map-obj { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 8px 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-inline-start: 5px solid var(--pillar, var(--line-strong)); border-radius: var(--radius); min-height: 92px; }
.map-obj:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(var(--shade), .1); }
.map-name { font-weight: 500; font-size: var(--fs-sm); line-height: 1.5; flex: 1; }
.map-foot { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.st-border-on_track { border-color: var(--ok); } .st-border-late { border-color: var(--warn); } .st-border-very_late { border-color: var(--bad); }
.st-border-complete { border-color: var(--done); }
.map-obj[class*="st-border"] { border-inline-start-color: var(--pillar, var(--line-strong)); }
.st-border-on_track .map-foot { color: var(--ok); } .st-border-late .map-foot { color: var(--warn); } .st-border-very_late .map-foot { color: var(--bad); }
.map-empty { align-self: center; padding: 8px; }
.map-pillars > div { padding: 8px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--pillar, var(--accent)); font-size: var(--fs-sm); }
.map-values { grid-auto-flow: row; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; background: var(--sunk); border-radius: var(--radius); font-size: var(--fs-sm); }
.map-values .map-label { display: inline; margin: 0 4px 0 0; }
.map-values span:not(.map-label) { padding: 2px 10px; background: var(--surface); border-radius: 999px; border: 1px solid var(--line); }

@media (max-width: 760px) {
  .plan-card-body { grid-template-columns: 1fr; }
  .plan-card-head { flex-direction: column; }
  .map-row { grid-template-columns: 1fr; }
  .map-band { grid-auto-flow: row; }
  .so-head { flex-direction: column; }
  .so-score { align-items: flex-start; }
}

/* Compliance status band: the organization picks the colour */
.band { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.band::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--band, var(--idle)); }

.code { margin: 0; padding: 8px 12px; background: var(--sunk); border-radius: var(--radius); font: 13px/1.6 ui-monospace, Consolas, monospace; overflow-x: auto; }

/* User guide */
.guide h2 { margin-bottom: 10px; }
.guide ol, .guide ul { margin: 0; padding-inline-start: 1.3em; line-height: 1.9; color: var(--ink-2); }
.guide-toc { position: sticky; top: 16px; }
.help-links { margin-bottom: 6px; }
.help-links a { color: var(--ink-3); }

/* ---------- Organization chart: an indented tree, readable at any width ---------- */
.org-chart ul { list-style: none; margin: 0; padding: 0; }
.org-chart ul ul { margin-inline-start: 22px; padding-inline-start: 18px; border-inline-start: 2px solid var(--line-strong); }
.org-chart li { position: relative; padding: 6px 0; }
.org-chart ul ul > li::before { content: ""; position: absolute; inset-inline-start: -18px; top: 28px; width: 16px; border-top: 2px solid var(--line-strong); }
.org-node { display: inline-flex; flex-direction: column; gap: 1px; min-width: 240px; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--accent); border-radius: var(--radius); color: var(--ink); }
.org-node:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(var(--shade), .1); }
.org-node span { font-size: var(--fs-sm); color: var(--ink-3); }
.guide-unit + .guide-unit { margin-top: 12px; }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .subnav { display: none; }
  body { background: #fff; font-size: 11px; }
  .rail, .ctx, .topbar, .no-print, .flash { display: none !important; }
  .print-only { display: block; }
  .main { padding: 0; max-width: none; }
  .panel { border-color: #bbb; break-inside: avoid; }
  .cols, .cols-even { grid-template-columns: 1fr 1fr; }
  .table th, .table td { padding: 5px 7px; }
  .table .hide-sm { display: table-cell; }
  a { color: inherit; text-decoration: none; }
  .st, .lv i, .statusbar span, .meter span, .pva .fill, .prio-critical { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Decision ---------- */
.decide { display: grid; gap: 14px; }
.choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice label {
  position: relative;
  display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.choice input { position: absolute; inset: 0; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.choice label span { font-size: 12px; color: var(--ink-3); }
.choice label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice label.ret:has(input:checked) { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.choice label.rej:has(input:checked) { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .panel { width: min(380px, 100%); padding: 28px; }
.login .brand { padding: 0 0 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .cols-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .export-menu ul { inset-inline-end: auto; inset-inline-start: 0; max-width: calc(100vw - 32px); }
  .main { padding: 18px 16px 48px; }
  .form { grid-template-columns: 1fr; }
  .choice, .choice.choice-4 { grid-template-columns: 1fr; }
  .step-fields { grid-template-columns: 1fr; }
  .step-user[hidden] { display: none; }
  .search-groups { grid-template-columns: 1fr; }
  .lesson-body, .sh-grid { grid-template-columns: 1fr; }
  .sh-cell:nth-child(odd) { border-inline-end: 0; }
  .step-row { padding: 12px; gap: 10px; }
  .table .hide-sm { display: none; }
  .health { grid-template-columns: 1fr 1fr; }
  .health > div:nth-child(3) { border-inline-start: 0; }
  .health > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .inline-forms { grid-template-columns: 1fr; }
  .ms-row { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .ms-row > :first-child { grid-column: 1 / -1; }
}

/* ---------- Projects map ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; padding: 0 16px 16px; }
.map-canvas { height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunk); z-index: 0; }
.map-side { max-height: 560px; overflow-y: auto; font-size: var(--fs-sm); }
.map-side h3 { font-size: var(--fs-sm); color: var(--ink-3); margin: 16px 0 6px; font-weight: 600; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: -1px; }
.map-places { list-style: none; margin: 0; padding: 0; }
.map-places > li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.map-places ul { list-style: none; margin: 4px 0 0; padding-inline-start: 10px; }
.map-places li li { padding: 2px 0; }
.map-place { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.map-place:hover { color: var(--accent-ink); }
.map-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; padding: 0; background: currentColor; }
.map-picker { height: 300px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunk); z-index: 0; }
.map-coords { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 8px; }
.map-coords .field { flex: 1 1 160px; }
.leaflet-container { font: inherit; }
.map-pop { min-width: 180px; font-size: var(--fs-sm); line-height: 1.5; }
.map-pop .title { font-weight: 600; display: block; margin-bottom: 2px; }
.map-pop .meta { color: var(--ink-3); }
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-canvas { height: 420px; }
  .map-side { max-height: none; }
}

/* ---------- Permission matrix ---------- */
.perm-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 18px; margin: 0 0 16px; }
.perm-levels dt { margin-bottom: 4px; }
.perm-levels dd { margin: 0; color: var(--ink-3); font-size: var(--fs-sm); }
.perm { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-sm); white-space: nowrap; }
.perm-none { color: var(--bad); background: var(--bad-bg); }
.perm-view { color: var(--warn); background: var(--warn-bg); }
.perm-role { color: var(--idle); background: var(--idle-bg); }
.perm-manage { color: var(--ok); background: var(--ok-bg); }
.perm-matrix td, .perm-matrix th { vertical-align: middle; }
.perm-matrix td.title { font-weight: 500; min-width: 220px; }
.perm-select { min-width: 120px; padding: 4px 8px; min-height: 0; border-radius: var(--radius); font-size: var(--fs-sm); }
.perm-select.perm-role { background: var(--surface); }
.perm-note { padding: 10px 16px; margin: 0; }
.perm-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-top: 20px; align-items: start; }
@media (max-width: 900px) { .perm-grid { grid-template-columns: 1fr; } }

/* ---------- Home ---------- */
.home-head { margin: 4px 0 24px; }
.home-head h1 { font-size: 28px; font-weight: 600; margin-top: 2px; }
.home-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.home-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.home-tile:hover { border-color: var(--line-strong); text-decoration: none; }
.home-tile b { font-size: 34px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.home-tile.is-bad b { color: var(--bad); }
.home-tile.is-zero b { color: var(--ink-3); }
.home-band { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: center;
  padding: 18px 0; border-top: 1px solid var(--line); }
.home-band-title { display: flex; flex-direction: column; gap: 2px; }
.home-band-title a { color: var(--ink); font-weight: 600; font-size: var(--fs-lg); }
.status-strip { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--sunk); }
.status-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 10px 0 0; padding: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.status-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; }
.status-legend a { color: inherit; }
.seg-on_track { background: var(--ok); } .seg-late { background: var(--warn); } .seg-very_late { background: var(--bad); }
.seg-complete { background: var(--done); } .seg-not_started, .seg-paused, .seg-closed { background: var(--idle); }
.home-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.home-h { font-size: var(--fs); font-weight: 600; margin-bottom: 10px; }
.home-list, .home-agenda { list-style: none; margin: 0; padding: 0; }
.home-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.home-list .title { color: var(--ink); font-weight: 500; }
.home-proj { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.home-proj .pva { flex: 1; }
.home-agenda li { display: flex; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.home-agenda time { display: flex; flex-direction: column; align-items: center; width: 44px; flex: none; font-size: 12px; color: var(--ink-3); line-height: 1.2; }
.home-agenda time b { font-size: var(--fs-lg); color: var(--ink); }
.home-agenda div { display: flex; flex-direction: column; min-width: 0; }
.home-agenda a { color: var(--ink); }
@media (max-width: 900px) {
  .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-band { grid-template-columns: 1fr; gap: 10px; }
  .home-cols { grid-template-columns: 1fr; gap: 24px; }
}


/* ---------- My tasks ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.quick-task { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.quick-task input[type="text"] { flex: 1 1 320px; border: 0; background: transparent; font-size: var(--fs); padding: 6px 8px; }
.quick-task input[type="text"]:focus { outline: none; }
.quick-task select, .quick-task input[type="date"] { flex: 0 1 auto; width: auto; min-height: 34px; padding: 4px 8px; font-size: var(--fs-sm); }
.quick-task .err { flex-basis: 100%; margin: 0; }
.filters-inline { display: flex; gap: 6px; padding: 0; margin: 0; border: 0; }
.filters-inline select { width: auto; min-height: 30px; padding: 2px 8px; font-size: var(--fs-sm); }
.task-row { align-items: center !important; }
button.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; padding: 0; flex: none; }
button.check:hover { border-color: var(--ok); background: var(--ok-bg); }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; background: var(--sunk);
  color: var(--ink-2); font-size: 12px; line-height: 20px; white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
a.chip:hover { text-decoration: none; color: var(--accent-ink); }
.chip-project { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.chip-high { background: var(--warn-bg); color: var(--warn); }
.chip-urgent { background: var(--bad-bg); color: var(--bad); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board-col { background: var(--sunk); border-radius: 10px; padding: 12px; min-height: 160px; }
.board-col h2 { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin: 0 2px 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.card + .card { margin-top: 8px; }
.card .title { color: var(--ink); font-weight: 500; font-size: var(--fs-sm); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; }
.card-foot form { display: flex; gap: 4px; }
@media (max-width: 1000px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .board { grid-template-columns: 1fr; } }

.chip-approach { background: var(--done-bg); color: var(--done); font-weight: 500; }
.ctx-record .chip-approach { max-width: 100%; white-space: normal; line-height: 1.5; padding-block: 2px; }

/* ---------- Shared bits for delivery pages ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-size: var(--fs-lg); font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; }
.empty-state { text-align: center; padding: 40px 20px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-2); margin-bottom: 18px; }
.empty-state h3 { font-size: var(--fs-lg); margin-bottom: 6px; color: var(--ink); }
.empty-state p { max-width: 460px; margin: 0 auto 14px; }
.btn-danger-quiet { color: var(--bad); }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.add-panel { margin-top: 18px; }
.add-panel > summary { padding: 12px 18px; cursor: pointer; font-weight: 500; color: var(--accent-ink); list-style: none; }
.add-panel > summary::-webkit-details-marker { display: none; }
.add-panel > summary::before { content: "+ "; }
.add-panel[open] > summary { border-bottom: 1px solid var(--line); }
.inline-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.inline-add input[type="text"] { flex: 1 1 220px; }
.inline-add input[type="number"], .score-input { width: 64px; min-height: 30px; padding: 2px 6px; text-align: center; }
tr.is-selected td { background: var(--accent-soft); }

/* Status pills for backlog items, iterations, increments */
.bst { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; font-weight: 500; white-space: nowrap;
  background: var(--idle-bg); color: var(--idle); }
.bst-in_progress, .bst-active { background: var(--warn-bg); color: var(--warn); }
.bst-review, .bst-ready { background: var(--done-bg); color: var(--done); }
.bst-done { background: var(--ok-bg); color: var(--ok); }

/* Backlog tree */
.backlog { display: flex; flex-direction: column; gap: 12px; }
.bl-epic { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; }
.bl-loose { border-style: dashed; }
.bl-loose > h3 { padding: 6px 16px 0; }
.bl-list { list-style: none; margin: 0; padding: 0; }
.bl-feature { border-top: 1px solid var(--line); }
.bl-feature:first-of-type { border-top: 0; }
.bl-item { display: flex; align-items: center; gap: 10px; padding: 7px 16px; }
.bl-item:hover { background: var(--tint); }
.bl-epic > .bl-list .bl-item .bl-title { font-weight: 600; font-size: var(--fs); }
.bl-feature > .bl-list:first-child .bl-title { font-weight: 500; }
.bl-work .bl-item { padding-inline-start: 40px; font-size: var(--fs-sm); }
.bl-code { flex: none; font: 500 11px/1 ui-monospace, Consolas, monospace; color: var(--ink-3); background: var(--sunk); padding: 3px 6px; border-radius: 4px; }
.bl-epic > .bl-list .bl-code { background: var(--accent-soft); color: var(--accent-ink); }
.bl-title { flex: 1; min-width: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.bl-meta { display: flex; align-items: center; gap: 6px; flex: none; }
.pts { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; flex: none; }
.pts-none { background: var(--warn-bg); color: var(--warn); }
.wsjf { font-size: 12px; font-weight: 600; color: var(--done); background: var(--done-bg); padding: 0 6px; border-radius: 4px; }
.wsjf-table td b { color: var(--done); }

/* Velocity bars */
.velocity { display: flex; align-items: flex-end; gap: 18px; height: 190px; padding: 10px 0 0; overflow-x: auto; }
.v-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; }
.v-bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; }
.v-bars span { display: block; width: 16px; border-radius: 3px 3px 0 0; min-height: 2px; }
.v-committed, .v-key-c { background: var(--line-strong); }
.v-done, .v-key-d { background: var(--accent); }
.pva-legend .v-key-c, .pva-legend .v-key-d, .pva-legend .bd-key-a, .pva-legend .bd-key-i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-inline-end: 6px; }
.bd-key-a { background: var(--accent); }
.bd-key-i { background: var(--line-strong); }

/* Burndown */
.burndown { width: 100%; max-width: 680px; height: auto; display: block; }
.bd-axis { stroke: var(--line-strong); stroke-width: 1; }
.bd-ideal { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 5 5; }
.bd-actual { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.bd-dot { fill: var(--accent); }
.bd-label { font-size: 12px; fill: var(--ink); font-weight: 600; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; font-size: var(--fs-sm); }
.pick-list label { display: flex; align-items: center; gap: 8px; }

/* Agile board */
.agile-board .board-col { min-height: 260px; transition: background .1s; }
.agile-board .board-col.is-over { background: var(--accent-soft); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card[draggable="true"] { cursor: grab; }
.card.is-dragging { opacity: .5; }
.board-empty { padding: 8px 2px; }
.agile-overview { display: grid; grid-template-columns: 2fr 1fr 1.4fr 1fr; gap: 22px; align-items: start; }
.agile-overview > div { display: flex; flex-direction: column; gap: 2px; }
.agile-overview b { font-size: var(--fs-lg); }
.agile-overview .title { font-weight: 600; color: var(--ink); }

/* Program increments */
.pi + .pi { margin-top: 16px; }
.pi-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; padding: 16px 18px; }

/* AI journey */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.step a { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink-2); }
.step a:hover { text-decoration: none; border-color: var(--line-strong); }
.step-n { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--sunk); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.step-name { font-weight: 600; color: var(--ink); font-size: var(--fs-sm); line-height: 1.4; }
.step-state { font-size: 12px; color: var(--ink-3); }
.step-passed .step-n { background: var(--ok); color: var(--on-status); }
.step-in_progress .step-n { background: var(--accent); color: var(--on-color); }
.step-at_gate .step-n { background: var(--warn); color: var(--on-status); }
.step-stopped .step-n { background: var(--bad); color: var(--on-status); }
.step.is-current a { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.step.is-open a { background: var(--accent-soft); }
.step-not_started a { opacity: .75; }
.step-badge { font-size: 12px; font-weight: 500; padding: 1px 9px; border-radius: 999px; background: var(--idle-bg); color: var(--idle); }
.step-badge.step-in_progress { background: var(--accent-soft); color: var(--accent-ink); }
.step-badge.step-at_gate { background: var(--warn-bg); color: var(--warn); }
.step-badge.step-passed { background: var(--ok-bg); color: var(--ok); }
.step-badge.step-stopped { background: var(--bad-bg); color: var(--bad); }
.gate-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gate-checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.gate-checklist input { width: 18px; height: 18px; min-height: 0; margin-top: 3px; flex: none; accent-color: var(--accent); }
.gate { font-weight: 600; }
.gate-go { color: var(--ok); }
.gate-iterate { color: var(--warn); }
.gate-no_go { color: var(--bad); }
.gate-panel { border-color: var(--warn); }
.access { font-size: 12px; font-weight: 500; }
.access-granted { color: var(--ok); }
.access-requested { color: var(--warn); }
.access-blocked { color: var(--bad); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }
@media (max-width: 1000px) {
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agile-overview, .pi-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agile-overview, .pi-body { grid-template-columns: 1fr; }
}
.pva-legend i.v-key-c, .pva-legend i.bd-key-i { background: var(--line-strong); border: 0; }
.pva-legend i.v-key-d, .pva-legend i.bd-key-a { background: var(--accent); border: 0; }

/* ---------- App frame: rail, context panel, top bar ---------- */
.app { display: grid; grid-template-columns: var(--rail) var(--ctx) minmax(0, 1fr); min-height: 100vh; }
.panel-closed .app { grid-template-columns: var(--rail) minmax(0, 1fr); }
.panel-closed .ctx { display: none; }

.rail {
  position: sticky; top: 0; height: 100vh; z-index: 50;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 14px; background: var(--surface); border-inline-end: 1px solid var(--line);
}
.rail-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; color: var(--accent-ink); }
.rail-mark svg { width: 28px; height: 28px; }
.rail-items { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 6px; overflow-y: auto; scrollbar-width: none; }
.rail-items::-webkit-scrollbar { display: none; }
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 7px;
  border-radius: 8px; color: var(--ink-3); font-size: 11px; line-height: 1.25; text-align: center;
}
.rail-item:hover { color: var(--ink); text-decoration: none; }
.rail-item:hover .rail-icon { background: var(--sunk); }
.rail-icon { position: relative; display: grid; place-items: center; width: 44px; height: 30px; border-radius: 15px; transition: background .12s; }
.rail-icon svg { width: 20px; height: 20px; }
.rail-item[aria-current] { color: var(--ink); font-weight: 600; }
.rail-item[aria-current] .rail-icon { background: var(--accent-soft); color: var(--accent-ink); }
.rail-count {
  position: absolute; top: -3px; inset-inline-end: 0; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); color: var(--on-color); font: 600 10px/17px var(--font); font-style: normal;
}
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 6px; }
.account { position: relative; }
.account > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.account > summary::-webkit-details-marker { display: none; }
.account-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 240px; z-index: 60;
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(var(--shade), .14);
}
.account-menu > a, .account-menu .linkish { display: block; padding: 7px 10px; border-radius: var(--radius); color: var(--ink); font-size: var(--fs-sm); text-align: start; width: 100%; }
.account-menu > a:hover, .account-menu .linkish:hover { background: var(--sunk); text-decoration: none; color: var(--ink); }
.account-who { display: flex; flex-direction: column; padding: 4px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.account-menu .lang-switch { margin: 0; }
.account > summary .avatar { width: 34px; height: 34px; }
.account > summary:hover .avatar { box-shadow: 0 0 0 2px var(--line-strong); }
.theme-pick { display: flex; gap: 2px; padding: 4px; margin: 4px 0; border-radius: var(--radius); background: var(--sunk); }
.theme-pick button { flex: 1; display: grid; place-items: center; height: 30px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink-3); cursor: pointer; }
.theme-pick button svg { width: 18px; height: 18px; }
.theme-pick button:hover { color: var(--ink); }
.theme-pick button:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 1px; }
.theme-pick button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shade), .12); }
.account-label { padding: 6px 10px 0; font-size: 12px; color: var(--ink-3); }
/* Short screens: the rail tightens so every section fits without a cut-off icon. */
@media (max-height: 820px) {
  .rail { padding: 8px 0 10px; }
  .rail-mark { height: 36px; margin-bottom: 2px; }
  .rail-items { gap: 0; padding: 2px 6px; }
  .rail-item { padding: 4px 2px 5px; gap: 1px; }
  .rail-icon { height: 26px; }
}
@media (max-height: 640px) {
  .rail-label { display: none; }
  .rail-icon { height: 32px; }
}

.ctx {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 50;
  padding: 20px 12px 24px; background: var(--rail-bg); border-inline-end: 1px solid var(--line);
}
.ctx-title { font-family: var(--font-head); font-size: 17px; font-weight: 600; line-height: 1.45; padding: 0 10px 12px; }
.ctx-pages { display: flex; flex-direction: column; gap: 1px; }
.ctx-pages a, .ctx-items a {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; border-radius: var(--radius);
  border-inline-start: 3px solid transparent; color: var(--ink-2); font-size: 14px; line-height: 1.45;
}
.ctx-pages a:hover, .ctx-items a:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.ctx-pages a[aria-current], .ctx-items a[aria-current] {
  background: var(--surface); color: var(--ink); font-weight: 600; border-inline-start-color: var(--accent);
}
.ctx-count { margin-inline-start: auto; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.ctx-sub { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 20px 10px 6px; }
.ctx-items { list-style: none; margin: 0; padding: 0; }
.ctx-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item-meta { flex: none; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.dot-state { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.dot-approved, .dot-active { background: var(--ok); }
.dot-submitted { background: var(--warn); }
.ctx-back { display: inline-block; padding: 0 10px 12px; font-size: var(--fs-sm); color: var(--ink-3); }
.ctx-back:hover { color: var(--accent-ink); }
.ctx-record { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 10px 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.ctx-record .ctx-title { padding: 0 0 6px; font-size: 16px; }
.ctx-code { font-size: 12px; color: var(--ink-3); }
.ctx-grouped .ctx-sub:first-child { margin-top: 4px; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
/* The top bar from the latest design: crisp (no blur), a wide search, a quiet "New", the bell and a round account
   button; the page gets more room. The side (rail + section panel) is the original. */
:root { --topbar: 68px; --gutter: 40px; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  height: var(--topbar); padding: 0 var(--gutter) 0 20px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar .quick-search { flex: 0 1 520px; }
.topbar .quick-search input { min-height: 44px; font-size: 15px; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
[dir="rtl"] .panel-toggle svg { transform: scaleX(-1); }
.nav-toggle { display: none; }
.bell-count {
  position: absolute; top: 4px; inset-inline-end: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--bad); color: var(--on-status); font: 600 10px/16px var(--font); font-style: normal;
}
.new-menu { position: relative; }
.new-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.new-menu > summary::-webkit-details-marker { display: none; }
.new-menu > summary svg { width: 16px; height: 16px; }
.new-menu > summary.btn-quiet { border-color: transparent; border-radius: var(--radius-pill); font-weight: 600; }
.new-menu > summary.btn-quiet:hover, .new-menu[open] > summary.btn-quiet { background: var(--sunk); }
.new-list {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 180px; z-index: 45;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elev-hi);
}
.new-list a { padding: 9px 12px; border-radius: var(--radius); color: var(--ink); font-size: var(--fs-sm); }
.new-list a:hover { background: var(--sunk); text-decoration: none; }
.account-pill {
  display: grid; place-items: center; padding: 3px; border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); transition: box-shadow .15s;
}
.account-pill:hover, .account[open] > .account-pill { box-shadow: var(--elev); }
.account-pill .avatar { width: 32px; height: 32px; }
.account-menu { width: 248px; border-color: var(--line); box-shadow: var(--elev-hi); }
.main { min-width: 0; width: 100%; max-width: 1320px; padding: 32px var(--gutter) 72px; }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(var(--shade), .35); }
.rail-item:focus-visible, .ctx a:focus-visible, .icon-btn:focus-visible, .rail-mark:focus-visible, .account > summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Page heads on record pages: the name, then its key facts as labelled values */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head-main { min-width: 0; flex: 1 1 420px; }
.page-head h1 { font-size: 26px; line-height: 1.45; }
.inline-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0 0; }
.inline-facts > div { display: flex; align-items: baseline; gap: 8px; }
.inline-facts dt { font-size: 12px; color: var(--ink-3); }
.inline-facts dd { margin: 0; font-size: 14px; color: var(--ink); }

@media (max-width: 1100px) {
  :root { --ctx: 212px; --gutter: 24px; }
  .topbar .quick-search kbd { display: none; }
}
@media (max-width: 860px) {
  .app, .panel-closed .app { grid-template-columns: minmax(0, 1fr); }
  .rail, .ctx { position: fixed; top: 0; bottom: 0; height: auto; display: none; }
  .rail { inset-inline-start: 0; width: var(--rail); }
  .ctx { inset-inline-start: var(--rail); width: min(280px, calc(100vw - var(--rail))); }
  .nav-open .rail, .nav-open .ctx { display: flex; }
  .nav-open .ctx { display: block; }
  .panel-closed .nav-open .ctx { display: block; }
  .panel-toggle { display: none; }
  .nav-toggle { display: inline-grid; }
  :root { --topbar: 60px; --gutter: 16px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar .quick-search { flex: 1 1 auto; }
  .topbar .quick-search input { min-height: 40px; }
  .topbar-actions { gap: 2px; }
  .new-menu > summary span { display: none; }
  .new-menu > summary.btn-quiet { width: 40px; padding: 0; justify-content: center; }
  .main { padding: 22px var(--gutter) 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .rail-icon, .account-pill { transition: none; }
}

/* Brand lockup on sign-in, welcome and error pages */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand svg { width: 28px; height: 28px; color: var(--accent-ink); flex: none; }
.brand b { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.quick-search kbd { white-space: nowrap; }

/* ---------- Strategy cockpit ---------- */
.block { margin-top: 30px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h2 { font-family: var(--font-head); font-size: 17px; font-weight: 600; }
.block-head a { font-size: var(--fs-sm); }
.calm { color: var(--ink-2); padding: 14px 0; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; }

/* The balance: performance as the one answer, and the beam that shows why */
.balance {
  display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 36px; align-items: center;
  padding: 26px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.balance-label { font-family: var(--font); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); }
.balance-num { margin: 2px 0 8px; font-family: var(--font-head); font-size: 56px; font-weight: 600; line-height: 1.05; color: var(--ink); }
.balance-num small { font-size: 26px; font-weight: 500; color: var(--ink-3); margin-inline-start: 2px; }
.balance-say { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; max-width: 32ch; }
.beam { padding-top: 34px; }
.beam-track { position: relative; height: 14px; border-radius: 7px; background: var(--sunk); }
.beam-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 7px; background: var(--ok); }
.beam-fill.st-late { background: var(--warn); }
.beam-fill.st-very_late { background: var(--bad); }
.beam-fill.st-not_started, .beam-fill.st-no_reading { background: var(--idle); }
.beam-target { position: absolute; top: -30px; bottom: -8px; width: 0; }
.beam-target i { position: absolute; top: 22px; bottom: 0; inset-inline-start: -1px; width: 2px; background: var(--ink); border-radius: 1px; }
.beam-target i::after {
  content: ""; position: absolute; bottom: -7px; inset-inline-start: -5px;
  border: 6px solid transparent; border-bottom: 7px solid var(--ink); border-top: 0;
}
.beam-target b { position: absolute; top: 0; inset-inline-start: 0; transform: translateX(50%); white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--ink); }
[dir="ltr"] .beam-target b { transform: translateX(-50%); }
.beam-scale { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11px; color: var(--ink-3); }
.beam-facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.beam-facts dt { font-size: 12px; color: var(--ink-3); }
.beam-facts dd { margin: 0; font-size: var(--fs-lg); font-weight: 600; }

/* Executive plans and their perspectives */
.ep { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ep + .ep { margin-top: 10px; }
.ep-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ep-name a { color: var(--ink); font-weight: 600; }
.persp { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.persp-cell { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--paper); }
.persp-name { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; }
.persp-cell b { font-size: var(--fs); }
.persp-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.persp-bar span { display: block; height: 100%; background: var(--ok); }
.persp-cell.st-late .persp-bar span { background: var(--warn); }
.persp-cell.st-very_late .persp-bar span { background: var(--bad); }
.persp-cell.st-no_reading .persp-bar span, .persp-cell.st-not_started .persp-bar span { background: var(--idle); }
.persp-state { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
.persp-cell.st-late .persp-state { color: var(--warn); }
.persp-cell.st-very_late .persp-state { color: var(--bad); }

/* Objectives needing attention, and the quiet side column */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.attention { list-style: none; margin: 14px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.attention li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; }
.attention li + li { border-top: 1px solid var(--line); }
.attention-name { display: flex; flex-direction: column; min-width: 0; }
.attention-name a { color: var(--ink); font-weight: 500; }
.attention-perf { font-weight: 600; }
.aside-stack { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.due-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); }
.due-card b { font-family: var(--font-head); font-size: 30px; color: var(--ink-3); line-height: 1; }
.due-card.has-due { border-color: var(--warn); }
.due-card.has-due b { color: var(--warn); }
.due-card:hover { text-decoration: none; border-color: var(--accent); }
.quiet h3 { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 12px 0 4px; }
.quiet h3:first-child { margin-top: 0; }
.quiet .rich p { margin-bottom: 6px; }
.pillar-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pillar-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); }
.pillar-chips i { width: 8px; height: 8px; border-radius: 50%; }
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .aside-stack { margin-top: 0; }
}
@media (max-width: 760px) {
  .balance { grid-template-columns: 1fr; gap: 10px; padding: 20px; }
  .balance-num { font-size: 46px; }
}

/* Executive plan, objective and board pages */
.balance-compact { padding: 20px 24px; margin-bottom: 14px; }
.balance-compact .balance-num { font-size: 44px; }
.balance-compact .beam { padding-top: 30px; }
.count-line { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0 0 24px; padding: 0 4px; color: var(--ink-2); font-size: var(--fs-sm); }
.count-line b { font-size: var(--fs-lg); color: var(--ink); margin-inline-end: 4px; }
.score-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.score-row > div { padding: 14px 18px; border-inline-start: 1px solid var(--line); }
.score-row > div:first-child { border-inline-start: 0; }
.score-row dt { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.score-row dd { margin: 4px 0 0; font-size: var(--fs-lg); font-weight: 600; }
.score-row .score-lead { background: var(--accent-soft); }
.score-row .score-lead dd { font-family: var(--font-head); font-size: 26px; color: var(--accent-ink); }
.view-switch { margin: 0 0 14px; }
.seg-lg a { padding: 7px 16px; font-size: 14px; }
@media (max-width: 900px) { .score-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .score-row > div { border-inline-start: 0; border-top: 1px solid var(--line); } }

/* Status colours mean status: a bar with a status takes its colour; a bar without one stays neutral (brand). */
.meter.st-on_track span, .pva.st-on_track .fill { background: var(--ok); }
.meter.st-complete span { background: var(--done); }
.meter.st-not_started span, .meter.st-no_reading span, .pva.st-not_started .fill, .pva.st-paused .fill { background: var(--idle); }
.pva-legend i:not(.tick):not([class*="key"]) { background: var(--ink-3); }

/* ---------- Project overview ---------- */
.band-card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.next-ms { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.next-ms > b { font-weight: 600; }
.next-ms .inline-facts { margin: 0; flex-basis: 100%; }
.follow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.follow-group { padding: 14px 18px 10px; }
.follow-group + .follow-group { border-top: 1px solid var(--line); }
.follow-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.follow-head h3 { font-size: 14px; font-weight: 600; }
.follow-head a { font-size: var(--fs-sm); }
.follow-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 7px 0; }
.follow-row + .follow-row { border-top: 1px dashed var(--line); }
.follow-row:not(:has(.prio, .lv)) { grid-template-columns: minmax(0, 1fr) auto auto; }
.follow-title { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-empty { margin: 4px 0 6px; color: var(--ink-3); font-size: var(--fs-sm); }
.quiet-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.quiet-card p { margin: 0 0 6px; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.activity li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: var(--fs-sm); }
.activity-what { flex: 1; min-width: 0; color: var(--ink); }
.activity li > .muted { flex-basis: 100%; }
.activity-act { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--sunk); color: var(--ink-2); }
.activity-create { background: var(--ok-bg); color: var(--ok); }
.activity-delete { background: var(--bad-bg); color: var(--bad); }

/* ---------- Projects list ---------- */
.summary-band { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 18px 22px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.summary-nums { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; }
.summary-nums dt { font-size: 12px; color: var(--ink-3); }
.summary-nums dd { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.status-filter a { color: var(--ink-2); padding: 2px 8px; border-radius: 999px; }
.status-filter a:hover { background: var(--sunk); text-decoration: none; }
.status-filter a[aria-current] { background: var(--ink); color: var(--paper); }
.status-filter a[aria-current] i { box-shadow: 0 0 0 2px var(--paper); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-bar input[type="search"] { flex: 1 1 240px; max-width: 340px; }
.filter-bar select { width: auto; }
.filter-bar .check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.filter-bar .check input { width: auto; min-height: 0; }
.projects-table .chip-approach { margin-inline-start: 4px; }
@media (max-width: 900px) { .summary-band { grid-template-columns: 1fr; gap: 14px; } }

/* Add-forms on record pages: collapsed under the content, which takes the full width */
.cols.forms-below { grid-template-columns: minmax(0, 1fr); }
.cols.forms-below > .stack + .stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.cols.forms-below > .stack + .stack > * { margin-top: 0; }
.add-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; }
.add-form > .btn, .add-form > button { justify-self: start; }
.add-form > input[type="hidden"] { display: none; }

/* ---------- Home ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.needs-say { margin: 0 0 12px; color: var(--ink-2); }
.needs-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.need { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 11px 16px; }
.need + .need { border-top: 1px solid var(--line); }
.need-kind { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.need-decision .need-kind { color: var(--accent-ink); }
.need-task .need-kind { color: var(--bad); }
.need-reading .need-kind { color: var(--warn); }
.need-title { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda .home-agenda { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 4px 14px; }
.agenda .home-agenda li:last-child { border-bottom: 0; }
.watch { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.watch-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); }
.watch-card:hover { border-color: var(--accent); text-decoration: none; }
.watch-card b { font-weight: 600; line-height: 1.45; }
.watch-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-2); }
.watch-foot .st { margin-inline-start: auto; }
.org-strip { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.org-strip .status-legend a { color: var(--ink-2); }
.dot-status-on_track, .dot-status-complete { background: var(--ok); }
.dot-status-late { background: var(--warn); }
.dot-status-very_late { background: var(--bad); }
@media (max-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .need { grid-template-columns: minmax(0, 1fr) auto; } .need-kind { grid-column: 1 / -1; } .need-meta { display: none; } .need .btn { grid-column: 1 / -1; justify-self: start; } }

/* ---------- My tasks ---------- */
.tasks-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.block-first { margin-top: 0; }
.task-groups { display: flex; flex-direction: column; gap: 14px; }
.task-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.task-group h3 { display: flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.task-group h3 .num { font-weight: 500; color: var(--ink-3); }
.task-group-overdue h3 { color: var(--bad); }
.task-group-today h3 { color: var(--accent-ink); }
.also { padding: 6px 0 4px; }
.also-title { font-family: var(--font-head); font-size: 15px; font-weight: 600; padding: 8px 18px 0; }
.also .follow-group { padding: 12px 18px 10px; }
.also .follow-group + .follow-group { border-top: 1px solid var(--line); }
.also-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.also-row + .also-row { border-top: 1px dashed var(--line); }
.also-row > a { color: var(--ink); line-height: 1.45; }
.also-row .lv { transform: scale(.85); }
@media (max-width: 1100px) { .tasks-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Risk register ---------- */
.risk-band { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: center; padding: 20px 24px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.heat-lg { grid-template-columns: 18px repeat(5, 46px); gap: 4px; }
.heat-lg .cell { height: 40px; aspect-ratio: auto; font-size: 14px; }
.risk-read { display: flex; flex-direction: column; gap: 14px; }
.level-filter { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.level-filter a { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); }
.level-filter a:hover { border-color: var(--line-strong); text-decoration: none; }
.level-filter a[aria-current] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.summary-band-simple { grid-template-columns: 1fr; }
@media (max-width: 760px) { .risk-band { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Committees ---------- */
.kind-filter { margin: -8px 0 18px; }
.more-menu ul { min-width: 220px; }
.menu-danger { background: none; border: 0; padding: 7px 10px; width: 100%; text-align: start; font: inherit; color: var(--bad); cursor: pointer; border-radius: var(--radius); }
.menu-danger:hover { background: var(--bad-bg); }
.export-menu li form { margin: 0; }

/* ---------- Knowledge ---------- */
.folder-tree li.is-child a { padding-inline-start: 26px; }
.file-name { display: flex; align-items: flex-start; gap: 10px; }
.file-name > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.files-table .file-ext { margin-top: 2px; }

/* ---------- Compliance ---------- */
.comp-balance { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); }
.comp-domain { margin-top: 16px; scroll-margin-top: 72px; }
.comp-standard { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }

/* ---------- Secondary pages and forms ---------- */
.page-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: var(--fs-sm); color: var(--ink-3); }
.page-back::before { content: "→"; }
[dir="ltr"] .page-back::before { content: "←"; }
.page-back:hover { color: var(--accent-ink); }
.page-lede { margin-top: 6px; max-width: 72ch; color: var(--ink-2); }
.page-head .actions { align-self: flex-end; }
.form-card { max-width: 880px; }
.form-card.form-narrow { max-width: 640px; }
.form-card .form-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .panel-head, .block-head { flex-wrap: wrap; }
  .panel-head .muted { white-space: normal; }
  .filters-inline { flex-wrap: wrap; }
  .filters-inline select { max-width: 100%; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg a { white-space: nowrap; }
  .board-col, .agile-board .board-col { min-height: 0; }
  /* filters: search on its own line, the dropdowns share the next ones evenly */
  .filter-bar input[type="search"], .filters input[type="search"] { flex: 1 1 100%; max-width: none; width: auto; }
  .filter-bar select, .filters select { flex: 1 1 140px; min-width: 0; }
  /* in a table that scrolls sideways, keep the name column readable instead of one word per line */
  :is(.scroll-x, .table-wrap) .table :is(td, th):first-child { min-width: 180px; }
}

/* Milestone rows follow the width of their card, not the window: the side panel can leave the card narrow on a laptop. */
.panel:has(.ms-row) { container-type: inline-size; }
@container (max-width: 720px) {
  .ms-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .ms-row > :first-child { grid-column: 1 / -1; }
}

/* A row reached by its link (after saving) clears the sticky top bar. */
:is([id^="m-"], [id^="d-"], [id^="cr-"], [id^="report-"]) { scroll-margin-top: 72px; }

/* ---------- Project intake: picked answers, not typed ones ---------- */
.intake { grid-column: 1 / -1; display: grid; gap: 22px; }
.intake [data-when][hidden] { display: none; }
.intake-q { margin: 0; padding: 0; border: 0; min-width: 0; }
.intake-q legend { padding: 0; font-weight: 600; color: var(--ink); }
.intake-q > .help { margin: 2px 0 10px; font-size: 12px; color: var(--ink-3); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
/* Intake answers: scoped to .choices so they don't restyle the .choice card pickers (approach, decisions). */
.choices > .choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: var(--fs-sm); line-height: 1.5; }
.choices > .choice input { margin-top: 3px; flex: none; }
.choices > .choice:hover { border-color: var(--accent); }
.choices > .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; }
.choices > .choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.intake-q.invalid .choices > .choice { border-color: var(--bad); }
.intake-q > .err { display: block; margin-top: 6px; }
.intake-follow { margin-top: 12px; }
.intake-follow:not(:has(> :not([hidden]))) { display: none; }
.intake-slot { display: contents; }
.intake-slot[hidden] { display: none; }
.intake-say { margin: 0; padding: 10px 12px; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink-2); }
.intake-say span { display: block; }
.intake-say span[hidden] { display: none; }

/* ---------- Procurement and funding ---------- */
.pr-steps { display: flex; gap: 0; margin: 10px 0 4px; padding: 0; list-style: none; counter-reset: pr; }
.pr-steps li { flex: 1 1 0; position: relative; padding-top: 18px; font-size: 12px; color: var(--ink-3); text-align: center; min-width: 0; }
.pr-steps li::before { content: ""; position: absolute; top: 4px; inset-inline: 0; height: 2px; background: var(--line-strong); }
.pr-steps li::after { content: ""; position: absolute; top: 0; inset-inline-start: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.pr-steps li.done::before, .pr-steps li.now::before { background: var(--accent); }
.pr-steps li.done::after { background: var(--accent); border-color: var(--accent); }
.pr-steps li.now::after { border-color: var(--accent); background: var(--accent-soft); }
.pr-steps li.now { color: var(--ink); font-weight: 600; }
.pr-item { padding: 14px 18px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.pr-item:last-child { border-bottom: 0; }
.pr-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.pr-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 18px; margin: 12px 0 0; }
.pr-facts dt { font-size: 12px; color: var(--ink-3); }
.pr-facts dd { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.pr-cancelled { opacity: .6; }
.import-review { display: grid; gap: 12px; }
.import-card { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.import-card dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 14px; margin: 0 0 10px; font-size: var(--fs-sm); }
.import-card dt { color: var(--ink-3); }
.import-card dd { margin: 0; overflow-wrap: anywhere; }
.fund-box { display: grid; gap: 10px; }
.fund-confirmed { color: var(--ok); font-weight: 500; }

/* ---------- Suhail: the chat on the home page and in a conversation ---------- */
.ask-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ask-head h2 { font-size: var(--fs-lg); }
.ask-head p { margin: 2px 0 0; }
.ask-mark, .msg-mark { flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.ask-mark { width: 38px; height: 38px; }
.ask-mark svg { width: 22px; height: 22px; }
.ask-recent { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.ask-recent a { display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: var(--radius); color: var(--ink); }
.ask-recent a:hover { background: var(--sunk); text-decoration: none; }

.composer { position: relative; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: border-color .12s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer.is-drop { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); }
.composer.is-busy { opacity: .75; }
.composer-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px; }
.composer textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 200px; resize: none; border: 0; background: transparent; color: var(--ink);
  font: 400 var(--fs)/1.6 var(--font); padding: 8px 6px; outline: none; overflow-y: hidden; }
.ask-suhail .composer textarea { min-height: 64px; }
.composer-attach { cursor: pointer; }
.composer-attach:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer-send { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-color); cursor: pointer; }
.composer-send:hover { background: var(--accent-hover); }
.composer-send svg { width: 18px; height: 18px; }
.composer-send:disabled { opacity: .5; }
.composer-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
.file-pill { padding: 2px 10px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-error { margin: 0; padding: 8px 12px 0; color: var(--bad); font-size: var(--fs-sm); }

.replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.reply { padding: 5px 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2);
  font: 500 13px/1.5 var(--font); cursor: pointer; text-align: start; }
.reply:hover { border-color: var(--accent); color: var(--accent-ink); }
.reply:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chat { max-width: 820px; display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar) - 150px); }
.chat-head { margin-bottom: 18px; }
.chat-head h1 { font-size: 22px; }
.chat-thread { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-bottom: 16px; }
.msg { display: flex; gap: 10px; align-items: flex-start; scroll-margin-bottom: 130px; }
.msg-mark { width: 30px; height: 30px; margin-top: 2px; }
.msg-mark svg { width: 18px; height: 18px; }
.msg-body { min-width: 0; max-width: min(640px, 90%); }
.msg-text { white-space: normal; overflow-wrap: anywhere; }
.msg-user { justify-content: flex-end; }
.msg-user .msg-body { padding: 8px 14px; border-radius: 14px; background: var(--sunk); color: var(--ink); }
.msg-user.is-pending { opacity: .7; }
.msg-user.is-failed .msg-body { box-shadow: inset 0 0 0 1px var(--bad); }
.msg.is-past .replies { display: none; }
.msg-files { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink-2); }
.msg-files li { display: inline-flex; align-items: center; gap: 4px; }
.msg-files svg { width: 14px; height: 14px; }

.draft-card { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.draft-card dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.draft-card dl > div { padding: 9px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.draft-card dt { font-size: 12px; color: var(--ink-3); }
.draft-card dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.draft-card dd .linkish { color: var(--ink); text-align: start; padding: 0; }
.draft-card dd .linkish:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.draft-card-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; padding: 12px 14px; background: var(--tint); }
.msg.is-past .draft-card-actions .btn-primary { display: none; }
@media (max-width: 600px) { .draft-card dl { grid-template-columns: 1fr; } }

.chat > .composer { position: sticky; bottom: 12px; box-shadow: 0 8px 24px rgba(var(--shade), .08); }
.chat-done { padding: 12px 14px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ink); }
.chat-typing { display: flex; gap: 4px; padding: 0 40px 12px; }
.chat-typing[hidden] { display: none; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: typing 1s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-typing span, .pv-loading span { animation: none; opacity: .6; } }

/* ---------- File preview: a pop-up over the page, or a page of its own ---------- */
.pv-dialog { width: min(1100px, calc(100vw - 32px)); height: min(88vh, 900px); padding: 0; border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(var(--shade), .3); }
.pv-dialog::backdrop { background: rgba(var(--shade), .45); }
.pv-dialog .pv { height: 100%; }
.pv { display: flex; flex-direction: column; min-height: 0; }
.pv-page .pv { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); min-height: 70vh; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.pv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.pv-close { font-size: 22px; line-height: 1; }
.pv-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; }
.pv-frame { width: 100%; height: 100%; min-height: 70vh; border: 0; border-radius: var(--radius); background: var(--sunk); }
.pv-dialog .pv-body:has(.pv-frame) { padding: 0; }
.pv-dialog .pv-frame { min-height: 0; border-radius: 0; }
.pv-image { display: block; max-width: 100%; max-height: 75vh; width: auto; height: auto; margin: 0 auto; border-radius: var(--radius); }
/* The logo keeps a fixed 72px line, so nothing below it moves when it arrives. */
.org-logo { display: block; height: 72px; width: auto; max-width: 216px; object-fit: contain; object-position: center; margin-bottom: 14px; }
.pv-doc { max-width: 760px; margin: 0 auto; line-height: 1.8; }
.pv-doc h3 { margin: 18px 0 6px; font-size: var(--fs-lg); }
.pv-doc p { margin: 0 0 10px; white-space: pre-wrap; }
.pv-scroll { overflow: auto; max-width: 100%; margin-bottom: 12px; }
.pv-table { border-collapse: collapse; font-size: 13px; }
.pv-table td, .pv-table th { border: 1px solid var(--line); padding: 4px 8px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.pv-table th { background: var(--tint); font-weight: 600; position: sticky; top: 0; }
.pv-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.pv-tabs button { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: 500 12px/1.6 var(--font); cursor: pointer; }
.pv-tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.pv-slides { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pv-slides li { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.pv-slides p { margin: 4px 0 0; color: var(--ink-2); }
.pv-slide-n { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: var(--sunk); color: var(--ink-2); font-size: 12px; }
.pv-mail { display: grid; gap: 4px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pv-mail > div { display: flex; gap: 10px; }
.pv-mail dt { flex: none; width: 70px; color: var(--ink-3); font-size: 12px; padding-top: 2px; }
.pv-mail dd { margin: 0; overflow-wrap: anywhere; }
.pv-mail-body { line-height: 1.8; overflow-wrap: anywhere; }
.pv-sub { margin: 16px 0 6px; font-weight: 600; }
.pv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pv-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 8px; border-radius: var(--radius); }
.pv-list li:nth-child(odd) { background: var(--tint); }
.pv-zip li.is-dir { font-weight: 600; }
.pv-text { white-space: pre-wrap; font: 13px/1.7 ui-monospace, Consolas, monospace; margin: 0; }
.pv-none { padding: 40px 10px; text-align: center; color: var(--ink-2); }
.pv-loading { display: flex; gap: 6px; justify-content: center; align-items: center; height: 100%; }
.pv-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: typing 1s infinite ease-in-out; }
.pv-loading span:nth-child(2) { animation-delay: .15s; } .pv-loading span:nth-child(3) { animation-delay: .3s; }

/* ---------- Home: Suhail first. No side panel; the conversation is the page. ---------- */
@media (min-width: 861px) { .app.app-focus { grid-template-columns: var(--rail) minmax(0, 1fr); } }
.app-focus .ctx { display: none !important; }
.app-focus .panel-toggle { display: none; }
.app-focus .main { max-width: none; }
/* Home: Suhail is the front door. A greeting, one wide pill to ask in (label over the field, a round go button), the
   things Suhail can start as a row of icons with their names, and what is waiting as a grid of cards whose cover
   shows the one figure that matters. The pill is the only thing with a shadow. */
.app-home .topbar .quick-search { display: none; }        /* the pill below is the search on this page */
.front { max-width: 1120px; margin: 0 auto; padding: clamp(20px, 7vh, 72px) 0 56px; }
.ask-suhail { margin: 0; padding: 0; background: none; border: 0; }
.front-title { text-align: center; font-size: clamp(28px, 4vw, 42px); line-height: 1.25; margin-bottom: 28px; }

.ask-pill { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 780px; margin: 0 auto;
  padding: 10px 12px 10px 10px; border: 1px solid var(--line); border-radius: 40px; background: var(--surface); box-shadow: var(--elev);
  transition: box-shadow .2s; }
[dir="rtl"] .ask-pill { padding: 10px 10px 10px 12px; }
.ask-pill:hover { box-shadow: var(--elev-hi); }
.ask-pill:has(textarea:focus) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--elev-hi); }
.ask-pill.is-drop { border-style: dashed; border-color: var(--accent); }
.ask-pill.is-busy { opacity: .75; }
.ask-field { flex: 1; min-width: 0; display: grid; gap: 0; padding: 4px 22px; cursor: text; }
.ask-label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ask-field textarea { width: 100%; min-height: 30px; max-height: 180px; padding: 0; border: 0; resize: none; background: transparent;
  color: var(--ink); font: 400 17px/1.6 var(--font); box-shadow: none; overflow-y: hidden; }
.ask-field textarea:focus { outline: none; box-shadow: none; }
.ask-field textarea::placeholder { color: var(--ink-3); }
.ask-attach { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-2); cursor: pointer; }
.ask-attach:hover { background: var(--sunk); }
.ask-attach svg { width: 22px; height: 22px; }
.ask-go { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-color); cursor: pointer; }
.ask-go:hover { background: var(--accent-hover); }
.ask-go:disabled { opacity: .5; }
.ask-go svg { width: 22px; height: 22px; }
.ask-go:focus-visible, .ask-attach:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.ask-pill .composer-files { order: 2; flex-basis: 100%; padding: 0 22px 4px; }
.ask-pill .composer-error { order: 3; flex-basis: 100%; padding: 0 22px 6px; }
.ask-note { max-width: 780px; margin: 12px auto 0; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.ask-suhail .hub-thinking { justify-content: center; }

.shortcuts > :first-child { margin-inline-start: auto; } .shortcuts > :last-child { margin-inline-end: auto; }   /* centred, yet scrolls from its start */
.shortcuts { display: flex; justify-content: flex-start; gap: 8px 30px; margin: 40px auto 0; padding: 0 0 2px;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.shortcuts::-webkit-scrollbar { display: none; }
.shortcut { display: grid; justify-items: center; gap: 8px; flex: none; min-width: 64px; padding: 6px 2px 12px; border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--ink-3); font: 500 13px/1.3 var(--font); cursor: pointer;
  transition: color .15s, border-color .15s; }
.shortcut svg { width: 26px; height: 26px; }
.shortcut:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.shortcut:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--radius); }

.front-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 40px 0 16px; }
.front-row h2 { font-size: 22px; }
.front-row a { font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.stay-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; }
@media (max-width: 900px) { .stay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stay { display: grid; gap: 3px; width: 100%; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.stay:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 14px; }
.stay-cover { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 10px; border-radius: 14px;
  background: var(--sunk); color: var(--ink-2); overflow: hidden; }
.stay:hover .stay-cover { filter: brightness(.97); }
.stay-cover.tone-warn { color: var(--warn); }      /* the figure carries the status; the cover stays neutral */
.stay-cover.tone-bad { color: var(--bad); }
.stay-cover svg { width: 40px; height: 40px; }
.stay-figure { font: 700 clamp(40px, 5vw, 56px)/1 var(--font-head); }
.stay-bar { position: absolute; inset-inline: 18px; bottom: 18px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .08); }
.stay-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: currentColor; }
.stay-bar em { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-inline-start: -1px; background: var(--ink); }
.stay-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stay-head b { font-size: 15.5px; font-weight: 600; line-height: 1.45; min-width: 0; }
.stay-head .st { font-size: 13.5px; flex: none; }
.stay-kind { font-size: 14px; color: var(--ink-3); }
.stay-detail { font-size: 14px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stay:hover .stay-head b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.front-last { margin: 36px 0 0; text-align: center; font-size: 15px; }
@media (max-width: 720px) {
  .shortcuts { gap: 8px 22px; margin-inline: -16px; padding-inline: 16px; }
  .stay-grid { gap: 22px 14px; }
}
@media (max-width: 600px) {
  .front { padding-top: 12px; }
  .front-title { font-size: 28px; margin-bottom: 18px; }
  .ask-field { padding: 4px 12px; }
  .ask-go { width: 46px; height: 46px; }
  .ask-attach { width: 40px; height: 40px; }
}

/* Alignment map (home): the whole strategy, pillar → objectives → projects → programs → portfolios. */
.amap { max-width: 1120px; margin: 64px auto 0; }
.amap-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.amap-head h2 { font-size: var(--fs-lg); margin: 0 0 4px; }
.amap-head p { margin: 0; max-width: 70ch; }
.amap-side { display: grid; gap: 6px; justify-items: stretch; }
.amap-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.amap-plan { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; color: var(--ink); font-size: var(--fs-sm); }
.amap-plan:hover { text-decoration: none; }
.amap-plan:hover .amap-plan-name { text-decoration: underline; }
.amap-plan-name { color: var(--ink-2); }
.amap-plan b { font-size: 17px; }
.amap-bar { position: sticky; top: var(--topbar); z-index: 2; display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; padding: 10px 0; background: var(--paper); }
.amap-detail { flex: 1 1 320px; display: grid; align-content: center; gap: 1px; min-height: 52px; padding: 4px 2px; }
.amap-detail.is-idle .amap-detail-name { font-weight: 400; font-size: var(--fs-sm); color: var(--ink-3); }
.amap-detail-kind { color: var(--ink-3); font-size: 12px; min-height: 1em; }
.amap-detail-name { font-weight: 600; font-size: 14px; }
.amap-detail-meta { color: var(--ink-2); font-size: 12.5px; }
.amap-gaps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.amap-gaps button { font: inherit; font-size: 12.5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.amap-gaps button::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 6px; border-radius: 50%; background: var(--warn); vertical-align: 1px; }
.amap-gaps button:hover { border-color: var(--line-strong); }
.amap-gaps button[aria-pressed="true"] { border-color: var(--ink-2); background: var(--sunk); }
.amap-scroll { overflow-x: auto; padding-bottom: 6px; }
.amap-svg { display: block; width: 100%; min-width: 860px; height: auto; font-family: var(--font); }
.amap-col { fill: var(--ink-3); font-size: 11.5px; font-weight: 600; text-anchor: middle; }
.amap-link { fill: none; stroke: var(--line-strong); stroke-width: 1.25; transition: opacity .15s, stroke .15s; }
.amap-card rect:first-of-type { fill: var(--surface); stroke: var(--line); stroke-width: 1; transition: opacity .15s; }
.amap-card:hover rect:first-of-type { stroke: var(--line-strong); }
.amap-code { fill: var(--ink); font-size: 11.5px; font-weight: 700; }
.amap-name { fill: var(--ink-2); font-size: 11.5px; }
.amap-name.is-strong { fill: var(--ink); font-weight: 600; font-size: 12px; }
.amap-value { fill: var(--ink-2); font-size: 11px; text-anchor: end; }
.amap-value.is-start { text-anchor: start; }
.amap-edge { fill: var(--idle); }
.amap-block rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.amap-block.is-portfolio rect { fill: var(--accent); stroke: none; }
.amap-block.is-portfolio .amap-code, .amap-block.is-portfolio .amap-name { fill: var(--on-color); }
.amap-block.is-program .amap-code { fill: var(--accent-ink); }
.amap-hole rect { fill: none; stroke: var(--line-strong); stroke-dasharray: 4 3; }
.amap-hole text { fill: var(--ink-3); font-size: 11px; text-anchor: middle; }
.amap-node { cursor: pointer; outline: none; }
.amap-node:focus-visible rect:first-of-type { stroke: var(--ink); stroke-width: 2; }
/* status: the edge bar on objectives and pillars, the mark on projects */
.amap-mark { fill: var(--idle); }
.s-on_track > .amap-edge, .s-on_track > .amap-mark { fill: var(--ok); }
.s-late > .amap-edge, .s-late > .amap-mark { fill: var(--warn); }
.s-very_late > .amap-edge, .s-very_late > .amap-mark { fill: var(--bad); }
.s-complete > .amap-edge, .s-complete > .amap-mark { fill: var(--done); }
.amap-card.is-loose rect:first-of-type, .amap-card.is-orphan rect:first-of-type { stroke: var(--warn); stroke-dasharray: 4 3; }
/* focus: everything off the pointed line steps back */
.amap-svg.is-focus .amap-node:not(.is-on) { opacity: .25; }
.amap-svg.is-focus .amap-link { opacity: .1; }
.amap-svg.is-focus .amap-link.is-on { opacity: 1; stroke: var(--ink-2); stroke-width: 2; }
.amap-key { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); }
.amap-key li { display: inline-flex; align-items: center; gap: 6px; }
.k-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--idle); }
.k-dot.s-on_track { background: var(--ok); } .k-dot.s-late { background: var(--warn); } .k-dot.s-very_late { background: var(--bad); } .k-dot.s-complete { background: var(--done); }
.k-dot.k-diamond { border-radius: 1px; transform: rotate(45deg); width: 8px; height: 8px; }
.k-dot.k-loose { background: none; border: 1.5px dashed var(--warn); border-radius: 2px; }
/* map / radar switch */
.amap-views { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunk); }
.amap-views button { font: inherit; font-size: 13px; padding: 5px 14px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); cursor: pointer; }
.amap-views button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(var(--shade), .12); }
.amap-views button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.amap-scroll[hidden] { display: none; }
/* radar view: objectives inside, projects on the middle ring, programs and portfolios as bands outside */
.amap-radar[hidden] { display: none; }
.amap-radar { overflow-x: auto; overscroll-behavior-x: contain; }
.rd-svg .amap-node circle.rd-hit { fill: transparent; stroke: none; pointer-events: all; }
/* On a phone the whole circle would shrink to unreadable codes and specks to tap: keep it at reading size and scroll. */
@media (max-width: 680px) { .amap-radar .rd-svg { width: 680px; max-width: none; } }
.rd-svg { display: block; width: 100%; max-width: 600px; height: auto; margin-inline: auto; font-family: var(--font); overflow: visible; }
.rd-ring { fill: none; stroke: var(--line); stroke-dasharray: 2 4; }
.rd-ring-label { fill: var(--ink-3); font-size: 10.5px; text-anchor: middle; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.rd-band.is-portfolio path { fill: var(--accent); }
.rd-band.is-program path { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.rd-band-label { font-size: 9.5px; font-weight: 700; text-anchor: middle; pointer-events: none; direction: ltr; unicode-bidi: plaintext; }
.is-portfolio .rd-band-label { fill: var(--on-color); }
.is-program .rd-band-label { fill: var(--accent-ink); }
.rd-link { fill: none; stroke: var(--line-strong); stroke-width: 1.25; transition: opacity .15s, stroke .15s; }
.rd-project circle, .rd-project > path { stroke: var(--surface); stroke-width: 2; fill: var(--idle); }
.rd-project.s-on_track circle, .rd-project.s-on_track > path { fill: var(--ok); }
.rd-project.s-late circle, .rd-project.s-late > path { fill: var(--warn); }
.rd-project.s-very_late circle, .rd-project.s-very_late > path { fill: var(--bad); }
.rd-project.s-complete circle, .rd-project.s-complete > path { fill: var(--done); }
.rd-project.is-loose circle, .rd-project.is-loose > path { fill: var(--surface); stroke: var(--warn); stroke-dasharray: 3 2; }
.rd-code { fill: var(--ink-2); font-size: 9.5px; text-anchor: middle; pointer-events: none; }
.rd-objective circle { fill: var(--surface); stroke: var(--idle); stroke-width: 2.5; }
.rd-objective.s-on_track circle { stroke: var(--ok); } .rd-objective.s-late circle { stroke: var(--warn); }
.rd-objective.s-very_late circle { stroke: var(--bad); } .rd-objective.s-complete circle { stroke: var(--done); }
.rd-objective.is-orphan circle { stroke-dasharray: 4 3; }
.rd-objective text { fill: var(--ink); font-size: 9px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.rd-plan circle { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.rd-plan.s-on_track circle { stroke: var(--ok); } .rd-plan.s-late circle { stroke: var(--warn); } .rd-plan.s-very_late circle { stroke: var(--bad); }
.rd-plan-num { fill: var(--ink); font-size: 22px; font-weight: 700; text-anchor: middle; }
.rd-plan-cap { fill: var(--ink-3); font-size: 10px; text-anchor: middle; }
.rd-svg .amap-node { transition: opacity .15s; }
.rd-svg.is-focus .amap-node:not(.is-on) { opacity: .22; }
.rd-svg.is-focus .rd-link { opacity: .12; }
.rd-svg.is-focus .rd-link.is-on { opacity: 1; stroke: var(--ink-2); stroke-width: 2; }
@media (max-width: 900px) { .amap { margin-inline: 0; } .amap-bar { position: static; } }

.msg-links { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); font-size: 13.5px; font-weight: 500; }
.msg-links a:hover { text-decoration: none; border-color: var(--ink); }

.hub-thinking { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; color: var(--ink-2); font-size: 14px; }
.hub-thinking[hidden] { display: none; }
.hub-thinking .chat-typing { padding: 0; }

.account-version { margin-top: 4px; padding: 8px 10px 2px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11.5px; text-align: start; }
.login-version { margin-inline-start: 12px; color: var(--ink-3); font-size: 12px; }

/* answers: a chart drawn from the same data, linked codes, where it came from, what Suhail did */
.msg-text a.ref { font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.msg-text a.ref:hover { text-decoration-color: currentColor; }
.viz { margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.viz-title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.viz-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.viz-row { display: grid; grid-template-columns: minmax(0, 11em) minmax(60px, 1fr) auto; align-items: center; gap: 4px 10px; font-size: var(--fs-sm); }
.viz-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-note { color: var(--ink-3); }
.viz-track { position: relative; block-size: 10px; border-radius: 999px; background: var(--sunk); }
.viz-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--accent); }
.viz-row.tone-ok .viz-fill { background: var(--ok); }
.viz-row.tone-warn .viz-fill { background: var(--warn); }
.viz-row.tone-bad .viz-fill { background: var(--bad); }
.viz-row.tone-idle .viz-fill { background: var(--idle); }
.viz-mark, .viz-key-mark { position: absolute; inset-block: -3px; inline-size: 2px; margin-inline-start: -1px; background: var(--ink); border-radius: 1px; }
.viz-key-mark { position: relative; display: inline-block; inset-block: 0; block-size: 10px; vertical-align: -1px; margin: 0 4px; }
.viz-value { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.viz-key { margin: 6px 0 0; }
@media (max-width: 520px) { .viz-row { grid-template-columns: minmax(0, 1fr) auto; } .viz-track { grid-column: 1 / -1; grid-row: 2; } }
.msg-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.msg-steps li { position: relative; padding-inline-start: 22px; }
.msg-steps li::before { content: ""; position: absolute; inset-inline-start: 4px; inset-block-start: .45em; inline-size: 9px; block-size: 9px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.msg-steps li.is-done::before { background: var(--ok); border-color: var(--ok); }
.msg-undo { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.msg.is-past .msg-undo .muted { display: none; }
.msg-source { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }

/* forecast: when a project finishes at its own pace */
.forecast-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 10px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.forecast-label { font-weight: 600; color: var(--ink); }
.forecast-note.is-slipping .forecast-label { color: var(--warn); }
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel:not([open]) > summary { border-bottom: 0; }

/* what if a project slips */
.whatif-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; }
.whatif-form .field { flex: 1 1 240px; margin: 0; }
.whatif-form input[type="range"] { inline-size: 100%; accent-color: var(--accent); }
.whatif-form output { font-weight: 700; color: var(--ink); margin-inline-start: 6px; }
.whatif-result { margin-top: 18px; }
.whatif-h { font-size: var(--fs); margin: 18px 0 8px; }
.whatif-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.whatif-list li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); border-inline-start: 3px solid var(--ok); }
.whatif-list li.is-falling { border-inline-start-color: var(--bad); }
.forecast-table td.num { white-space: nowrap; }
.msg-body > .msg-steps:first-child { margin-top: 0; }

/* strategy overview: the radar leads the page */
.ov-radar { margin: 0 0 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.ov-radar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ov-radar-head h2 { font-size: 22px; }
.ov-radar-head a { font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.ov-radar .amap-detail { text-align: center; margin: 4px auto 6px; max-width: 560px; }
.ov-radar .rd-svg { max-width: 640px; }

/* ---------- Open sections (Suhail identity) ----------
   Content sits on the page, separated by hairlines and space, the way a well-made detail page reads. Boxes stay for
   tables, forms and the one thing that floats; no side stripes, no big-number boxes, no dotted pills. */
.balance, .band-card, .follow, .ep, .attention, .summary-band, .quiet-card, .due-card {
  background: none; border: 0; border-radius: 0; box-shadow: none;
}
.balance { padding: 4px 0 30px; border-bottom: 1px solid var(--line); }
.summary-band { padding: 4px 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.band-card { padding: 6px 0 0; }
.follow { border-top: 1px solid var(--line); }
.follow-group { padding: 18px 0 12px; }
.follow-row + .follow-row { border-top: 1px solid var(--line); }
.ep { padding: 20px 0; border-top: 1px solid var(--line); }
.ep + .ep { margin-top: 0; }
.persp-cell { padding: 4px 0; background: none; border-radius: 0; }
.attention { border-top: 1px solid var(--line); }
.quiet-card { padding: 18px 0 0; border-top: 1px solid var(--line); }
.due-card { display: block; padding: 0 0 18px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.due-card b { display: inline; font: 700 15px/1.5 var(--font); color: var(--ink); margin-inline-end: 4px; }
.due-card.has-due b { color: var(--warn); }
.due-card:hover { text-decoration: underline; text-underline-offset: 4px; }
.pillar-chips { flex-direction: column; gap: 8px; }
.pillar-chips li { padding: 0; border: 0; border-radius: 0; background: none; font-size: 15px; gap: 10px; }
.pillar-chips i { width: 4px; height: 18px; border-radius: 2px; }
.table-wrap, .panel { border-radius: var(--radius-lg); }
.callout, .callout[class] { border-inline-start: 0; border-radius: var(--radius-lg); padding: 12px 16px; }
.chip { border-radius: 6px; }
.block-head h2 { font-size: 20px; font-weight: 600; }
.block { margin-top: 40px; }

/* Content takes its own direction: an Arabic answer, name or title reads right-to-left (and sits at its own start)
   even in the English interface, and English text reads left-to-right in the Arabic one. */
.msg-steps li, .viz-label, .ctx-item-name, .recent-title, .follow-title, .starter-text b, .stay-head b,
.stay-detail, .agenda-title, .hub-recent-title, .draft-card dd, .suggest a, .activity-what { unicode-bidi: plaintext; }
.msg-user .msg-body { unicode-bidi: plaintext; }
.shortcut span::first-letter { text-transform: uppercase; }

/* facts in one line, joined with the language's comma (not a decorative dot) */
.inline-facts > span + span::before { content: "، "; }
:lang(en) .inline-facts > span + span::before { content: ", "; }
/* a second action beside the first: space, not a separator */
.act-gap { margin-inline-start: 14px; }

/* ---------- Sections without boxes, everywhere ----------
   A section with a heading is page layout, not a card: no frame, no fill. Sections are told apart by space (48px above a
   heading, 12px below it), not by lines; lines stay where they carry structure (table header, rows of a list).
   Forms keep their frame: that is where people work. */
.panel:has(> .panel-head):not(.form-card):not(.add-panel) { background: none; border: 0; border-radius: 0; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) > .panel-head { padding: 0 0 12px; border-bottom: 0; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) > .panel-head h2 { font-size: 20px; font-weight: 600; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) > :is(.panel-body, .panel-empty) { padding-inline: 0; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) > .panel-body:first-of-type { padding-top: 4px; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) .rows > li { padding-inline: 0; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) table :is(th, td):first-child { padding-inline-start: 0; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) table :is(th, td):last-child { padding-inline-end: 0; }
.panel:has(> .panel-head):not(.form-card):not(.add-panel) table thead th { border-top: 0; }
* + .panel:has(> .panel-head):not(.form-card):not(.add-panel), .panel + .panel { margin-top: 48px; }
.cols > * > .panel:first-child, .cols-even > .panel, .stack > .panel:first-child { margin-top: 0; }
/* forms: one quiet frame, more room inside */
.form-card { border-radius: var(--radius-lg); padding: 24px; }
/* section edges: space instead of hairlines */
.balance, .summary-band { border-bottom: 0; }
.attention, .quiet-card, .follow { border-top: 0; }
.balance { padding-bottom: 8px; margin-bottom: 40px; }
.summary-band { margin-bottom: 40px; }
/* dates never break at their hyphens */
td.num, .meta .num, td .nowrap { white-space: nowrap; }
/* Numbers read left-to-right, but sit on the side of their column like the text around them: without this an Arabic
   table's figures hug the left edge while their headers sit on the right. */
[dir="rtl"] :is(td, th, dd, p, div).num { text-align: right; }
[dir="rtl"] .table :is(td, th).end.num { text-align: left; }
/* short lists of counts stay short: the count beside its label, not across the page */
.levels, .panel .facts[style*="1fr 1fr"] { max-width: 420px; }

/* ---------- Lists: open rows, not a boxed grid ----------
   A list is rows on the page: the name large enough to scan, one quiet line of facts under it, the status as a word.
   No frame around the table, no fill on hover; rows are told apart by room and one hairline. The first and last
   columns line up with the page title. */
.table-wrap, .table-wrap[class] { background: none; border: 0; border-radius: 0; }
.table th {
  font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 0 16px 12px; border-bottom: 1px solid var(--line);
}
.table td { padding: 20px 16px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 1px solid var(--line); }
.table :is(th, td):first-child { padding-inline-start: 0; }
.table :is(th, td):last-child { padding-inline-end: 0; }
.table tbody tr:hover { background: none; }
.table .title { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.table .title:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.table .meta { font-size: 14px; margin-top: 4px; }
.table td .st { font-size: 14px; }
@media (max-width: 860px) {
  .table td { padding: 16px 10px; }
  .table th { padding: 0 10px 10px; }
}
.table .col-name { min-width: 260px; }
.meta.num, .table .meta .num { white-space: nowrap; }
/* lists inside a section that has no heading of its own (KPIs board) are open too */
.panel:has(> .scroll-x > .table, > .table, > .table-wrap) { background: none; border: 0; border-radius: 0; }
.panel:has(> .scroll-x > .table, > .table) > .filters { padding-inline: 0; }
/* group heads inside a list: a heading line, not a grey band */
.group-head { padding: 28px 0 10px; background: none; border-bottom: 1px solid var(--line); }
.group-head h3 { font-size: 17px; font-weight: 600; }
.objective-row td { background: none; font-weight: 600; padding-top: 24px; }
/* "waiting for your decision": rows on the page, the whole title readable */
.needs-list { background: none; border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.need { padding: 16px 0; border-bottom: 1px solid var(--line); }
.need + .need { border-top: 0; }
.need-title { font-size: 15px; font-weight: 600; white-space: normal; overflow: visible; }
/* projects at medium widths: the next step folds away so the name keeps its room */
@media (max-width: 1280px) { .projects-table :is(th, td):nth-child(4) { display: none; } }
/* Long tables: the column names stay pinned while you scroll (only where the table fits, since a sideways-scrolling
   box can't pin vertically); after 12 rows the rest waits behind "Show all". */
.table-wrap.fits, .scroll-x.fits { overflow: visible; }
.table thead th { position: sticky; top: var(--topbar); z-index: 2; background: var(--paper); }
:is(.table-wrap, .scroll-x):not(.fits) > .table thead th { position: static; }
.table tr.is-more { display: none; }
.table.show-all tr.is-more { display: table-row; }
.table-more { margin-top: 16px; }
@media print { .table tr.is-more { display: table-row !important; } .table thead th { position: static; } }

