/* Dark theme: activated by setting data-theme="dark" on <html> (see dashboard.js theme toggle).

   One flat background color everywhere - top bar, rail, page canvas, and
   every inline content section all share the exact same fill. Nothing is
   distinguished by a lighter/darker "card" background anymore; a border
   line is what defines a section (see .executive-project-hero and
   .workspace-copilot in styles.css for the equivalent light-mode treatment).
   Text is white throughout; only real links and semantic status colors
   (danger, score bands) carry any hue. Modals/floating menus still lean on
   box-shadow (--theruka-shadow/--theruka-card-shadow) to read as elevated
   over the same-colored page, same as Neon's own dropdowns. */

:root[data-theme="dark"]:not([data-print-theme="light"]) {
  color-scheme: dark;

  /* Base tokens (styles.css) */
  --bg: #0d0f13;
  --panel: #0d0f13;
  --panel-strong: #14171c;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --accent: #cbd5e1;
  --accent-strong: #f4f4f5;
  --accent-soft: rgba(255, 255, 255, 0.06);
  /* The light petrol (#14635a) is 2.71:1 on this page and unusable here; this
     is the same hue lifted until it reads, at 6.73:1. */
  --accent-brand: #4aa89c;
  --focus: #8b98a8;
  --sent: #1b1e24;
  --received: #14171c;
  --warn: #eab676;

  /* Semantic tints for the dark page.
     ------------------------------------------------------------------------
     Not a flip of the light values - the roles partly invert. A wash is a pale
     background in light and has to become a DARK tinted one here; a strong is
     dark ink in light and has to become light enough to read on a near-black
     page. So each keeps its family's hue and takes the lightness this page can
     use, measured rather than picked:

       wash     >= 1.15:1 on #0d0f13   visible as a tint without glowing
       surface  >= 1.5:1  on #0d0f13   reads as a filled chip
       line     >= 2.2:1  on #14171c   survives at one pixel
       strong   >= 4.5:1  on #0d0f13   it is text

     Hue is taken from each family's most-used light member (#b91c1c, #7a4b10,
     #2f7d55) so the three tiers stay one family rather than three neighbours. */
  --danger-wash: #331d1b;      /* 1.22:1 */
  --danger-surface: #512c28;   /* 1.59:1 */
  --danger-line: #814e48;      /* 2.67:1 */
  --danger-strong: #ff9589;    /* 9.05:1 */
  --warn-surface: #4b3216;     /* 1.61:1 */
  --warn-line: #795531;        /* 2.70:1 */
  --warn-wash: #302111;        /* 1.23:1 */
  --good-line: #396a4e;        /* 2.86:1 */
  --good-wash: #15291d;        /* 1.25:1 */
  --good-strong: #5cc98b;      /* 9.30:1 - it is text; beside --danger-strong's 9.05 */
  --shadow-resting: 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.32);
  --shadow-modal: 0 32px 70px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);

  /* dashboard-premium.css tokens */
  --theruka-green: #2fb27d;
  --theruka-green-strong: #6fd3a8;
  --theruka-green-soft: rgba(47, 178, 125, 0.16);
  --theruka-surface: #0d0f13;
  --theruka-surface-2: #14171c;
  --theruka-surface-3: #1b1e24;
  --theruka-page: #0d0f13;
  --theruka-rail: #0d0f13;
  --theruka-line: rgba(255, 255, 255, 0.16);
  --theruka-text: #ffffff;
  --theruka-muted: rgba(255, 255, 255, 0.72);
  --theruka-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  --theruka-card-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);

  /* design-refresh.css tokens. Same two-layer idea as light mode, one step
     apart instead of grey-on-white: the canvas stays the flat page color and
     the content card lifts off it just enough to read as a surface. */
  --canvas: #0d0f13;
  --surface: #14171c;
  --surface-soft: #1b1e24;
  --pill: rgba(255, 255, 255, 0.10);
  --pill-hover: rgba(255, 255, 255, 0.16);
  --nav-active: rgba(255, 255, 255, 0.14);
  --notice-bg: rgba(208, 112, 44, 0.14);
  --notice-line: rgba(208, 112, 44, 0.32);
  --notice-ink: #f0c9a8;
  --notice-accent: #d0702c;

  /* milestone-timeline-enhancements.css tokens */
  --theruka-ui-bg: #0d0f13;
  --theruka-panel-bg: rgba(20, 23, 28, 0.97);
  --theruka-soft-border: rgba(255, 255, 255, 0.14);
  --theruka-muted-text: rgba(255, 255, 255, 0.72);
  --theruka-strong-text: #ffffff;
  --theruka-shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.4);
}

/* Structural surfaces: explicit overrides in case a component sets a literal
   color instead of referencing the tokens above. */

:root[data-theme="dark"]:not([data-print-theme="light"]) body {
  background: var(--theruka-ui-bg);
  color: var(--theruka-strong-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .dashboard-shell.executive-dashboard-shell,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-dashboard-shell {
  background: var(--theruka-ui-bg);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .workspace-copilot {
  background: var(--theruka-rail);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

/* styles.css's .primary-rail-nav-group-toggle/.primary-rail-nav-item hover,
   expanded, and active states use rgba(18,24,23,...) - a dark tint that reads
   correctly on the light rail background but disappears against the dark
   one. Restore the light-on-dark rgba(255,255,255,...) treatment here. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .primary-rail-nav-group-toggle:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .primary-rail-nav-group-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .primary-rail-nav-group-toggle[aria-expanded="true"] {
  background: transparent;
  border-left-color: #5b9bff;
  color: #5b9bff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .primary-rail-nav-item:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .primary-rail-nav-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .primary-rail-nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .app-top-bar {
  background: var(--theruka-rail);
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .workspace-copilot-switcher {
  background: transparent;
}

/* Level 1 - sections/cards that sit directly on the page canvas. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-project-hero,
:root[data-theme="dark"]:not([data-print-theme="light"]) .plan-section,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-project-score-list,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-project-score-row,
:root[data-theme="dark"]:not([data-print-theme="light"]) .workspace-account-card,
:root[data-theme="dark"]:not([data-print-theme="light"]) .access-removed-panel,
:root[data-theme="dark"]:not([data-print-theme="light"]) .account-summary,
:root[data-theme="dark"]:not([data-print-theme="light"]) .sharing-link-row,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-scorecard,
:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge,
:root[data-theme="dark"]:not([data-print-theme="light"]) .account-plan-card,
:root[data-theme="dark"]:not([data-print-theme="light"]) .account-addon-list,
:root[data-theme="dark"]:not([data-print-theme="light"]) .account-data-mode,
:root[data-theme="dark"]:not([data-print-theme="light"]) .account-ai-tools,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-timeline-drift,
:root[data-theme="dark"]:not([data-print-theme="light"]) .compact-gantt-row,
:root[data-theme="dark"]:not([data-print-theme="light"]) .comments-thread-item,
:root[data-theme="dark"]:not([data-print-theme="light"]) .onboarding-template-button,
:root[data-theme="dark"]:not([data-print-theme="light"]) .automation-rule-row,
:root[data-theme="dark"]:not([data-print-theme="light"]) .webhook-list-item,
:root[data-theme="dark"]:not([data-print-theme="light"]) .webhook-event-fieldset,
:root[data-theme="dark"]:not([data-print-theme="light"]) .recipient-chip,
:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-recommendation-card,
:root[data-theme="dark"]:not([data-print-theme="light"]) .portfolio-drilldown-item,
:root[data-theme="dark"]:not([data-print-theme="light"]) .dashboard-profile-link,
:root[data-theme="dark"]:not([data-print-theme="light"]) .portfolio-rail-button,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-strip div,
:root[data-theme="dark"]:not([data-print-theme="light"]) .impact-date-chip,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-timeline-marker,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-timeline-card,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-impact-list li,
:root[data-theme="dark"]:not([data-print-theme="light"]) .entity-editor-form label.checkbox-row,
:root[data-theme="dark"]:not([data-print-theme="light"]) .export-option-form label,
:root[data-theme="dark"]:not([data-print-theme="light"]) .workspace-upload {
  background: var(--theruka-surface);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .portfolio-drilldown-item:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .dashboard-profile-link:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .portfolio-rail-button:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .export-option-form label:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .mobile-nav-toggle:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .score-explanation-close {
  background: var(--theruka-surface-3);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .upload-window-header,
:root[data-theme="dark"]:not([data-print-theme="light"]) .section-editor-header {
  border-bottom-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-strip dt {
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-strip dd {
  color: var(--theruka-strong-text);
}

/* "Nd late" on a project list row, which replaced the health badge below.
   It needs a dark rule of its own for the same reason the badge does: the
   blanket `... strong { color: var(--theruka-text) }` further down this file
   is (0,3,1), so the (0,2,1) rule in styles.css loses and the figure renders
   white. Caught by the colour gate, which read it as white on dark while
   light was correctly red. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-score-stack strong.project-late {
  color: var(--danger-strong);
}

/* Score bands - same semantic colors as the executive-metrics tiles above
   (low=red, mid=yellow, warn=orange, high=green), just as a pill badge
   instead of a filled tile. Covers health/complete/milestones/risk summary
   badges, milestone status badges, and inline tags like "Client Commitment"
   or "Moved". */
:root[data-theme="dark"]:not([data-print-theme="light"]) .score-badge.score-low {
  background: rgba(182, 76, 62, 0.28);
  color: #f3a898;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-badge.score-mid {
  background: rgba(201, 155, 17, 0.28);
  color: #e8c877;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-badge.score-warn {
  background: rgba(208, 112, 44, 0.28);
  color: #f0a05c;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-badge.score-high {
  background: rgba(58, 155, 93, 0.3);
  color: #6fd3a8;
}

/* .recommendation-priority is a <span>, so without its own dark-mode color it
   fell to the blanket "span { color: var(--theruka-muted-text) }" reset below
   (3 selector components beats this class pair's 2), leaving the AI
   Recommendations priority pill with light-mode background but near-white
   text - unreadable. Same score-band palette as .score-badge above. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .recommendation-priority.score-low {
  background: rgba(182, 76, 62, 0.28);
  color: #f3a898;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .recommendation-priority.score-mid {
  background: rgba(201, 155, 17, 0.28);
  color: #e8c877;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .recommendation-priority.score-warn {
  background: rgba(208, 112, 44, 0.28);
  color: #f0a05c;
}

/* .risk-verdict-badge is a <span> too, so it needs its own colors here for the
   same reason as .recommendation-priority above. Pending/inconclusive verdicts
   carry no score band and are left to the muted-span default deliberately. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .report-readiness-clean {
  background: rgba(58, 155, 93, 0.16);
  border-color: rgba(58, 155, 93, 0.4);
}

/* .milestone-confirm-tag is a <span> too - same blanket-reset trap as
   .recommendation-priority and .risk-verdict-badge above. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-confirm-tag.score-high {
  background: rgba(58, 155, 93, 0.3);
  border-color: rgba(58, 155, 93, 0.45);
  color: #6fd3a8;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-confirm-tag.score-mid {
  background: rgba(201, 155, 17, 0.28);
  border-color: rgba(201, 155, 17, 0.45);
  color: #e8c877;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-confirm-tag.score-low {
  background: rgba(182, 76, 62, 0.28);
  border-color: rgba(182, 76, 62, 0.45);
  color: #f3a898;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-verdict-badge.score-low {
  background: rgba(182, 76, 62, 0.28);
  border-color: rgba(182, 76, 62, 0.45);
  color: #f3a898;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-verdict-badge.score-mid {
  background: rgba(201, 155, 17, 0.28);
  border-color: rgba(201, 155, 17, 0.45);
  color: #e8c877;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-verdict-badge.score-high {
  background: rgba(58, 155, 93, 0.3);
  border-color: rgba(58, 155, 93, 0.45);
  color: #6fd3a8;
}

/* Level 2 - modals and floating panels, one step lighter than level-1 cards so
   they visibly float above whatever page content sits behind them. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .pending-plan-review:not(:empty),
:root[data-theme="dark"]:not([data-print-theme="light"]) .upload-window-panel,
:root[data-theme="dark"]:not([data-print-theme="light"]) .confirm-panel,
:root[data-theme="dark"]:not([data-print-theme="light"]) .section-editor-panel,
:root[data-theme="dark"]:not([data-print-theme="light"]) .floating-detail-panel,
:root[data-theme="dark"]:not([data-print-theme="light"]) .onboarding-welcome-panel,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-focus-board,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-fork-marker div,
:root[data-theme="dark"]:not([data-print-theme="light"]) .fork-detail-panel,
:root[data-theme="dark"]:not([data-print-theme="light"]) .notification-dropdown,
:root[data-theme="dark"]:not([data-print-theme="light"]) .onboarding-welcome-step,
:root[data-theme="dark"]:not([data-print-theme="light"]) .cost-card,
:root[data-theme="dark"]:not([data-print-theme="light"]) .admin-card,
:root[data-theme="dark"]:not([data-print-theme="light"]) .decision-card {
  background: var(--theruka-surface-2);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .fork-detail-panel-title {
  color: #f1a996;
}

/* Level 3 - editable rows and other blocks nested one layer inside a level-2
   modal (e.g. a risk/decision row inside the section editor, or an impact/
   mitigation entry inside a risk row), lighter again so they read as their
   own layer instead of blending into the modal around them. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .section-editor-row,
:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-subentity-block,
:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-subentity-list li,
:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-milestone-checklist label.checkbox-row,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-focus-related details,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-focus-detail dl div {
  background: var(--theruka-surface-3);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-editor-row.resolved input {
  background: rgba(255, 255, 255, 0.04);
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) h1,
:root[data-theme="dark"]:not([data-print-theme="light"]) h2,
:root[data-theme="dark"]:not([data-print-theme="light"]) h3,
:root[data-theme="dark"]:not([data-print-theme="light"]) h4,
:root[data-theme="dark"]:not([data-print-theme="light"]) strong {
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) p,
:root[data-theme="dark"]:not([data-print-theme="light"]) small,
:root[data-theme="dark"]:not([data-print-theme="light"]) span,
:root[data-theme="dark"]:not([data-print-theme="light"]) .eyebrow,
:root[data-theme="dark"]:not([data-print-theme="light"]) .compact-scale span {
  color: var(--theruka-muted-text);
}

/* Two button styles only: primary (unclassed <button>, e.g. every Save/Create
   submit button - this codebase's existing convention already writes those
   as plain <button>/<button type="submit"> with no class) is a solid white
   fill with black text; everything else (.secondary-button/.sample-button)
   is an outline that just borrows whatever background already sits behind
   it, with a white border and white text.

   button:not([class]) - not just plain `button` - is deliberate: dozens of
   ghost/tab/menu-style buttons across the app (.rail-section-toggle,
   .primary-rail-nav-item, .project-detail-menu button, .account-popover-item,
   etc.) only override `background` for their own look and rely on inherited
   `color` from the surrounding text - they never set their own explicit
   color. A bare `button` selector here would have contributed a color
   declaration those buttons don't already have a competing one for, painting
   their labels black regardless of specificity. Since every one of those
   components carries at least one class, :not([class]) excludes all of them
   at the selector level rather than trying to out-specificity-fight each one. */
:root[data-theme="dark"]:not([data-print-theme="light"]) button:not([class]) {
  background: #ffffff;
  border-color: #ffffff;
  color: #14171c;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) button:not([class]):hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .secondary-button,
:root[data-theme="dark"]:not([data-print-theme="light"]) .sample-button {
  background: transparent;
  border-color: #ffffff;
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .secondary-button:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .sample-button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) button:disabled {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--theruka-line);
  color: rgba(233, 235, 238, 0.35);
}

/* Wins the specificity tie with the .secondary-button dark override above (same
   selector prefix, declared later) so the terminate confirmation stays visibly red
   in dark mode instead of blending into the neutral secondary-button treatment. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .confirm-danger-button {
  background: #a33a2a;
  border-color: #a33a2a;
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .confirm-danger-button:hover {
  background: #c04a35;
  border-color: #c04a35;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .section-row-delete {
  background: rgba(163, 58, 42, 0.18);
  border-color: rgba(163, 58, 42, 0.4);
  color: #e8a99c;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .portfolio-upload-button:not(.secondary-button) {
  background: var(--theruka-green);
  color: #08150f;
}

/* background-COLOR, not the background shorthand. <select> now carries its own
   drop-down chevron as a background-image (styles.css), and the shorthand resets
   background-image to none - which would strip the arrow from every select in
   dark mode and leave a text field that silently opens a menu. */
:root[data-theme="dark"]:not([data-print-theme="light"]) input,
:root[data-theme="dark"]:not([data-print-theme="light"]) textarea,
:root[data-theme="dark"]:not([data-print-theme="light"]) select {
  background-color: var(--theruka-surface);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

/* The calendar button is a dark glyph drawn by the browser, invisible against a
   dark field. Inverting it is the only handle CSS has on it. */
:root[data-theme="dark"]:not([data-print-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.55;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.95;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) input::placeholder,
:root[data-theme="dark"]:not([data-print-theme="light"]) textarea::placeholder {
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .upload-window {
  background: rgba(0, 0, 0, 0.65);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .admin-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-project-score-row {
  border-top-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-project-score-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-cell {
  border-left-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-track {
  background: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-menu,
:root[data-theme="dark"]:not([data-print-theme="light"]) .workspace-section-menu .project-detail-menu {
  background: var(--theruka-surface-2);
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-menu h3,
:root[data-theme="dark"]:not([data-print-theme="light"]) .workspace-section-menu .project-detail-menu h3 {
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-menu button {
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .workspace-section-menu .project-detail-menu strong,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-menu strong {
  background: var(--theruka-green-soft);
  color: var(--theruka-green-strong);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-menu button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-detail-menu button.active {
  background: var(--theruka-green-soft);
  border-color: var(--theruka-line);
  border-left-color: var(--theruka-green);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .empty-state-glyph {
  color: var(--theruka-muted-text);
}

/* Both of these hardcode a light mint background in styles.css (#eef4f2) with
   no matching dark-mode override, so their text - which just inherits white
   from --ink - was rendering as white-on-near-white and reading as a blank
   pill/banner. Same soft-green "notice" treatment used elsewhere in dark
   mode (see .project-detail-menu strong above). */
:root[data-theme="dark"]:not([data-print-theme="light"]) .subscription-pending-banner {
  background: var(--theruka-green-soft);
  border-color: var(--theruka-green);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .account-plan-badge {
  background: var(--theruka-green-soft);
  color: var(--theruka-green-strong);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .dashboard-brand-logo .theme-logo-light {
  display: none;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .dashboard-brand-logo .theme-logo-dark {
  display: block;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .collapsible-section-heading:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .rail-section-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .dashboard-account-badge {
  color: var(--theruka-green-strong);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .site-footer,
:root[data-theme="dark"]:not([data-print-theme="light"]) .app-page-footer {
  background: var(--theruka-ui-bg);
  border-color: var(--theruka-line);
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* Base/unclassed stat tiles (e.g. "Timeline moves", "Next delivery signal", and
   every executive-metrics tile without a score band) default to a hardcoded white
   background in light mode with no dark-mode counterpart - only their score-band
   siblings (score-low/mid/warn/high, below) were covered. This is deliberately
   less specific than those score-band rules (class+element vs class+class), so
   they still win for tiles that have a color-coded meaning. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary div,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics div,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics button {
  background: var(--theruka-surface);
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics button:hover {
  background: var(--theruka-green-soft);
  border-color: var(--theruka-green);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics .score-low,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-low {
  background: rgba(182, 76, 62, 0.14);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics .score-mid,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-mid {
  background: rgba(201, 155, 17, 0.14);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics .score-warn,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-warn {
  background: rgba(208, 112, 44, 0.14);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics .score-high,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-high {
  background: rgba(58, 155, 93, 0.16);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .compact-gantt-label,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-label-button {
  background: var(--theruka-surface);
  border-color: var(--theruka-soft-border);
  color: var(--theruka-strong-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .compact-gantt-track {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border-color: var(--theruka-soft-border);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .section-editor-row.resolved {
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .compact-edit-milestone {
  background: var(--theruka-surface);
  border-color: var(--theruka-green);
  color: var(--theruka-green-strong);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-today-line em {
  background: rgba(255, 255, 255, 0.06);
  color: #f0a05c;
}

/* The timeline canvas (calendar scale + track) stayed hardcoded light before -
   a bright white panel dropped into an otherwise dark modal reads as broken,
   not "a chart with a light background". Give it real dark surfaces instead. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-gantt-track {
  background: var(--theruka-surface);
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-calendar-scale {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    var(--theruka-surface);
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-calendar-scale span {
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-track-date,
:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-track-date.finish {
  background: var(--theruka-line);
  border-color: var(--theruka-line);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-track-date.fork {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .milestone-track-date.fork.risk-open {
  background: rgba(185, 28, 28, 0.18);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

/* Dots punch a border matching whatever the track's own background is, so
   they read as "sitting on the line" rather than a mismatched light ring. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .track-dot {
  border-color: var(--theruka-surface);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .subscription-limit-banner {
  background: #241c0f;
  border-color: #6b4805;
  color: #eab676;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .subscription-limit-banner strong {
  color: #eab676;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .subscription-limit-warning {
  color: var(--warn);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .notification-bell-button {
  background: transparent !important;
  border-color: #ffffff !important;
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .notification-dropdown-header,
:root[data-theme="dark"]:not([data-print-theme="light"]) .notification-item {
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .notification-item.unread {
  background: rgba(45, 200, 120, 0.12);
}

/* The questions block keeps its indigo identity in the dark theme - a tint that
   survives, not a light-mode card dropped onto a dark panel. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .report-preflight-section {
  background: rgba(109, 92, 224, 0.14);
  border-color: rgba(140, 126, 235, 0.34);
  border-left-color: #8c7eeb;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .report-preflight-section h4 {
  color: #b9afff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .report-preflight-section .report-questions-progress,
:root[data-theme="dark"]:not([data-print-theme="light"]) .report-preflight-section .report-questions-recovered {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(140, 126, 235, 0.34);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .notification-item.notification-navigable:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .notification-item.notification-navigable:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge-track {
  stroke: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge-readout strong {
  color: var(--theruka-strong-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge-label {
  color: var(--theruka-muted-text);
}

/* Three self-contained mini-theming components (Health/Complete/Milestones/Risk
   score tiles, the portfolio score table cells, and the overall-score gauge)
   each drive their own colors through local --score-accent/--score-soft custom
   properties set per score band, entirely independent of the --theruka-*
   tokens above - none of it was dark-aware before. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card {
  --score-accent: #a3acb6;
  --score-soft: rgba(255, 255, 255, 0.05);
  background: var(--theruka-surface);
  border-left-color: var(--theruka-line);
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card-top span {
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card > strong {
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-bar {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card small {
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-detail {
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-label {
  color: var(--theruka-muted-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-cell strong {
  color: var(--theruka-strong-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-cell {
  --score-accent: #a3acb6;
  --score-soft: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-scorecard {
  color: var(--theruka-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card.score-low,
:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-cell.score-low,
:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge.score-low {
  --score-accent: #e08a7a;
  --score-soft: rgba(182, 76, 62, 0.16);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card.score-mid,
:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-cell.score-mid,
:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge.score-mid {
  --score-accent: #e8c877;
  --score-soft: rgba(201, 155, 17, 0.16);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card.score-warn,
:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-cell.score-warn,
:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge.score-warn {
  --score-accent: #f0a05c;
  --score-soft: rgba(208, 112, 44, 0.16);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-score-card.score-high,
:root[data-theme="dark"]:not([data-print-theme="light"]) .score-table-cell.score-high,
:root[data-theme="dark"]:not([data-print-theme="light"]) .global-score-gauge.score-high {
  --score-accent: #6fd3a8;
  --score-soft: rgba(58, 155, 93, 0.18);
}

/* Open but with nothing decided about it. Red against the dark card, using the
   token whose dark value was measured at 9.05:1, so it separates from the amber
   of a managed open risk rather than blending into it. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-status-pill.undecided {
  background: rgba(255, 149, 137, 0.16);
  color: var(--danger-strong);
}

/* Badges - amber for "open/awaiting", neutral for "closed/completed", same
   semantic split as light mode, adjusted for contrast against dark surfaces. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-status-pill.open,
:root[data-theme="dark"]:not([data-print-theme="light"]) .status.awaiting_outcome {
  background: rgba(234, 182, 118, 0.18);
  color: #eab676;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-status-pill.closed,
:root[data-theme="dark"]:not([data-print-theme="light"]) .status.completed,
:root[data-theme="dark"]:not([data-print-theme="light"]) .risk-lifecycle-meta span,
:root[data-theme="dark"]:not([data-print-theme="light"]) .attribution-role {
  background: rgba(255, 255, 255, 0.08);
  color: var(--theruka-strong-text);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .adoption-status-pill.warn {
  background: rgba(234, 182, 118, 0.18);
  color: #eab676;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .adoption-status-pill.stale {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .adoption-status-pill.good,
:root[data-theme="dark"]:not([data-print-theme="light"]) .adoption-status-pill.none {
  background: rgba(255, 255, 255, 0.08);
  color: var(--theruka-strong-text);
}

/* Scope badge (see .scope-badge in styles.css) - the light-mode tints are too
   dark to read against the dark surface, so lift the text and drop the fill. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .scope-badge-portfolio {
  background: rgba(245, 179, 66, 0.16);
  color: #f0b95f;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .scope-badge-project {
  background: rgba(91, 155, 255, 0.18);
  color: #8ab6ff;
}

/* The two report kinds, same treatment for the same reason - the light-mode
   teal and violet are too dark to read against the dark surface. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .report-badge-live {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .report-badge-frozen {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
}

/* The tinted report rails are gone - Reports is a list now, and the two kinds
   are told apart by a word in a column rather than by a wash behind a panel
   (see the note on .reports-index in design-refresh.css). The badge colours
   above are kept: on a row, beside the word, a hue reinforces rather than
   carries the meaning on its own.

   The table itself needs nothing here. Its border and hover both resolve
   through --line and --pill, which this file already redefines. */

/* ---------------------------------------------------------------------------
   design-refresh.css counterparts
   ---------------------------------------------------------------------------
   The refresh layer paints everything through the tokens declared at the top
   of this file, so most of it needs nothing here. These are the components
   that already carried an explicit dark-mode background from the previous
   (bordered-card) design and would otherwise keep it while light mode goes
   flat - plus the two-layer canvas/card split, which dark mode expresses as
   one step of lift rather than grey-on-white. */

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-dashboard {
  background: var(--surface);
  border-color: var(--theruka-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .primary-rail-nav-flyout,
:root[data-theme="dark"]:not([data-print-theme="light"]) .rail-search {
  background: var(--surface);
  border-color: var(--theruka-line);
}

/* Stat tiles are numbers on the card now, not boxes - including the score
   bands, which keep their meaning through the colored left rule they already
   have in styles.css. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary div,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics div,
:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics button,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-low,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-mid,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-warn,
:root[data-theme="dark"]:not([data-print-theme="light"]) .project-focus-summary .score-high {
  background: none;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .executive-metrics button:hover {
  background: var(--surface-soft);
  border-color: transparent;
}

/* Secondary actions are filled pills in both themes now (they used to be
   outlined here), so the header/hero action rows read the same way. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .secondary-button,
:root[data-theme="dark"]:not([data-print-theme="light"]) .sample-button {
  background: var(--pill);
  border-color: transparent;
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .secondary-button:hover,
:root[data-theme="dark"]:not([data-print-theme="light"]) .sample-button:hover {
  background: var(--pill-hover);
  border-color: transparent;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .list-row-initial {
  background: var(--pill);
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-dashboard .plan-section.attention-section {
  background: var(--notice-bg);
  border-color: var(--notice-line);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .project-dashboard .plan-section.attention-section h3 {
  color: var(--notice-ink);
}

/* Owner picker. The blanket `span { color: var(--theruka-muted-text) }` reset
   would otherwise win over the option's own colours, so both the strong and the
   span are set explicitly here (same reason as .recommendation-priority). */
html[data-theme="dark"] .owner-picker-dropdown {
  /* Opaque, not translucent: this floats over the page and anything showing
     through it makes the names underneath unreadable. */
  background: #14171c;
  border-color: var(--theruka-line);
}

html[data-theme="dark"] .owner-picker-option strong {
  color: var(--theruka-text);
}

html[data-theme="dark"] .owner-picker-option span {
  color: var(--theruka-muted-text);
}

html[data-theme="dark"] .owner-picker-option:hover,
html[data-theme="dark"] .owner-picker-option.active {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .owner-picker-add {
  border-top-color: var(--theruka-line);
}

html[data-theme="dark"] .owner-picker-add strong {
  color: #a5b4fc;
}

html[data-theme="dark"] .owner-picker-empty,
html[data-theme="dark"] .owner-picker-seat-note {
  color: var(--theruka-muted-text);
}

/* ---------------------------------------------------------------------------
   Check-in action buttons in dark mode.
   The generic dark .secondary-button rule is a white border on transparent,
   which these rows never inherited - they render from their own classes in
   styles.css, so they need their own dark treatment or they fall back to a
   light-mode fill on a near-black card.
   --------------------------------------------------------------------------- */

:root[data-theme="dark"]:not([data-print-theme="light"]) .check-in-item-actions button {
  border-color: rgba(255, 255, 255, 0.28);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .check-in-item-actions .check-in-answer-button {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .check-in-item-actions .check-in-answer-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
}

/* The one the report singled out as invisible: transparent, borderless, and
   green-on-near-black. It keeps the accent colour - which is what says "this
   goes somewhere" - but now has an edge to be seen by. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .check-in-item-actions .check-in-go-button {
  background: transparent;
  border-color: var(--theruka-green-strong);
  color: var(--theruka-green-strong);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .check-in-item-actions .check-in-go-button:hover {
  background: rgba(47, 178, 125, 0.18);
  border-color: var(--theruka-green-strong);
}

/* Gantt row banding in dark mode. The eight tints and the row-colour control
   they belonged to are gone (see styles.css); what is left is the same neutral
   zebra, lightened rather than darkened because it sits over a near-black card
   instead of a white one. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .gantt-grid-list .gantt-row-alt .milestone-gantt-label,
:root[data-theme="dark"]:not([data-print-theme="light"]) .gantt-grid-list .gantt-row-alt .milestone-gantt-track {
  background-color: rgba(255, 255, 255, 0.035);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .gantt-grid-list .milestone-gantt-row + .milestone-gantt-row {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Trial. Translucent washes over the dark surface rather than the light-mode
   cards, which would land as bright rectangles under the top bar. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .trial-bar,
:root[data-theme="dark"]:not([data-print-theme="light"]) .subscription-trial-banner {
  background: rgba(96, 148, 230, 0.14);
  border-color: rgba(120, 165, 235, 0.32);
  color: #cfe0fb;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .trial-bar.trial-bar-ending,
:root[data-theme="dark"]:not([data-print-theme="light"]) .subscription-trial-banner.ending {
  background: rgba(226, 160, 63, 0.16);
  border-color: rgba(232, 179, 98, 0.36);
  color: #f2d6a8;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .trial-bar-button {
  background: #cfe0fb;
  color: #10243f;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .trial-bar.trial-bar-ending .trial-bar-button {
  background: #f2d6a8;
  color: #3d2708;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .subscription-suspended-banner {
  background: rgba(224, 96, 96, 0.14);
  border-color: rgba(232, 128, 128, 0.34);
  color: #f4c9c9;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .trial-decision-reassurance {
  background: rgba(60, 170, 110, 0.14);
  border-left-color: #4fbf85;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .seat-selection-list label:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Terminating the subscription. Same translucent wash as the delete block below
   it, in amber rather than red - the light-mode pair are deliberately different
   colours because one is reversible and the other is not, and washing both to
   the same red here would throw that away. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .account-terminate-zone {
  background: rgba(224, 176, 96, 0.13);
  border-color: rgba(232, 190, 128, 0.32);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .account-terminate-zone header strong {
  color: #f0dcb4;
}

/* Delete account. Same translucent-wash treatment as the other danger surfaces
   rather than the light-mode card, which lands as a bright block on a dark page. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .account-danger-zone {
  background: rgba(224, 96, 96, 0.14);
  border-color: rgba(232, 128, 128, 0.34);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .account-danger-zone header strong {
  color: #f4c9c9;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-status {
  background: rgba(244, 165, 165, 0.12);
  color: #f4a5a5;
}

/* The delete dialog's own surfaces. The light theme's red tints are mixed
   against white, so on a dark panel they read as muddy brown rather than as a
   warning - each one is re-stepped here rather than left to blend. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-steps {
  border-left-color: rgba(244, 165, 165, 0.32);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-steps li::before {
  background: rgba(244, 165, 165, 0.16);
  color: #f4a5a5;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-keeps {
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-scope {
  background: rgba(244, 165, 165, 0.1);
  border-color: rgba(244, 165, 165, 0.4);
  color: #f4c9c9;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-scope strong {
  color: #f4a5a5;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-field input:focus-visible {
  border-color: #f4a5a5;
  box-shadow: 0 0 0 3px rgba(244, 165, 165, 0.2);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .delete-account-field input[data-confirm-match="yes"] {
  border-color: #6fbf8b;
}

/* Trend badges carried hard-coded light-mode fills and no dark counterpart, so
   on a dark surface they rendered as blank white pills - the arrow and the delta
   were still there, just unreadable. The score bars put these next to the hero
   figure, which is where it started showing. Same tints as .score-badge above. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .trend-good {
  background: rgba(58, 155, 93, 0.3);
  color: #6fd3a8;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .trend-bad {
  background: rgba(190, 70, 62, 0.32);
  color: #f4a5a5;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .trend-flat {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

/* The change strip's deltas use the light-mode red/green, which sit at roughly
   2.8:1 against the dark surface - legible as a colour, not as small bold text.
   These are the lighter steps used for the badges above. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .change-worse .change-delta {
  color: #f4a5a5;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .change-better .change-delta {
  color: #6fd3a8;
}

/* The recommended-cycle card and its badge carry the same light-mode green the
   trial reassurance panel uses, so they get the same dark treatment: a tint
   rather than a fill, and the lighter green that stays legible on it. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .billing-cycle-recommended {
  background: rgba(60, 170, 110, 0.14);
  border-color: #4fbf85;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .billing-cycle-option:hover {
  border-color: #4fbf85;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .billing-cycle-badge {
  background: #4fbf85;
  color: #0f1417;
}

/* The resolution options are cards on the panel surface, and the lead/danger
   accents are the same light-mode greens and reds used elsewhere in this file. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-option {
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-option:hover {
  border-color: #4fbf85;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-lead {
  background: rgba(60, 170, 110, 0.14);
  border-color: #4fbf85;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-danger:hover {
  border-color: #f4a5a5;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-danger .payment-resolution-label {
  color: #f4a5a5;
}

/* Same reason as light: the base button rule's white text would otherwise carry
   into the card labels, which here happens to be legible but is not the token. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-option,
:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-label {
  color: var(--ink);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-lead:hover {
  background: rgba(60, 170, 110, 0.2);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .payment-resolution-danger .payment-resolution-label {
  color: #f4a5a5;
}

/* --danger is never actually defined, so the required-fields message falls back
   to a light-mode red that sits at roughly 2:1 on this surface. The "still
   needed" line is the one thing in that dialog somebody has to read. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .required-fields-status {
  color: #f4a5a5;
}

/* The first-run planner card keeps its "this is step one" emphasis in dark
   mode. The shared .onboarding-welcome-step rule above outranks the card's own
   class by specificity, so without this it flattens into the same surface as
   the four cards under it and stops leading anything. Border rather than a
   tinted fill: the light-mode green wash is unreadable against this surface. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .onboarding-welcome-step-planner {
  border-color: var(--theruka-green-strong);
}

/* ---------------------------------------------------------------------------
   theruKO in the dark.

   Two things were wrong rather than merely plain. The bubble and the "Show
   more" label were painted with var(--brand), a token THIS CODEBASE DOES NOT
   DEFINE - so both fell back to a light-mode literal (#2f6f4f) and sat as a
   dark green on a near-black panel, which is why parts of the conversation
   read as missing. They use --accent-brand now, which is defined in both
   themes, so this block is about refinement rather than rescue.

   THE RULES BETWEEN ENTRIES. A flat 1px line at 16% white is what a dark theme
   looks like before anyone has looked at it: on a near-black ground an even
   hairline reads as a scratch across the panel, because there is no ambient
   light to soften its ends. Fading it out at both edges is the detail that
   separates a considered dark mode from an inverted light one - the rule is
   strongest where the eye needs the separation, in the middle of the text
   column, and disappears where it would otherwise collide with the panel edge.
   ------------------------------------------------------------------------ */

:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-reading-entry {
  border-bottom: 0;
  position: relative;
}

/* In the chat, bubbles separate the messages and a rule between them would
   cut across both sides at once. The faded rule moves to the one line a chat
   does have: the edge between the conversation and the box. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-chat .ai-reading-entry::after {
  display: none;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-chat .ai-ask {
  border-top-color: transparent;
  background-image: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.18) 12%,
    rgba(255, 255, 255, 0.18) 88%,
    transparent
  );
  background-position: top;
  background-repeat: no-repeat;
  background-size: 100% 1px;
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-chat .ai-chat-theirs,
:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-chat-typing {
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-reading-entry:not(:last-child)::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.18) 12%,
    rgba(255, 255, 255, 0.18) 88%,
    transparent
  );
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
}

/* A tint alone is not enough to read as a surface on near-black - it needs an
   edge. One inset hairline, brighter on the side the light would come from, so
   the bubble sits ON the panel rather than staining it. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-chat-said {
  background: color-mix(in srgb, var(--accent-brand) 16%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-chat-said.has-more::after {
  color: var(--accent-brand);
}

/* The drag edge, which should be findable without being a feature. Invisible
   until reached for, then the same accent as everything else theruKO does. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-drawer-resizer::after {
  background: rgba(255, 255, 255, 0.22);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-drawer-resizer:hover::after,
:root[data-theme="dark"]:not([data-print-theme="light"]) .ai-drawer-resizer:focus-visible::after,
:root[data-theme="dark"]:not([data-print-theme="light"]) body.is-resizing-ai-drawer .ai-drawer-resizer::after {
  background: var(--accent-brand);
}

/* A removal is an absence. Struck and quiet in both themes - red here would
   make every proposed removal look like an error the product had found. */
:root[data-theme="dark"]:not([data-print-theme="light"]) .plan-diff-removed {
  color: rgba(255, 255, 255, 0.55);
}

/* ---------------------------------------------------------------------------
   THE ANSWER BLOCK, which was invisible in the dark.

   .where-to-start-explain set background: #f8fafc - a near-white LITERAL with
   no dark counterpart anywhere. In this theme --ink is #ffffff, so the block
   painted white text onto a near-white panel: the headline, the reading and
   the first move were all still in the DOM, still selectable, and could not be
   read. That is the "some sections are not showing" in the report, and it is
   the exact failure a literal causes - it does not degrade, it disappears.

   Fixed with tokens rather than with a second literal, so the next theme gets
   it for free. The left rule is what marks generated prose as generated, and
   it has to survive here too, or dark mode quietly drops a distinction the
   light one makes.
   ------------------------------------------------------------------------ */

:root[data-theme="dark"]:not([data-print-theme="light"]) .where-to-start-explain {
  background: var(--panel-strong);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .where-to-start-explain-headline {
  color: var(--ink);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .where-to-start-explain-reading {
  color: var(--muted);
}

:root[data-theme="dark"]:not([data-print-theme="light"]) .where-to-start-explain-move,
:root[data-theme="dark"]:not([data-print-theme="light"]) .where-to-start-explain-move strong {
  color: var(--ink);
}
