/* Portal shell CSS — sidebar chrome + content components for the C1 sidebar shell
   (card r1shl005/r1apv006, doc 60 §2). Shared by every portal mode page (index / approved-plans /
   plan-v-actual) via <link>, so the sidebar + content styling has ONE source of truth. The shared
   design-token :root blocks (repp-shell) stay INLINE per page (synced + drift-guarded by
   tools/shell-tokens.js); only these portal-specific sidebar/content styles live here. */
    /* Extended C1 tokens (doc 60 §1) — sidebar chrome + semantic surfaces, live on this surface.
       FULL-LIGHT (Chairman directive, card refine1-ux-fastfollow): in LIGHT mode the sidebar is a LIGHT
       cool surface with dark text (same steel-blue accent family); the DARK blocks below keep the
       dark-slate rail unchanged. Verified by tools/c1-tokens.test.js (LIGHT_C1 sidebar contrast). */
    :root{
      /* W6-08 — declare the color-scheme per theme so native controls (the <select> button/arrow region
         and the options popup, scrollbars) render in the matching UA scheme. W5-08 themed the select's
         background from tokens, but with color-scheme left at the default ("normal" = light) Chrome still
         painted the select's button area and popup as a bright-white light widget in dark mode. Light is
         set here on the base :root; the two dark blocks below flip it. A [data-theme="light"] override
         while the OS is dark keeps this light value (the dark @media rule excludes it). */
      color-scheme:light;
      --sidebar:#eef1f6;--sidebar-active:#dbe6f4;--sidebar-ink:#1c2430;--sidebar-muted:#5a6473;
      --sidebar-line:#d0d7e1;--sidebar-active-ink:#14243a;--sidebar-accent:#3d6fa8;
      --success:#2f8a52;--success-bg:#e7f3ec;--success-line:#bfe0cc;--success-ink:#1f6b3d;
      --warn:#b9760f;--danger-bg:#fbe9e7;--danger-line:#edc7c1;--danger-ink:#8f2c20;
      --purple-bg:#efe9f7;--purple-line:#d3c2ec;--purple-ink:#6b3fa0;
      /* W5-09 — generic surface/border aliases used by injected inline-SVG maps (the Programs cluster
         locator, approved-plans.js) and small raised panels (home.css). Defined here so those `var(--surface-2)`
         / `var(--border)` references resolve to a THEME-AWARE value instead of their hard-coded near-white
         fallbacks (#f6f7f9 / #ccc), which rendered a white box in dark theme. */
      --surface-2:#eef1f6;--border:#d0d7e1;
      /* R73 single-view — the fixed top bar's height. A static fallback so the page clears the fixed header with
         no pre-JS flash; shell.js measures the real rendered height and overwrites this on documentElement (and
         on resize / font-load) so a wrapped bar never overlaps the content. Theme-independent, so it lives on the
         base :root only. */
      --cp-topbar-h:52px;
    }
    @media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
      color-scheme:dark;  /* W6-08 — native controls follow the dark scheme (OS-dark, no explicit light override) */
      --sidebar:#1a212b;--sidebar-active:#273240;--sidebar-ink:#e7ebf1;--sidebar-muted:#9aa4b3;
      --sidebar-line:#2c3644;--sidebar-active-ink:#ffffff;--sidebar-accent:#6ea0d6;
      --success:#5cbd85;--success-bg:#16241c;--success-line:#2e5540;--success-ink:#97d6af;
      --warn:#d9a24a;--danger-bg:#2c1a17;--danger-line:#5a2f28;--danger-ink:#e8a397;
      --purple-bg:#241a33;--purple-line:#4a3566;--purple-ink:#c3a3e8;
      --surface-2:#161c24;--border:#2c3644;  /* W5-09 — dark counterparts of the SVG-map surface/border aliases */
    }}
    :root[data-theme="dark"]{
      color-scheme:dark;  /* W6-08 — native controls follow the dark scheme (explicit dark override) */
      --sidebar:#1a212b;--sidebar-active:#273240;--sidebar-ink:#e7ebf1;--sidebar-muted:#9aa4b3;
      --sidebar-line:#2c3644;--sidebar-active-ink:#ffffff;--sidebar-accent:#6ea0d6;
      --success:#5cbd85;--success-bg:#16241c;--success-line:#2e5540;--success-ink:#97d6af;
      --warn:#d9a24a;--danger-bg:#2c1a17;--danger-line:#5a2f28;--danger-ink:#e8a397;
      --purple-bg:#241a33;--purple-line:#4a3566;--purple-ink:#c3a3e8;
      --surface-2:#161c24;--border:#2c3644;  /* W5-09 — dark counterparts of the SVG-map surface/border aliases */
    }
    /* ============================================================================
       Typography scale (hotfix-typography) — ONE global lever for portal readability.
       Every --fs-* token (shell-tokens.js: --fs-body/-small/-micro/-h1/-h2/-display) is
       rem-based, so setting the ROOT font-size here scales the whole type ramp
       PROPORTIONALLY — body, section headers, and labels move together and their size
       relationships are preserved (the Tesla/iPhone clean-minimal hierarchy is unchanged,
       just larger). line-height stays a unitless ratio (--lh-tight 1.2 / --lh-body 1.55)
       so lines grow WITH the text — no squishing; the --space-* tokens are px, so
       padding/whitespace is NOT compressed — the breathing room is kept while the text
       gets larger.
         Why here and not in the token block: the --fs-* VALUES live in the inline
       <style id="repp-shell"> :root block (source of truth tools/shell-tokens.js),
       drift-guarded byte-for-byte by tools/shell.test.js + tools/design-tokens.test.js
       and synced into every page. Editing those values would mean re-syncing ~20 pages
       and updating the value test. Scaling the ROOT instead leaves every token value
       untouched — this rule only changes the px the rems resolve against, and only on
       pages that link shell.css (the portal shell). 112.5% = 18px root (was the
       UA-default 16px) → a ~12.5% proportional lift across the whole ramp
       (e.g. body 17→19px, labels 14→15.75px, section headers/H2 22→24.75px). */
    html{font-size:112.5%;}
    .cp-app{display:grid;grid-template-columns:266px 1fr;min-height:100vh;}
    .cp-app.is-collapsed{grid-template-columns:66px 1fr;}
    /* ---- sidebar (persistent chrome) ---- */
    .cp-sidebar{background:var(--sidebar);color:var(--sidebar-ink);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto;border-right:1px solid var(--sidebar-line);}
    .cp-id{padding:var(--space-5) var(--space-4) var(--space-3);border-bottom:1px solid var(--sidebar-line);}
    .cp-id .brand{display:inline-block;font-size:var(--fs-micro);letter-spacing:1px;text-transform:uppercase;color:var(--sidebar-muted);font-weight:var(--fw-bold);text-decoration:none;}
    a.brand:hover{color:var(--sidebar-accent);}
    .cp-id .co{font-size:var(--fs-h2);font-weight:var(--fw-bold);line-height:var(--lh-tight);margin-top:4px;}
    .cp-id .co[hidden]{display:none;}
    .cp-id .instance{font-size:var(--fs-micro);color:var(--sidebar-muted);margin-top:3px;}
    /* Multi-company demo selector (card r1sel042) — injected into .cp-id by company-context.js only on the
       demo deploy when ≥2 fictional companies are served; absent otherwise. Sidebar-token themed. */
    .cp-company-switch{margin-top:4px;display:flex;flex-direction:column;gap:3px;}
    .cp-company-switch-label{font-size:var(--fs-micro);letter-spacing:0.6px;text-transform:uppercase;color:var(--sidebar-muted);font-weight:var(--fw-semibold);}
    /* W3-01/06 — the switcher IS the portfolio name now (no "Viewing" label), so it reads at name prominence. */
    .cp-company-select{width:100%;background:var(--sidebar-active);color:var(--sidebar-ink);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);padding:5px 8px;font-family:inherit;font-size:var(--fs-h2);line-height:var(--lh-tight);font-weight:var(--fw-bold);cursor:pointer;}
    .cp-company-select:focus-visible{outline:2px solid var(--sidebar-accent);outline-offset:1px;}
    .cp-company-note{margin:var(--space-2) 0 0;font-size:var(--fs-micro);line-height:var(--lh-body);color:var(--sidebar-muted);}
    /* W5-08 — native <select> controls are theme-aware from the shell tokens. Left unstyled they render as a
       bright-white UA box against the dark shell (the walkthrough saw this on the Plan-wizard "Direction by
       function" selects, the Working-draft business-unit chooser, and the Review-queue "Acting as" switch).
       This themes every native select on every page from one place; the sidebar company switcher keeps its own
       more-specific .cp-company-select rule above (class beats element), so it is unaffected. */
    select{background-color:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);padding:5px 8px;font-family:inherit;font-size:var(--fs-small);line-height:var(--lh-tight);}
    select:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
    /* The popup option list — some platforms paint it from these, so theme them too (never a white-on-white
       or black-on-black list in dark mode). */
    select option{background-color:var(--panel);color:var(--ink);}
    .cp-newreq{margin:var(--space-3) var(--space-4);display:flex;flex-direction:column;gap:2px;align-items:flex-start;background:var(--sidebar-accent);color:var(--on-accent);border:none;border-radius:var(--radius-sm);padding:10px 14px;font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-bold);cursor:pointer;}
    .cp-newreq:hover{filter:brightness(1.06);}
    .cp-newreq .tag{font-weight:var(--fw-regular);font-size:var(--fs-micro);opacity:0.85;}
    .cp-collapse{margin:0 var(--space-4) var(--space-3);background:transparent;color:var(--sidebar-muted);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);padding:5px 9px;font-size:var(--fs-micro);cursor:pointer;align-self:flex-start;}
    .cp-collapse:hover{color:var(--sidebar-ink);border-color:var(--sidebar-accent);}
    /* (W3-01/06 — the "Set up or switch portfolio" button is folded into the switcher dropdown's
       "Set up a new portfolio…" item; its .cp-setup styles are removed with it.) */
    .cp-nav{flex:1;padding:var(--space-2) 0;}
    .cp-group{padding:var(--space-3) var(--space-4) var(--space-2);}
    .cp-group .badge{display:flex;flex-direction:column;gap:1px;}
    .cp-group .mode{font-size:var(--fs-small);font-weight:var(--fw-bold);letter-spacing:0.3px;}
    .cp-group .onto{font-size:9px;letter-spacing:0.8px;text-transform:uppercase;color:var(--sidebar-muted);font-weight:var(--fw-semibold);}
    .cp-group.is-current .mode{color:var(--sidebar-active-ink);}
    .cp-group.is-interim .mode,.cp-group.is-coming .mode{color:var(--sidebar-muted);}
    /* ---- Sidebar as a MAP of the cycle (simplification pass) ----
       The flow band is the PATH (the sequential steps); the sidebar is the MAP of where you are on it. shell.js
       applyStage lights exactly one current group and marks the groups before it (in flow order) done. Current =
       an accent bar + a light tint; done = a lighter shade + a ✓ so completed steps read as behind you; upcoming
       steps stay plain. Theme-aware via the sidebar tokens. The tint/bar is expanded-only so it never fights the
       collapsed rail's own current treatment; the mode/item colour rules are moot when collapsed (badge hidden). */
    .cp-app:not(.is-collapsed) .cp-group.is-current{box-shadow:inset 2px 0 0 var(--sidebar-accent);background:var(--sidebar-active);}
    .cp-group.is-done .mode{color:var(--sidebar-muted);}
    .cp-group.is-done .mode::before{content:"✓ ";color:var(--success);}
    .cp-group.is-done .cp-item:not(.is-active){color:var(--sidebar-muted);}
    /* Collapsed icon rail: a completed step's glyph reads in the done (lighter) shade so the rail is a map too;
       the current rail-link keeps its accent treatment defined further below. */
    .is-collapsed .cp-group.is-done .cp-rail-link{color:var(--sidebar-muted);}
    .cp-items{list-style:none;margin:6px 0 0;padding:0;}
    .cp-items li{margin:0;}
    .cp-item{display:block;width:100%;text-align:left;background:transparent;border:none;color:var(--sidebar-ink);font-family:inherit;font-size:var(--fs-small);padding:7px 14px 7px 16px;border-radius:0;cursor:pointer;text-decoration:none;border-left:2px solid transparent;}
    .cp-item:hover{background:var(--sidebar-active);}
    .cp-item.is-active{background:var(--sidebar-active);color:var(--sidebar-active-ink);border-left-color:var(--sidebar-accent);font-weight:var(--fw-semibold);}
    .cp-item.is-link::after{content:" ↗";color:var(--sidebar-muted);font-size:var(--fs-micro);}
    /* No cross-page arrow on the current page's own entry (Wave 6b sidebar finalize, doc 72 frame 4). */
    .cp-item.is-active.is-link::after{content:none;}
    .cp-item.is-disabled{color:var(--sidebar-muted);cursor:default;}
    .cp-item .coming{font-size:9px;text-transform:uppercase;letter-spacing:0.6px;background:var(--sidebar-active);color:var(--sidebar-muted);border-radius:999px;padding:1px 7px;margin-left:6px;}
    /* UX-shell wave 1 — the sidebar is FOUR single mode links (no sub-items). Each is a .cp-item.cp-mode
       carrying the step label + its landing-page Cycle phrase (Set baseline / Run scenarios / Make decisions /
       Track progress) as a sub-line, so the four steps read the same words as the landing Cycle. */
    .cp-mode{display:flex;flex-direction:column;gap:1px;padding:10px 14px 10px 16px;}
    .cp-mode .mode{font-size:var(--fs-small);font-weight:var(--fw-bold);letter-spacing:0.3px;}
    .cp-mode .cp-mode-sub{font-size:var(--fs-micro);color:var(--sidebar-muted);}
    .cp-group.is-current .cp-mode .mode{color:var(--sidebar-active-ink);}
    .cp-mode.is-link::after{content:none;}
    .is-collapsed .cp-mode{display:none;}
    .cp-foot{border-top:1px solid var(--sidebar-line);padding:var(--space-3) var(--space-4);display:flex;gap:8px;flex-wrap:wrap;}
    /* UX-shell wave 1 — Data · Settings · About · theme toggle live behind ONE "⋯ More" control (fewer
       decisions per screen). The menu is hidden until the control is opened (shell.js wires the toggle). */
    .cp-more{width:100%;justify-content:flex-start;}
    .cp-more[aria-expanded="true"]{border-color:var(--sidebar-accent);color:var(--sidebar-accent);}
    .cp-more-menu{display:flex;flex-direction:column;gap:8px;margin-top:8px;width:100%;}
    .cp-more-menu[hidden]{display:none;}
    .is-collapsed .cp-more-menu{display:none;}
    .is-collapsed .cp-more{justify-content:center;}
    .cp-foot button{background:transparent;color:var(--sidebar-ink);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);padding:6px 10px;font-family:inherit;font-size:var(--fs-small);cursor:pointer;display:inline-flex;align-items:center;gap:6px;}
    .cp-foot button:hover{border-color:var(--sidebar-accent);}
    .cp-foot .cp-data.is-disabled{color:var(--sidebar-muted);cursor:default;}
    /* Settings — a real footer link (Wave 5, card 6 / ruling 14), styled to match the footer buttons; it
       replaces the former disabled "⚙ Data / ⚙ Settings — coming soon" control now that Settings is live
       (honesty rule 3 — no dead control ships). is-current marks it on the Settings page itself. */
    .cp-foot .cp-settings{background:transparent;color:var(--sidebar-ink);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);padding:6px 10px;font-family:inherit;font-size:var(--fs-small);text-decoration:none;display:inline-flex;align-items:center;gap:6px;}
    .cp-foot .cp-settings:hover{border-color:var(--sidebar-accent);color:var(--sidebar-accent);}
    .cp-foot .cp-settings.is-current{border-color:var(--sidebar-accent);color:var(--sidebar-accent);font-weight:var(--fw-semibold);}
    /* About REPP — a small link in the footer (card r1abt001), styled to match the footer buttons; NOT a
       fifth mode group (the four-mode sidebar stands). is-current marks it on the About page itself. */
    .cp-foot .cp-about{background:transparent;color:var(--sidebar-ink);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);padding:6px 10px;font-family:inherit;font-size:var(--fs-small);text-decoration:none;display:inline-flex;align-items:center;gap:6px;}
    .cp-foot .cp-about:hover{border-color:var(--sidebar-accent);color:var(--sidebar-accent);}
    .cp-foot .cp-about.is-current{border-color:var(--sidebar-accent);color:var(--sidebar-accent);font-weight:var(--fw-semibold);}
    /* About page prose: a readable measure inside the shared card. */
    .about-copy{max-width:70ch;}
    .about-copy p{margin:0 0 var(--space-4);}
    .about-copy .about-h{font-size:var(--fs-h2);font-weight:var(--fw-bold);margin:var(--space-5) 0 var(--space-3);}
    .about-copy .about-list{margin:0 0 var(--space-4);padding-left:var(--space-5);display:flex;flex-direction:column;gap:var(--space-2);}
    .about-copy .about-list li{line-height:var(--lh-body);}
    /* collapsed: hide text, keep the frame legible */
    .is-collapsed .cp-id .co,.is-collapsed .cp-id .instance,.is-collapsed .cp-company-switch,.is-collapsed .cp-company-note,.is-collapsed .cp-newreq .label-text,.is-collapsed .cp-newreq .tag,.is-collapsed .cp-group .badge,.is-collapsed .cp-items,.is-collapsed .cp-foot .cp-data span,.is-collapsed .cp-foot .cp-settings span,.is-collapsed .cp-foot .cp-about span,.is-collapsed .cp-theme .repp-theme-text{display:none;}
    .is-collapsed .cp-group{border-top:1px solid var(--sidebar-line);text-align:center;}
    /* Collapsed rail: each mode is a REAL navigation link (card walkthrough-defects, Chairman finding #21).
       It was a decorative .cp-group::before glyph on a plain <div> — no handler, no href, not focusable, so
       clicking it did nothing (rule 3: no control that silently does nothing). The link ships in every group
       and shows ONLY when collapsed; expanded, it is display:none so it never duplicates the .cp-items nav in
       the tab order. Navigating lands on the mode's first section; the collapsed state persists in
       localStorage, so the destination page reloads still-collapsed (never a surprise-expand). */
    .cp-rail-link{display:none;}
    .is-collapsed .cp-rail-link{display:flex;align-items:center;justify-content:center;padding:12px 0;color:var(--sidebar-muted);text-decoration:none;border-left:2px solid transparent;}
    .is-collapsed .cp-rail-link::before{content:attr(data-icon);font-size:16px;}
    .is-collapsed .cp-rail-link:hover{background:var(--sidebar-active);color:var(--sidebar-ink);}
    .is-collapsed .cp-rail-link:focus-visible{outline:2px solid var(--sidebar-accent);outline-offset:-2px;}
    .is-collapsed .cp-group.is-current .cp-rail-link{color:var(--sidebar-active-ink);border-left-color:var(--sidebar-accent);background:var(--sidebar-active);}
    /* ---- main content ---- */
    .cp-main{min-width:0;padding:0 0 var(--space-6);}
    .cp-header{position:sticky;top:0;z-index:5;background:var(--bg);border-bottom:1px solid var(--line);padding:var(--space-4) var(--space-5) var(--space-3);}
    .cp-chip{display:inline-flex;align-items:center;gap:8px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);letter-spacing:0.5px;text-transform:uppercase;color:var(--accent);background:var(--accent-soft);border:1px solid var(--accent);border-radius:999px;padding:3px 11px;}
    .cp-chip:empty{display:none;} /* W3-11/12 — an unpopulated pill never shows a bare box (e.g. Home before home.js fills it) */
    .cp-crumb{color:var(--muted);font-size:var(--fs-small);margin-left:10px;}
    /* Status chip (simplification pass) — a compact state pill for the working-analysis / in-review / approved
       states, each visually distinct so a draft is never mistaken for an approved or in-review plan (three-state
       seam, KNOWLEDGE rule 15). "Working analysis" is amber (matching the working seam + exec-brief working
       state); Approved is accent; In review is a neutral outline. A leading dot picks up the state's own colour. */
    .cp-status{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);letter-spacing:0.4px;text-transform:uppercase;border-radius:999px;padding:2px 10px;white-space:nowrap;vertical-align:middle;}
    .cp-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;}
    .cp-status.working{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);}
    .cp-status.review{background:var(--panel);border:1px solid var(--line);color:var(--muted);}
    .cp-status.approved{background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);}
    .cp-h{font-size:var(--fs-h1);font-weight:var(--fw-bold);margin:10px 0 0;line-height:var(--lh-tight);}
    /* F10 — the Portfolio view pulldown sits IN the H1 slot at the H1's size + weight, with a ▾. It is a native
       <select> (accessible, keyboard-navigable) styled to read as the heading; the ▾ is drawn by the wrapper so it
       shows identically in light + dark. */
    .cp-switch{position:relative;display:inline-flex;align-items:baseline;max-width:100%;}
    .cp-switch-select{font-family:var(--font-sans);font-size:var(--fs-h1);font-weight:var(--fw-bold);line-height:var(--lh-tight);color:var(--ink);background:transparent;border:0;margin:0;padding:0 1.4em 0 0;max-width:100%;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;}
    .cp-switch-select:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:var(--radius-sm);}
    .cp-switch::after{content:'▾';position:absolute;right:0;bottom:0.12em;font-size:var(--fs-h2);font-weight:var(--fw-regular);color:var(--muted);pointer-events:none;}
    .cp-switch-select:hover{color:var(--accent);}
    .cp-switch-select option{font-size:var(--fs-body);font-weight:var(--fw-regular);color:var(--ink);background:var(--panel);}
    .cp-sub{color:var(--muted);font-size:var(--fs-small);margin:4px 0 0;}
    .cp-sub:empty{display:none;} /* W3-12 — the removed caption leaves no empty gap */
    /* W3-46 — the plain delivery pointer that replaced the Approved-plans "Committed view…" seam band */
    .cp-deliver{margin:6px 0 0;font-size:var(--fs-small);}
    .cp-deliver a{color:var(--accent);text-decoration:none;}
    .cp-deliver a:hover{text-decoration:underline;}
    .cp-deliver:empty{display:none;}
    .cp-seam{margin-top:var(--space-3);font-size:var(--fs-small);border-radius:var(--radius-sm);padding:8px 12px;display:inline-flex;align-items:center;gap:8px;}
    .cp-seam.asbuilt{background:var(--panel);border:1px solid var(--line);color:var(--ink);}
    .cp-seam .dot{width:8px;height:8px;border-radius:50%;background:var(--ink);}
    .cp-body{padding:var(--space-5);max-width:1160px;}
    .cp-section{display:none;}
    .cp-section.is-active{display:block;}
    /* generic bits */
    .info{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;border:1px solid var(--line);color:var(--muted);font-size:10px;font-weight:var(--fw-bold);cursor:help;vertical-align:middle;margin-left:6px;}
    .info[title]{cursor:help;}
    .newreq-link{font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--accent);text-decoration:none;white-space:nowrap;}
    .newreq-link:hover{text-decoration:underline;}
    .metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:var(--space-3);margin-bottom:var(--space-5);}
    @media(max-width:1000px){.metrics{grid-template-columns:repeat(2,1fr);}}
    .metric{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4);}
    .metric .label{font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.5px;color:var(--muted);font-weight:var(--fw-semibold);}
    .metric .value{font-size:var(--fs-h1);font-weight:var(--fw-bold);margin-top:6px;line-height:var(--lh-tight);font-variant-numeric:tabular-nums;}
    .metric .sub{font-size:var(--fs-micro);color:var(--muted);margin-top:4px;}
    .metric.na .value{color:var(--muted);font-size:var(--fs-h2);}
    .cards2{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4);}
    @media(max-width:900px){.cards2{grid-template-columns:1fr;}}
    .card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-5);}
    .card h3{font-size:var(--fs-h2);margin:6px 0 4px;font-weight:var(--fw-semibold);}
    .card .lead{color:var(--muted);font-size:var(--fs-small);margin:0 0 var(--space-3);}
    .card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}
    .row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--line);font-size:var(--fs-small);}
    .row.head{border-top:none;color:var(--muted);font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.4px;}
    .row .name{font-weight:var(--fw-semibold);}
    .pill{display:inline-block;font-size:var(--fs-micro);font-weight:var(--fw-semibold);padding:2px 8px;border-radius:999px;white-space:nowrap;}
    .pill.ok{background:var(--success-bg);border:1px solid var(--success-line);color:var(--success-ink);}
    .pill.warn{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);}
    .pill.danger{background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger-ink);}
    .pill.derived{background:var(--panel);border:1px dashed var(--muted);color:var(--muted);}
    .pill.confirmed{background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);}
    .pill.asserted{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);}
    /* lenses */
    .lens-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:var(--space-4);}
    .lens-tab{background:var(--panel);border:1px solid var(--line);border-radius:999px;padding:6px 14px;font-size:var(--fs-small);cursor:pointer;color:var(--ink);font-family:inherit;}
    .lens-tab:hover{border-color:var(--accent);}
    .lens-tab.is-active{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:var(--fw-semibold);}
    .bar-row{display:grid;grid-template-columns:180px 1fr 120px;align-items:center;gap:12px;padding:7px 0;border-top:1px solid var(--line);font-size:var(--fs-small);}
    .bar-row .bl{font-weight:var(--fw-medium);}
    .bar{height:12px;background:var(--accent-soft);border-radius:6px;overflow:hidden;}
    .bar span{display:block;height:100%;background:var(--accent);}
    .bar-row .bv{text-align:right;font-variant-numeric:tabular-nums;color:var(--muted);}
    table.grid{border-collapse:collapse;width:100%;font-size:var(--fs-small);}
    table.grid th,table.grid td{border:1px solid var(--line);padding:6px 9px;text-align:right;font-variant-numeric:tabular-nums;}
    table.grid th:first-child,table.grid td:first-child{text-align:left;font-weight:var(--fw-semibold);white-space:nowrap;}
    table.grid thead th{background:var(--accent-soft);color:var(--ink);font-weight:var(--fw-semibold);}
    .scroll-x{overflow-x:auto;}
    .hm-cell{display:table-cell;text-align:center;font-variant-numeric:tabular-nums;font-size:var(--fs-micro);}
    .note{font-size:var(--fs-small);color:var(--muted);background:var(--panel);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--radius-sm);padding:10px 14px;margin-top:var(--space-3);}
    /* "About these results" — the shared derivation affordance (one pattern, every results surface). */
    .about-results{margin-top:var(--space-3);border-top:1px solid var(--line);}
    .about-results>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;padding:8px 0 2px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);text-transform:uppercase;letter-spacing:0.4px;color:var(--muted);}
    .about-results>summary::-webkit-details-marker{display:none;}
    .about-results>summary::before{content:"ⓘ";font-size:12px;color:var(--accent);}
    .about-results>summary:hover{color:var(--accent);}
    .about-results[open]>summary{color:var(--ink);}
    .ar-body{display:grid;gap:8px;padding:8px 0 4px;}
    .ar-row{display:grid;grid-template-columns:150px 1fr;gap:12px;font-size:var(--fs-small);}
    @media(max-width:560px){.ar-row{grid-template-columns:1fr;gap:2px;}}
    .ar-l{color:var(--muted);font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.4px;font-weight:var(--fw-semibold);padding-top:1px;}
    .ar-v{color:var(--ink);}
    .gap-item{border-top:1px solid var(--line);padding:10px 0;font-size:var(--fs-small);}
    .gap-item .g-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
    .gap-item .g-rel{font-weight:var(--fw-semibold);}
    .gap-item .g-basis{color:var(--muted);margin-top:3px;}
    .tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:var(--space-4);border-bottom:1px solid var(--line);}
    .tab{background:transparent;border:none;border-bottom:2px solid transparent;color:var(--muted);padding:8px 12px;font-family:inherit;font-size:var(--fs-small);cursor:pointer;}
    .tab.is-active{color:var(--ink);border-bottom-color:var(--accent);font-weight:var(--fw-semibold);}
    .brief-panel{display:none;}
    .brief-panel.is-active{display:block;}
    .pdf-btn{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);padding:6px 12px;font-family:inherit;font-size:var(--fs-small);cursor:pointer;color:var(--ink);}
    .pdf-btn:hover{border-color:var(--accent);color:var(--accent);}
    .sel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);padding:6px 10px;font-family:inherit;font-size:var(--fs-small);color:var(--ink);}
    .stack-floor{display:grid;grid-template-columns:70px 1fr auto;gap:12px;align-items:center;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm);margin-bottom:6px;background:var(--panel);}
    .stack-floor .fl{font-weight:var(--fw-bold);}
    .stack-floor .sp{font-size:var(--fs-small);}
    .stack-floor .sq{color:var(--muted);font-variant-numeric:tabular-nums;font-size:var(--fs-small);}
    .cp-error{background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger-ink);border-radius:var(--radius-md);padding:14px 18px;font-size:var(--fs-small);margin:var(--space-4) var(--space-5);}
    .loading{color:var(--muted);font-size:var(--fs-small);}
    footer.cp-f{color:var(--muted);font-size:var(--fs-micro);padding:var(--space-4) var(--space-5) var(--space-6);}
    /* Print document furniture (card r1der009b) — masthead + closing note, built in JS from the
       snapshot. Present in the DOM but invisible on screen; the @media print block reveals them. */
    .print-doc-head,.print-doc-foot,.print-only-site{display:none;}

    /* ============================================================================
       Charts (Card A — the /app/ visual layer restoration, design note 63). ADDITIVE: new selectors only,
       altering no existing rule. The plot box is width-fluid (ECharts resize() re-measures it) with a
       responsive height. The honesty chrome (label/legend/basis) lives in the DOM around the chart, never
       in the chart canvas, so the print system carries it.
       ============================================================================ */
    .chart-box{width:100%;height:340px;}
    @media(max-width:900px){.chart-box{height:300px;}}
    @media(max-width:560px){.chart-box{height:260px;}}
    /* Mixed-chart honesty legend: solid = researched, hatched = illustrative — one line, no per-point
       badges. (A wholly-real chart, like the composition pie, shows none of this.) */
    .chart-legend{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 0;font-size:var(--fs-micro);color:var(--muted);}
    .chart-legend .swatch{display:inline-block;width:16px;height:11px;border-radius:2px;border:1px solid var(--line);vertical-align:middle;}
    .chart-legend .swatch-real{background:var(--accent);}
    .chart-legend .swatch-illus{background:repeating-linear-gradient(-45deg,color-mix(in srgb,var(--accent) 55%,transparent) 0 2px,transparent 2px 4px);}
    /* Print: keep a plotted chart whole on the page (charts.js re-renders it to a light palette on
       beforeprint; the SVG then prints as-is). Additive — a second @media print block, altering nothing. */
    @media print{.chart-box{height:300px;break-inside:avoid;page-break-inside:avoid;}}

    /* ============================================================================
       Relationship-coverage matrix (Card B — design note 63). ADDITIVE: new .rc-* selectors only,
       altering no existing rule. An HTML table (table.grid.rc-matrix) inside .scroll-x so it inherits the
       r1mob018 wide-table scroll-shadow at ≤900px instead of undoing it. Status reads by GLYPH + COLOUR +
       a visually-hidden label (never colour alone), so it survives print (forced light) and colour-blind
       readers; "Can't tell yet" (warn) stays visually distinct from "Not met" (danger).
       ============================================================================ */
    table.grid.rc-matrix th.rc-h,table.grid.rc-matrix td.rc-cell,table.grid.rc-matrix th.rc-row-h{text-align:center;padding:5px 7px;min-width:26px;}
    /* Readability pass — responsive row axis. NARROW default (≤900px): rows are NUMBERED and the grid stays
       compact enough to fit its box, so it never leaks a page-level scrollbar on a phone/tablet; the key
       below resolves the numbers. DESKTOP (>900px, the @media block further down): the rows carry their full
       LABEL so no lookup is needed, and the columns stay numbered mirroring the row order. Both the number
       and the label ship in every row header; the breakpoint shows exactly one. */
    table.grid.rc-matrix th.rc-row-h{white-space:nowrap;font-weight:var(--fw-semibold);background:var(--accent-soft);}
    .rc-matrix .rc-lbl{display:none;}                     /* label hidden at narrow width (rows show the number) */
    .rc-matrix .rc-num{font-weight:var(--fw-semibold);}
    .rc-matrix .rc-corner{font-weight:var(--fw-semibold);white-space:nowrap;color:var(--muted);}
    .rc-matrix .rc-g{font-size:13px;line-height:1;font-weight:var(--fw-bold);}
    .rc-matrix td.rc-ok{background:var(--success-bg);color:var(--success-ink);}
    .rc-matrix td.rc-danger{background:var(--danger-bg);color:var(--danger-ink);}
    .rc-matrix td.rc-warn{background:var(--warn-bg);color:var(--warn-ink);}
    .rc-matrix td.rc-derived{color:var(--muted);}
    .rc-matrix td.rc-self{background:var(--accent-soft);color:var(--muted);}
    .rc-matrix td.rc-empty{color:var(--muted);opacity:0.45;}
    /* Required vs preferred, read by SHAPE not colour alone (card walkthrough-defects, Chairman finding #6/#19).
       A required nearness is RINGED; a preferred one is plain. This makes the two cells across the diagonal
       visibly DIFFERENT requirements of different strictness — so a met-one-way / not-met-the-other pair can
       no longer read as one relationship contradicting itself. The status glyph + colour stay the first
       encoding; the ring is the second; distance-class is deliberately left to the hover/label only (a third
       in-cell encoding would crowd the cell and cost the legibility this fix is for). */
    .rc-matrix td.rc-req{box-shadow:inset 0 0 0 2px currentColor;}
    /* W3-23 — a not-met item links into its matching cell; the target cell flashes so the eye lands on it. */
    .rc-matrix td.rc-cell.is-flash{outline:3px solid var(--accent);outline-offset:-1px;animation:rc-flash 1.4s ease-out 1;}
    @keyframes rc-flash{0%{outline-color:var(--accent);}70%{outline-color:var(--accent);}100%{outline-color:transparent;}}
    .adj-cell-link{margin-left:6px;font-size:var(--fs-micro);color:var(--accent);text-decoration:none;font-weight:var(--fw-semibold);white-space:nowrap;}
    .adj-cell-link:hover{text-decoration:underline;}
    .rc-readas{font-size:var(--fs-micro);color:var(--muted);margin:8px 0 0;line-height:1.6;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);padding:8px 12px;}
    .rc-readas b{color:var(--ink);}
    /* The Portfolio Brief's Adjacency tab list (card walkthrough-defects, Chairman finding #2). */
    .brief-adj{margin:0 0 4px;padding-left:18px;font-size:var(--fs-small);color:var(--ink);}
    .brief-adj li{margin:2px 0;}
    .rc-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}
    .rc-legend{display:flex;flex-wrap:wrap;gap:6px 14px;margin:10px 0 0;font-size:var(--fs-micro);color:var(--muted);}
    .rc-legend .rc-key{display:inline-flex;align-items:center;gap:5px;}
    .rc-legend .rc-g{font-size:13px;line-height:1;font-weight:var(--fw-bold);}
    .rc-legend .rc-ok .rc-g{color:var(--success-ink);}
    .rc-legend .rc-danger .rc-g{color:var(--danger-ink);}
    .rc-legend .rc-warn .rc-g{color:var(--warn-ink);}
    .rc-legend .rc-derived .rc-g,.rc-legend .rc-empty .rc-g{color:var(--muted);}
    .rc-legend .rc-swatch{display:inline-block;width:12px;height:12px;border-radius:3px;background:var(--panel);border:1px solid var(--line);}
    .rc-legend .rc-swatch.rc-req{box-shadow:inset 0 0 0 2px var(--ink);}
    .rc-guide{font-size:var(--fs-micro);color:var(--muted);margin-top:8px;line-height:1.7;display:flex;flex-wrap:wrap;gap:2px 14px;align-items:baseline;}
    .rc-guide .rc-team{white-space:nowrap;}
    .rc-guide .rc-team b{color:var(--ink);}
    /* DESKTOP (>900px): the matrix sits in its own full-width row, so the rows have the width to carry their
       full label — show it, left-align the row header, and drop the numbered key below (the labelled rows
       already name every entry; the numbered columns mirror the row order). At ≤900px none of this applies:
       the rows stay numbered with the key, which is what keeps the grid inside its box on a narrow viewport.
       Additive + scoped entirely to the matrix's own .rc-* classes — no other surface is affected. */
    @media(min-width:901px){
      table.grid.rc-matrix th.rc-row-h{text-align:left;}
      .rc-matrix .rc-lbl{display:inline;}
      .rc-matrix .rc-num{color:var(--muted);margin-right:8px;font-weight:var(--fw-regular);}
      .rc-matrix .rc-corner{text-align:left;}
      .rc-guide{display:none;}
    }

    /* ============================================================================
       Wide-table treatment + content reflow at narrow widths (card r1mob018). Scoped to ≤900px — the
       point at which the two-column .cards2 row already collapses to one column — so the DESKTOP layout
       (>900px) is left byte-identical: there the adjacency matrix stays fully visible in its own row as
       today. Below 900px, where the content is one column, the treatment engages.
       ============================================================================ */
    @media(max-width:900px){
      /* Reflow: grid items default to min-width:auto, so a wide child (a data table) refuses to shrink
         and blows its card past the viewport — cut off at the right with no scroll. min-width:0 lets the
         card shrink to its track so the .scroll-x inside becomes the real scroll boundary. */
      .card,.metric,.dim,.opt,.health .h,.opt .dimc{min-width:0;}
      /* W6-16 — the fixed "Next" pill sits at the bottom-right of the viewport; on narrow screens it overlaps
         the last line of a long page at rest. Reserve space below the content equal to the pill height plus its
         bottom offset (clears a single- or two-line pill) so nothing hides behind it. Print resets this. */
      .cp-main{padding-bottom:calc(var(--space-6) + 64px);}
      /* Visible scroll affordance: theme-aware edge shadows (Lea Verou's local-background technique) that
         appear only when the table can scroll that way and fade out at each end, so a reader can tell more
         columns exist instead of panning blindly. Covers scroll with the content (local); shadows are
         fixed to the edges (scroll). When a table fits, both covers hide both shadows and nothing shows.
         One treatment, applied to every wide table. */
      .scroll-x{
        background:
          linear-gradient(to right, var(--panel) 42%, transparent) left center/34px 100% no-repeat,
          linear-gradient(to left, var(--panel) 42%, transparent) right center/34px 100% no-repeat,
          radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 26%, transparent), transparent) left center/14px 100% no-repeat,
          radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 26%, transparent), transparent) right center/14px 100% no-repeat;
        background-attachment:local,local,scroll,scroll;
      }
    }
    /* Mobile menu toggle — injected by portal/mobile-nav.js, shown only on a narrow viewport. */
    .cp-mnav{display:none;}

    /* ============================================================================
       Narrow-viewport shell (card r1mob018, extended to ≤900 per Chairman ruling). One breakpoint at
       900px — the point .cards2 already collapses to one column — covers phones AND tablets (an iPad in
       portrait, 768, lands here). Two problems below it: on a phone the un-collapsed sidebar stacks above
       the content and fills the first screen (a nav tap changes a view below the fold); on a tablet the
       266px rail eats a third of the width. portal/mobile-nav.js adds .has-mobile-nav and turns the
       sidebar into a compact bar with a Menu toggle — the nav is a drawer, closed by default (content is
       visible on load), that opens on the toggle and CLOSES on selection, reclaiming the width and
       keeping every tap visible. Without the JS the nav renders stacked (functional, uncollapsed) — the
       base rule below is that safe fallback. Desktop (>900px) is untouched: none of this exists there.
       ============================================================================ */
    @media(max-width:900px){
      .cp-app{grid-template-columns:1fr;}
      .cp-sidebar{position:static;height:auto;}
      /* metric grid: one column so five cards don't leave an orphaned last card in a 2-col row. */
      .metrics{grid-template-columns:1fr;}
      /* chip rows: a single scrollable strip instead of wrapping to several rows before any content. */
      .lens-tabs,.tabs{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:2px;}
      .lens-tab,.tab{flex:0 0 auto;}

      /* --- collapsing nav (only with the JS present) --- */
      .has-mobile-nav .cp-id{display:flex;align-items:center;justify-content:space-between;gap:12px;}
      .has-mobile-nav .cp-mnav{display:inline-flex;align-items:center;gap:6px;background:transparent;color:var(--sidebar-ink);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);padding:7px 12px;font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);cursor:pointer;flex:0 0 auto;}
      .has-mobile-nav .cp-mnav:hover{border-color:var(--sidebar-accent);}
      .has-mobile-nav .cp-mnav .cp-mnav-i{font-size:15px;line-height:1;}
      /* drawer closed by default: keep only the identity bar visible */
      .has-mobile-nav .cp-newreq,
      .has-mobile-nav .cp-collapse,
      .has-mobile-nav .cp-nav,
      .has-mobile-nav .cp-foot{display:none;}
      /* drawer open: reveal the nav + actions inline below the bar */
      .has-mobile-nav.is-mnav-open .cp-newreq{display:flex;}
      .has-mobile-nav.is-mnav-open .cp-nav{display:block;}
      .has-mobile-nav.is-mnav-open .cp-foot{display:flex;}
    }

    /* ============================================================================
       Print / PDF export system (card r1der009b, Theme E, Deliverable 1).
       Turns a live portal page into a clean, chrome-free DOCUMENT — light regardless
       of the on-screen theme, readable at print size, with no interactive control
       printed as a dead element, and with page breaks that don't split a table row
       or orphan a heading. A body scope class (set by portal/print-doc.js) selects
       which document prints: .print-brief · .print-stacking · .print-exec. The
       generic chrome-hide + light-palette rules apply to ANY print of a portal page;
       the scope classes narrow the page to a single document.
       ============================================================================ */
    @media print{
      /* Documents always leave the app LIGHT, whatever theme is on screen. !important
         beats the (non-important) dark-theme token overrides regardless of source order,
         so no dependence on which <style>/<link> loads last. */
      :root{
        --bg:#ffffff !important;--panel:#ffffff !important;--ink:#1b232f !important;--muted:#454f5d !important;
        --line:#c4ccd6 !important;--accent:#2f5c8f !important;--on-accent:#ffffff !important;--accent2:#2f7e86 !important;
        --accent-soft:#e9eff6 !important;--warn-bg:#fbf2df !important;--warn-line:#e3c98f !important;--warn-ink:#6f4a0c !important;
        --danger:#a5342a !important;--danger-bg:#fbecea !important;--danger-line:#e2b8b1 !important;--danger-ink:#7e281d !important;
        --success:#256b41 !important;--success-bg:#e7f3ec !important;--success-line:#bfe0cc !important;--success-ink:#1a5c34 !important;
        --purple-bg:#efe9f7 !important;--purple-line:#cdbbe8 !important;--purple-ink:#5c3591 !important;--shadow:none !important;
      }
      @page{margin:15mm 14mm;}
      html,body{background:#fff !important;}
      body{font-size:10.5pt;line-height:1.4;color:var(--ink);}
      /* Drop the app frame and every interactive affordance — nothing prints as a dead control. */
      .cp-sidebar,.cp-header,.cp-newreq,.cp-collapse,.cp-foot,footer.cp-f,
      .pdf-btn,.tabs,.lens-tabs,.sel,.info,.cp-seam{display:none !important;}
      .cp-app,.cp-app.is-collapsed{display:block !important;grid-template-columns:1fr !important;min-height:0 !important;}
      .cp-main{padding:0 !important;min-width:0 !important;}
      .cp-section{padding:0 !important;}
      /* Only the scoped document prints; the others (all rendered into the DOM) drop out. */
      body.printing .cp-section{display:none !important;}
      body.print-brief #sec-brief{display:block !important;}
      body.print-stacking #sec-buildings{display:block !important;}
      body.print-exec #sec-exec{display:block !important;}
      /* Portfolio Brief: print EVERY panel as one continuous document, not just the open tab,
         each headed by its plain name; the tab strip is gone. */
      body.print-brief .brief-panel{display:block !important;margin:0 0 14px !important;break-inside:avoid;}
      body.print-brief .brief-panel::before{content:attr(data-bpanel);display:block;font-size:8.5pt;font-weight:var(--fw-bold);text-transform:uppercase;letter-spacing:0.6px;color:var(--accent);margin-bottom:5px;}
      /* Print-only masthead / closing note / stacking site label (the on-screen <select> is
         hidden in print, so the exported stacking document names its site in plain text). */
      .print-doc-head,.print-doc-foot{display:block !important;}
      body.print-stacking .print-only-site{display:block !important;font-size:12pt;font-weight:var(--fw-bold);color:var(--ink);margin:2px 0 4px;}
      .print-doc-head{margin:0 0 16px;padding-bottom:10px;border-bottom:2px solid var(--accent);}
      .print-doc-head .pdh-brand{font-size:8.5pt;text-transform:uppercase;letter-spacing:1.2px;color:var(--muted);font-weight:var(--fw-bold);}
      .print-doc-head .pdh-title{font-size:19pt;font-weight:var(--fw-bold);line-height:1.12;margin-top:3px;color:var(--ink);}
      .print-doc-head .pdh-date{font-size:9.5pt;color:var(--muted);margin-top:4px;}
      .print-doc-foot{margin-top:18px;padding-top:8px;border-top:1px solid var(--line);font-size:8.5pt;color:var(--muted);}
      /* "About these results" -> a static, visible BASIS block. The disclosure is opened by
         print-doc.js so the basis prints with the figures; here it reads as a plain labelled
         block, not an interactive control (no marker, no hover affordance). */
      .about-results{break-inside:avoid;border-top:1px solid var(--line);margin-top:14px;}
      .about-results>summary{list-style:none;color:var(--ink) !important;font-size:8.5pt;text-transform:uppercase;letter-spacing:0.5px;font-weight:var(--fw-bold);padding:6px 0 3px;}
      .about-results>summary::before{content:"" !important;margin:0 !important;}
      .about-results .ar-body{display:grid !important;}
      .about-results .ar-l{color:var(--muted) !important;}
      /* Page-break discipline: never split a table row, a card, a floor row, a metric, or a
         basis row; never orphan a heading; repeat table headers across pages. */
      section.card,.metric,.stack-floor,.gap-item,.brief-panel,.note,tr,.ar-row{break-inside:avoid;}
      table.grid{break-inside:auto;}
      thead{display:table-header-group;}
      h1,h2,h3,.card h3,.repp-eyebrow,.print-doc-head,.dim-h{break-after:avoid;}
      /* Reflow multi-column screen layouts into single-column document flow. */
      .metrics{grid-template-columns:repeat(3,1fr) !important;gap:10px !important;}
      .cards2,.dims{display:block !important;}
      .cards2 .card,.dims .dim{margin-bottom:14px;}
      .scroll-x{overflow:visible !important;background:none !important;}
      .card{box-shadow:none !important;}
      a[href]{color:var(--ink) !important;text-decoration:none;}
    }

    /* ---- Approved Plans + Plan v Actual (card r1apv006) ---- */
    .cp-seam.committed{background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);}
    .cp-seam.committed .dot{background:var(--accent);}
    .pill.purple{background:var(--purple-bg);border:1px solid var(--purple-line);color:var(--purple-ink);}
    .req{font-weight:var(--fw-semibold);}
    .drv{color:var(--muted);font-size:var(--fs-micro);margin-top:2px;}
    .sub2{color:var(--muted);font-size:var(--fs-micro);margin-top:2px;}
    .capex-na{color:var(--muted);font-style:italic;}
    table.grid tr.superseded td,table.grid tr.stopped td{opacity:0.72;}
    .pva-tbl th,.pva-tbl td{vertical-align:top;}
    .exceed-line{background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger-ink);border-radius:var(--radius-sm);padding:8px 12px;font-size:var(--fs-small);font-weight:var(--fw-semibold);margin-bottom:var(--space-4);}
    .exceed-inline{color:var(--danger-ink);font-size:var(--fs-micro);font-weight:var(--fw-semibold);margin-top:4px;}
    .cross{color:var(--warn-ink);font-size:var(--fs-micro);margin-top:4px;}
    .stop-cell{color:var(--muted);font-size:var(--fs-small);}
    .gap-card{margin-bottom:var(--space-4);}
    .dims{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4);margin-top:var(--space-3);}
    @media(max-width:760px){.dims{grid-template-columns:1fr;}}
    .dim{border:1px solid var(--line);border-radius:var(--radius-sm);padding:var(--space-3);background:var(--panel);}
    .dim-h{font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.5px;color:var(--muted);font-weight:var(--fw-semibold);margin-bottom:6px;}
    .attrib{color:var(--muted);font-size:var(--fs-micro);margin-top:6px;}
    .d-note{font-size:var(--fs-small);margin-top:6px;}
    .d-note.mit{background:var(--warn-bg);border-left:3px solid var(--warn-line);border-radius:var(--radius-sm);padding:6px 10px;color:var(--warn-ink);}
    .computed{font-size:var(--fs-micro);color:var(--muted);margin-top:8px;border-top:1px dashed var(--line);padding-top:6px;}
    .warn-note{border-left-color:var(--warn) !important;background:var(--warn-bg);color:var(--warn-ink);}
    .card.coming{border-style:dashed;color:var(--muted);}
    .card.coming h3{color:var(--muted);}
    .chain{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;}
    .chain-step{font-size:var(--fs-micro);background:var(--panel);border:1px solid var(--line);border-radius:999px;padding:2px 9px;}
    .chain-step.first{border-style:dashed;color:var(--muted);}
    .chain-arrow{color:var(--muted);font-size:var(--fs-micro);}

    /* ---- Scenario Planning — the working area (card r1scn007) ---- */
    /* Working-analysis state line: warn-framed so a scenario is never confused with an approved plan. */
    .cp-seam.working{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);}
    .cp-seam.working .dot{background:var(--warn);}
    /* health strip — portfolio position */
    .health{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-3);margin-bottom:var(--space-5);}
    @media(max-width:760px){.health{grid-template-columns:1fr;}}
    .health .h{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4);}
    .health .h .n{font-size:var(--fs-h1);font-weight:var(--fw-bold);font-variant-numeric:tabular-nums;line-height:var(--lh-tight);}
    .health .h .l{font-size:var(--fs-small);color:var(--muted);margin-top:4px;}
    .health .h.keep .n{color:var(--success);}
    .health .h.review .n{color:var(--warn);}
    .health .h.change .n{color:var(--danger);}
    /* watchlist */
    .watch{border-top:1px solid var(--line);padding:12px 0;display:flex;justify-content:space-between;align-items:flex-start;gap:14px;}
    .watch .wl-b{min-width:0;}
    .watch .wl-t{font-weight:var(--fw-semibold);}
    .watch .wl-o{color:var(--muted);font-size:var(--fs-small);margin-top:2px;}
    .watch .wl-kind{font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.4px;color:var(--muted);}
    .wl-open{white-space:nowrap;background:transparent;border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--accent);font-family:inherit;font-size:var(--fs-small);padding:6px 10px;cursor:pointer;}
    .wl-open:hover{border-color:var(--accent);}
    /* comparison readout — option cards */
    .opts{display:grid;grid-template-columns:1fr;gap:var(--space-4);}
    .opt{border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4);background:var(--panel);}
    .opt.recommended{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset;}
    .opt .opt-h{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;}
    .opt .opt-name{font-size:var(--fs-h2);font-weight:var(--fw-semibold);}
    .opt .opt-dims{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--space-3);margin-top:var(--space-3);}
    @media(max-width:820px){.opt .opt-dims{grid-template-columns:1fr 1fr;}}
    .opt .dimc{border:1px solid var(--line);border-radius:var(--radius-sm);padding:8px 10px;}
    .opt .dimc .dl{font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.4px;color:var(--muted);}
    .opt .dimc .dv{font-weight:var(--fw-semibold);margin-top:2px;font-variant-numeric:tabular-nums;}
    .opt .parts{margin-top:10px;display:flex;flex-wrap:wrap;gap:6px;}
    .opt .part{font-size:var(--fs-micro);background:var(--accent-soft);border:1px solid var(--accent-soft);border-radius:999px;padding:2px 9px;color:var(--ink);}
    .opt .who{font-size:var(--fs-small);color:var(--muted);margin-top:10px;}
    .opt .align{font-size:var(--fs-small);margin-top:8px;border-left:3px solid var(--accent);background:var(--accent-soft);border-radius:var(--radius-sm);padding:6px 10px;}
    .opt .gap{font-size:var(--fs-small);margin-top:8px;border-left:3px solid var(--warn);background:var(--warn-bg);color:var(--warn-ink);border-radius:var(--radius-sm);padding:6px 10px;}
    /* posture + demand */
    .posture{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3);}
    @media(max-width:760px){.posture{grid-template-columns:1fr;}}
    .pill.grow{background:var(--success-bg);border:1px solid var(--success-line);color:var(--success-ink);}
    .pill.hold{background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);}
    .pill.exit{background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger-ink);}
    .stale-tag{font-size:var(--fs-micro);color:var(--warn-ink);background:var(--warn-bg);border:1px solid var(--warn-line);border-radius:999px;padding:1px 8px;margin-left:6px;}
    /* weighting control (redesigned: long slider + numeric entry) */
    .wt-row{display:grid;grid-template-columns:150px 1fr 84px;gap:14px;align-items:center;padding:9px 0;border-top:1px solid var(--line);}
    .wt-row .wt-l{font-weight:var(--fw-medium);font-size:var(--fs-small);}
    .wt-row input[type=range]{width:100%;accent-color:var(--accent);}
    .wt-num{display:flex;align-items:center;gap:4px;}
    .wt-num input[type=number]{width:56px;font:inherit;font-size:var(--fs-small);padding:5px 6px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink);text-align:right;}
    .wt-total{margin-top:10px;font-size:var(--fs-small);font-weight:var(--fw-semibold);}
    .wt-total.over{color:var(--danger-ink);}
    .origin{font-size:var(--fs-micro);color:var(--muted);}
    .mkt-controls{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3) var(--space-4);margin-bottom:var(--space-4);}
    @media(max-width:760px){.mkt-controls{grid-template-columns:1fr;}}
    .mkt-controls label.hdr{display:block;font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.4px;color:var(--muted);font-weight:var(--fw-semibold);margin-bottom:5px;}
    .rankbar{height:10px;background:var(--accent-soft);border-radius:5px;overflow:hidden;min-width:60px;}
    .rankbar span{display:block;height:100%;background:var(--accent);}
    /* deep-linked analysis context header (card refine1-ux-fastfollow) — states the subject + a way back */
    .ctx-header{background:var(--accent-soft);border:1px solid var(--accent);border-radius:var(--radius-md);padding:var(--space-3) var(--space-4);margin-bottom:var(--space-4);}
    .ctx-header .ctx-back{background:transparent;border:1px solid var(--accent);color:var(--accent);border-radius:var(--radius-sm);font-family:inherit;font-size:var(--fs-small);padding:4px 10px;cursor:pointer;margin-bottom:8px;}
    .ctx-header .ctx-back:hover{background:var(--accent);color:var(--on-accent);}
    .ctx-header .ctx-line{font-size:var(--fs-body);color:var(--ink);}
    /* honestly-labelled coming-soon control (visibly disabled, never a silent no-op) */
    .wl-open.is-soon{color:var(--muted);border-color:var(--line);cursor:default;background:var(--panel);}
    .wl-open.is-soon:hover{border-color:var(--line);}

    /* ---- Executive Brief (card r1der009b) — the cross-mode report + its sidebar entry ---- */
    /* Sidebar entry: a cross-cutting report, distinct from the four mode groups (not a mode). */
    .cp-report-wrap{padding:var(--space-2) var(--space-4) var(--space-3);}
    .cp-report{display:block;text-decoration:none;background:transparent;border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);color:var(--sidebar-ink);padding:8px 12px;font-size:var(--fs-small);font-weight:var(--fw-semibold);}
    .cp-report::before{content:"▤ ";color:var(--sidebar-muted);}
    .cp-report:hover{border-color:var(--sidebar-accent);color:var(--sidebar-accent);}
    .cp-report.is-active{background:var(--sidebar-active);color:var(--sidebar-active-ink);border-color:var(--sidebar-accent);}
    .is-collapsed .cp-report-wrap{display:none;}
    /* The "demonstration" tag — sits ADJACENT to any figure that is not real (G4), so a reader who
       skims only the numbers can never take a demonstration figure as real spend. Prints as-is. */
    .illus{display:inline-block;font-size:9px;line-height:1.5;text-transform:uppercase;letter-spacing:0.4px;font-weight:var(--fw-semibold);color:var(--warn-ink);background:var(--warn-bg);border:1px solid var(--warn-line);border-radius:999px;padding:0 6px;vertical-align:baseline;margin-left:3px;white-space:nowrap;}
    /* The brief document: continuous sections, each with a dated STATE line carrying the three-state
       seam without mode chrome (as-built / committed / delivery / working-analysis). */
    .eb-doc{max-width:760px;}
    .eb-toolbar{margin-bottom:var(--space-4);align-items:center;}
    .eb-sec{padding:var(--space-4) 0;border-top:1px solid var(--line);}
    .eb-sec:first-of-type{border-top:none;padding-top:var(--space-2);}
    .eb-h{margin-bottom:6px;}
    .eb-h h2{font-size:var(--fs-h2);font-weight:var(--fw-semibold);margin:4px 0 0;line-height:var(--lh-tight);}
    .eb-state{display:inline-block;font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.5px;font-weight:var(--fw-semibold);border-radius:999px;padding:2px 10px;}
    .eb-state-asbuilt{background:var(--panel);border:1px solid var(--line);color:var(--muted);}
    .eb-state-committed{background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);}
    .eb-state-delivery{background:var(--panel);border:1px solid var(--accent2);color:var(--accent2);}
    .eb-state-working{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);}
    .eb-p{margin:8px 0 0;font-size:var(--fs-body);}
    /* section-level demonstration label: one badge for a wholly-demonstration section, prose stays clean */
    .eb-demo{margin:8px 0 2px;font-size:var(--fs-small);color:var(--warn-ink);}
    .eb-note{margin-top:var(--space-4);font-size:var(--fs-small);color:var(--muted);}

    /* ---- Scenario Planning working environment (card r1wea-b1) ---- */
    /* A genuinely-disabled action (e.g. Submit before the scenario is named): dimmed and non-interactive,
       distinct from the .is-soon "coming" treatment. Never a silent no-op — the adjacent note says why. */
    .wl-open:disabled,.wl-open[aria-disabled="true"]{color:var(--muted);border-color:var(--line);cursor:not-allowed;opacity:0.65;background:var(--panel);}
    .wl-open:disabled:hover,.wl-open[aria-disabled="true"]:hover{border-color:var(--line);}
    .wb-card{margin-bottom:var(--space-4);}
    .wb-status{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;margin-bottom:var(--space-3);}
    .wb-status .wb-name{font-size:var(--fs-h2);font-weight:var(--fw-semibold);}
    .wb-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--space-4);padding:var(--space-3) 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);}
    .wb-ctl{display:flex;flex-direction:column;gap:4px;}
    .wb-ctl .a-in{font:inherit;font-size:var(--fs-small);padding:5px 6px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink);}
    .wb-ctl-note{flex:1;min-width:200px;margin:0;align-self:center;}
    .wb-authoring{margin-top:var(--space-3);}
    .wb-form{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-3);}
    .wb-form .sel{font:inherit;font-size:var(--fs-small);padding:6px 8px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink);flex:1;min-width:220px;}
    .wb-btns{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3);margin-top:var(--space-2);}
    .wb-hist-wrap{margin-top:var(--space-3);}
    .wb-hist-row{display:flex;gap:10px;align-items:flex-start;padding:6px 0;border-top:1px solid var(--line);}
    .wb-hist-row:first-child{border-top:none;}
    .wb-hist-dot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent);margin-top:7px;}
    .wb-hist-detail{font-size:var(--fs-small);}

    /* ---- Workbench (redesign Card 11; portal/workbench.js). ADDITIVE — no existing rule changed. Reuses
       .card/.wt-row/.wl-open/.origin/.rc-matrix; only the selectors below are new. Theme-aware via tokens. */
    .wb > .card{margin-bottom:var(--space-4);}
    .wb-sec{margin-bottom:var(--space-4);}
    .wb-recompute{border:1px solid var(--accent);}
    .wb-recompute-row{display:flex;flex-wrap:wrap;gap:var(--space-3);align-items:center;justify-content:space-between;}
    .wb-recompute-actions{display:flex;flex-wrap:wrap;gap:var(--space-2);}
    .wb-count{font-size:var(--fs-body);margin-top:2px;}
    .wb-rows{margin:6px 0 4px;}
    .wb-badge{display:inline-block;font-size:var(--fs-micro);font-weight:var(--fw-semibold);padding:2px 8px;border-radius:999px;background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);white-space:normal;}
    .wb-subcard{margin-top:var(--space-4);padding:var(--space-4);border:1px dashed var(--line);border-radius:var(--radius-md);background:var(--bg);}
    .wb-risk-row{display:grid;grid-template-columns:1fr 92px auto;gap:12px;align-items:center;padding:8px 0;border-top:1px solid var(--line);}
    .wb-risk-row .wt-num input,.wb-ko input{width:56px;font:inherit;font-size:var(--fs-small);padding:4px 6px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink);}
    .wb-ko{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-small);color:var(--muted);}
    .wb-ko-unit{color:var(--muted);}
    .wb-adj-controls{display:flex;flex-wrap:wrap;gap:var(--space-3);align-items:center;margin:10px 0;}
    .wb-check{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-small);color:var(--ink);cursor:pointer;}
    .rc-matrix td.rc-edited{box-shadow:inset 0 0 0 2px var(--accent);}
    .rc-matrix td.rc-dim{opacity:0.35;}
    .wb-pop{margin-top:var(--space-4);padding:var(--space-4);border:1px solid var(--accent);border-radius:var(--radius-md);background:var(--panel);box-shadow:var(--shadow);}
    .wb-pop[hidden]{display:none;}
    /* New-build entitlement & permitting (card entitlements-wire, Wave 9). Theme-aware via tokens. */
    .ent-block{margin-top:var(--space-4);padding-top:var(--space-3);border-top:1px solid var(--line);}
    .ent-block:first-of-type{border-top:none;margin-top:var(--space-2);}
    .ent-head{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;}
    .ent-head b{font-size:var(--fs-body);}
    .ent-loc{color:var(--muted);font-size:var(--fs-small);}
    .ent-eyebrow{margin-top:var(--space-3);font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.5px;color:var(--muted);font-weight:var(--fw-semibold);}
    .ent-table{width:100%;border-collapse:collapse;margin:6px 0;font-size:var(--fs-small);}
    .ent-table th{text-align:left;color:var(--muted);font-weight:var(--fw-semibold);font-size:var(--fs-micro);border-bottom:1px solid var(--line);padding:4px 8px 4px 0;}
    .ent-table td{padding:5px 8px 5px 0;border-bottom:1px solid var(--line);vertical-align:top;}
    .ent-table .ent-n{color:var(--muted);width:20px;}
    .ent-table .ent-mo{white-space:nowrap;color:var(--muted);}
    .ent-dash{color:var(--muted);}
    .ent-badge{display:inline-block;font-size:var(--fs-micro);font-weight:var(--fw-semibold);padding:1px 8px;border-radius:999px;white-space:nowrap;}
    .ent-ok{background:var(--success-bg);border:1px solid var(--success-line);color:var(--success-ink);}
    .ent-inf{background:var(--purple-bg);border:1px solid var(--purple-line);color:var(--purple-ink);}
    .ent-gap{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn-ink);}
    .ent-factor{margin:var(--space-3) 0;padding:var(--space-3);border:1px dashed var(--line);border-radius:var(--radius-md);background:var(--bg);}
    .ent-factor-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;}
    .ent-factor-l{font-weight:var(--fw-medium);}
    .ent-score{font-size:var(--fs-h2);font-weight:var(--fw-bold);color:var(--ink);}
    .ent-score-max{font-size:var(--fs-small);color:var(--muted);font-weight:var(--fw-medium);}
    .ent-schedule{margin:var(--space-3) 0;font-size:var(--fs-small);background:var(--panel);border-left:3px solid var(--accent);border-radius:var(--radius-sm);padding:8px 12px;}
    .ent-alt{margin:4px 0 0;padding-left:var(--space-4);display:flex;flex-direction:column;gap:4px;font-size:var(--fs-small);}
    .wb-pop .card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;}
    .wb-pop-x{background:transparent;border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--muted);cursor:pointer;font-size:var(--fs-small);padding:2px 8px;}
    .wb-pop-x:hover{border-color:var(--accent);color:var(--accent);}
    .wb-pop-field{display:grid;grid-template-columns:130px 1fr;gap:12px;align-items:center;padding:8px 0;}
    .wb-toggle-group{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;}
    .wb-toggle{background:var(--panel);border:none;border-right:1px solid var(--line);color:var(--ink);font:inherit;font-size:var(--fs-small);padding:6px 14px;cursor:pointer;}
    .wb-toggle:last-child{border-right:none;}
    .wb-toggle.is-on{background:var(--accent);color:var(--on-accent);font-weight:var(--fw-semibold);}
    @media (max-width:640px){
      .wb-risk-row{grid-template-columns:1fr auto;}
      .wb-risk-row .wb-ko{grid-column:1 / -1;}
      .wb-pop-field{grid-template-columns:1fr;}
    }

/* ---------------------------------------------------------------------------------------------------
   Guided-flow orientation band (Wave 7b → doc 111 W3-08/09/13, R2). Injected at the top of .cp-main by
   flow-bar.js as the SINGLE orientation surface: a title, the six larger step buttons (See · Play · Submit ·
   Review · Approved · Track), and one line below — "You're here: <step> — <purpose>" with the Next and Resume
   links on that same line. One step is emphasised as current, the next is lit; the sidebar group for the same
   step is lit by shell.js from the same page→step map. Theme-aware via the shell tokens. ----------------- */
.cp-flow{margin:0 0 var(--space-4);padding:var(--space-3) var(--space-4);border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);}
.cp-flow-title{margin:0 0 var(--space-2);font-size:var(--fs-small);font-weight:var(--fw-bold);letter-spacing:0.2px;color:var(--ink);}
.cp-flow-track{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-1);}
/* Larger step buttons (W3-08): a touch bigger than the former inline spine. */
.cp-flow-step{display:inline-flex;align-items:center;gap:7px;text-decoration:none;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:7px 14px;font-size:var(--fs-body);}
.cp-flow-step:hover{border-color:var(--accent);color:var(--ink);}
.cp-flow-dot{width:9px;height:9px;border-radius:50%;background:var(--line);flex:0 0 auto;}
.cp-flow-step.is-done{color:var(--ink);}
.cp-flow-step.is-done .cp-flow-dot{background:var(--accent2);}
.cp-flow-step.is-current{color:var(--on-accent);background:var(--accent);border-color:var(--accent);font-weight:var(--fw-semibold);}
.cp-flow-step.is-current .cp-flow-dot{background:var(--on-accent);}
.cp-flow-step.is-next{color:var(--accent);border-color:var(--accent);}
.cp-flow-step.is-next .cp-flow-dot{background:var(--accent);}
.cp-flow-sep{color:var(--muted);font-size:var(--fs-small);padding:0 1px;}
/* The "You're here" line — purpose, Next, Resume all on one wrapping line. */
.cp-flow-here{margin:var(--space-3) 0 0;font-size:var(--fs-small);color:var(--muted);line-height:var(--lh-body);display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px;}
.cp-flow-here-k{text-transform:uppercase;letter-spacing:0.5px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--accent2);}
.cp-flow-here-step{color:var(--ink);}
.cp-flow-here-purpose{color:var(--muted);}
.cp-flow-line-sep{color:var(--line);}
/* One fixed position for the primary action (R24, simplification pass). flow-bar.js renders the Next slot as a
   sibling of the "You're here" line, and it is pinned here to a fixed bottom-right spot — so the "Next: <step> →"
   primary is always in the same place and never scrolls away with the band. A filled accent pill; hidden when
   empty (terminal read pages); never printed. */
.cp-flow-next{position:fixed;right:var(--space-5);bottom:var(--space-5);z-index:20;display:inline-flex;
  align-items:center;gap:8px;background:var(--accent);border:1px solid var(--accent);border-radius:999px;
  padding:11px 18px;box-shadow:var(--shadow);max-width:min(340px,calc(100vw - 2*var(--space-5)));}
.cp-flow-next:empty{display:none;}
.cp-flow-next .cp-flow-nk{color:var(--on-accent);opacity:0.82;}
.cp-flow-next .cp-flow-next-go{color:var(--on-accent);}
@media(max-width:900px){.cp-flow-next{right:var(--space-4);bottom:var(--space-4);}}
@media print{.cp-flow-next{display:none !important;}}
.cp-flow-nk{text-transform:uppercase;letter-spacing:0.5px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--accent2);}
.cp-flow-next-go{color:var(--accent);text-decoration:none;font-weight:var(--fw-semibold);border:0;background:transparent;padding:0;cursor:pointer;font:inherit;}
.cp-flow-next-go:hover{text-decoration:underline;}
.cp-flow-next-text{color:var(--muted);}
.cp-flow-next.is-empty .cp-flow-next-text,.cp-flow-next.is-done .cp-flow-next-text{color:var(--muted);}
.cp-flow-resume-k{text-transform:uppercase;letter-spacing:0.5px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--accent2);}
.cp-flow-resume-go{color:var(--accent);text-decoration:none;font-weight:var(--fw-semibold);}
.cp-flow-resume-go:hover{text-decoration:underline;}
@media (max-width:640px){.cp-flow-label{font-size:var(--fs-small);}.cp-flow-step{padding:6px 10px;font-size:var(--fs-small);}}
@media print{.cp-flow{display:none !important;}}

/* The standalone next-action line — the fallback only for a page with no flow band (Build-your-own hand-off).
   On flow pages the Next link lives inside the band above (W3-08/13); this keeps the hand-off view legible. */
.cp-next{margin:0 0 var(--space-4);padding:var(--space-2) var(--space-3);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--radius-md);background:var(--panel);display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-size:var(--fs-small);}
.cp-next-k{text-transform:uppercase;letter-spacing:0.5px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--accent2);flex:0 0 auto;}
.cp-next-sep{color:var(--muted);flex:0 0 auto;}
.cp-next-act{color:var(--accent);text-decoration:none;font-weight:var(--fw-semibold);}
.cp-next-act:hover{text-decoration:underline;}
.cp-next-btn{border:0;background:transparent;padding:0;cursor:pointer;font:inherit;}
.cp-next-text{color:var(--ink);}
/* An empty / done state is guidance, not an action — muted, and no accent rail. */
.cp-next.is-empty,.cp-next.is-done{border-left-color:var(--line);}
.cp-next.is-empty .cp-next-text,.cp-next.is-done .cp-next-text{color:var(--muted);}
.cp-next.is-empty .cp-next-act,.cp-next.is-done .cp-next-act{color:var(--muted);}
@media print{.cp-next{display:none !important;}}

/* ---------------------------------------------------------------------------------------------------
   "On this page" jump strip (doc 111 W3-28). Injected under the page title on read pages (Current Portfolio,
   Approved Plans) by on-this-page.js; lists that page's sections so content below the fold is one click away.
   Sits inside the sticky .cp-header, so it stays put as you read. Theme-aware via the shell tokens. -------- */
.cp-otp{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px;margin:var(--space-3) 0 0;padding-top:var(--space-2);border-top:1px solid var(--line);}
.cp-otp-k{text-transform:uppercase;letter-spacing:0.5px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--muted);flex:0 0 auto;}
.cp-otp-links{display:flex;flex-wrap:wrap;gap:4px 8px;min-width:0;}
.cp-otp-link{text-decoration:none;color:var(--muted);border:1px solid transparent;border-radius:999px;padding:3px 10px;font-size:var(--fs-small);}
.cp-otp-link:hover{color:var(--ink);border-color:var(--line);}
.cp-otp-link.is-active{color:var(--accent);border-color:var(--accent);font-weight:var(--fw-semibold);}
@media(max-width:900px){.cp-otp-links{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}}
@media print{.cp-otp{display:none !important;}}

/* UX-shell wave 1 — the per-step TAB STRIP (See · Plan · Decide). What left the four-item sidebar became a tab
   here. Tabs are navigation links (not accent action buttons); the active tab is marked with the accent border
   only, so it never counts against the one-accent-button rule. The Decide sub-row (Waiting-on-me's Queue +
   approved horizons) reads as a lighter second row. */
.cp-steptabs{display:flex;flex-direction:column;gap:6px;margin:0 0 var(--space-4);}
.cp-steptab-row{display:flex;flex-wrap:wrap;gap:6px;}
.cp-steptab-row.cp-steptab-decide-sub{padding-left:var(--space-3);border-left:2px solid var(--line);}
.cp-steptab{text-decoration:none;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:5px 12px;font-size:var(--fs-small);white-space:nowrap;}
.cp-steptab:hover{color:var(--ink);border-color:var(--accent);}
.cp-steptab.is-active{color:var(--accent);border-color:var(--accent);font-weight:var(--fw-semibold);}
.cp-steptab-row.cp-steptab-decide-sub .cp-steptab{font-size:var(--fs-micro);}
@media(max-width:900px){.cp-steptab-row{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}}
@media print{.cp-steptabs{display:none !important;}}

/* M-G-03: the request-level progress strip — the request-scoped analogue of the spine, on the request detail
   and (condensed) on each board card. Shares the flow bar's dot/label grammar so the two read as one system. */
.rq-prog{margin:var(--space-2) 0 var(--space-3);padding:var(--space-2) var(--space-3);border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);}
.rq-prog-track{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-1);list-style:none;margin:0;padding:0;}
.rq-prog-node{display:inline-flex;align-items:center;gap:6px;color:var(--muted);border:1px solid transparent;border-radius:999px;padding:3px 9px;font-size:var(--fs-small);}
.rq-prog-dot{width:8px;height:8px;border-radius:50%;background:var(--line);flex:0 0 auto;}
.rq-prog-node.is-done{color:var(--ink);}
.rq-prog-node.is-done .rq-prog-dot{background:var(--accent2);}
.rq-prog-node.is-current{color:var(--on-accent);background:var(--accent);border-color:var(--accent);font-weight:var(--fw-semibold);}
.rq-prog-node.is-current .rq-prog-dot{background:var(--on-accent);}
.rq-prog-sep{color:var(--muted);font-size:var(--fs-small);padding:0 1px;list-style:none;}
.rq-prog-current{margin-top:var(--space-2);display:flex;flex-wrap:wrap;gap:2px 12px;font-size:var(--fs-small);}
.rq-prog-holder{color:var(--ink);font-weight:var(--fw-semibold);}
.rq-prog-unresolved{color:var(--muted);font-weight:normal;}
.rq-prog-unresolved a{color:var(--accent);}
.rq-prog-checks{color:var(--muted);}
.rq-prog-tail{margin-top:4px;font-size:var(--fs-small);}
.rq-prog-state{color:var(--accent2);font-weight:var(--fw-semibold);}
.rq-prog-remaining{color:var(--muted);}
/* the board-card one-liner: dot track + a single status, never stacked */
.rq-prog-compact{margin:6px 0;padding:6px 8px;}
.rq-prog-compact .rq-prog-track{gap:4px;}
.rq-prog-compact .rq-prog-node{padding:2px 7px;font-size:var(--fs-micro);}
.rq-prog-cstatus{display:block;margin-top:4px;font-size:var(--fs-micro);color:var(--muted);}
@media print{.rq-prog{border-color:var(--line);}}

/* ============================================================================
   R63 (doc 118 §7, W8) — TOP BAR + STATUS STRIP. The sidebar is REMOVED on every shell (hidden,
   not deleted — visibility.js 'shell:sidebar'); shell.js sets body.is-topbar, which hides the sidebar
   and collapses the grid to one column, and injects the top bar (the only navigation) with the status
   strip beneath it. Theme-aware via the shell tokens; hidden in print / board mode like the old sidebar
   chrome. Removing 'shell:sidebar' from the HIDDEN set reverses all of this (the sidebar shell returns).
   ============================================================================ */
body.is-topbar .cp-sidebar{display:none;}
body.is-topbar .cp-app,body.is-topbar .cp-app.is-collapsed{grid-template-columns:1fr;}
/* The top bar is the fixed shared header; the page's own sticky header relaxes to normal flow beneath it. */
body.is-topbar .cp-header{position:static;}
/* R73 — the top bar is position:fixed (below), so it's out of flow: push all in-flow body content (the status
   strip, the app grid) down by the measured header height so nothing hides beneath it. Applies on every shell. */
body.is-topbar{padding-top:var(--cp-topbar-h);}

/* R73 — the top bar is the FIXED shared header on every page: it stays on top as the page scrolls. z-index sits
   above the page content, the fixed filter sidebar (40), the options drawer/scrim (50) and the chat widget (60)
   so the header is never occluded. */
.cp-topbar{position:fixed;top:0;left:0;right:0;z-index:100;display:flex;align-items:center;gap:16px;flex-wrap:wrap;
  padding:10px 20px;background:var(--panel);border-bottom:1px solid var(--line);}
.cp-tb-brand{flex:0 0 auto;font-weight:var(--fw-bold);font-size:var(--fs-body);letter-spacing:0.2px;color:var(--ink);text-decoration:none;}
.cp-tb-brand:hover{color:var(--accent);}
.cp-tb-company{flex:0 0 auto;min-width:0;}
.cp-tb-company #cp-company{font-weight:var(--fw-bold);font-size:var(--fs-body);}
.cp-tb-company .cp-company-select{max-width:220px;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);padding:6px 10px;cursor:pointer;}
.cp-tb-company .cp-company-select:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
/* The four steps — navigation links, active marked with an accent BORDER only (never a solid fill), so a
   top-bar step never counts as an accent action button (the one-accent-per-screen rule, doc 118 §7). */
.cp-tb-steps{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin:0 auto 0 8px;}
.cp-tb-step{text-decoration:none;color:var(--muted);border:1px solid transparent;border-radius:999px;padding:6px 13px;font-size:var(--fs-small);white-space:nowrap;}
.cp-tb-step:hover{color:var(--ink);border-color:var(--line);}
.cp-tb-step.is-active{color:var(--accent);border-color:var(--accent);font-weight:var(--fw-semibold);}
/* R73 — with the spine steps removed, the search takes the auto margin that used to sit on the steps, so the
   bar reads REWS.AI · company on the left, search · ⋯ on the right. */
.cp-tb-search{flex:0 1 220px;display:flex;min-width:120px;margin-left:auto;}
.cp-tb-search-input{width:100%;background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:999px;padding:6px 12px;font-family:inherit;font-size:var(--fs-small);}
.cp-tb-search-input:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent);}
.cp-tb-more{position:relative;flex:0 0 auto;}
.cp-tb-more .cp-more{background:transparent;color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);padding:6px 11px;font-family:inherit;font-size:var(--fs-small);cursor:pointer;}
.cp-tb-more .cp-more[aria-expanded="true"]{border-color:var(--accent);color:var(--accent);}
.cp-tb-more .cp-more-menu{position:absolute;right:0;top:calc(100% + 6px);display:flex;flex-direction:column;gap:6px;margin:0;width:210px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);box-shadow:var(--shadow);padding:8px;z-index:40;}
.cp-tb-more .cp-more-menu[hidden]{display:none;}
.cp-tb-more .cp-more-menu a,.cp-tb-more .cp-more-menu button{width:100%;justify-content:flex-start;background:transparent;color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);padding:6px 10px;font-family:inherit;font-size:var(--fs-small);text-decoration:none;display:inline-flex;align-items:center;gap:6px;cursor:pointer;}
.cp-tb-more .cp-more-menu a:hover,.cp-tb-more .cp-more-menu button:hover{border-color:var(--accent);color:var(--accent);}

/* R74 plumbing-header lane — Home-only fixed-header chrome the page fills (home.js syncTopbarChrome): a
   read-only Model-inputs summary (center) + the Run control (right). Built by mountTopBar only on Home; styled
   here with the rest of the bar. The .hz-run* button/line styles are shared (below, with the hero strip); these
   selectors are more specific, so they compactly override for the header regardless of source order. */
.cp-tb-filters{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0;}
.cp-tb-chip{display:inline-flex;align-items:baseline;gap:6px;background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:3px 11px;font-size:var(--fs-micro);white-space:nowrap;}
.cp-tb-chip-k{color:var(--muted);font-weight:var(--fw-medium);}
.cp-tb-chip-v{color:var(--ink);font-weight:var(--fw-semibold);}
.cp-tb-run{flex:0 0 auto;display:flex;align-items:center;}
.cp-tb-run .hz-run{gap:8px;}
.cp-tb-run .hz-lastrun{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media(max-width:820px){.cp-tb-filters{display:none;}}

/* Status strip — under the bar on every page, data-driven from the served snapshots (status-strip.js), with
   honest empty states. Part of normal flow (scrolls with the page); the top bar stays sticky above it. */
.cp-statusstrip{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px;padding:9px 20px;
  background:var(--bg);border-bottom:1px solid var(--line);font-size:var(--fs-small);color:var(--ink);}
.cp-ss-item{display:inline-flex;align-items:baseline;gap:5px;white-space:nowrap;}
.cp-ss-k{color:var(--muted);text-transform:uppercase;letter-spacing:0.4px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);}
.cp-ss-ok{color:var(--success);font-weight:var(--fw-bold);}
.cp-ss-sub,.cp-ss-muted{color:var(--muted);}
.cp-ss-sep{color:var(--line);}
@media(max-width:900px){
  .cp-tb-steps{order:5;width:100%;margin:6px 0 0;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}
  .cp-tb-search{order:4;flex:1 1 140px;}
  .cp-statusstrip{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}
}
@media print{.cp-topbar,.cp-statusstrip{display:none !important;}}
body.board-mode .cp-topbar,body.board-mode .cp-statusstrip,
body.stacking-print-mode .cp-topbar,body.stacking-print-mode .cp-statusstrip{display:none !important;}

/* Incoming-requests alert bar (W8-23, requests-bar.js) — sits directly under the status strip, amber to read
   as work-waiting (the shared --warn tokens; matches the "working"/caution seam, KNOWLEDGE rule 15). Present
   only when there ARE requests in flight (the module removes it at count 0), so it never shows an empty state.
   Part of normal flow, like the status strip. */
.cp-reqbar{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px;padding:8px 20px;
  background:var(--warn-bg);border-bottom:1px solid var(--warn-line);color:var(--warn-ink);font-size:var(--fs-small);}
.cp-rq-lead{font-weight:var(--fw-semibold);}
.cp-rq-icon{font-weight:var(--fw-bold);}
.cp-rq-count b{font-weight:var(--fw-bold);}
.cp-rq-ex{color:var(--warn-ink);opacity:0.85;}
.cp-rq-sep{opacity:0.5;}
.cp-rq-cta{margin-left:auto;color:var(--warn-ink);font-weight:var(--fw-semibold);white-space:nowrap;}
.cp-rq-cta:hover{text-decoration:underline;}
@media(max-width:900px){.cp-reqbar{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}.cp-rq-cta{margin-left:12px;}}
@media print{.cp-reqbar{display:none !important;}}
body.board-mode .cp-reqbar,body.stacking-print-mode .cp-reqbar{display:none !important;}

/* ============================================================================
   R63 / W8-09 (doc 118 §7) — the shell "See details ▸" EXPANDER convention. Every collapsible <details> that
   carries .cp-expander reads as clickable: a link-styled summary with a rotating chevron (▸ closed → ▾ open)
   and the default disclosure triangle removed — so an expander never looks like inert text (W8-09, "expanders
   don't look clickable"). Shell-level, so any page adopts it by adding the class; applied to the Current
   portfolio page's expanders in this lane. Theme-aware via the shell tokens.
   ============================================================================ */
.cp-expander > summary{list-style:none;cursor:pointer;display:inline-flex;align-items:baseline;gap:7px;color:var(--accent);font-weight:var(--fw-semibold);}
.cp-expander > summary::-webkit-details-marker{display:none;}
.cp-expander > summary::before{content:"\25B8";display:inline-block;flex:0 0 auto;align-self:center;transition:transform .15s ease;color:var(--accent);font-size:0.9em;}
.cp-expander[open] > summary::before{transform:rotate(90deg);}
.cp-expander > summary:hover{text-decoration:underline;}
.cp-expander > summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
@media print{.cp-expander > summary::before{content:"";}}

/* ============================================================================================
   REWS.AI chat widget (Wave 9, Lane E — portal/rews-chat.js). A persistent, fixed bottom-right
   widget on every shell page: a collapsed launcher bubble that expands into a chat panel. Stacked
   ABOVE the fixed .cp-flow-next primary CTA (which owns right/bottom var(--space-5), z-index 20) so
   the two never overlap. Theme-aware from the shared tokens; @media print hides it.
   ============================================================================================ */
.rews-chat{position:fixed;right:var(--space-5);bottom:calc(var(--space-5) + 60px);z-index:60;
  display:flex;flex-direction:column;align-items:flex-end;gap:var(--space-3);
  font-family:inherit;color:var(--ink);}

/* Collapsed launcher — a round accent bubble. Fades/scales out when the panel is open. */
.rews-chat-launcher{width:52px;height:52px;border-radius:999px;border:1px solid var(--accent);
  background:var(--accent);color:var(--on-accent);box-shadow:var(--shadow);cursor:pointer;
  display:flex;align-items:center;justify-content:center;font-size:22px;line-height:1;
  transition:transform .15s ease, box-shadow .15s ease, opacity .15s ease;}
.rews-chat-launcher:hover{transform:translateY(-2px) scale(1.05);}
.rews-chat-launcher:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.rews-chat-launcher-glyph{pointer-events:none;}
.rews-chat.is-open .rews-chat-launcher{opacity:0;transform:scale(.6);pointer-events:none;}

/* Expanded panel — animated in from the launcher corner. When closed it is visibility:hidden (out of
   the a11y tree) and non-interactive; .is-open on the root fades + slides it in. */
.rews-chat-panel{position:absolute;right:0;bottom:0;width:340px;max-width:calc(100vw - 2*var(--space-5));
  max-height:min(70vh,560px);display:flex;flex-direction:column;overflow:hidden;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow);
  opacity:0;visibility:hidden;transform:translateY(12px) scale(.98);transform-origin:bottom right;pointer-events:none;
  transition:opacity .18s ease, transform .18s ease, visibility 0s linear .18s;}
.rews-chat.is-open .rews-chat-panel{opacity:1;visibility:visible;transform:none;pointer-events:auto;
  transition:opacity .18s ease, transform .18s ease, visibility 0s;}

.rews-chat-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);
  padding:var(--space-3) var(--space-4);background:var(--accent);color:var(--on-accent);}
.rews-chat-name{font-weight:var(--fw-semibold);font-size:var(--fs-body);line-height:1.2;}
.rews-chat-sub{font-size:var(--fs-micro);opacity:.85;}
.rews-chat-close{background:transparent;border:0;color:var(--on-accent);cursor:pointer;font-size:22px;
  line-height:1;padding:0 var(--space-1);border-radius:var(--radius-sm);}
.rews-chat-close:hover{opacity:.8;}
.rews-chat-close:focus-visible{outline:2px solid var(--on-accent);outline-offset:2px;}

/* Scrollable message log. */
.rews-chat-log{flex:1 1 auto;overflow-y:auto;padding:var(--space-4);display:flex;flex-direction:column;
  gap:var(--space-3);background:var(--bg);}
.rews-chat-msg{display:flex;flex-direction:column;max-width:82%;gap:2px;}
.rews-chat-msg.is-user{align-self:flex-end;align-items:flex-end;}
.rews-chat-msg.is-assistant{align-self:flex-start;align-items:flex-start;}
.rews-chat-bubble{padding:var(--space-2) var(--space-3);border-radius:var(--radius-md);font-size:var(--fs-small);
  line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere;}
.rews-chat-msg.is-user .rews-chat-bubble{background:var(--accent);color:var(--on-accent);border-bottom-right-radius:var(--radius-sm);}
.rews-chat-msg.is-assistant .rews-chat-bubble{background:var(--surface-2);color:var(--ink);border:1px solid var(--line);border-bottom-left-radius:var(--radius-sm);}
.rews-chat-time{font-size:var(--fs-micro);color:var(--muted);}

/* Input row. */
.rews-chat-form{display:flex;gap:var(--space-2);padding:var(--space-3);border-top:1px solid var(--line);background:var(--panel);}
.rews-chat-input{flex:1 1 auto;min-width:0;padding:var(--space-2) var(--space-3);border:1px solid var(--line);
  border-radius:var(--radius-md);background:var(--bg);color:var(--ink);font-size:var(--fs-small);font-family:inherit;}
.rews-chat-input:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent);}
.rews-chat-send{flex:0 0 auto;padding:var(--space-2) var(--space-4);border:1px solid var(--accent);border-radius:var(--radius-md);
  background:var(--accent);color:var(--on-accent);font-size:var(--fs-small);font-weight:var(--fw-semibold);cursor:pointer;font-family:inherit;}
.rews-chat-send:hover{filter:brightness(1.06);}
.rews-chat-send:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

/* Responsive — on a narrow viewport the panel goes near-full-width and drops the flow-next offset. */
@media (max-width:600px){
  .rews-chat{right:var(--space-4);bottom:calc(var(--space-4) + 56px);}
  .rews-chat-panel{width:calc(100vw - 2*var(--space-4));max-height:70vh;}
}
@media (prefers-reduced-motion:reduce){
  .rews-chat-launcher,.rews-chat-panel{transition:none;}
}
@media print{.rews-chat{display:none !important;}}

/* ============================================================================================
   Sidebar FILTER section (Wave 9, Lane E — portal/sidebar-filter.js). A generic, collapsable
   "Filters › Locations" section injected at the top of the shell sidebar, ahead of page-specific
   sections. Styled to match the sidebar nav chrome; inert/hidden in top-bar mode where the sidebar
   itself is hidden (visibility.js 'shell:sidebar').
   ============================================================================================ */
.cp-filter{border-bottom:1px solid var(--sidebar-line);padding:var(--space-2) 0;margin-bottom:var(--space-2);}
.cp-filter-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);width:100%;
  background:transparent;border:0;cursor:pointer;padding:var(--space-2) var(--space-3);
  color:var(--sidebar-ink);font-size:var(--fs-small);font-weight:var(--fw-semibold);font-family:inherit;text-align:left;}
.cp-filter-head:hover{color:var(--sidebar-active-ink);}
.cp-filter-head:focus-visible{outline:2px solid var(--sidebar-accent);outline-offset:-2px;}
.cp-filter-chevron{flex:0 0 auto;transition:transform .15s ease;color:var(--sidebar-accent);}
.cp-filter:not(.is-collapsed) .cp-filter-chevron{transform:rotate(90deg);}
.cp-filter-body{padding:var(--space-1) var(--space-3) var(--space-2);}
.cp-filter-group-label{font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:.04em;
  color:var(--sidebar-muted);margin-bottom:var(--space-2);}
.cp-filter-list{display:flex;flex-direction:column;gap:var(--space-1);}
.cp-filter-option{display:flex;align-items:center;gap:var(--space-2);font-size:var(--fs-small);
  color:var(--sidebar-ink);cursor:pointer;padding:2px 0;}
.cp-filter-check{flex:0 0 auto;accent-color:var(--sidebar-accent);}
.cp-filter-empty{font-size:var(--fs-small);color:var(--sidebar-muted);margin:0;}
/* In the collapsed icon rail the filter section is not meaningful — hide it there. */
.cp-app.is-collapsed .cp-filter{display:none;}

/* ============================================================================
   W9 Lane D (unify) — the unified, VIEW-ONLY Current portfolio surface (home.html): a sticky filter side
   panel + the W8 table + the 8-tab Details panel. Styled off the workspace "result right, levers left"
   idiom (portal/workspace-render.js) using the shared shell tokens, so it reads as one system with the
   Planning-tools surfaces. Theme-aware via the tokens; print- and board-mode hide the filter rail.
   The filter classes are namespaced .cp-pfilter* (NOT .cp-filter*) so the page-content filter rail never
   collides with Lane E's shell-sidebar .cp-filter section (portal/sidebar-filter.js). Each filter group is a
   collapsable section with a ▸ chevron head (rotates on aria-expanded), ported from the superseded
   portfolio-sidebar.js along with the localStorage view-state (repp-portfolio/v1).
   ============================================================================ */
.cp-portfolio{display:grid;grid-template-columns:250px 1fr;gap:var(--space-5);align-items:start;}
.cp-pfilter{position:sticky;top:12px;max-height:calc(100vh - 24px);overflow-y:auto;overscroll-behavior:contain;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4);font-size:var(--fs-small);}
.cp-pfilter-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-3);}
.cp-pfilter-title{font-size:var(--fs-micro);letter-spacing:0.6px;text-transform:uppercase;color:var(--muted);font-weight:var(--fw-semibold);}
.cp-pfilter-clear{background:none;border:1px solid var(--line);border-radius:var(--radius-sm);padding:2px 9px;font-size:var(--fs-micro);color:var(--accent);cursor:pointer;font-family:inherit;}
.cp-pfilter-clear:hover{border-color:var(--accent);}
.cp-pfilter-group{margin-bottom:var(--space-4);}
.cp-pfilter-h{display:flex;align-items:center;gap:6px;width:100%;background:none;border:0;padding:0;cursor:pointer;font-family:inherit;text-align:left;font-size:var(--fs-micro);letter-spacing:0.4px;text-transform:uppercase;color:var(--muted);font-weight:var(--fw-semibold);margin-bottom:var(--space-2);}
.cp-pfilter-h:hover{color:var(--accent);}
.cp-pfilter-h:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--radius-sm);}
.cp-pfilter-h .cp-side-chevron{flex:0 0 auto;color:var(--accent);font-size:0.85em;transition:transform .15s ease;transform:rotate(0deg);}
.cp-pfilter-h[aria-expanded="true"] .cp-side-chevron{transform:rotate(90deg);}
.cp-pfilter-opt{display:flex;align-items:center;gap:7px;padding:2px 0;cursor:pointer;color:var(--ink);}
.cp-pfilter-opt input{accent-color:var(--accent);flex:0 0 auto;}
.cp-pfilter-opt:hover{color:var(--accent);}
.cp-pfilter-note{margin:var(--space-3) 0 0;color:var(--muted);font-size:var(--fs-micro);line-height:1.5;}
.cp-portfolio-main{min-width:0;}
.cp-table-sec{margin-bottom:var(--space-5);}
table.cp-porttable th{white-space:nowrap;}
table.cp-porttable td .home-muted{color:var(--muted);}
.cp-details{margin-top:var(--space-5);}
.cp-details-tabs{margin:var(--space-2) 0 var(--space-4);}
.cp-details-body{min-height:40px;}
.cp-export{padding:var(--space-2) 0;}
.cp-export .pdf-btn{margin-top:var(--space-3);}
@media(max-width:820px){
  .cp-portfolio{grid-template-columns:1fr;}
  .cp-pfilter{position:static;}
}
@media print{.cp-pfilter{display:none !important;}.cp-portfolio{grid-template-columns:1fr;}}
body.board-mode .cp-pfilter{display:none !important;}

/* ============================================================================
   R74 Wave 2 sidebar (plumbing lane) — the in-content Model inputs + Filter rail (.cp-pfilter), upgraded IN
   PLACE per the R74 architecture (docs/design-references/REWS-DASHBOARD-REBUILD-ARCHITECTURE.md, Wave 2). Two
   properties this lane adds; the desktop rail is otherwise unchanged (>820px keeps the sidebar column, the body
   always open, and the toggle hidden):
     • fixed-on-scroll — the base rule above now caps the sticky rail to the viewport and gives it its OWN
       overflow, so a tall panel (seven Model-input groups expanded + the filter) scrolls WITHIN the rail and its
       foot stays reachable while the list scrolls past, instead of running off the bottom of the screen.
     • mobile icon-only — on a phone the rail stacks above the list; the full panel there buries the list, so the
       rail collapses to a single compact toggle that opens the panel on demand (state persists, home.js).
   ============================================================================ */
/* the toggle is desktop-hidden; the body is always open on the desktop rail */
.cp-pfilter-mtoggle{display:none;}
/* topbar single-view mode owns the rail's full-height fixed geometry below the fixed header (rule above, pinned
   by shell-layout.test.js) — don't let the new base max-height cap it there */
body.cp-single.is-topbar .cp-pfilter{max-height:none;}
@media(max-width:820px){
  /* the rail stacks above the content here (base rule sets position:static) — drop the fixed-scroll cap so it
     flows naturally, and reveal the icon-only toggle that gates the panel body */
  .cp-pfilter{max-height:none;overflow:visible;}
  .cp-pfilter-mtoggle{display:inline-flex;align-items:center;gap:8px;width:100%;justify-content:flex-start;
    background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);
    padding:8px 12px;font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);cursor:pointer;}
  .cp-pfilter-mtoggle:hover{border-color:var(--accent);color:var(--accent);}
  .cp-pfilter-mtoggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
  .cp-pfilter-mtoggle-icon{font-size:16px;line-height:1;flex:0 0 auto;}
  .cp-pfilter-mtoggle-caret{margin-left:auto;flex:0 0 auto;color:var(--accent);transition:transform .15s ease;}
  .cp-pfilter:not(.is-pf-collapsed) .cp-pfilter-mtoggle-caret{transform:rotate(90deg);}
  .cp-pfilter.is-pf-collapsed .cp-pf-body{display:none;}
}

/* ============================================================================
   R73 single-view (decision-history 2026-09-19; card AGE-63) — on Home + the working draft (body.cp-single,
   flagged by shell.js from isSingleViewPath), the in-page FILTER panel becomes the single view's SIDEBAR: a
   fixed, independently-scrolling left rail under the fixed header, with the content to its right. Two pages,
   two sidebar idioms, one behaviour: Home's Current-portfolio filter is .cp-pfilter (in .cp-portfolio); the
   working draft's Filter + Model-inputs + Saved-scenarios rail is .ws-sidebar (in .ws-grid, styled in
   workspace-render.js's injected CSS — this more-specific rule overrides its position regardless of source
   order). Scoped to body.cp-single.is-topbar so every OTHER shell keeps single-column flow under the fixed
   header (no gutter, no margins). overscroll-behavior:contain keeps a scroll gesture over the rail from leaking
   into the page. Reverts to stacked flow on a narrow viewport (matches the .cp-portfolio / .ws-grid breakpoints).
   ============================================================================ */
/* the content column clears the fixed rail; the header (H1 pulldown) + body + footer all sit to its right.
   sidebar-fix (defect 1): the rail WIDTH is responsive — it expands with the viewport (clamp 320–380px, per
   the PR-73-001 close-out's stated expansion) so the Model-input group labels ("Proximity to operations &
   supply", the driver / criteria sliders) are readable at desktop widths instead of ellipsizing in the fixed
   230px rail that a later lane had pinned. ONE var drives BOTH the rail width and the content gutter, so they
   can never drift apart. This is the comfort layer; label WRAPPING (.ml-mi-slrow label) is the readability
   FLOOR that holds at every width, expansion or not. */
body.cp-single.is-topbar{--cp-rail-w:clamp(320px,23vw,380px);}
body.cp-single.is-topbar .cp-main{margin-left:var(--cp-rail-w);}
/* the filter panel / workspace rail is pinned to the viewport's left, below the fixed header, full remaining
   height; z-index sits below the header (100), the drawer/scrim (50) and the chat widget (60) so those cover it */
body.cp-single.is-topbar .cp-pfilter,
body.cp-single.is-topbar .ws-sidebar{position:fixed;left:0;top:var(--cp-topbar-h);bottom:0;width:var(--cp-rail-w);z-index:40;
  overflow-y:auto;overscroll-behavior:contain;margin:0;border:0;border-right:1px solid var(--line);border-radius:0;background:var(--panel);}
/* the rail is out of flow, so the page grid is a single content column */
body.cp-single.is-topbar .cp-portfolio,
body.cp-single.is-topbar .ws-grid{grid-template-columns:1fr;}
@media(max-width:900px){
  /* narrow: the rail returns to normal stacked flow (no fixed rail, no content gutter) — matches .ws-grid's own
     900px breakpoint (and is <= the base .cp-portfolio 820px, which also single-columns below it) */
  body.cp-single.is-topbar .cp-main{margin-left:0;}
  body.cp-single.is-topbar .cp-pfilter,
  body.cp-single.is-topbar .ws-sidebar{position:static;top:auto;bottom:auto;width:auto;height:auto;z-index:auto;
    overflow:visible;border:1px solid var(--line);border-radius:var(--radius-md);}
}

/* ============================================================================
   R73 MERGED LIST single view (card AGE-63; wireframe repp-single-view-wireframe-v6.html). ONE list at SITE
   grain, all horizons: eight columns split by a seam — as-built on the left (SITE · STATUS · SHORT BY · WHEN),
   the proposed plan on the right (STATUS AFTER · PROJECT · DELIVERS · FYxx CAPEX). The four plan columns are a
   COLLAPSIBLE GROUP, collapsed by default (.ml-collapsed) so a new visitor sees only the four left columns; the
   "See plan options" header toggles them, and the group carries a light amber tint (plan state, not the current
   portfolio). Rows are grouped under sticky fiscal-year section headers (Today · FYxx …). SITE is sticky-left
   (z-index 40) so it stays pinned on horizontal scroll, the seam visible beside it. Each row
   expands (per-row, separate from the column group) to a panel with Today facts, why-this-order, a View-chart
   drawer, and the site's Options grid. The sidebar carries a collapsible Model inputs section above Filter.
   ============================================================================ */
/* The merged list scrolls at the PAGE level, not inside its own box: an overflow-x scroll container would
   (per the CSS overflow coercion — visible→auto on the cross axis) capture the thead's position:sticky and
   confine it to a box that never scrolls vertically, so the column headers would slide away with the rows
   instead of pinning under the fixed banner. overflow:visible keeps the document/viewport as the scrollport,
   so the sticky header rows (and the sticky-left SITE column, which pins against the viewport's horizontal
   scroll) work. A table wider than the content column scrolls with the page; the fixed banner + sidebar and
   the sticky SITE column keep it oriented. */
.ml-scroll{overflow:visible;}
/* --ml-head-top is the vertical offset the sticky header rows pin AT: below the FIXED shared topbar so the
   column headers stay visible (never hidden behind the banner) as the rows scroll. It is the topbar's real
   height in topbar mode (--cp-topbar-h, measured + kept in sync by shell.js) and 0 in the legacy sidebar
   shell where there is no fixed banner above the table. All sticky tops below add it. */
.ml-table{width:100%;border-collapse:separate;border-spacing:0;font-size:var(--fs-small);--ml-head-top:0px;--ml-site-left:0px;}
body.is-topbar .ml-table{--ml-head-top:var(--cp-topbar-h);}
/* --ml-site-left is where the sticky SITE column pins on HORIZONTAL scroll: since the list now scrolls at the
   page level (see .ml-scroll), a left:0 SITE column would tuck behind the fixed 230px filter rail. Pin it at
   the rail's right edge instead. The rail is fixed only on the wide desktop layout (body.cp-single.is-topbar);
   below 900px it returns to static flow (the .cp-main gutter collapses), so the offset resets to 0 there. */
body.cp-single.is-topbar .ml-table{--ml-site-left:230px;}
@media(max-width:900px){body.cp-single.is-topbar .ml-table{--ml-site-left:0px;}}
/* Wave 3 (seaming) — sticky layering, corrected once the header actually sticks (the fixed-header fix). The
   stacking runs high→low: the SITE header corner (50) over the column-header row (46) over the fiscal-year
   section headers (45) over the SITE body column (40, the DoD-pinned value) over the body. The column-header
   row MUST outrank the SITE body column (40) so a row's sticky-left SITE cell scrolls cleanly UNDER the header
   instead of poking through on top of it; the section headers sit just under the column headers (45<46) so
   they slide beneath the header as a new cohort pushes them up; the SITE body (40) stays above the plain body
   cells (0) on horizontal scroll. The corner outranks both axes so it never lifts off. All sit under the
   fixed topbar (100), and pin at --ml-head-top so the header (both rows) stays fixed just beneath the banner. */
.ml-table th{font-size:var(--fs-micro);letter-spacing:0.06em;text-transform:uppercase;color:var(--muted);text-align:left;padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap;background:var(--bg);position:sticky;top:var(--ml-head-top);z-index:46;}
/* --ml-r1-h / --ml-thead-h are the MEASURED header-row heights (home.js mlSyncStickyOffsets), so the second
   header row pins directly under the first and the section headers pin under the whole header — no hardcoded
   guess that the buttons-bearing first row is 34px tall (it is ~60, and wraps narrower). Static fallbacks
   keep it sane pre-JS / in tests. */
.ml-table .ml-subhead th{top:calc(var(--ml-head-top) + var(--ml-r1-h, 34px));}
.ml-table.ml-collapsed .ml-subhead{display:none;}
.ml-table td{padding:10px 10px;border-bottom:1px solid var(--line);white-space:nowrap;vertical-align:middle;color:var(--ink);}
.ml-table .num{font-variant-numeric:tabular-nums;}
/* sticky SITE column — stays pinned left during horizontal scroll (both the header and the body cells) */
.ml-table td.ml-site{position:sticky;left:var(--ml-site-left);z-index:40;background:var(--panel);font-weight:var(--fw-semibold);}
.ml-table th.ml-site{position:sticky;left:var(--ml-site-left);top:var(--ml-head-top);z-index:50;background:var(--bg);}
/* The subhead's own (empty) SITE corner must pin at the SECOND row's offset, not the banner — otherwise the
   more-specific th.ml-site rule above pulls it up to the top row, leaving the SITE column transparent across
   the second-row band so body rows show through there. Higher specificity (adds .ml-subhead) wins the top. */
.ml-table .ml-subhead th.ml-site{top:calc(var(--ml-head-top) + var(--ml-r1-h, 34px));}
/* the seam divides the as-built read from the proposed plan — a 2px divider, visible on horizontal scroll */
.ml-table th.ml-seam,.ml-table td.ml-seam{border-left:2px solid var(--accent);}
/* the four plan columns carry a light amber tint — the signal that this is PLAN state, not the current
   portfolio (rule 15, the working-analysis seam colour); hidden as a group when the plan columns collapse */
.ml-table th.ml-p,.ml-table td.ml-p{background:var(--warn-bg);}
.ml-table.ml-collapsed th.ml-p,.ml-table.ml-collapsed td.ml-p{display:none;}
/* Wave 3 (seaming) — fiscal-year section headers grouping the rows (Today · FYxx …). Sticky just below the
   two-row header (one row when the plan columns are collapsed); the label stays pinned left on horizontal
   scroll so the cohort is always legible. */
.ml-fy-head td{position:sticky;top:calc(var(--ml-head-top) + var(--ml-thead-h, 66px));z-index:45;background:var(--bg);border-top:2px solid var(--line);border-bottom:1px solid var(--line);padding:6px 10px;white-space:nowrap;}
.ml-fy-label{position:sticky;left:calc(var(--ml-site-left) + 10px);display:inline-block;font-weight:var(--fw-bold);font-size:var(--fs-small);letter-spacing:0.04em;text-transform:uppercase;color:var(--ink);}
.ml-fy-count{color:var(--muted);font-size:var(--fs-micro);font-weight:var(--fw-medium);margin-left:8px;}
.ml-grouphead{text-transform:none;letter-spacing:0;}
.ml-plancols-toggle{background:none;border:0;cursor:pointer;color:var(--accent);font-family:inherit;font-size:var(--fs-micro);letter-spacing:0.06em;text-transform:uppercase;font-weight:var(--fw-semibold);padding:0;display:inline-flex;gap:6px;align-items:center;}
.ml-plancols-toggle:hover{color:var(--ink);}
.ml-group-note{color:var(--muted);text-transform:none;letter-spacing:0;font-weight:var(--fw-regular);}
.ml-exp{background:none;border:0;cursor:pointer;color:var(--accent);font-size:0.9em;margin-right:8px;padding:0;line-height:1;}
.ml-exp:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--radius-sm);}
.ml-row{cursor:pointer;}
.ml-row:hover>td{background:var(--accent-soft);}
.ml-row.is-expanded>td{background:var(--accent-soft);}
/* keep the amber plan tint through row hover/expand so the plan-state signal never flickers to blue */
.ml-row:hover>td.ml-p,.ml-row.is-expanded>td.ml-p{background:var(--warn-bg);}
/* status chips (as-built + status-after) */
.ml-st{display:inline-block;border-radius:6px;padding:2px 9px;font-size:var(--fs-micro);white-space:nowrap;}
.ml-st-red{color:var(--danger);background:rgba(178,59,59,0.14);}
.ml-st-amber{color:var(--warn-ink);background:var(--warn-bg);}
.ml-st-green{color:#2f8f5a;background:rgba(95,179,122,0.16);}
.ml-st-grey{color:var(--muted);background:rgba(120,130,145,0.16);}
/* the per-row expand panel */
tr.ml-panel>td{background:var(--panel);padding:14px 16px 16px 36px;white-space:normal;border-bottom:1px solid var(--line);}
.ml-pnl{display:grid;grid-template-columns:1fr 1fr;gap:24px;max-width:1100px;}
.ml-pnl h5,.ml-opts h5{margin:0 0 6px;font-size:var(--fs-micro);letter-spacing:0.06em;text-transform:uppercase;color:var(--muted);}
.ml-line{margin:3px 0;color:var(--ink);}
.ml-muted{color:var(--muted);}
.ml-opts{margin-top:16px;max-width:1100px;}
.ml-optgrid{display:flex;flex-direction:column;}
.ml-opt{display:flex;gap:12px;align-items:baseline;padding:7px 0;border-top:1px solid var(--line);}
.ml-opt:first-child{border-top:0;}
.ml-opt.is-chosen{}
.ml-opt-k{width:20px;flex:0 0 auto;color:var(--muted);}
.ml-opt-label{flex:1 1 auto;color:var(--ink);}
.ml-opt-label.chosen{font-weight:var(--fw-semibold);}
.ml-opt-rec{color:var(--accent);font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.04em;margin-left:6px;}
.ml-opt-fig{flex:0 0 auto;color:var(--muted);}
.ml-opt-act{flex:0 0 auto;margin-left:12px;}
.ml-opt-chosen{color:var(--accent);font-weight:var(--fw-semibold);white-space:nowrap;}
.ml-choose{background:none;border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--accent);cursor:pointer;font-family:inherit;font-size:var(--fs-micro);padding:3px 12px;}
.ml-choose:hover{border-color:var(--accent);}
.ml-viewchart{cursor:pointer;}
/* Wave 4 — multi-source (absorb-donor) affordances. A RECEIVING site (plan absorbs from >1 in-market donor)
   carries an accent badge + its donor list in the expand panel; a DONOR/source site carries a neutral-warn
   badge, and its SITE cell gains a left accent stripe (is-linked) while a receiver it supplies is expanded, so
   the receiving ← donor relationship is visible in the running list. All colours ride the shell theme vars so
   light + dark both resolve. */
.ml-src-badge{display:inline-block;margin-left:8px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);letter-spacing:0.03em;border-radius:999px;padding:1px 8px;vertical-align:baseline;white-space:nowrap;}
.ml-src-recv{color:var(--accent);background:var(--accent-soft);border:1px solid var(--accent);}
.ml-src-donor{color:var(--warn-ink);background:var(--warn-bg);border:1px solid var(--warn-line);}
.ml-row.is-linked>td.ml-site{box-shadow:inset 3px 0 0 var(--accent);}
/* the inline donor ("Sources") list inside a receiving site's expand panel — indented + lighter than the row */
.ml-sources{margin-top:16px;max-width:1100px;padding-left:12px;border-left:2px solid var(--accent-soft);}
.ml-sources h5{margin:0 0 6px;font-size:var(--fs-micro);letter-spacing:0.06em;text-transform:uppercase;color:var(--muted);}
.ml-need{margin:0 0 8px;color:var(--ink);}
.ml-donor-list{list-style:none;margin:0 0 6px;padding:0;}
.ml-donor-item{display:flex;justify-content:space-between;gap:16px;padding:4px 8px;border-top:1px solid var(--line);color:var(--ink);}
.ml-donor-item:first-child{border-top:0;}
.ml-donor-name{flex:1 1 auto;}
.ml-donor-spare{flex:0 0 auto;color:var(--muted);font-variant-numeric:tabular-nums;}
/* Absorb allocation (2026-09-21) — the cost-ordered fill readouts + the inline supply/demand graph. Each
   spare/shortfall carries sq ft AND a labelled % (Addendum 2); the graph is a dependency-free SVG whose
   colours ride the shell theme tokens (light + dark both resolve), never inline. */
.ml-donor-alloc{flex:0 1 auto;color:var(--muted);font-variant-numeric:tabular-nums;text-align:right;}
.ml-donor-flag{color:var(--warn-ink);font-size:var(--fs-micro);font-weight:var(--fw-regular);}
.ml-need-short{margin:2px 0 8px;color:var(--danger);}
.ml-sd{margin-top:16px;max-width:1100px;}
.ml-sd h5{margin:0 0 6px;font-size:var(--fs-micro);letter-spacing:0.06em;text-transform:uppercase;color:var(--muted);}
.ml-sd-svg{display:block;width:100%;max-width:520px;height:auto;overflow:visible;}
.ml-sd-cap{fill:none;stroke:var(--muted);stroke-width:1.5;stroke-dasharray:4 3;}
.ml-sd-dem{fill:none;stroke:var(--danger);stroke-width:2;}
.ml-sd-rel{fill:none;stroke:var(--accent);stroke-width:2;stroke-dasharray:2 2;}
.ml-sd-mark{stroke:var(--warn);stroke-width:1.2;stroke-dasharray:3 2;}
.ml-sd-mark-t{fill:var(--warn-ink);font-size:9px;}
.ml-sd-axis{fill:var(--muted);font-size:9px;}
.ml-sd-grid{stroke:var(--line);stroke-width:1;}
.ml-sd-legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:6px;}
.ml-sd-key{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-micro);color:var(--muted);}
.ml-sd-sw{display:inline-block;width:14px;height:0;border-top-width:2px;border-top-style:solid;}
.ml-sd-sw-dem{border-top-color:var(--danger);}
.ml-sd-sw-cap{border-top-color:var(--muted);border-top-style:dashed;}
.ml-sd-sw-rel{border-top-color:var(--accent);border-top-style:dashed;}
.ml-sd-notes{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:6px;}
.ml-sd-note{font-size:var(--fs-micro);color:var(--muted);}
/* R73 new-request lane (card lane-new-request) — the "+ New request" seam control + the inline draft row. The
   control floats to the right of the "Plan options" toggle in the seam header (wireframe frame); the draft row
   spans the whole table with an editable field grid. Theme-aware via the shell vars (light + dark). */
.ml-newreq{float:right;background:none;border:0;cursor:pointer;color:var(--accent);font-family:inherit;font-size:var(--fs-micro);letter-spacing:0.06em;text-transform:uppercase;font-weight:var(--fw-semibold);padding:0;}
.ml-newreq:hover{color:var(--ink);}
.ml-newreq:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--radius-sm);}
tr.ml-draftrow>td{background:var(--panel);padding:14px 16px;white-space:normal;border-bottom:1px solid var(--line);}
.ml-dr{max-width:1000px;}
.ml-dr-eyebrow{font-size:var(--fs-micro);letter-spacing:0.06em;text-transform:uppercase;color:var(--muted);margin-bottom:6px;font-weight:var(--fw-semibold);}
.ml-dr-text{width:100%;box-sizing:border-box;font-family:inherit;font-size:var(--fs-small);color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-sm);padding:8px 10px;resize:vertical;min-height:44px;}
.ml-dr-text:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent);}
.ml-dr-note{color:var(--muted);font-size:var(--fs-micro);margin:6px 0 12px;}
.ml-dr-draftit{background:none;border:0;padding:0;color:var(--accent);font-family:inherit;font-size:var(--fs-micro);font-weight:var(--fw-semibold);cursor:pointer;}
.ml-dr-draftit:hover{text-decoration:underline;}
.ml-dr-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px 18px;}
.ml-dr-f{display:flex;flex-direction:column;gap:3px;}
.ml-dr-k{font-size:var(--fs-micro);text-transform:uppercase;letter-spacing:0.04em;color:var(--muted);font-weight:var(--fw-semibold);}
.ml-dr-in{font-family:inherit;font-size:var(--fs-small);color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-sm);padding:6px 8px;width:100%;box-sizing:border-box;}
.ml-dr-in:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent);}
.ml-dr-sub{font-size:var(--fs-micro);color:var(--muted);}
.ml-dr-ask{font-size:var(--fs-small);color:var(--warn-ink);}
.ml-dr-missing{color:var(--warn-ink);font-size:var(--fs-small);font-weight:var(--fw-semibold);margin:12px 0 0;}
.ml-dr-actions{display:flex;gap:12px;align-items:center;margin-top:12px;}
.ml-dr-save{background:var(--accent);color:var(--on-accent);border:1px solid var(--accent);border-radius:var(--radius-sm);padding:6px 14px;font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);cursor:pointer;}
.ml-dr-save:hover{filter:brightness(1.05);}
.ml-dr-save:disabled{opacity:0.55;cursor:default;filter:none;}
.ml-dr-discard{background:none;border:0;color:var(--muted);font-family:inherit;font-size:var(--fs-small);cursor:pointer;}
.ml-dr-discard:hover{color:var(--ink);}
.ml-dr-saved{color:var(--accent);font-size:var(--fs-small);font-weight:var(--fw-bold);margin:10px 0 0;}
@media(max-width:720px){.ml-dr-grid{grid-template-columns:1fr 1fr;}}
/* Model inputs sidebar section (above Filter) */
.ml-mi{margin-bottom:var(--space-4);padding-bottom:var(--space-3);border-bottom:1px solid var(--line);}
.ml-mi-head{margin-bottom:var(--space-2);}
.ml-mi-note{color:var(--muted);font-size:var(--fs-micro);margin:0 0 var(--space-2);}
.ml-mi-group{margin:0;border-top:1px solid var(--line);}
.ml-mi-group summary.ml-mi-sum{cursor:pointer;padding:6px 0;font-size:var(--fs-small);color:var(--ink);list-style:none;}
.ml-mi-group summary.ml-mi-sum::-webkit-details-marker{display:none;}
.ml-mi-sum::before{content:"▸ ";color:var(--accent);}
.ml-mi-group[open] summary.ml-mi-sum::before{content:"▾ ";}
.ml-mi-gbody{padding:0 0 8px 14px;}
.ml-mi-desc{color:var(--muted);font-size:var(--fs-micro);margin:4px 0 0;}
.ml-mi-link{font-size:var(--fs-micro);}
/* HOTFIX 2 — the inline model-input controls (space/capacity/hurdle fields, driver/criteria sliders, adjacency toggles) */
.ml-mi-field{display:flex;flex-direction:column;gap:2px;font-size:var(--fs-small);color:var(--ink);margin:0 0 8px;}
.ml-mi-num{width:100%;box-sizing:border-box;padding:4px 6px;border:1px solid var(--line);border-radius:var(--radius-sm,4px);background:var(--panel);color:var(--ink);font:inherit;}
.ml-mi-slrow{display:grid;grid-template-columns:1fr 90px 34px;align-items:center;gap:6px;margin:0 0 6px;font-size:var(--fs-small);color:var(--ink);}
/* sidebar-fix (defect 1) — the readability FLOOR: a slider label WRAPS to as many lines as it needs (word
   boundaries only, never a mid-word ellipsis) so "Proximity to operations & supply" reads in full at any rail
   width. Replaces the single-line overflow:hidden/text-overflow:ellipsis that truncated labels to "P... to
   o... & s..." in the narrow rail. min-width:0 lets the grid track shrink so wrapping (not overflow) happens;
   overflow-wrap:break-word is a safety net for a single word longer than the column. */
.ml-mi-slrow label{min-width:0;white-space:normal;overflow-wrap:break-word;line-height:1.3;}
.ml-mi-slider{width:100%;}
.ml-mi-slval{color:var(--muted);font-size:var(--fs-micro);text-align:right;}
.ml-mi-chk{display:flex;align-items:flex-start;gap:6px;font-size:var(--fs-small);color:var(--ink);margin:0 0 5px;cursor:pointer;}
.ml-mi-chk input{margin-top:2px;flex:0 0 auto;}
/* PR-73-001 — the editable adjacency MATRIX (replaces .ml-mi-chk list). A compact square-cell grid; it is
   inherently wider than the rail, so it scrolls horizontally inside .scroll-x (the page body never does).
   Status/type reads by SHAPE + COLOUR + a title/aria label, never colour alone (survives print + colour-blind,
   same discipline as the .rc-matrix coverage view). Colours reuse the theme's semantic triplets, so both
   light and dark render correctly with no per-theme override needed. */
.ml-adjmx-scroll{margin:2px 0 2px;}
.ml-adjmx{border-collapse:separate;border-spacing:2px;font-size:var(--fs-micro);}
.ml-adjmx th,.ml-adjmx td{padding:0;}
.ml-adjmx-corner{width:118px;}
.ml-adjmx-colh{width:22px;text-align:center;color:var(--muted);font-weight:var(--fw-semibold);vertical-align:bottom;}
.ml-adjmx-rowh{width:118px;max-width:118px;text-align:left;font-weight:var(--fw-normal);color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:6px;position:sticky;left:0;background:var(--panel);z-index:1;}
.ml-adjmx-rownum{color:var(--muted);font-weight:var(--fw-semibold);}
.ml-adjmx-rowlbl{color:var(--ink);}
.ml-adjmx-self{background:repeating-linear-gradient(-45deg,transparent,transparent 3px,var(--line) 3px,var(--line) 4px);border-radius:var(--radius-sm,4px);}
.ml-adjmx-empty{background:var(--bg);border-radius:var(--radius-sm,4px);opacity:.35;}
.ml-adjmx-cell{width:22px;height:22px;display:flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--line);border-radius:var(--radius-sm,4px);background:var(--panel);color:var(--muted);font:inherit;font-size:12px;line-height:1;cursor:pointer;transition:transform .08s ease,box-shadow .08s ease;}
.ml-adjmx-cell:hover{transform:scale(1.14);box-shadow:var(--shadow);z-index:2;}
.ml-adjmx-cell:focus-visible{outline:2px solid var(--accent);outline-offset:1px;z-index:2;}
.ml-adjmx-cell.is-must{background:var(--danger-bg);border-color:var(--danger-line);color:var(--danger-ink);}
.ml-adjmx-cell.is-prefer{background:var(--warn-bg);border-color:var(--warn-line);color:var(--warn-ink);}
.ml-adjmx-cell.is-off{background:var(--panel);border-color:var(--line);color:var(--muted);}
/* a cell the user has re-weighed away from its imported base wears an accent ring — honest visible-edit state */
.ml-adjmx-cell.is-changed{box-shadow:0 0 0 2px var(--accent-soft,var(--accent));}
.ml-adjmx-legend{display:flex;flex-wrap:wrap;gap:4px 12px;list-style:none;margin:8px 0 0;padding:0;font-size:var(--fs-micro);color:var(--muted);}
.ml-adjmx-legend li{display:flex;align-items:center;gap:5px;}
.ml-adjmx-key{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-sm,4px);border:1px solid var(--line);font-size:10px;line-height:1;}
.ml-adjmx-key.is-must{background:var(--danger-bg);border-color:var(--danger-line);color:var(--danger-ink);}
.ml-adjmx-key.is-prefer{background:var(--warn-bg);border-color:var(--warn-line);color:var(--warn-ink);}
.ml-adjmx-key.is-off{background:var(--panel);color:var(--muted);}
/* ≤820px: the rail expands full-width, so the matrix has more room — bump the touch target for a finger. */
@media (max-width:820px){
  .ml-adjmx-cell{width:28px;height:28px;font-size:14px;}
  .ml-adjmx-colh{width:28px;}
}
/* the View-chart right drawer (lives on <body>, slides in from the right, under the fixed header) */
.ml-drawer-host:not(.is-open){display:none;}
.ml-drawer-scrim{position:fixed;inset:0;z-index:49;background:transparent;}
.ml-drawer{position:fixed;top:var(--cp-topbar-h);right:0;bottom:0;width:420px;max-width:92vw;background:var(--panel);border-left:1px solid var(--line);padding:16px 18px;z-index:50;overflow-y:auto;box-shadow:var(--shadow);}
.ml-drawer-x{position:absolute;right:14px;top:12px;background:none;border:0;color:var(--muted);font-size:20px;cursor:pointer;line-height:1;}
.ml-drawer-x:hover{color:var(--ink);}
.ml-drawer h5{margin:0 0 12px;font-size:var(--fs-body);font-weight:var(--fw-semibold);}
.ml-drawer-chart{min-height:180px;}
.ml-drawer-leg{color:var(--muted);font-size:var(--fs-micro);margin-top:12px;line-height:var(--lh-body);}

/* R73 horizon lane (card AGE-63) — the hero strip: horizon segment control · read-only plan state · two impact
   tiles (sites-short delta, plan cost). Sits above the merged list in the page body; the shared fixed header +
   sidebar (plumbing lane) are untouched. */
.hz-hero{margin-bottom:var(--space-4);}
.hz-row{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap;}
.hz-row-controls{margin-bottom:var(--space-3);}
.hz-seg{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;background:var(--panel);}
.hz-seg-btn{background:none;border:0;border-right:1px solid var(--line);cursor:pointer;font-family:inherit;font-size:var(--fs-small);color:var(--muted);padding:6px 14px;white-space:nowrap;}
.hz-seg-btn:last-child{border-right:0;}
.hz-seg-btn:hover{color:var(--ink);}
.hz-seg-btn.is-on{background:var(--accent-soft);color:var(--ink);font-weight:var(--fw-semibold);}
.hz-seg-btn:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}
.hz-planstate{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:var(--fs-small);}
.hz-ps-chip{border:1px solid var(--line);border-radius:var(--radius-sm);padding:3px 10px;color:var(--muted);}
.hz-ps-chip.is-current{background:var(--accent-soft);border-color:var(--accent);color:var(--ink);font-weight:var(--fw-semibold);}
.hz-ps-chip.is-muted{color:var(--muted);}
.hz-ps-sep{color:var(--line);}
.hz-ps-meta{color:var(--muted);font-size:var(--fs-micro);width:100%;}
.hz-tiles{gap:var(--space-3);}
.hz-tile{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);padding:10px 16px;min-width:320px;flex:1 1 320px;}
.hz-tile-v{font-size:var(--fs-h2);font-weight:var(--fw-bold);color:var(--ink);font-variant-numeric:tabular-nums;}
.hz-arrow{color:var(--muted);font-weight:var(--fw-regular);}
.hz-arrow-down{color:#2f8f5a;}
.hz-tile-l{color:var(--muted);}
.hz-tile-s{color:var(--muted);font-size:var(--fs-micro);margin-left:auto;}
.hz-askfin{color:var(--accent);}
/* the spill-over line under the list — n projects pushed beyond the selected horizon */
.ml-spill{margin:10px 2px 0;color:var(--warn-ink);font-size:var(--fs-small);}
.ml-spill .ml-spill-n{font-weight:var(--fw-semibold);}
.ml-spill-none{color:var(--muted);}
/* status-after deferred marker + per-option beyond-horizon note */
.ml-defer{color:var(--warn-ink);font-size:var(--fs-micro);margin-left:6px;white-space:nowrap;}
.ml-opt-beyond{color:var(--warn-ink);}
/* R73 explicit-run — the Run to optimization control (prominent filled button) + last-run line. The button is
   the one control that recomputes the frozen results; a pending input edit puts it in an attention "stale"
   state and the line says so. */
.hz-run{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.hz-run-btn{background:var(--accent);color:#fff;border:1px solid var(--accent);border-radius:var(--radius-sm);cursor:pointer;font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);padding:7px 16px;white-space:nowrap;}
.hz-run-btn:hover{filter:brightness(1.06);}
.hz-run-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.hz-run-btn.is-stale{box-shadow:0 0 0 3px var(--accent-soft);}
.hz-lastrun{color:var(--muted);font-size:var(--fs-micro);}
.hz-lastrun.is-stale{color:var(--warn-ink);font-weight:var(--fw-semibold);}
/* R73 explicit-run — the before→after row markers: green ✓ improved · amber ! deferred-or-costlier. */
.ml-mark{display:inline-block;margin-left:8px;font-weight:var(--fw-bold);font-variant-numeric:tabular-nums;line-height:1;}
.ml-mark-up{color:#2f8f5a;}
.ml-mark-down{color:var(--warn-ink);}
/* R73 explicit-run — the "Prioritize near…" geographic control (dropdown + custom autocomplete + validation). */
.ml-geo{display:flex;flex-direction:column;gap:6px;}
.ml-geo-lbl{display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:var(--fs-micro);}
.ml-geo-mode,.ml-geo-custom{width:100%;padding:6px 8px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink);font-family:inherit;font-size:var(--fs-small);}
.ml-geo-mode:focus-visible,.ml-geo-custom:focus-visible{outline:2px solid var(--accent);outline-offset:-1px;}
.ml-geo-ok{color:var(--muted);font-size:var(--fs-micro);margin:2px 0 0;}
.ml-geo-err{color:var(--warn-ink);font-size:var(--fs-micro);font-weight:var(--fw-semibold);margin:2px 0 0;}

/* ---- Wave 5 — model-inputs expansion (radius · space errors · criticality · run spinner · row fade) ---- */
/* R3 — the "Prioritize near" priority radius (stored-ahead). A compact inline miles field + its honest note. */
.ml-geo-radius{flex-direction:row;align-items:center;gap:6px;color:var(--muted);font-size:var(--fs-micro);}
.ml-geo-radius input{width:80px;flex:0 0 auto;}
.ml-storeahead{font-style:italic;}
/* R4 — space-utilization inline errors: the field turns danger-bordered and the message shows below it. The
   `hidden` attribute keeps an empty message out of the a11y tree until it has text. */
.ml-mi-err{color:var(--danger);font-size:var(--fs-micro);font-weight:var(--fw-semibold);margin:2px 0 8px;}
.ml-mi-num.is-invalid,.ml-geo-radius input.is-invalid{border-color:var(--danger);outline-color:var(--danger);}
/* R5 — Investment Criticality: per-function radio triplet, colour-coded by level (mission red · high amber ·
   flexible grey). The level tint sits on each option chip; the selected one is emphasised (accent-soft fill). */
.ml-crit{display:flex;flex-direction:column;gap:8px;}
.ml-crit-row{display:flex;flex-direction:column;gap:3px;}
.ml-crit-fn{font-size:var(--fs-small);color:var(--ink);font-weight:var(--fw-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ml-crit-opts{display:flex;flex-wrap:wrap;gap:4px;}
.ml-crit-opt{display:inline-flex;align-items:center;gap:4px;font-size:var(--fs-micro);border:1px solid var(--line);border-radius:999px;padding:2px 8px;cursor:pointer;color:var(--muted);}
.ml-crit-opt input{margin:0;}
.ml-crit-opt.is-mission{border-color:var(--danger);color:var(--danger);accent-color:var(--danger);}
.ml-crit-opt.is-high{border-color:var(--warn-line);color:var(--warn-ink);accent-color:var(--warn-ink);}
.ml-crit-opt.is-flexible{border-color:var(--line);color:var(--muted);}
.ml-crit-opt:has(input:checked){background:var(--accent-soft);font-weight:var(--fw-semibold);}
/* G1 — the Run button's recompute state: a disabled, progress-cursor button with a spinner (text hidden). */
.hz-run-btn.is-running{color:transparent;cursor:progress;position:relative;}
.hz-run-btn.is-running::after{content:"";position:absolute;inset:0;margin:auto;width:14px;height:14px;border:2px solid rgba(255,255,255,0.45);border-top-color:#fff;border-radius:50%;animation:mlSpin 0.6s linear infinite;}
.hz-run-btn:disabled{opacity:0.85;cursor:progress;}
@keyframes mlSpin{to{transform:rotate(360deg);}}
/* G2 — the changed-row fade: rows that moved on the last Run get a one-shot 2s tint that fades to transparent,
   alongside the persistent ✓/! markers. Honours reduced-motion (no flash, instant settle). */
@keyframes mlRowFade{from{background:var(--warn-bg);}to{background:transparent;}}
.ml-row-changed>td{animation:mlRowFade 2s ease-out;}
@media (prefers-reduced-motion:reduce){.ml-row-changed>td{animation:none;}}

/* ---- R73 actuals + packet lane (card AGE-63) ------------------------------------------------------- */
/* The Actuals column: a comparison read (actual cost spent / occupancy date / size delivered) alongside the
   as-built + plan columns. Read-only; imported via CSV. Kept OUT of the collapsible plan group so it stays
   visible whether or not the plan columns are shown. */
.ml-actualhead{border-left:2px solid var(--accent-soft);white-space:nowrap;}
.ml-actuals{border-left:2px solid var(--accent-soft);vertical-align:top;}
.ml-actuals-cell{display:flex;flex-direction:column;line-height:1.35;}
.ml-actuals-cost{font-weight:var(--fw-semibold);color:var(--ink);font-variant-numeric:tabular-nums;}
.ml-actuals-sub{color:var(--muted);font-size:var(--fs-micro);}
.ml-actuals-none{color:var(--muted);font-size:var(--fs-small);}

/* The header action bar (Refresh baseline · Import actuals · Baseline history · Send FYxx for approval). */
.apk-actions{margin-top:var(--space-3);gap:var(--space-2);}
.apk-action{display:inline-flex;align-items:center;gap:6px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--ink);font-family:inherit;font-size:var(--fs-small);padding:7px 14px;cursor:pointer;}
.apk-action:hover{border-color:var(--accent);}
.apk-action:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
.apk-action-primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:var(--fw-semibold);}
.apk-action-primary:hover{filter:brightness(1.05);border-color:var(--accent);}
.apk-count{display:inline-block;min-width:18px;text-align:center;background:var(--accent-soft);color:var(--ink);border-radius:999px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);padding:0 6px;}

/* Modal dialogs (Import actuals · Send for approval) — a centred card over a dim scrim. */
.apk-modal-host:not(.is-open){display:none;}
.apk-modal-host{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:5vh 16px;}
.apk-scrim{position:fixed;inset:0;background:rgba(15,23,42,.45);}
.apk-dialog{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);box-shadow:var(--shadow);width:640px;max-width:96vw;max-height:90vh;overflow-y:auto;padding:22px 24px;z-index:61;}
.apk-x{position:absolute;right:14px;top:12px;background:none;border:0;color:var(--muted);font-size:22px;line-height:1;cursor:pointer;}
.apk-x:hover{color:var(--ink);}
.apk-title{margin:0 0 8px;font-size:var(--fs-h3);font-weight:var(--fw-semibold);color:var(--ink);}
.apk-note{color:var(--muted);font-size:var(--fs-small);line-height:var(--lh-body);margin:0 0 12px;}
.apk-req{color:var(--accent);font-size:var(--fs-micro);}
/* file uploader — the native input is hidden behind a styled label button */
.apk-file{display:inline-flex;align-items:center;gap:10px;margin:4px 0 12px;cursor:pointer;}
.apk-file input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;}
.apk-filebtn{display:inline-block;background:var(--accent-soft);border:1px solid var(--accent);border-radius:var(--radius-sm);color:var(--ink);font-size:var(--fs-small);padding:6px 14px;}
.apk-filename{color:var(--muted);font-size:var(--fs-small);}
/* column mapping */
.apk-map{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin:8px 0 14px;}
.apk-maprow{display:flex;flex-direction:column;gap:4px;}
.apk-maplabel{font-size:var(--fs-small);color:var(--ink);font-weight:var(--fw-semibold);}
.apk-select{font-family:inherit;font-size:var(--fs-small);padding:6px 8px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg);color:var(--ink);}
.apk-select:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
/* preview */
.apk-preview{margin:6px 0 12px;}
.apk-preview-label{font-size:var(--fs-small);color:var(--ink);font-weight:var(--fw-semibold);margin-bottom:6px;}
.apk-preview-table{width:100%;border-collapse:collapse;font-size:var(--fs-small);}
.apk-preview-table th,.apk-preview-table td{border:1px solid var(--line);padding:5px 8px;text-align:left;}
.apk-preview-table td.num,.apk-preview-table th.num{text-align:right;font-variant-numeric:tabular-nums;}
.apk-preview-table thead th{background:var(--accent-soft);color:var(--ink);}
.apk-error{color:var(--warn-ink);font-size:var(--fs-small);background:var(--warn-soft,rgba(220,38,38,.08));border:1px solid var(--warn-ink);border-radius:var(--radius-sm);padding:8px 12px;margin:6px 0;}
.apk-foot{display:flex;justify-content:flex-end;gap:10px;margin-top:14px;}
.apk-btn{font-family:inherit;font-size:var(--fs-small);border-radius:var(--radius-sm);padding:8px 18px;cursor:pointer;border:1px solid var(--line);}
.apk-btn-ghost{background:var(--panel);color:var(--ink);}
.apk-btn-ghost:hover{border-color:var(--accent);}
.apk-btn-primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:var(--fw-semibold);}
.apk-btn-primary:hover:not(:disabled){filter:brightness(1.05);}
.apk-btn:disabled{opacity:.5;cursor:not-allowed;}
.apk-approval{width:480px;}
/* baseline history — a right-side drawer listing prior baselines with a restore action */
.apk-drawer-host:not(.is-open){display:none;}
.apk-drawer-scrim{position:fixed;inset:0;z-index:59;background:rgba(15,23,42,.35);}
.apk-drawer{position:fixed;top:var(--cp-topbar-h);right:0;bottom:0;width:420px;max-width:92vw;background:var(--panel);border-left:1px solid var(--line);padding:18px 20px;z-index:60;overflow-y:auto;box-shadow:var(--shadow);}
.apk-bl-list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:8px;}
.apk-bl-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;}
.apk-bl-main{display:flex;flex-direction:column;gap:2px;min-width:0;}
.apk-bl-date{font-size:var(--fs-small);color:var(--ink);font-weight:var(--fw-semibold);}
.apk-bl-meta{font-size:var(--fs-micro);color:var(--muted);}
.apk-bl-current{display:inline-block;margin-left:6px;background:var(--accent-soft);color:var(--ink);border-radius:999px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);padding:0 8px;}
.apk-bl-empty{margin-top:12px;}

@media(max-width:900px){
  /* narrow: the dialogs go near-full-width; the baseline drawer narrows; actions wrap + scroll */
  .apk-dialog,.apk-approval{width:96vw;}
  .apk-map{grid-template-columns:1fr;}
  .apk-drawer{width:340px;}
  .apk-actions{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}
  .apk-action{white-space:nowrap;}
  /* narrow: the merged list still scrolls with SITE pinned; the drawer narrows */
  .ml-pnl{grid-template-columns:1fr;}
  .ml-drawer{width:360px;}
  .hz-planstate{margin-left:0;}
  .hz-run{width:100%;}
  .hz-tile{min-width:100%;}
  .hz-tile-s{margin-left:0;width:100%;}
}
@media print{.ml-drawer-host{display:none !important;}}

/* ============================================================================================
   LANE ask-labels (R73 v6) — the advisor-consultation workflow. Two surfaces:
     1. the per-row "?" (.ml-ask) + its modal popover (.ml-ask-pop) — "<what> — ask <who>";
     2. the collected "Questions for outside advisors" panel (.qp-panel), opened from the list header.
   Both are modal overlays (scrim + centered dialog), theme-aware from the shared tokens, hidden in print.
   ============================================================================================ */

/* --- the per-row "?" trigger + its count badge, and the list-header opener ------------------- */
.ml-site-name{margin-right:2px;}
.ml-ask{margin-left:6px;width:20px;height:20px;flex:0 0 auto;border-radius:999px;border:1px solid var(--line);
  background:var(--surface-2);color:var(--muted);font-size:var(--fs-micro);font-weight:var(--fw-bold);
  line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;position:relative;
  vertical-align:middle;padding:0;transition:background .12s ease,color .12s ease,border-color .12s ease;}
.ml-ask:hover{background:var(--accent);color:var(--on-accent);border-color:var(--accent);}
.ml-ask:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.ml-ask-n{position:absolute;top:-6px;right:-6px;min-width:15px;height:15px;padding:0 3px;border-radius:999px;
  background:var(--accent);color:var(--on-accent);font-size:9px;line-height:15px;font-weight:var(--fw-bold);text-align:center;}
.ml-sec-head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap;}
.ml-viewq{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;background:transparent;
  border:1px solid var(--line);border-radius:var(--radius-md);padding:5px 11px;color:var(--ink);
  font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);cursor:pointer;}
.ml-viewq:hover{border-color:var(--accent);color:var(--accent);}
.ml-viewq:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.ml-viewq-n{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--accent);color:var(--on-accent);
  font-size:var(--fs-micro);line-height:18px;font-weight:var(--fw-bold);text-align:center;}

/* --- shared overlay chrome (popover + panel) ------------------------------------------------- */
.ml-ask-host,.qp-host{position:fixed;inset:0;z-index:120;}
.ml-ask-scrim,.qp-scrim{position:fixed;inset:0;background:rgba(0,0,0,.42);}
.ml-ask-pop,.qp-panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1;
  width:min(460px,calc(100vw - 2*var(--space-4)));max-height:min(86vh,720px);display:flex;flex-direction:column;
  overflow:hidden;background:var(--panel);color:var(--ink);border:1px solid var(--line);
  border-radius:var(--radius-lg);box-shadow:var(--shadow);}
.qp-panel{width:min(600px,calc(100vw - 2*var(--space-4)));}
.ml-ask-head,.qp-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-3);
  padding:var(--space-4);background:var(--accent);color:var(--on-accent);}
.ml-ask-title,.qp-title{margin:0;font-size:var(--fs-h3);font-weight:var(--fw-bold);line-height:var(--lh-tight);}
.ml-ask-sub,.qp-count{margin:2px 0 0;font-size:var(--fs-micro);opacity:.9;}
.ml-ask-close,.qp-close{flex:0 0 auto;background:transparent;border:0;color:var(--on-accent);cursor:pointer;
  font-size:18px;line-height:1;padding:2px 6px;border-radius:var(--radius-sm);}
.ml-ask-close:hover,.qp-close:hover{opacity:.8;}
.ml-ask-close:focus-visible,.qp-close:focus-visible{outline:2px solid var(--on-accent);outline-offset:2px;}

/* --- the per-row popover body ---------------------------------------------------------------- */
.ml-ask-examples{padding:var(--space-3) var(--space-4) 0;}
.ml-ask-ex-lead{margin:0 0 6px;font-size:var(--fs-micro);color:var(--muted);}
.ml-ask-ex-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;}
.ml-ask-ex{width:100%;text-align:left;background:var(--surface-2);border:1px solid var(--line);
  border-radius:var(--radius-md);padding:7px 10px;color:var(--ink);font-family:inherit;font-size:var(--fs-small);cursor:pointer;}
.ml-ask-ex:hover{border-color:var(--accent);}
.ml-ask-ex:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
.ml-ask-form{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-4);overflow-y:auto;}
.ml-ask-field{display:flex;flex-direction:column;gap:4px;}
.ml-ask-flabel{font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--muted);}
.ml-ask-what,.ml-ask-who{width:100%;background:var(--bg);color:var(--ink);border:1px solid var(--line);
  border-radius:var(--radius-md);padding:var(--space-2) var(--space-3);font-family:inherit;font-size:var(--fs-small);}
.ml-ask-what{resize:vertical;min-height:52px;}
.ml-ask-what:focus-visible,.ml-ask-who:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent);}
.ml-ask-formactions{display:flex;justify-content:flex-end;}
.ml-ask-add{border:1px solid var(--accent);border-radius:var(--radius-md);background:var(--accent);color:var(--on-accent);
  padding:var(--space-2) var(--space-4);font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);cursor:pointer;}
.ml-ask-add:hover{filter:brightness(1.06);}
.ml-ask-add:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.ml-ask-existing-wrap{padding:0 var(--space-4);overflow-y:auto;}
.ml-ask-existing-lead{margin:0 0 6px;font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--muted);}
.ml-ask-none{margin:0;padding:0 0 var(--space-2);font-size:var(--fs-small);color:var(--muted);}
.ml-ask-q-list,.qp-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;}
.ml-ask-q,.qp-q{display:flex;align-items:flex-start;gap:8px;background:var(--surface-2);border:1px solid var(--line);
  border-radius:var(--radius-md);padding:7px 10px;font-size:var(--fs-small);line-height:1.35;}
.ml-ask-q-text,.qp-q-text{flex:1 1 auto;min-width:0;overflow-wrap:anywhere;}
.ml-ask-q-rm,.qp-q-remove{flex:0 0 auto;background:transparent;border:0;color:var(--muted);cursor:pointer;
  font-size:var(--fs-micro);line-height:1;padding:2px 4px;border-radius:var(--radius-sm);}
.ml-ask-q-rm:hover,.qp-q-remove:hover{color:var(--danger-ink,#c0392b);}
.ml-ask-q-rm:focus-visible,.qp-q-remove:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
.ml-ask-foot{padding:var(--space-3) var(--space-4) var(--space-4);border-top:1px solid var(--line);}
.ml-ask-viewall{background:transparent;border:0;color:var(--accent);font-family:inherit;font-size:var(--fs-small);
  font-weight:var(--fw-semibold);cursor:pointer;padding:0;}
.ml-ask-viewall:hover{text-decoration:underline;}
.ml-ask-viewall:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

/* --- the collected "Questions for outside advisors" panel ------------------------------------ */
.qp-toolbar{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap;padding:var(--space-3) var(--space-4);
  border-bottom:1px solid var(--line);background:var(--bg);}
.qp-group-toggle{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius-md);overflow:hidden;}
.qp-tog{background:transparent;border:0;padding:6px 11px;color:var(--ink);font-family:inherit;font-size:var(--fs-small);cursor:pointer;}
.qp-tog + .qp-tog{border-left:1px solid var(--line);}
.qp-tog.is-active{background:var(--accent);color:var(--on-accent);font-weight:var(--fw-semibold);}
.qp-tog:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}
.qp-filter{display:inline-flex;align-items:center;gap:6px;}
.qp-filter-label{font-size:var(--fs-micro);color:var(--muted);}
.qp-actions{margin-left:auto;display:inline-flex;gap:8px;}
.qp-btn{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);color:var(--ink);
  padding:6px 12px;font-family:inherit;font-size:var(--fs-small);font-weight:var(--fw-semibold);cursor:pointer;}
.qp-btn:hover{border-color:var(--accent);color:var(--accent);}
.qp-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.qp-btn-primary{border-color:var(--accent);background:var(--accent);color:var(--on-accent);}
.qp-btn-primary:hover{filter:brightness(1.06);color:var(--on-accent);}
.qp-body{flex:1 1 auto;overflow-y:auto;padding:var(--space-4);display:flex;flex-direction:column;gap:var(--space-4);}
.qp-group{display:flex;flex-direction:column;gap:8px;}
.qp-group-head{display:flex;align-items:center;gap:8px;margin:0;font-size:var(--fs-small);font-weight:var(--fw-bold);color:var(--ink);}
.qp-group-n{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);
  color:var(--muted);font-size:var(--fs-micro);line-height:18px;font-weight:var(--fw-semibold);text-align:center;}
.qp-who{flex:0 0 auto;align-self:center;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;
  padding:1px 8px;font-size:var(--fs-micro);color:var(--muted);white-space:nowrap;}
.qp-empty{margin:0;font-size:var(--fs-small);color:var(--muted);}
.qp-note{margin:0;padding:var(--space-3) var(--space-4);border-top:1px solid var(--line);font-size:var(--fs-small);color:var(--muted);}

@media(max-width:600px){
  .qp-toolbar{gap:var(--space-2);}
  .qp-actions{margin-left:0;width:100%;}
}
@media(prefers-reduced-motion:reduce){.ml-ask{transition:none;}}
@media print{.ml-ask,.ml-viewq,.ml-ask-host,.qp-host{display:none !important;}}
