/* ScheduleRisk app layer on the Modernist design system (css/modernist.css): flat, zero radius,
   strong 2px rules, one red accent. Tokens come from modernist.css; this file adds the self-hosted
   font, a dark theme, the page layout and the app's own pieces. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/archivo-400.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/archivo-600.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/archivo-800.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* Chart series and the SVG helpers in HtmlReport (SCurve, Tornado) */
  --a: var(--color-text);       /* pre-mitigation */
  --b: var(--color-accent);     /* post-mitigation, the confidence line */
  --fg: var(--color-text);
  --line: color-mix(in srgb, var(--color-text) 14%, transparent);
  --card: var(--color-bg);
  --muted: var(--color-neutral-700);
  /* Gantt bars (GanttView): P6's default colours, used by that chart only. The rest of the app keeps the
     design system's ink and single accent; critical work shares the accent. */
  --g-actual: #2c5db0;
  --g-remaining: #3b8f45;
  --g-critical: var(--color-accent);
  /* Risk ratings on the matrix (register steps): red, amber, green with ink that reads on each */
  --rag-red: #c62828; --rag-red-ink: #ffffff;
  --rag-amber: #f2a900; --rag-amber-ink: #1a1918;
  --rag-green: #3f8f47; --rag-green-ink: #ffffff;
}

/* Dark theme. The design system ships light only; this keeps its structure and derives the dark
   ground from its own ramps (reversed, so "700 = secondary ink" still holds) with accent-500. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-bg: #1a1918;
    --color-surface: #242221;
    --color-text: #f3f2f2;
    --color-accent: #ff563c;
    --color-accent-2: #ef6853;
    --color-divider: color-mix(in srgb, #f3f2f2 34%, transparent);
    --color-neutral-100: #2d2b2b; --color-neutral-200: #444141; --color-neutral-300: #605d5d;
    --color-neutral-400: #7d7979; --color-neutral-500: #9b9797; --color-neutral-600: #bab6b6;
    --color-neutral-700: #d7d3d3; --color-neutral-800: #eae7e7; --color-neutral-900: #f8f4f4;
    --color-accent-100: #4d170e; --color-accent-200: #7c1405; --color-accent-300: #ae1800;
    --color-accent-400: #dd2b0f; --color-accent-500: #ff563c; --color-accent-600: #ff9783;
    --color-accent-700: #ffc4b8; --color-accent-800: #ffe0d9; --color-accent-900: #fff2ef;
    --color-accent-2-100: #471d16; --color-accent-2-200: #71261b; --color-accent-2-300: #9e3526;
    --color-accent-2-400: #c94b39; --color-accent-2-500: #ef6853; --color-accent-2-600: #ff9784;
    --color-accent-2-700: #ffc4b9; --color-accent-2-800: #ffe0da; --color-accent-2-900: #fff2ef;
    --shadow-sm: 0 0 0 1px color-mix(in srgb, #f3f2f2 10%, transparent);
    --shadow-md: 0 0 0 1px color-mix(in srgb, #f3f2f2 12%, transparent), 0 6px 18px rgba(0,0,0,.45);
    --shadow-lg: 0 0 0 1px color-mix(in srgb, #f3f2f2 14%, transparent), 0 16px 40px rgba(0,0,0,.55);
    --g-actual: #6d9df0;
    --g-remaining: #63bd71;
    --rag-red: #d9442f; --rag-amber: #e5a524; --rag-green: #4e9f58;
  }
}

body { font-variant-numeric: tabular-nums; }
input, select, textarea, button { font-family: inherit; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--color-accent); }
details summary { cursor: pointer; color: var(--color-neutral-700); font-size: 13px; }
ul.small, .small { font-size: 12.5px; }
.sub, .hint { font-size: 13px; color: var(--color-neutral-700); }
.hint { font-size: 12px; }
.strong { font-weight: 600; }
.dim { color: var(--color-neutral-700); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.mt { margin-top: var(--space-1); }
.kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-700); }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.lede { margin: 0; max-width: 46ch; color: var(--color-neutral-700); text-wrap: pretty; }
.body { margin: 0; max-width: 90ch; font-size: 14px; }
h1, h2, h4 { margin: 0; }

/* ---------------------------------------------------------------- frame */
.topnav { gap: 0; padding: 0 var(--space-6); align-items: stretch; flex-wrap: wrap; white-space: nowrap;
  position: sticky; top: 0; z-index: 5; background: var(--color-bg); }
.brandcell { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6) var(--space-4) 0; border-right: 2px solid var(--color-divider); }
.brandmark { width: 14px; height: 14px; background: var(--color-accent); flex: none; }
.topnav .nav-brand { margin: 0; }
/* On narrower screens the name stacks over two lines, so the bar keeps the project and Report button on one row. */
@media (max-width: 1100px) {
  .topnav .nav-brand { white-space: normal; max-width: 6.8em; line-height: 1.1; }
}
.projcell { display: flex; flex-direction: column; justify-content: center; padding: 0 var(--space-6); border-right: 2px solid var(--color-divider); min-width: 0; }
.projname { font-size: 14px; font-weight: 600; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; }
.navactions { display: flex; align-items: center; gap: var(--space-2); padding-left: var(--space-6); }
.navactions .btn { justify-content: flex-start; min-width: 120px; margin: var(--space-2) 0; }
.page { display: flex; flex-direction: column; min-width: 0; }

/* The risk workflow (design/workflow/steps.png): a column of numbered steps beside the page, Promote as an arrow
   between 03 and 04. It sticks under the top bar. Narrower, the descriptions go; on a phone it becomes a row. */
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.workflow { position: sticky; top: var(--nav-h, 0px); max-height: calc(100vh - var(--nav-h, 0px)); overflow: auto;
  border-right: 2px solid var(--color-divider); padding: var(--space-4) var(--space-3); }
.workflow ol { list-style: none; margin: 0; padding: 0; }
.workflow li + li { border-top: 1px solid var(--color-divider); }
.wf-step { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 56px minmax(0, 1fr);
  align-items: baseline; gap: var(--space-3); padding: var(--space-4) var(--space-3); }
.wf-n { font-size: 28px; font-weight: 800; line-height: 1; color: var(--color-accent-700); font-variant-numeric: tabular-nums; }
.wf-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wf-title { font-size: 17px; font-weight: 800; color: var(--color-text); }
.wf-desc { font-size: 13px; color: var(--color-neutral-700); white-space: normal; text-wrap: pretty; }
.wf-step:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.wf-step.on { background: var(--color-accent-100); box-shadow: inset 4px 0 0 var(--color-accent); }
.wf-step:disabled { opacity: .45; cursor: not-allowed; }
.wf-step:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
@media (max-width: 1400px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .wf-desc { display: none; }
  .wf-step { grid-template-columns: 36px minmax(0, 1fr); padding: var(--space-3) var(--space-2); }
  .wf-n { font-size: 18px; }
  .wf-title { font-size: 15px; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .workflow { position: static; max-height: none; border-right: 0; border-bottom: 2px solid var(--color-divider); padding: 0 var(--space-2); }
  .workflow ol { display: flex; overflow-x: auto; }
  .workflow li { flex: none; }
  .workflow li + li { border-top: 0; border-left: 1px solid var(--color-divider); }
  .wf-step { width: auto; white-space: nowrap; grid-template-columns: auto auto; gap: var(--space-2); }
  .wf-n { font-size: 13px; }
  .wf-title { font-size: 14px; }
}
.review-body { display: flex; flex-direction: column; gap: var(--space-3); }

.banner { display: flex; gap: var(--space-4); align-items: flex-start; justify-content: space-between; padding: var(--space-3) var(--space-6);
  background: var(--color-surface); border-left: 4px solid var(--color-text); font-size: 14px; }
.banner.error { border-left-color: var(--color-accent); background: var(--color-accent-100); color: var(--color-accent-800); }
.banner ul { margin: var(--space-2) 0 0; padding-left: 18px; }
.main-col > .banner { padding: var(--space-3) var(--space-4); }

/* ---------------------------------------------------------------- sections */
.rule-b { border-bottom: 2px solid var(--color-divider); }
.pad { padding: var(--space-6); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.headrow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.toolbar, .btn-row, .actions-end, .runfoot, .runbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.toolbar .input[type=search] { width: auto; min-width: 260px; }
.actions-end { justify-content: flex-end; }
.btn-wide { justify-content: flex-start; min-width: 220px; }
.btn { font-size: 14px; }
.btn-ghost.add { align-self: flex-start; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; }
.steps-list { margin: var(--space-3) 0 0; padding-left: 20px; color: var(--color-neutral-700); max-width: 80ch; }
.steps-list li { margin-bottom: var(--space-1); }

/* step 01 */
.hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.hero-text { grid-column: span 5; padding: var(--space-8) var(--space-6); border-right: 2px solid var(--color-divider); display: flex; flex-direction: column; gap: var(--space-3); }
.hero-drop { grid-column: span 7; padding: var(--space-6); }
.hero-drop.ready { display: flex; align-items: flex-end; }
.dropzone { position: relative; height: 100%; min-height: 180px; border: 2px dashed var(--color-divider); display: flex; flex-direction: column; justify-content: center;
  gap: var(--space-3); padding: var(--space-6); background: var(--color-surface); }
.dropzone:hover, .dropzone.over { border-color: var(--color-accent); }
.dropzone.over { background: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface)); }
.drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-title { font-size: 20px; font-weight: 800; }
.drop-actions { position: relative; z-index: 1; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { padding: var(--space-4) var(--space-6); border-right: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .v { font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.grid-wrap { height: 520px; overflow: auto; border-top: 2px solid var(--color-divider); }
.grid-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--color-bg); }
.grid-wrap .table th { border-bottom-width: 2px; }

/* step 01 landing: an engineering-drawing feel. A fine blueprint grid behind the hero, the site drawn in ink
   in elevation with its schedule under the ground line, then the three steps and a closing poster band. */
.blueprint {
  --bp-minor: color-mix(in srgb, var(--color-text) 5%, transparent);
  --bp-major: color-mix(in srgb, var(--color-text) 9%, transparent);
  background-color: var(--color-bg);
  background-image:
    linear-gradient(var(--bp-major) 1px, transparent 1px), linear-gradient(90deg, var(--bp-major) 1px, transparent 1px),
    linear-gradient(var(--bp-minor) 1px, transparent 1px), linear-gradient(90deg, var(--bp-minor) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}
.landing { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.landing-text { grid-column: span 5; padding: var(--space-8) var(--space-6); border-right: 2px solid var(--color-divider);
  display: flex; flex-direction: column; gap: var(--space-4); }
.landing-text h1 { font-size: clamp(34px, 4vw, 54px); line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
.landing-drop { grid-column: span 7; padding: var(--space-8) var(--space-6); display: flex; }
.landing-drop .dropzone { flex: 1; min-height: 220px; }
.landing-art { grid-column: 1 / -1; border-top: 2px solid var(--color-divider); padding: var(--space-4) 0 0; overflow: hidden; }
.drop-head { display: flex; align-items: center; gap: var(--space-4); }
.step-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step-card { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); border-right: 2px solid var(--color-divider); min-width: 0; }
.step-card:last-child { border-right: 0; }
.step-card .num { font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--color-accent-700); }
.step-card .body { color: var(--color-neutral-700); }
.card-art { background: var(--color-surface); padding: var(--space-3); }
.poster { background: var(--color-accent); color: var(--color-bg); padding: var(--space-8) var(--space-6);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3) var(--space-8); }
.poster p { margin: 0; }
.poster-text { font-family: var(--font-heading); font-weight: 800; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.05;
  letter-spacing: -0.02em; max-width: 20ch; text-wrap: balance; }
.poster-sub { font-size: 15px; max-width: 54ch; }
.file-strip { display: flex; align-items: center; gap: var(--space-4) var(--space-6); flex-wrap: wrap; padding: var(--space-4) var(--space-6); }
.fs-file { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }
.fs-name { font-family: var(--font-heading); font-weight: 800; font-size: 20px; overflow-wrap: anywhere; }
.file-strip .field { display: flex; flex-direction: column; gap: var(--space-1); }
.file-strip .field > label { margin: 0; font-size: 12px; }
.dropzone.slim { flex-direction: row; align-items: center; flex-wrap: wrap; height: auto; min-height: 0; padding: var(--space-3) var(--space-4); gap: var(--space-4); }
.dropzone.slim .drop-title { font-size: 15px; }

/* P6-style Gantt (GanttView.razor): an activity table that sticks on the left, bars on a two-tier timescale that
   sticks on top, WBS bands shaded by level. Only the rows in view are on the page (Virtualize, 26px rows). */
.gantt-tools { display: flex; align-items: center; gap: var(--space-2) var(--space-6); flex-wrap: wrap; }
.zoom, .tool-group { display: inline-flex; align-items: center; gap: var(--space-2); }
.zoom-btn { min-width: 36px; padding: 4px 10px; font-size: 16px; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: 12.5px; color: var(--color-neutral-700); }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 8px; }
.lg.actual { background: var(--g-actual); }
.lg.remaining { background: var(--g-remaining); }
.lg.critical { background: var(--g-critical); }
.lg.float { height: 2px; background: var(--color-text); }
.lg.ms { width: 8px; height: 8px; margin: 0 5px; background: var(--g-remaining); transform: rotate(45deg); }
.lg.summary { height: 4px; background: var(--color-text); }
.lg.dd { width: 0; height: 12px; margin: 0 8px; border-left: 2px dashed var(--color-accent-700); }
.gantt { --colw: 118px 230px 58px 58px 96px 96px 58px;
  max-height: 560px; overflow: auto; position: relative; border-top: 2px solid var(--color-divider); font-size: 12.5px; overscroll-behavior: contain; }
.gantt .g-head, .gantt .g-row { display: flex; width: max-content; }
.g-head { position: sticky; top: 0; z-index: 3; height: 46px; background: var(--color-bg); border-bottom: 2px solid var(--color-divider); }
.g-cols { position: sticky; left: 0; z-index: 2; flex: none; display: grid; grid-template-columns: var(--colw);
  background: var(--color-bg); border-right: 2px solid var(--color-divider); }
.g-cols > span { padding: 0 6px; align-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-cols .c-n { text-align: right; }
.g-cols .c-tf.neg { color: var(--color-accent-700); font-weight: 600; }
.g-head .g-cols { z-index: 4; }
.g-head .g-cols > span { align-self: end; padding-bottom: 5px; font-size: 11px; line-height: 1.2; letter-spacing: .06em; text-transform: uppercase;
  white-space: normal; text-overflow: clip; color: var(--color-neutral-700); }
.g-scale, .g-lane { position: relative; flex: none; width: var(--lane); }
.g-tier { position: relative; height: 22px; }
.g-tier span { position: absolute; top: 0; bottom: 0; padding: 4px 4px 0; overflow: hidden; white-space: nowrap;
  border-left: 1px solid color-mix(in srgb, var(--color-text) 22%, transparent); font-size: 11.5px; font-weight: 600; }
.g-tier.low span { font-weight: 400; color: var(--color-neutral-700); border-top: 1px solid color-mix(in srgb, var(--color-text) 14%, transparent); }
.g-row { height: 26px; cursor: default; border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); }
.g-row:hover, .g-row:hover .g-cols { background: color-mix(in srgb, var(--color-text) 5%, var(--color-bg)); }
.g-row:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.g-wbs { font-weight: 700; }
.g-wbs.d0, .g-wbs.d0 .g-cols { background: var(--color-neutral-300); }
.g-wbs.d1, .g-wbs.d1 .g-cols { background: var(--color-neutral-200); }
.g-wbs.d2, .g-wbs.d2 .g-cols, .g-wbs.d3, .g-wbs.d3 .g-cols { background: var(--color-neutral-100); }
.g-tog { all: unset; cursor: pointer; display: inline-block; width: 14px; margin-right: 2px; text-align: center; }
.g-tog:focus-visible { outline: 2px solid var(--color-accent); }
.g-bar { position: absolute; top: 8px; height: 10px; }
.g-bar.actual { background: var(--g-actual); }
.g-bar.remaining { background: var(--g-remaining); }
.g-bar.critical { background: var(--g-critical); }
.g-bar.float { top: 12px; height: 2px; background: var(--color-text); }
.g-bar.summary { top: 9px; height: 5px; background: var(--color-text); }
.g-bar.summary::before, .g-bar.summary::after { content: ""; position: absolute; top: 5px; border: 4px solid transparent; border-top: 5px solid var(--color-text); }
.g-bar.summary::before { left: -4px; }
.g-bar.summary::after { right: -4px; }
.g-ms { position: absolute; top: 8px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: var(--g-remaining); }
.g-ms.critical { background: var(--g-critical); }
.g-ms.actual { background: var(--g-actual); }
.g-dd { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--color-accent-700); pointer-events: none; }
.g-tip { display: none; position: absolute; top: 3px; z-index: 1; padding: 2px 8px; white-space: nowrap; pointer-events: none;
  font-size: 12px; font-weight: 400; background: var(--color-text); color: var(--color-bg); }
.g-tip.flip { transform: translateX(-100%); }
.g-row:hover .g-tip, .g-row:focus-within .g-tip { display: block; }
/* searchable activity picker (ActivityPicker): chips in a field, a floating list grouped by WBS like the Gantt */
.pk { flex: 1 1 260px; min-width: 0; }
.pk-field { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 32px; padding: 3px 6px; cursor: text; }
.pk-field:focus-within { border-color: var(--color-accent); }
.pk-input { flex: 1 1 120px; min-width: 0; padding: 2px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: inherit; }
.pk-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 1px 2px 1px 6px; font-size: 12.5px; background: var(--color-neutral-200); }
.pk-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-neutral-700); }
.pk-chip.unknown { background: var(--color-accent-100); color: var(--color-accent-800); }
.pk-x { all: unset; cursor: pointer; padding: 0 4px; line-height: 1.4; }
.pk-x:hover { color: var(--color-accent-700); }
.pk-x:focus-visible { outline: 2px solid var(--color-accent); }
.pk-panel { position: fixed; z-index: 45; display: flex; flex-direction: column; background: var(--color-bg);
  border: 2px solid var(--color-text); box-shadow: var(--shadow-md); }
.pk-list { flex: 1; min-height: 60px; overflow: auto; overscroll-behavior: contain; }
.pk-band, .pk-opt { display: flex; align-items: center; gap: var(--space-2); height: 30px; padding-right: 10px; overflow: hidden; white-space: nowrap; font-size: 13px; }
.pk-band { font-weight: 700; background: var(--color-neutral-100); }
.pk-band.d0 { background: var(--color-neutral-300); }
.pk-band.d1 { background: var(--color-neutral-200); }
.pk-opt { cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent); }
.pk-opt:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.pk-opt.active { background: var(--color-accent-100); box-shadow: inset 3px 0 0 var(--color-accent); }
.pk-box { position: relative; flex: none; width: 14px; height: 14px; border: 2px solid var(--color-text); }
.pk-opt.sel .pk-box { background: var(--color-accent); border-color: var(--color-accent); }
.pk-opt.sel .pk-box::after { content: ""; position: absolute; left: 3px; top: 0; width: 4px; height: 8px;
  border: solid var(--color-bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pk-id { flex: none; min-width: 64px; font-weight: 700; }
.pk-name { overflow: hidden; text-overflow: ellipsis; }
.pk-tag { margin-left: auto; padding-left: var(--space-2); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-neutral-700); }
.pk-empty { padding: var(--space-3); font-size: 13px; color: var(--color-neutral-700); }
.pk-foot { padding: 6px 10px; font-size: 12px; color: var(--color-neutral-700); border-top: 1px solid var(--color-divider); }

/* right-click menu on the Gantt (GanttView): flat, a 2px ink rule, the accent for the item in hand */
.ctx-backdrop { position: fixed; inset: 0; z-index: 40; }
.ctx-menu { position: fixed; z-index: 41; min-width: 200px; display: flex; flex-direction: column; padding: var(--space-1) 0;
  background: var(--color-bg); border: 2px solid var(--color-text); box-shadow: var(--shadow-md); font-size: 14px; }
.ctx-menu:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.ctx-menu [role=menuitem] { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); cursor: pointer; }
.ctx-menu [role=menuitem]:hover:not(:disabled), .ctx-menu [role=menuitem]:focus-visible { background: var(--color-accent-100); color: var(--color-accent-800); }
.ctx-menu [role=menuitem]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.ctx-menu [role=menuitem]:disabled { opacity: .45; cursor: not-allowed; }
.ctx-glyph { width: 12px; text-align: center; }
.ctx-note { max-width: 240px; padding: var(--space-1) var(--space-4) var(--space-2); font-size: 12px; color: var(--color-neutral-700); }
@media (max-width: 1100px) {
  .gantt { --colw: 110px 200px 88px 88px 52px; }
  .gantt .c-dur { display: none; }
}
@media (max-width: 700px) {
  .gantt { --colw: 88px 124px; max-height: 460px; }
  .gantt .c-d, .gantt .c-tf { display: none; }
}

/* line art (LandingArt.razor, the loading screen) */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art-hero { aspect-ratio: 5 / 1; min-height: 150px; }
.art-doc { width: 36px; height: 44px; flex: none; }
.art .ln { fill: none; stroke: var(--color-text); stroke-width: 1.4; stroke-linejoin: miter; vector-effect: non-scaling-stroke; }
.art .thin, .art .ln .thin { stroke: var(--color-neutral-600); stroke-width: 1; }
.art .soft { fill: color-mix(in srgb, var(--color-text) 8%, transparent); }
.art .soft-strong { fill: var(--color-neutral-400); }
.art .ground { fill: none; stroke: var(--color-text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.art .hatch { fill: none; stroke: var(--color-neutral-500); stroke-width: 1; vector-effect: non-scaling-stroke; }
.art .link { fill: none; stroke: var(--color-neutral-600); stroke-width: 1; vector-effect: non-scaling-stroke; }
.art .dd { fill: none; stroke: var(--color-text); stroke-width: 1.2; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.art .curve { fill: none; stroke: var(--color-text); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.art .p-line { fill: none; stroke: var(--color-accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.art .accent, .art .bar.crit { fill: var(--color-accent); }
.art .sev-mid { fill: var(--color-neutral-600); }
.art .sev-low { fill: var(--color-neutral-300); }
.art .bar.done { fill: var(--color-text); }
.art .bar.rem { fill: var(--color-neutral-500); }
.art text { fill: var(--color-neutral-700); font-size: 9px; font-weight: 600; letter-spacing: .1em; }
.art .doc-t { fill: var(--color-bg); font-size: 8.5px; font-weight: 800; letter-spacing: .06em; }
.art .bar { transform-box: fill-box; transform-origin: 0 50%; animation: art-grow .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes art-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* tables (on top of the design system's .table) */
.wrap { overflow-x: auto; }
.table { font-size: 13.5px; }
.table th { white-space: nowrap; }
.table td { vertical-align: middle; }
.table .n { text-align: right; white-space: nowrap; }
.table tr.crit td:first-child { box-shadow: inset 3px 0 0 var(--color-accent); }
.table.conf tbody tr { cursor: pointer; }
.table.conf tbody tr.sel { background: var(--color-accent-100); font-weight: 800; }
.table.conf tbody tr:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* step 02 */
.split { display: flex; flex-wrap: wrap; flex: 1; }
.side { flex: 1 1 280px; max-width: 340px; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
.side .field { display: flex; flex-direction: column; gap: var(--space-2); }
.side .field > label { margin: 0; }
.side .btn-row .input { flex: 1; min-width: 0; width: auto; }
.side-foot { margin-top: auto; border-top: 2px solid var(--color-divider); padding-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2);
  position: sticky; bottom: calc(-1 * var(--space-6)); margin-bottom: calc(-1 * var(--space-6)); padding-bottom: var(--space-6); background: var(--color-bg); }
.seg-fill { display: flex; }
.seg-fill .seg-opt { flex: 1; }
.conv { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 13px; }
.conv .input { width: 76px; }
.main-col { flex: 3 1 600px; min-width: 0; padding: var(--space-6); border-left: 2px solid var(--color-divider); margin-left: -2px; display: flex; flex-direction: column; gap: var(--space-8); }
.block { display: flex; flex-direction: column; gap: var(--space-3); }
.block > .sub { margin: 0; max-width: 90ch; }
.input.sm { min-height: 30px; padding: 4px 8px; font-size: 13.5px; }
.input[type=number] { text-align: right; }
.filter { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.filter .input { width: auto; }
.filter .input[type=number] { width: 72px; }
.filter .input.ml { font-weight: 600; }
.filter select.input { max-width: 160px; }
.filter input.input:not([type=number]) { min-width: 150px; }
.filter textarea.input { width: 100%; min-height: 56px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.input.w-id { width: 76px; }
.input.w-text { min-width: 150px; }
.unit { display: inline-flex; align-items: center; gap: 4px; }
.unit .input { width: 64px; }
td > .input[type=number] { width: 80px; }
td > select.input { width: auto; }
.btn-x { padding: var(--space-1) var(--space-2); font-size: 15px; }
@media (min-width: 901px) {
  /* The side column (with Run simulation) stays in view while the model tables scroll. */
  .side { position: sticky; top: var(--nav-h, 62px); align-self: flex-start; max-height: calc(100vh - var(--nav-h, 62px)); overflow-y: auto; }
}
.rangecol { width: 22%; min-width: 140px; }
.range { position: relative; height: 12px; background: var(--color-neutral-200); }
.range-fill { position: absolute; top: 0; bottom: 0; background: var(--color-accent-300); }
.range-ml { position: absolute; top: -3px; width: 2px; height: 18px; margin-left: -1px; background: var(--color-text); }

/* step 03 */
.runbar .progress { flex: 1; min-width: 200px; }
.progress { height: 8px; background: var(--color-neutral-200); }
.progress > div { height: 100%; background: var(--color-accent); transition: width .15s; }
/* The Results summary: two columns of blocks, each headed like a table (small capitals over a 2px rule). */
.sum-head { display: flex; align-items: baseline; gap: var(--space-2) var(--space-4); flex-wrap: wrap; padding-bottom: 0; }
.summary .two-col > div { gap: var(--space-6); }
.sum-cap { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 2px solid var(--color-divider);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.sum-count { margin-left: var(--space-1); color: var(--color-text); font-weight: 800; letter-spacing: 0; }
.sum-none, .sum-more { margin: var(--space-2) 0 0; }
.sum-foot { margin: 0; padding-top: 0; max-width: 120ch; }
/* What the results mean: label (small capitals) over the text, in newspaper columns on a wide screen. */
.notes-head { display: flex; align-items: baseline; gap: var(--space-2) var(--space-4); flex-wrap: wrap; padding-bottom: var(--space-2); }
.notes-panel > dl.notes { padding: 0 var(--space-6); }
dl.notes { margin: 0; columns: 2 420px; column-gap: var(--space-8); }
dl.notes .note { break-inside: avoid; padding: var(--space-3) 0; border-top: 1px solid var(--color-divider); }
dl.notes dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  color: color-mix(in srgb, var(--color-text) 60%, transparent); }
dl.notes dd { margin: var(--space-1) 0 0; max-width: 72ch; line-height: 1.5; }
dl.notes .note.sel { background: var(--color-accent-100); box-shadow: -8px 0 0 var(--color-accent-100), 8px 0 0 var(--color-accent-100); }
.notes-panel details.terms { padding-top: var(--space-3); }
.notes-panel details.terms > summary { font-weight: 600; }
.notes-panel details.terms[open] > summary { margin-bottom: var(--space-2); }
.notes-panel details.terms dd { font-size: 13px; }
.nw { white-space: nowrap; }
.stat-table tbody tr.sel { background: var(--color-accent-100); }
.stat-table tbody tr.sel td { font-weight: 700; color: var(--color-text); }
.chart-row { display: flex; flex-wrap: wrap; }
.chart-col { flex: 2 1 520px; padding: var(--space-6); border-right: 2px solid var(--color-divider); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.conf-col { flex: 1 1 300px; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.wrap-row { align-items: flex-end; }
.chart-controls { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.slider { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); font-size: 13px; }
.legend > span { display: inline-flex; align-items: center; }
.key-line { display: inline-block; width: 16px; height: 2px; margin-right: 8px; }
.key-box { display: inline-block; width: 10px; height: 10px; background: var(--color-neutral-300); }
.key-box.in { background: var(--color-accent); margin-right: 2px; }
.key-box + .key-box { margin-right: 8px; }
.key-dash { display: inline-block; width: 0; height: 14px; border-left: 2px dashed var(--color-text); opacity: .6; margin: 0 8px 0 4px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.two-col > div { padding: var(--space-6); }
.two-col > div:first-child { border-right: 2px solid var(--color-divider); }
.barlist { display: flex; flex-direction: column; }
.barlist.narrow { max-width: 900px; }
.barrow { display: grid; grid-template-columns: 48px minmax(90px, 200px) minmax(0, 1fr) 52px; gap: var(--space-3); align-items: center;
  font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--color-divider); }
.barrow:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.barrow .id { color: var(--color-neutral-700); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .val { text-align: right; font-weight: 600; }
.track { height: 14px; background: var(--color-neutral-200); }
.fill { height: 100%; background: var(--color-neutral-700); }
.fill.top { background: var(--color-accent); }
.fill.ink { background: var(--color-text); }
.stat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: var(--space-6) var(--space-8); align-items: start; }
.stat-groups > .wrap { min-width: 0; overflow-x: auto; }
.stat-table td:first-child { color: var(--color-neutral-700); }
.stat-table td.shared { text-align: center; }
.runfoot { border-top: 0; }

/* dialogs and overlays */
.dialog-backdrop { z-index: 30; }
.dialog .field > label { margin-bottom: var(--space-2); }
.dialog-note { background: var(--color-bg); padding: var(--space-3); font-size: 13px; }
/* the report formats: the design system's radio dot, one format per row, the chosen one marked in red at its edge */
.fmt-list { border: 1px solid var(--color-divider); display: flex; flex-direction: column; min-width: 0; }
.fmt-opt { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: start; gap: 10px; padding: 10px 12px; }
.fmt-opt + .fmt-opt { border-top: 1px solid var(--color-divider); }
.fmt-opt .dot { margin-top: 2px; }
.fmt-opt:has(input:checked) { background: var(--color-accent-100); box-shadow: inset 3px 0 0 var(--color-accent); }
.fmt-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.fmt-text b { font-weight: 800; }
.fmt-ext { margin-left: 4px; font-size: 12px; color: var(--color-neutral-700); }
.fmt-note { display: block; margin-top: 2px; font-size: 13px; color: var(--color-neutral-700); }
.busy { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20;
  background: color-mix(in srgb, var(--color-neutral-900) 30%, transparent); }
.busy .dialog { border-top: 6px solid var(--color-accent); }

/* ---------------------------------------------------------------- charts */
svg text { fill: var(--color-neutral-700); font-size: 11px; font-family: var(--font-body); }
.scurve { position: relative; }
.scurve svg { display: block; cursor: crosshair; touch-action: pan-y; }
.scurve svg:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.scurve rect.bar { fill: var(--color-neutral-300); opacity: .45; }
.scurve rect.bar.in { fill: var(--color-accent); opacity: .3; }
.scurve.hist rect.bar { opacity: 1; }
.scurve.hist rect.bar.in { opacity: 1; }
.scurve rect.bar.on { opacity: .75; }
.scurve.hist rect.bar.on { fill: var(--color-neutral-500); }
.scurve.hist rect.bar.in.on { fill: var(--color-accent-600); }
.scurve.hist .scurve-dot { display: none; }
.scurve text.dlabel, .scurve text.plabel, .scurve text.slabel, .scurve text.mlabel { paint-order: stroke; stroke: var(--color-bg); stroke-width: 4px; stroke-linejoin: round; }
.scurve text.dlabel, .scurve text.mlabel { fill: var(--color-text); font-weight: 600; }
.scurve text.plabel { fill: var(--color-accent-700); font-weight: 800; }
.scurve text.slabel { fill: var(--color-text); font-weight: 600; font-size: 12px; }
.scurve-x { stroke: var(--color-text); stroke-width: 1; opacity: .5; }
.scurve-dot { stroke: var(--color-bg); stroke-width: 2; }
.scurve-tip { position: absolute; z-index: 2; pointer-events: none; background: var(--color-bg); color: var(--color-text);
  border: 1px solid var(--color-divider); border-top: 3px solid var(--color-text); box-shadow: var(--shadow-md);
  padding: 8px 12px; font-size: 12.5px; line-height: 1.5; white-space: nowrap; }
.scurve-tip .tip-h { margin-bottom: 3px; }
.scurve-tip .tip-h b { font-weight: 800; }
.scurve-tip .tip-r b { display: inline-block; min-width: 3.3em; margin-right: 6px; font-size: 14px; font-weight: 800; }
.scurve-tip .tip-r i { display: inline-block; width: 12px; height: 2px; margin-right: 8px; vertical-align: middle; }
.scurve-tip .tip-r span, .scurve-tip .tip-n { color: var(--color-neutral-700); }
.scurve-tip .tip-n { margin-top: 3px; }

/* ---------------------------------------------------------------- boot and errors */
.boot { max-width: 520px; margin: 18vh auto 0; padding: 0 var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.boot-title { font-family: var(--font-heading); font-weight: 800; font-size: 32px; display: flex; align-items: center; gap: var(--space-3); }
/* a small schedule that keeps drawing itself while the engine downloads */
.boot-gantt { width: 240px; height: 64px; margin: var(--space-2) 0; }
.boot-gantt rect { fill: var(--color-neutral-500); transform-box: fill-box; transform-origin: 0 50%;
  animation: boot-bar 2.4s cubic-bezier(.2, .7, .2, 1) infinite both; animation-delay: var(--d, 0ms); }
.boot-gantt rect.crit { fill: var(--color-accent); }
.boot-gantt path { fill: none; stroke: var(--color-neutral-600); stroke-width: 1; }
@keyframes boot-bar { 0% { transform: scaleX(0); } 45%, 100% { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .art .bar, .boot-gantt rect { animation: none; }
}
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: var(--space-3) var(--space-6); z-index: 40;
  background: var(--color-accent-100); color: var(--color-accent-800); border-top: 2px solid var(--color-accent); }
#blazor-error-ui .reload { margin-left: var(--space-2); }

/* ---------------------------------------------------------------- small screens and touch */
@media (max-width: 900px) {
  .hero-text, .hero-drop { grid-column: 1 / -1; }
  .hero-text { border-right: 0; border-bottom: 2px solid var(--color-divider); padding: var(--space-6); }
  .landing-text, .landing-drop { grid-column: 1 / -1; }
  .landing-text { border-right: 0; padding-bottom: 0; }
  .landing-drop .dropzone { min-height: 0; }
  .step-cards { grid-template-columns: minmax(0, 1fr); }
  .step-card { border-right: 0; border-bottom: 2px solid var(--color-divider); }
  .step-card:last-child { border-bottom: 0; }
  .side { max-width: none; border-bottom: 2px solid var(--color-divider); }
  .main-col { border-left: 0; margin-left: 0; }
  .chart-col { border-right: 0; border-bottom: 2px solid var(--color-divider); }
  .two-col > div:first-child { border-right: 0; border-bottom: 2px solid var(--color-divider); }
}
@media (max-width: 640px) {
  .topnav { padding: 0 var(--space-4); }
  .brandcell { padding-right: var(--space-4); }
  .topnav .nav-brand { font-size: 16px; }
  .projcell { padding: 0 var(--space-4); border-right: 0; flex: 1; }
  .navactions { padding-left: var(--space-2); }
  .navactions .btn { min-width: 0; }
  .pad, .main-col, .side, .chart-col, .conf-col, .two-col > div, .hero-drop { padding: var(--space-4); }
  .landing-text, .landing-drop, .step-card, .poster, .file-strip { padding: var(--space-4); }
  .landing-text { padding-top: var(--space-6); padding-bottom: 0; }
  .dropzone.slim { flex: 1 1 100%; }
  .barrow { grid-template-columns: 52px minmax(0, 1fr) minmax(48px, 30%) 44px; gap: var(--space-2); }
  .notes-head { padding-bottom: var(--space-2); }
  .notes-panel > dl.notes { padding: 0 var(--space-4); }
  .grid-wrap { height: 420px; }
  .toolbar .input[type=search] { min-width: 0; width: 100%; }
}
@media (pointer: coarse) {
  .btn, .step, .input, .seg-opt { min-height: 40px; }
  .check input { width: 20px; height: 20px; }
  .table td, .table th { padding: 9px 10px; }
}

/* ---------------------------------------------------------------- step 01 Setup: the risk matrix */
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.matrix th { font-weight: 600; text-align: center; padding: var(--space-2); background: var(--color-surface); vertical-align: bottom; min-width: 96px; }
.matrix th.corner { text-align: left; background: none; min-width: 150px; color: var(--color-neutral-700); font-weight: 400; }
.matrix th.prob { text-align: left; vertical-align: middle; }
.matrix .lvl { display: block; font-size: 18px; font-weight: 800; }
.matrix .rng { display: block; font-weight: 400; color: var(--color-neutral-700); font-size: 12px; }
.matrix td { padding: 0; }
.cell { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px;
  cursor: pointer; font-weight: 800; font-size: 14px; }
.cell:hover { filter: brightness(1.08); }
.cell:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
/* After .cell, whose "all: unset" would otherwise clear the rating colour */
.rag-red { background: var(--rag-red); color: var(--rag-red-ink); }
.rag-amber { background: var(--rag-amber); color: var(--rag-amber-ink); }
.rag-green { background: var(--rag-green); color: var(--rag-green-ink); }
.rag-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }
.rag-card { border: 1px solid var(--color-divider); display: flex; flex-direction: column; }
.rag-card .rag-head { padding: var(--space-2) var(--space-3); font-weight: 800; }
.rag-card .rag-body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.rag-head .input { background: transparent; color: inherit; border-color: currentColor; font-weight: 800; }
.side .btn-row select.input { flex: 1 1 7em; }
.rag-card textarea.input { min-height: 84px; font-size: 13px; }
.area { border: 1px solid var(--color-divider); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.area-head { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.area-head .field { display: flex; flex-direction: column; gap: 4px; }
.area-head .field > label { margin: 0; font-size: 12px; color: var(--color-neutral-700); }
.table textarea.input, .table input.input.w-wide { width: 100%; min-width: 220px; }
.table textarea.input { min-height: 38px; font-size: 13px; resize: vertical; }
.input.w-pct { width: 84px; }
.input.w-unit { width: 30ch; }
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: 13px; }
.issues li { padding: var(--space-2) var(--space-3); border-left: 4px solid var(--rag-amber); background: var(--color-surface); }
.issues li.err { border-left-color: var(--color-accent); background: var(--color-accent-100); color: var(--color-accent-800); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-edit { display: inline-flex; align-items: center; border: 1px solid var(--color-divider); }
.chip-edit .input { border: 0; min-width: 0; width: 15ch; }

/* ---------------------------------------------------------------- step 02 Identify: proposing and approving risks */
.btn-sm { font-size: 13px; min-height: 30px; padding: 4px 10px; }
.side form .field { display: flex; flex-direction: column; gap: var(--space-2); }
.side form .field > label { margin: 0; }
.side form .btn-row { align-items: flex-end; flex-wrap: nowrap; }
.side form .btn-row .field.grow { flex: 1; min-width: 0; }
.side textarea.input { resize: vertical; font-size: 14px; }
.statement { margin: 0; padding: var(--space-3); background: var(--color-surface); border-left: 3px solid var(--color-text); font-size: 13.5px; text-wrap: pretty; }
.empty { margin: 0; padding: var(--space-6); border: 1px dashed var(--color-divider); color: var(--color-neutral-700); }
.register td { vertical-align: top; }
.register .risk-cell { display: flex; flex-direction: column; gap: 2px; min-width: 260px; max-width: 70ch; }
.register tr.open > td { background: var(--color-surface); }
.register .edit-row > td { background: var(--color-surface); padding: var(--space-4); border-top: 0; }
.register .row-actions { display: flex; justify-content: flex-end; gap: var(--space-1); }
.toolbar select.input { width: auto; }
label .hint { margin-left: 6px; font-weight: 400; }
.edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.edit-grid .field { display: flex; flex-direction: column; gap: 4px; }
.edit-grid .field > label { margin: 0; font-size: 12px; color: var(--color-neutral-700); }
.edit-grid .field.wide { grid-column: 1 / -1; }
.edit-grid textarea.input { resize: vertical; }
.edit-row .issues { margin-bottom: var(--space-3); }
.status { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 600; border: 1px solid var(--color-divider); white-space: nowrap; }
.status-proposed { border-style: dashed; }
.status-approved { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.status-rejected, .status-closed { color: var(--color-neutral-700); text-decoration: line-through; text-decoration-thickness: 1px; }
.status-closed { text-decoration: none; }
@media (max-width: 800px) { .edit-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- step 03 Assess: the heat map and each risk's assessments */
.heatmap-wrap { overflow-x: auto; }
.heatmap { display: block; max-width: 100%; height: auto; font-family: inherit; }
.heatmap text { fill: var(--color-text); }
.hm-axis { font-size: 12px; fill: var(--color-neutral-700) !important; }
.hm-col { font-size: 18px; font-weight: 800; }
.hm-col-name { font-size: 12px; font-weight: 600; }
.hm-row { font-size: 13px; font-weight: 600; }
.hm-row-rng { font-size: 12px; fill: var(--color-neutral-700) !important; }
.hm-cell { cursor: pointer; outline: none; }
.hm-cell rect { stroke: transparent; stroke-width: 3; }
.hm-cell.rag-red rect { fill: var(--rag-red); }
.hm-cell.rag-amber rect { fill: var(--rag-amber); }
.hm-cell.rag-green rect { fill: var(--rag-green); }
.hm-cell.rag-red text { fill: var(--rag-red-ink); }
.hm-cell.rag-amber text { fill: var(--rag-amber-ink); }
.hm-cell.rag-green text { fill: var(--rag-green-ink); }
.hm-cell:not(.has) rect { opacity: .55; }
.hm-cell:hover rect { opacity: 1; }
.hm-cell.on rect, .hm-cell:focus-visible rect { stroke: var(--color-text); opacity: 1; }
.hm-name { font-size: 11px; font-weight: 600; opacity: .85; }
.hm-count { font-size: 22px; font-weight: 800; }
.hm-ids { font-size: 10.5px; font-weight: 600; }
.hm-path { stroke: var(--color-text); stroke-width: 3; }
.hm-arrowhead { fill: var(--color-text); }
.hm-marker circle { fill: var(--color-bg); stroke: var(--color-text); stroke-width: 2.5; }
.hm-marker text { font-size: 14px; font-weight: 800; fill: var(--color-text); }
.chip-rating { display: inline-block; padding: 1px 7px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-rating.none { border: 1px dashed var(--color-divider); color: var(--color-neutral-700); font-weight: 400; }
.risk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--color-divider); max-height: 50vh; overflow-y: auto; }
.risk-list li { border-bottom: 1px solid var(--color-divider); }
.risk-pick { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2);
  align-items: center; padding: var(--space-2) var(--space-2); font-size: 13.5px; }
.risk-pick .rp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-pick:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.risk-pick.on { background: var(--color-accent-100); box-shadow: inset 3px 0 0 var(--color-accent); }
.risk-pick:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.table.assess th { vertical-align: bottom; }
.table.assess td { vertical-align: top; min-width: 200px; }
.table.assess .rowhead { text-align: left; font-weight: 600; white-space: nowrap; vertical-align: top; padding-top: 12px; }
.table.assess select.input { width: 100%; }
.table.assess tr.result td { padding-top: var(--space-3); }
.pt-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 2px solid var(--color-text); border-radius: 50%; font-weight: 800; font-size: 12px; margin-right: 4px; }
.band-text { display: block; margin-top: 4px; font-size: 12px; color: var(--color-neutral-700); text-wrap: pretty; }
.sub-head { margin-top: var(--space-2); }
.table tr.overdue td { background: color-mix(in srgb, var(--color-accent) 7%, transparent); }

/* ---------------------------------------------------------------- Promote: register risks into the model */
.big { font-size: 22px; font-weight: 800; }
.hint.block, .block-hint { display: block; margin-top: 4px; }
.table.promote td { vertical-align: top; }
.tri { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.tri .input.w-pct { width: 70px; }
.input.set { border-color: var(--color-accent); box-shadow: inset 3px 0 0 var(--color-accent); }
.picker-cell { min-width: 260px; }
ul.plain { margin: 0; padding-left: 18px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.table.promote td:first-child { min-width: 170px; }

/* ---------------------------------------------------------------- 04 Schedule check: P6 Check Schedule and DCMA 14-Point */
.scorecard { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }
.sc-card { border: 1px solid var(--color-divider); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.sc-nums { display: flex; gap: var(--space-4); font-size: 13px; color: var(--color-neutral-700); flex-wrap: wrap; }
.sc-n { font-size: 26px; font-weight: 800; color: var(--color-text); margin-right: 4px; }
.sc-n.hc-pass-t { color: var(--rag-green); }
.sc-n.hc-fail-t { color: var(--color-accent); }
.sc-bar { display: flex; gap: 2px; height: 10px; }
.sc-bar > span { flex: 1; }
.sc-bar .hc-pass { background: var(--rag-green); }
.sc-bar .hc-fail { background: var(--color-accent); }
.sc-bar .hc-na { background: var(--color-neutral-300); }
.hc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
@media (max-width: 1500px) { .hc-cols { grid-template-columns: minmax(0, 1fr); } }
.table.hc td { vertical-align: top; }
.table.hc tr.hc-tab th { background: var(--color-surface); text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding-top: var(--space-3); }
.hc-status { display: inline-block; padding: 1px 8px; font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.hc-status.hc-pass { color: var(--rag-green); border-color: currentColor; }
.hc-status.hc-fail { background: var(--color-accent); color: var(--color-bg); }
.hc-status.hc-na { color: var(--color-neutral-700); border-color: var(--color-divider); border-style: dashed; }
.hc-toggle { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; }
.hc-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.hc-toggle .caret { font-size: 11px; color: var(--color-neutral-700); width: 10px; }
.hc-note { font-style: italic; }
.table.hc tr.open > td { background: var(--color-surface); }
.table.hc tr.hc-flags > td { background: var(--color-surface); padding: 0 var(--space-3) var(--space-3); }
.hc-flag-wrap { max-height: 360px; overflow: auto; background: var(--color-bg); }
.linkish { all: unset; cursor: pointer; font-weight: 700; color: var(--color-accent-700); text-decoration: underline; text-underline-offset: 2px; }
.linkish:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
#activities { scroll-margin-top: calc(var(--nav-h, 62px) + 8px); }
.move-banner { border-left-color: var(--color-accent); align-items: center; }
.table tr.typed td { background: color-mix(in srgb, var(--color-accent) 5%, transparent); }
label.check.block { display: flex; margin-top: 4px; }

/* ---------------------------------------------------------------- 06 Results: tornado and cost-benefit */
/* The chart is drawn 960 wide and scaled to the column: sizes in its own units, over the global svg text rule */
.tornado svg text { fill: var(--fg); font-family: inherit; font-size: 20px; }
.table td.neg { color: var(--color-accent); }
