  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    /* ── ICOP design tokens (Phase 0, 2026-07-05) ─────────────────────────
       Canonical values extracted from Live Ops — the reference surface for
       ICOP's look. Dark is the default theme, so these live at :root; the
       light theme overrides the legacy variables below and simply doesn't
       get the Live Ops treatment (out of scope by decision).
       Phases 1–3 (shared chart theme, primitives, chrome) consume these —
       new CSS should reach for --icop-* rather than hardcoding. */
    --icop-bg: #0a0f1a;                      /* console base (live-ops-fullscreen) */
    --icop-bg-wash: linear-gradient(180deg, #0e1626 0%, #0a101d 55%, #080c16 100%);  /* photo-free backdrop */
    --icop-panel-hi: rgba(24,34,55,0.60);    /* glass card gradient, top stop */
    --icop-panel-lo: rgba(13,21,37,0.50);    /* glass card gradient, bottom stop */
    --icop-panel: linear-gradient(158deg, var(--icop-panel-hi) 0%, var(--icop-panel-lo) 100%);
    --icop-panel-solid: #101a2c;             /* non-glass equivalent (popups, tooltips) */
    --icop-chip: #16233a;                    /* small solid chips / handles */
    --icop-border: rgba(122,152,193,0.30);   /* standard panel/popup border */
    --icop-border-strong: rgba(122,152,193,0.60);
    --icop-border-faint: rgba(58,88,130,0.26);
    --icop-div: #3a5882;                     /* opaque divider (command bar) */
    --icop-ink: #f1f6fd;                     /* headline text */
    --icop-text: #dbe6f3;                    /* body text on panels */
    --icop-mut: #8294ad;                     /* muted labels */
    --icop-axlbl: #9fb1c6;                   /* chart axis labels */
    --icop-blue: #3b82f6;                    /* primary accent */
    --icop-cyan: #2cc3ec;                    /* brand secondary (lockup, live) */
    --icop-green: #2ecc71;                   /* live / good */
    --icop-grid-minor: rgba(160,180,220,0.12);
    --icop-grid-major: rgba(180,210,255,0.20);
    --icop-radius: 12px;                     /* cards */
    --icop-radius-sm: 6px;                   /* buttons, chips, inputs */
    --icop-blur: 9px;                        /* glass backdrop-filter */
    --icop-shadow: 0 8px 28px rgba(0,0,0,0.5);
    --icop-mono: 'JetBrains Mono', ui-monospace, monospace;  /* micro-labels, KPI values */

    /* ── Legacy app variables — dark values nudged onto the Live Ops navy
       family (same lightness tier per variable, hue shifted from grey-slate,
       so existing contrast relationships hold everywhere they're used). */
    --bg-primary: #0a0f1a;      /* was #0a0e14 */
    --bg-secondary: #0f1626;    /* was #111820 */
    --bg-tertiary: #16233a;     /* was #1a2230 — now the Live Ops chip tone */
    --border: #2b3a54;          /* was #243040 — solid equiv of --icop-border over --bg-secondary */
    --text-primary: #e2e8f0;
    --text-secondary: #8294ad;  /* was #8899aa — Live Ops muted */
    --text-muted: #5e7190;      /* was #556677 — navy-shifted, slightly brighter */
    --accent: #3b82f6;          /* was #3a7bd5 — Live Ops blue */
    --accent-glow: rgba(59,130,246,0.25);
    --title-strong: #f1f6fd;    /* was #f1f5f9 — Live Ops ink */
    --fee: #27ae60; --blm: #f39c12; --state: #9b59b6; --tops: #00cec9;
    --sticks-h: #e74c3c; --sticks-d: #f39c12; --sticks-v: #3498db;
    --spot-active: #27ae60; --spot-shutin: #f39c12; --spot-aban: #95a5a6; --spot-dry: #7f8c8d;
    --spot-inj: #2980b9; --spot-permit: #ffffff; --spot-other: #bdc3c7;
    --contour: #e84393; --fault: #e74c3c;
    --danger: #e74c3c; --warning: #f39c12;
  }
  body.theme-light {
    --bg-primary: #ffffff; --bg-secondary: #f1f5f9; --bg-tertiary: #e2e8f0;
    --border: #cbd5e1; --text-primary: #0f172a; --text-secondary: #475569;
    --text-muted: #64748b; --accent: #2563eb; --accent-glow: rgba(37,99,235,0.18);
    --title-strong: #0f172a;
  }
  /* ── Light-mode targeted overrides ───────────────────────────────────
     Bright greens / yellows / pale blues that work on dark surfaces but
     wash out on white. Re-mapped to darker, accessible variants. */
  body.theme-light .step-marker { border-left-color: rgba(15,23,42,0.45); }
  body.theme-light .step-marker .step-box {
    border-color: rgba(15,23,42,0.45); color: var(--title-strong);
    box-shadow: 0 1px 3px rgba(15,23,42,0.18);
  }
  body.theme-light .step-marker .step-box:hover { color: #fff; }
  body.theme-light .step-overlay.locked .step-marker .step-box,
  body.theme-light .step-overlay.locked .step-marker .step-box:hover {
    border-color: rgba(15,23,42,0.45);
  }
  /* Annotation pins — the dark-mode light-gold (#ffd166) washes out on
     a white background. Re-map to a deeper amber (#b45309 — same
     reference the Stage Scorecard uses for its warn state) so the
     pin, dashed riser, label, and popup title all read with proper
     contrast in light mode. */
  body.theme-light .annotation-overlay .annotation-marker .am-line {
    border-left-color: rgba(180,83,9,0.6);
  }
  body.theme-light .annotation-overlay .annotation-marker .am-pin {
    background: #ffffff;
    color: #b45309;
    border-color: rgba(180,83,9,0.7);
    box-shadow: 0 1px 3px rgba(15,23,42,0.18);
  }
  body.theme-light .annotation-overlay .annotation-marker:hover .am-pin {
    background: rgba(180,83,9,0.10);
    border-color: rgba(180,83,9,1);
  }
  body.theme-light .annotation-overlay .annotation-marker.always-visible .am-pin {
    background: rgba(180,83,9,0.12);
    border-color: rgba(180,83,9,1);
  }
  body.theme-light .annotation-overlay .annotation-marker .am-pin .am-label {
    background: #ffffff;
    color: #1a1a1a;
    border-color: rgba(180,83,9,0.6);
    box-shadow: 0 2px 6px rgba(15,23,42,0.18);
  }
  body.theme-light .annotation-overlay .annotation-marker.always-visible .am-pin .am-label {
    border-color: rgba(180,83,9,0.85);
    box-shadow: 0 2px 8px rgba(180,83,9,0.16);
  }
  body.theme-light .annotation-overlay .annotation-marker.label-dragging .am-pin .am-label {
    border-color: rgba(180,83,9,1);
    box-shadow: 0 4px 12px rgba(180,83,9,0.28);
  }
  body.theme-light .annotation-overlay .annotation-marker .am-pin .am-label .am-label-handle:hover {
    background: rgba(180,83,9,0.4);
  }
  body.theme-light .annotation-popup {
    border-color: rgba(180,83,9,0.6);
  }
  body.theme-light .annotation-popup .ap-title { color: #b45309; }
  body.theme-light .annotation-popup .ap-btn.primary {
    background: #b45309;
    border-color: #b45309;
    color: #fff;
  }
  body.theme-light .annotation-popup .ap-checkbox input[type="checkbox"] {
    accent-color: #b45309;
  }
  /* ── Cost Optimization sandbox — 3-layer surface system ──
     Hierarchy was flat (every panel sat on near-identical gray-blue).
     Now stacked as:
       Layer 1 Navy   #1F3B63  ← headers, toolbars, scenario tabs (active)
       Layer 2 Slate  #E7EEF7  ← workspace surface that holds the cards
       Layer 3 White  #F8FBFF  ← cards, inner panels, schedule tables, inputs
     The slate "page" pushes the white cards forward; the white sections
     within those cards sit on slate gutters so the eye can track each
     panel as its own surface. */
  body.theme-light #cost-opt-workspace,
  body.theme-light #energy-fr-workspace { background:#E7EEF7; }
  body.theme-light #cost-opt-workspace .co-card,
  body.theme-light #energy-fr-workspace .co-card { background:#F8FBFF; border-color:#B8C7D9; }
  /* Sections inside the Treatment Schedule card (Step Globals, Ramp
     Globals + Solver, Step Settings, Per-Proppant Plan, Diagnostics, etc.).
     Each gets the white surface, separated by a thicker slate gutter so
     the section breaks are obvious without heavy banner rules. */
  body.theme-light #cost-opt-workspace .co-ramp-section {
    background:#F8FBFF;
    border-bottom: 8px solid #E7EEF7;     /* slate gutter as separator */
  }
  body.theme-light #cost-opt-workspace .co-ramp-section:last-child {
    border-bottom: none;
  }
  /* Schedule table wrap — flush white surface so the editable rows feel
     like a spreadsheet, not a nested panel. */
  body.theme-light #cost-opt-workspace .sched-table-wrap { background:#F8FBFF; }
  /* Stage Materials & Cost grid section cards (Frac Pumping, Energy,
     Additional Charges, Wireline, Volumes, Materials Cost). Default
     paints them on bg-tertiary (off-white in light mode); push them to
     pure white and use the slate as the gutter. */
  body.theme-light #cost-opt-workspace .materials-section {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .materials-grid {
    background:#E7EEF7;          /* gutter color between section cards */
    padding:10px; border-radius:6px;
  }
  /* Sandbox materials strip (Proppant Intensity / Fluid Intensity / FR
     Loading) sits between the stages bar and the tabs — give it the
     same white-on-slate treatment so it reads as a panel. */
  body.theme-light #cost-opt-workspace .materials-strip { background:transparent; }
  body.theme-light #cost-opt-workspace .materials-pill { background:#F8FBFF; border-color:#B8C7D9; }
  /* ── Cost Optimization sandbox — unified navy/blue palette ──
     Sandbox used to lean on emerald greens for active chips / pills /
     totals. With the Compare tab re-themed to the executive-navy palette
     (#1F3B63 + steel-blue ramp), those greens now feel like a different
     project. These rules push the navy/slate-blue family into every
     scenario chrome element so the whole sandbox reads as one designed
     surface. Functional greens/reds (Compare best/worst, diagnostics
     delivered-vs-target) are preserved on purpose. */
  /* Sand Step / Sand Ramp sub-tabs at top of Treatment Schedule. */
  body.theme-light .co-design-tab.active { color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9; }
  /* Numbered chip on Copy-from-Scenario dropdown items + source pill at
     top of the toolbar (well · stage N). */
  body.theme-light .co-clone-item-num { color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9; }
  body.theme-light .co-source .src-tag { color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9; }
  /* Step / Ramp mode badges (clone dropdown). Step on deep navy, Ramp on
     steel blue — same family, two depths so they're scannable. */
  body.theme-light .co-clone-item-mode .badge.step { color:#ffffff; background:#1F3B63; border-color:#12274A; }
  body.theme-light .co-clone-item-mode .badge.ramp { color:#1F3B63; background:#CCD9EA; border-color:#B8C7D9; }
  /* Compare table mode badges — white on the navy header. */
  body.theme-light .co-compare-table thead th .scen-mode-badge.step {
    color:#ffffff; background:rgba(255,255,255,0.12); border-color:rgba(255,255,255,0.50);
  }
  body.theme-light .co-compare-table thead th .scen-mode-badge.ramp {
    color:#ffffff; background:rgba(125,211,252,0.32); border-color:rgba(125,211,252,0.55);
  }
  /* Best / worst — kept green/red so a presenter spots the winner at a
     glance; tuned slightly darker so they sit cleanly on navy chrome. */
  body.theme-light .co-compare-table td.best { color:#166534; }
  body.theme-light .co-compare-table td.worst { color:#991b1b; }
  /* Scenario tab strip (Scenario 1..6 + Compare). Active tab + its number
     chip pick up the same navy family as everything else in the toolbar. */
  body.theme-light .co-scen-tab.active { color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9; }
  body.theme-light .co-scen-tab .co-scen-num { background:#EEF4FA; color:#1F3B63; border-color:#B8C7D9; }
  body.theme-light .co-scen-tab.active .co-scen-num { background:#1F3B63; color:#ffffff; border-color:#12274A; }
  /* Materials / Pumping Costs sub-tab indicator under the schedule. */
  body.theme-light .materials-tab.active { color:#1F3B63; border-bottom-color:#1F3B63; }
  /* Materials / intensity / stages-bar pill values — navy headline color. */
  body.theme-light .materials-pill .val { color:#1F3B63; }
  body.theme-light .co-stages-pill .val { color:#1F3B63; }
  /* Per-Proppant Plan: active Ramp/Step mode toggle. */
  body.theme-light .co-ramp-plan-row .co-ramp-plan-mode-btn.active {
    background:#D7E2F0; color:#1F3B63;
  }
  /* Section banners across all scenario panes (Ramp Design Globals /
     Solver, Step Design Globals, Step Design Settings, Per-Proppant Plan,
     Ramp Diagnostics, etc.) — navy small caps so the eye reads section
     breaks the same way it does on the Compare card. */
  body.theme-light .co-ramp-section h5,
  body.theme-light .co-step-settings h6 { color:#1F3B63; letter-spacing:1.4px; }
  /* ── Cost Optimization light mode — green sweep, row surfaces, toolbar ── */
  /* 1) Replace leftover emerald scenario / clone / ramp chrome with navy. */
  body.theme-light #cost-opt-workspace .co-scen-tab.has-data .co-scen-num,
  body.theme-light #cost-opt-workspace .co-scen-tab.compare .co-scen-num {
    background:#EEF4FA; color:#1F3B63; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-scen-tab.active.compare {
    border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-clone-item:hover {
    background:rgba(31,59,99,0.06);
  }
  body.theme-light #cost-opt-workspace .co-stages-result {
    background:#EEF4FA; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-stages-result .val {
    color:#1F3B63;
  }
  body.theme-light #cost-opt-workspace .co-ramp-split-total:not(.warn) {
    color:#1F3B63; background:#EEF4FA; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-ramp-plan-row .co-ramp-plan-mode-btn {
    color:#64748b;
  }
  body.theme-light #cost-opt-workspace .co-ramp-plan-row .co-ramp-plan-mode-btn:hover:not(.active) {
    background:rgba(31,59,99,0.06); color:#1F3B63;
  }
  /* 2) Dark rgba(0,0,0,0.18) strips → steel-blue surfaces on white cards. */
  body.theme-light #cost-opt-workspace .co-step-ramp-row {
    background:#EEF4FA; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-ramp-plan-row.co-step-ramp-row {
    border-left:3px solid #1F3B63;
  }
  body.theme-light #cost-opt-workspace .co-ramp-split-item {
    background:#EEF4FA; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-stages-bar {
    background:#EEF4FA; border-bottom-color:#B8C7D9;
  }
  /* 3) Toolbar + scenario tab bar — slate/white surfaces (not generic gray). */
  body.theme-light #cost-opt-workspace .co-toolbar {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-scenario-tabs {
    background:#E7EEF7; border-color:#B8C7D9;
    box-shadow:0 2px 8px rgba(15,23,42,0.06);
  }
  body.theme-light #cost-opt-workspace .co-scen-tab:not(.active) {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-workspace .co-scen-tab:not(.active):hover {
    background:#EEF4FA;
  }
  body.theme-light #cost-opt-workspace .co-clone-dropdown {
    background:#F8FBFF; border-color:#B8C7D9;
    box-shadow:0 8px 24px rgba(15,23,42,0.12);
  }
  /* Action strip above the comparison card — sits OUTSIDE the card so it
     doesn't get captured in a screenshot of the table for slides. */
  .co-compare-actions {
    display:flex; justify-content:flex-end; padding:0 0 10px 0;
  }
  /* Compare card header — centered, presentation-sized title bar. */
  .co-compare-header {
    justify-content:center !important;
    font-size:16px !important; letter-spacing:1.6px !important;
    padding:14px 16px !important;
  }
  /* ── Compare table — presentation-quality light-mode refresh (navy) ──
     PowerPoint-style navy header band over white cells. Matches the
     reference comparison-table aesthetic engineers use in customer
     reports so the Compare tab is screenshot-ready for a slide deck.
     The default (dark-mode) rules use transparent black overlays + green
     tints; on a white page those collapse to muddy gray bars and faint
     hints, so we override with an explicit navy/slate/emerald palette. */
  body.theme-light .co-compare-pane,
  body.theme-light #cost-opt-compare-pane {
    background: #E7EEF7;
  }
  body.theme-light .co-compare-pane .co-card,
  body.theme-light #cost-opt-compare-pane .co-card {
    background: #ffffff; border:1px solid #B8C7D9;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
  }
  /* Card header swapped to the navy band that anchors the deck-style look.
     #1F3B63 is the report-style "executive navy" — slightly more saturated
     than slate so the soft blues below register as warm/integrated rather
     than washed-out gray-blue. Applied to every .co-card-header in the
     sandbox so the Treatment Schedule banner harmonizes with the Compare
     card and the Stage Materials & Cost banner below it. */
  body.theme-light #cost-opt-workspace .co-card-header,
  body.theme-light #energy-fr-workspace .co-card-header {
    background: #1F3B63; color:#ffffff;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #cost-opt-workspace .co-card-header .co-card-sub,
  body.theme-light #energy-fr-workspace .co-card-header .co-card-sub { color:#D7E2F0; }
  /* Sand Step / Sand Ramp sub-tabs sit INSIDE that navy band, so the
     inactive tab needs white-on-translucent treatment and the active tab
     becomes a white pill so it pops against the navy. */
  body.theme-light #cost-opt-workspace .co-card-header .co-design-tab {
    color:#D7E2F0; background:transparent; border-color:rgba(255,255,255,0.30);
  }
  body.theme-light #cost-opt-workspace .co-card-header .co-design-tab:hover {
    color:#ffffff; border-color:rgba(255,255,255,0.55);
  }
  body.theme-light #cost-opt-workspace .co-card-header .co-design-tab.active {
    color:#1F3B63; background:#ffffff; border-color:#ffffff;
  }
  body.theme-light .co-compare-pane .co-card-sub,
  body.theme-light #cost-opt-compare-pane .co-card-sub { color:#D7E2F0; }
  body.theme-light #cost-opt-report-all {
    background:#ffffff; color:#1F3B63; border-color:#B8C7D9;
  }
  body.theme-light #cost-opt-report-all:hover {
    background:#EEF4FA; border-color:#8FA5C2;
  }
  body.theme-light .co-compare-wrap { background:#ffffff; padding:0; }
  body.theme-light .co-compare-table { background:#ffffff; }
  /* Data-row gridlines deliberately softened (#D6DEE8) so the eye tracks
     SECTIONS not individual cells — sections + totals carry their own
     stronger borders. */
  body.theme-light .co-compare-table th,
  body.theme-light .co-compare-table td {
    border-bottom: 1px solid #D6DEE8;
    padding: 9px 14px; color:#0f172a;
  }
  /* Column header — solid navy fill, white type, bold. Vertical padding
     bumped (14px) so the multi-line scenario header (name + stages·ft +
     mode badge) breathes and reads as a premium report header. */
  body.theme-light .co-compare-table thead th {
    background: #1F3B63; color:#ffffff;
    border-bottom: 2px solid #12274A; border-top: 0;
    padding: 14px 14px;
    text-shadow: none;
  }
  body.theme-light .co-compare-table thead th .scen-slot {
    display:block; font-size:15px; font-weight:700;
    letter-spacing:1.4px; text-transform:uppercase;
    color:#ffffff; margin-bottom:5px;
  }
  body.theme-light .co-compare-table thead th .scen-name {
    color:#ffffff; font-weight:600; font-size:12px;
    text-transform:none; letter-spacing:0;
  }
  body.theme-light .co-compare-table thead th .scen-source { color:#D7E2F0; }
  body.theme-light .co-compare-table th:first-child,
  body.theme-light .co-compare-table td:first-child {
    background: #ffffff; color:#1e293b; font-weight:600;
    border-right: 1px solid #B8C7D9;
  }
  body.theme-light .co-compare-table thead th:first-child {
    background: #1F3B63; color:#ffffff;
    text-align: center;          /* center the "Metric" label horizontally */
    vertical-align: middle;      /* anchor it against the multi-line scenario headers */
    font-size: 12px;             /* match scen-name weight so the corner cell reads as a peer label */
    letter-spacing: 1.6px;
  }
  /* Alternating data rows — very light steel blue so the stripe registers
     against the navy header instead of reading as a neutral gray. */
  body.theme-light .co-compare-table tbody tr:nth-child(even) td:not(:first-child) {
    background: #EEF4FA;
  }
  /* Section header bands — darkest band in the table body so breaks read
     above subtotals (#D7E2F0) and zebra rows (#EEF4FA). Top border uses
     workspace slate as a gutter so sections do not run into the row above. */
  body.theme-light .co-compare-table tbody tr.section-header td {
    background:#B8C7D9; color:#12274A;
    border-top:8px solid #E7EEF7;
    border-bottom:1px solid #8FA5C2;
    font-size:10px; padding:9px 14px 8px;
    font-weight:700; letter-spacing:1.4px;
  }
  /* Totals row — same muted slate blue as the section bars but emphasized
     with 2px navy rules and bold navy type so it reads as the headline
     summary. Label cell uses the deeper blue-gray border tone so it
     anchors as the row label even when scrolled. */
  body.theme-light .co-compare-table tr.totals td {
    background: #CCD9EA;
    color: #1F3B63;
    border-top: 2px solid #1F3B63;
    border-bottom: 2px solid #1F3B63;
    font-weight: 700; font-size: 13px;
  }
  body.theme-light .co-compare-table tr.totals td:first-child {
    background: #B8C7D9; color:#12274A;
  }
  /* Executive scoreboard — first five tbody rows (Stage Total through Energy
     Cost). Row 1 still carries class="totals" in markup but is KPI chrome,
     not a roll-up footer; nth-child(-n+5) resets totals band styling. */
  body.theme-light .co-compare-table tbody > tr:nth-child(-n+5) td {
    background:#ffffff; color:#0f172a;
    border-top:none; border-bottom:1px solid #D6DEE8;
    font-weight:400; font-size:12px;
  }
  body.theme-light .co-compare-table tbody > tr:nth-child(-n+5) td:first-child {
    background:#ffffff; color:#1e293b; font-weight:600;
  }
  body.theme-light .co-compare-table tbody > tr:nth-child(1) td:first-child {
    font-weight:700;
  }
  body.theme-light .co-compare-table tbody > tr:nth-child(even):nth-child(-n+5) td:not(:first-child) {
    background:#EEF4FA;
  }
  body.theme-light .co-compare-table tbody > tr:nth-child(5) td {
    border-bottom:2px solid #B8C7D9;
  }
  /* Section roll-ups (Materials Subtotal, Pumping Subtotal) — steel band
     between row stripes (#EEF4FA) and section headers (#CCD9EA). First
     cell is only a <strong> label (see energy-fr.js compare table builder). */
  body.theme-light .co-compare-table tbody tr:has(> td:first-child > strong:only-child) td {
    background:#D7E2F0; color:#1F3B63;
    border-top:2px solid #B8C7D9; border-bottom:1px solid #B8C7D9;
    font-weight:700; font-size:12.5px;
    padding-top:10px; padding-bottom:10px;
  }
  body.theme-light .co-compare-table tbody tr:has(> td:first-child > strong:only-child) td:first-child {
    background:#B8C7D9; color:#12274A;
  }
  /* Extra gutter after a subtotal before the next section header. */
  body.theme-light .co-compare-table tbody tr:has(> td:first-child > strong:only-child) + tr.section-header td {
    border-top-width:10px;
  }
  /* Best / worst — preserved as green/red so a presenter still spots the
     winner instantly, but the pill backgrounds are tuned to harmonize
     with the blue chrome (cooler greens, less intense reds). */
  body.theme-light .co-compare-table td.best {
    background: rgba(22,163,74,0.10); color:#166534; font-weight:700;
  }
  body.theme-light .co-compare-table td.worst {
    background: rgba(185,28,28,0.06); color:#991b1b; font-weight:600;
  }
  body.theme-light .co-compare-table td.empty { color:#94a3b8; font-style:italic; }
  body.theme-light .co-compare-table thead th .scen-mode-badge {
    border-color: rgba(255,255,255,0.45);
  }
  body.theme-light .co-compare-table thead th .scen-mode-badge.step {
    color:#ffffff; background:rgba(255,255,255,0.14); border-color:rgba(255,255,255,0.45);
  }
  body.theme-light .co-compare-table thead th .scen-mode-badge.ramp {
    color:#1F3B63; background:#D7E2F0; border-color:rgba(255,255,255,0.55);
  }
  /* Stage Proppant Target + per-ramp target pills under Globals. */
  body.theme-light .co-ramp-total-pill { background:#EEF4FA; border-color:#B8C7D9; }
  body.theme-light .co-ramp-total-pill .val { color:#1F3B63; }
  body.theme-light .co-ramp-total-pill.warn { background:rgba(180,83,9,0.08); border-color:rgba(180,83,9,0.40); }
  body.theme-light .co-ramp-total-pill.warn .val { color:#b45309; }
  /* Total Cost card anchored next to Globals. Navy palette consistent
     with Compare tab so a screenshot of either pane harmonizes. */
  body.theme-light .co-ramp-cost-card { background:#EEF4FA; border-color:#B8C7D9; }
  body.theme-light .co-ramp-cost-title {
    color:#1F3B63; border-bottom-color:#B8C7D9;
  }
  body.theme-light .co-ramp-cost-group { border-bottom-color:#B8C7D9; }
  body.theme-light .co-ramp-cost-row.subtotal .lbl { color:#1F3B63; }
  body.theme-light .co-ramp-cost-row.subtotal .val { color:#1F3B63; }
  body.theme-light .co-ramp-cost-row.total {
    border-top-color:#1F3B63 !important;
  }
  body.theme-light .co-ramp-cost-row.total .lbl { color:#1F3B63; }
  body.theme-light .co-ramp-cost-row.total .val.big { color:#1F3B63; }
  body.theme-light .co-ramp-cost-row .lbl { color:#334155; }
  body.theme-light .co-ramp-cost-row .val { color:#0f172a; }
  body.theme-light .co-ramp-cost-row .val.sub { color:#64748b; }
  body.theme-light .co-ramp-cost-perstage .lbl { color:#64748b; }
  body.theme-light .co-ramp-cost-perstage .val { color:#1F3B63; }
  /* Solver mode radio (Target+Slope / Target lbs / Slope). */
  body.theme-light .co-ramp-solver-mode label:has(input:checked) {
    color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9;
  }
  /* "Proppant" pill on per-ramp diagnostic cards — kept amber as the
     lone warm accent so proppant rows visually stand out against the
     blues. */
  body.theme-light .co-ramp-card-title .badge.proppant { color:#b45309; border-color:rgba(180,83,9,0.35); background:rgba(180,83,9,0.08); }
  /* Diagnostics delivery delta — green/amber retained: these are pass /
     fail signals for delivered vs target, not branding chrome. */
  body.theme-light .co-ramp-diag-delta.good { color:#166534; background:rgba(22,163,74,0.10); border-color:rgba(22,163,74,0.40); }
  body.theme-light .co-ramp-diag-delta.high { color:#b45309; background:rgba(180,83,9,0.10); border-color:rgba(180,83,9,0.40); }
  /* Energy & FR Trade-Off — navy light-mode chrome */
  body.theme-light #energy-fr-workspace .co-header .co-title { color:#1F3B63; }
  body.theme-light #energy-fr-workspace .co-close-btn {
    background:#ffffff; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #energy-fr-workspace .co-close-btn:hover {
    border-color:#991b1b; color:#991b1b; background:#F8FBFF;
  }
  body.theme-light #energy-fr-workspace .ef-toolbar {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .trim-btn.primary {
    background:#1F3B63; border-color:#12274A; color:#ffffff;
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.12);
  }
  body.theme-light #energy-fr-workspace .trim-btn.primary:hover {
    background:#243f66; border-color:#12274A;
  }
  body.theme-light #energy-fr-workspace .trim-btn:not(.primary) {
    background:#ffffff; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #energy-fr-workspace .trim-btn:not(.primary):hover {
    background:#EEF4FA; border-color:#8FA5C2; color:#1F3B63;
  }
  body.theme-light #energy-fr-workspace .ef-mode-tabs {
    background:#EEF4FA; border-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .ef-mode-tab:not(.active) {
    color:#64748b;
  }
  body.theme-light #energy-fr-workspace .ef-mode-tab:hover:not(.active) {
    color:#1F3B63; background:rgba(31,59,99,0.06);
  }
  body.theme-light #energy-fr-workspace .ef-mode-tab.active {
    color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .ef-source .src-tag {
    color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .ef-field label { color:#475569; }
  body.theme-light #energy-fr-workspace .ef-field input,
  body.theme-light #energy-fr-workspace .ef-field select {
    background:#ffffff; border-color:#B8C7D9; color:#0f172a;
  }
  body.theme-light #energy-fr-workspace .ef-field input:focus,
  body.theme-light #energy-fr-workspace .ef-field select:focus {
    border-color:#1F3B63;
    box-shadow:0 0 0 2px rgba(31,59,99,0.18);
  }
  body.theme-light #energy-fr-workspace .ef-field input[readonly] {
    background:#EEF4FA; color:#1F3B63; border-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .ef-field-derived label { color:#1F3B63; }
  body.theme-light #energy-fr-workspace .ef-note {
    background:#EEF4FA; border-left-color:#1F3B63; color:#475569;
  }
  body.theme-light #energy-fr-workspace .ef-note strong { color:#1F3B63; }
  body.theme-light #energy-fr-workspace .ef-slider-label { color:#475569; }
  body.theme-light #energy-fr-workspace .ef-slider-label strong { color:#1F3B63; }
  body.theme-light #energy-fr-workspace #ef-c-slider { accent-color:#1F3B63; }
  body.theme-light #energy-fr-workspace .ef-pill.floor {
    color:#1F3B63; background:#D7E2F0; border-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .ef-pill.unconstrained {
    color:#166534; background:rgba(22,163,74,0.10); border-color:rgba(22,163,74,0.35);
  }
  body.theme-light #energy-fr-workspace .ef-metric {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .ef-metric.opt {
    border-color:#1F3B63; background:#EEF4FA;
  }
  body.theme-light #energy-fr-workspace .ef-metric.opt .ef-m-val { color:#1F3B63; }
  body.theme-light #energy-fr-workspace .ef-metric.delta-pos .ef-m-val { color:#166534; }
  body.theme-light #energy-fr-workspace .ef-metric.delta-neg .ef-m-val { color:#991b1b; }
  body.theme-light #energy-fr-workspace .ef-compare thead th {
    background:#1F3B63; color:#ffffff;
    border-bottom:2px solid #12274A;
  }
  body.theme-light #energy-fr-workspace .ef-compare thead th.col-opt { color:#D7E2F0; }
  body.theme-light #energy-fr-workspace .ef-compare thead th.col-sel { color:#fcd34d; }
  body.theme-light #energy-fr-workspace .ef-compare thead th .h-sub { color:#D7E2F0; }
  body.theme-light #energy-fr-workspace .ef-compare tbody td {
    color:#0f172a; border-bottom-color:#D6DEE8;
  }
  body.theme-light #energy-fr-workspace .ef-compare tbody td.lbl { color:#334155; }
  body.theme-light #energy-fr-workspace .ef-compare tbody tr:nth-child(even) td:not(.lbl) {
    background:#EEF4FA;
  }
  body.theme-light #energy-fr-workspace .ef-compare tbody tr.section td {
    background:#B8C7D9; color:#12274A; border-bottom-color:#8FA5C2;
  }
  body.theme-light #energy-fr-workspace .ef-compare tbody tr.total td {
    background:#CCD9EA; color:#1F3B63;
    border-top:2px solid #1F3B63;
  }
  body.theme-light #energy-fr-workspace .ef-compare tbody tr.total td.lbl { color:#12274A; }
  body.theme-light #energy-fr-workspace .ef-compare td.col-opt { color:#1F3B63; }
  body.theme-light #energy-fr-workspace .ef-compare td.col-sel { color:#b45309; }
  body.theme-light #energy-fr-workspace .ef-quick .case-1 .co-card-header,
  body.theme-light #energy-fr-workspace .ef-quick .case-2 .co-card-header {
    color:#ffffff;
  }
  body.theme-light #energy-fr-workspace .ef-quick .co-card.case-1 { border-color:#8FA5C2; }
  body.theme-light #energy-fr-workspace .ef-quick .co-card.case-2 { border-color:#f59e0b; }
  body.theme-light #energy-fr-workspace .ef-quick-calc-btn {
    background:#1F3B63; color:#ffffff; border-color:#12274A;
  }
  body.theme-light #energy-fr-workspace .ef-quick-calc-btn:hover {
    background:#243f66; border-color:#12274A;
  }
  body.theme-light #energy-fr-workspace .ef-quick-headline {
    background:#EEF4FA; border-bottom-color:#B8C7D9;
  }
  body.theme-light #energy-fr-workspace .ef-quick-headline .val.savings { color:#166534; }
  body.theme-light #energy-fr-workspace .ef-quick-headline .val.cost { color:#991b1b; }
  /* ── Rate Step-Down Analysis — navy light-mode chrome (matches Execution
     Completed Stages + Energy & FR Trade-Off: slate page, white cards,
     executive-navy PRD band + frosted pick toolbar). ── */
  body.theme-light #rsd-workspace { background:#E7EEF7; }
  body.theme-light #rsd-workspace .co-header .co-title { color:#1F3B63; }
  body.theme-light #rsd-workspace .co-subtitle { color:#64748b; }
  body.theme-light #rsd-workspace .co-close-btn {
    background:#ffffff; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #rsd-workspace .co-close-btn:hover {
    border-color:#991b1b; color:#991b1b; background:#F8FBFF;
  }
  /* Per-Stage / Project Summary tabs — same active underline as mode tabs. */
  body.theme-light #rsd-workspace .rsd-tabs {
    background:#EEF4FA; border-bottom-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-tab:not(.active) { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-tab:not(.active):hover { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-tab.active {
    color:#1F3B63; border-bottom-color:#1F3B63;
  }
  body.theme-light #rsd-workspace .rsd-tab .rsd-tab-count {
    background:#D7E2F0; color:#1F3B63; border:1px solid #B8C7D9;
  }
  /* SDT-only / All stages filter — zone-btn pattern from Completed Stages. */
  body.theme-light #rsd-workspace .rsd-list-filter-label { color:#475569; }
  body.theme-light #rsd-workspace .rsd-list-filter-btn {
    background:#ffffff; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #rsd-workspace .rsd-list-filter-btn:hover {
    border-color:#8FA5C2; color:#1F3B63; background:#F8FBFF;
  }
  body.theme-light #rsd-workspace .rsd-list-filter-btn.active {
    background:#1F3B63; border-color:#12274A; color:#ffffff;
  }
  body.theme-light #rsd-workspace .rsd-list-filter-count { color:#64748b; }
  /* Well × stage pill strip */
  body.theme-light #rsd-workspace #rsd-wells-list {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace #rsd-wells-list .fa-well-row {
    border-bottom-color:#D6DEE8;
  }
  body.theme-light #rsd-workspace #rsd-wells-list .fa-well-name { color:#0f172a; }
  body.theme-light #rsd-workspace #rsd-wells-list .fa-well-name small { color:#64748b; }
  body.theme-light #rsd-workspace #rsd-wells-list .fa-stage-pill {
    background:#EEF4FA; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #rsd-workspace #rsd-wells-list .rsd-stage-pill.active {
    background:#1F3B63; border-color:#12274A; color:#ffffff;
  }
  body.theme-light #rsd-workspace #rsd-wells-list .rsd-stage-pill.has-region {
    border-color:rgba(180,83,9,0.55); color:#b45309;
  }
  body.theme-light #rsd-workspace #rsd-wells-list .rsd-stage-pill.has-plateaus::after {
    background:rgba(22,163,74,0.12); color:#15803d;
  }
  body.theme-light #rsd-workspace #rsd-wells-list .rsd-stage-pill.tagged-sdt {
    border-color:#8FA5C2;
  }
  body.theme-light #rsd-workspace .fa-card-empty { color:#64748b; }
  /* Per-stage detail card */
  body.theme-light #rsd-workspace .rsd-stage-block {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-stage-title { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-stage-title small { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-stage-tag {
    color:#15803d; background:rgba(22,163,74,0.10); border-color:rgba(22,163,74,0.35);
  }
  body.theme-light #rsd-workspace .rsd-test-conditions {
    border-bottom-color:#B8C7D9; color:#475569;
  }
  body.theme-light #rsd-workspace .rsd-test-conditions label { color:#1F3B63; letter-spacing:1px; }
  body.theme-light #rsd-workspace .rsd-test-conditions select,
  body.theme-light #rsd-workspace .rsd-test-conditions input[type="number"] {
    background:#ffffff; border-color:#B8C7D9; color:#0f172a;
  }
  body.theme-light #rsd-workspace .rsd-test-conditions select:focus,
  body.theme-light #rsd-workspace .rsd-test-conditions input[type="number"]:focus {
    border-color:#1F3B63;
    box-shadow:0 0 0 2px rgba(31,59,99,0.18);
  }
  body.theme-light #rsd-workspace .rsd-test-conditions input.rsd-mult-override-active {
    border-color:rgba(180,83,9,0.55); background:rgba(180,83,9,0.06);
  }
  body.theme-light #rsd-workspace .rsd-test-conditions .rsd-tc-hint { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-test-conditions .rsd-tc-link { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-test-conditions button.rsd-mult-clear {
    background:#ffffff; border-color:#B8C7D9; color:#64748b;
  }
  body.theme-light #rsd-workspace .rsd-test-conditions button.rsd-mult-clear:hover {
    border-color:#8FA5C2; color:#1F3B63; background:#EEF4FA;
  }
  /* PRD plot band — same executive navy as Execution PRD / Chemical panels. */
  body.theme-light #rsd-workspace .rsd-prd-toggle {
    background:#1F3B63; color:#ffffff; border-radius:4px 4px 0 0;
    margin-bottom:0; border-bottom:1px solid #12274A;
  }
  body.theme-light #rsd-workspace .rsd-prd-toggle:hover { background:#243f66; color:#ffffff; }
  body.theme-light #rsd-workspace .rsd-prd-caret { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-prd-toggle-hint { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-prd-fullscreen-btn {
    color:#ffffff; background:rgba(255,255,255,0.14); border-color:rgba(215,226,240,0.62);
  }
  body.theme-light #rsd-workspace .rsd-prd-fullscreen-btn:hover {
    background:rgba(255,255,255,0.24); border-color:rgba(255,255,255,0.78); color:#ffffff;
  }
  body.theme-light #rsd-workspace .rsd-toolbar {
    background:#1F3B63; border-bottom:1px solid #12274A;
    margin-bottom:8px; padding:6px 10px 8px;
  }
  body.theme-light #rsd-workspace .rsd-toolbar .rsd-status { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-toolbar .trim-btn:not(.armed):not(.primary) {
    color:#ffffff;
    background:rgba(255,255,255,0.14);
    border:1px solid rgba(215,226,240,0.62);
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.14);
  }
  body.theme-light #rsd-workspace .rsd-toolbar .trim-btn:not(.armed):not(.primary):hover {
    background:rgba(255,255,255,0.24);
    border-color:rgba(255,255,255,0.78);
    color:#ffffff;
  }
  body.theme-light #rsd-workspace .rsd-toolbar .trim-btn.danger:not(.armed):hover {
    background:rgba(248,113,113,0.22);
    border-color:rgba(252,165,165,0.75);
    color:#fecaca;
  }
  body.theme-light #rsd-workspace .rsd-toolbar .trim-btn.armed {
    color:#1F3B63; background:#ffffff; border:1px solid #ffffff; box-shadow:none;
  }
  body.theme-light #rsd-workspace .rsd-canvas-wrap {
    background:#ffffff; border:1px solid #B8C7D9; border-top:none;
    border-radius:0 0 4px 4px;
  }
  body.theme-light #rsd-workspace .rsd-yzoom-col { background:#EEF4FA; }
  body.theme-light #rsd-workspace .rsd-yzoom-track::before { background:#B8C7D9; }
  body.theme-light #rsd-workspace .rsd-xzoom-bar {
    background:#EEF4FA; border:1px solid #B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-xzoom-bar .rsd-xzoom-hint,
  body.theme-light #rsd-workspace .rsd-xzoom-bar .hz-range { color:#64748b; }
  /* Steps + decomposition tables — navy header band. */
  body.theme-light #rsd-workspace table.rsd-steps-table th {
    background:#1F3B63; color:#ffffff; border-bottom:2px solid #12274A;
  }
  body.theme-light #rsd-workspace table.rsd-steps-table td {
    border-bottom-color:#D6DEE8; color:#0f172a;
  }
  body.theme-light #rsd-workspace table.rsd-steps-table tr.rsd-isip td {
    background:#EEF4FA; color:#64748b;
  }
  body.theme-light #rsd-workspace .rsd-summary {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-summary-title {
    color:#1F3B63; letter-spacing:1.2px; border-bottom-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-summary-block-title { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-summary-row .rsd-sum-label { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-summary-row .rsd-sum-value { color:#0f172a; }
  body.theme-light #rsd-workspace .rsd-summary-row.rsd-warn .rsd-sum-value { color:#b45309; }
  body.theme-light #rsd-workspace .rsd-summary-row.rsd-good .rsd-sum-value { color:#15803d; }
  body.theme-light #rsd-workspace .rsd-summary-row.rsd-bad  .rsd-sum-value { color:#991b1b; }
  body.theme-light #rsd-workspace .rsd-summary-tag.good { color:#15803d; background:rgba(22,163,74,0.10); }
  body.theme-light #rsd-workspace .rsd-summary-tag.info { color:#1F3B63; background:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-summary-tag.warn { color:#b45309; background:rgba(180,83,9,0.10); }
  body.theme-light #rsd-workspace .rsd-summary-tag.bad  { color:#991b1b; background:rgba(153,27,27,0.08); }
  body.theme-light #rsd-workspace .rsd-perftort-wrap { border-top-color:#B8C7D9; }
  body.theme-light #rsd-workspace .rsd-perftort-title { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-perftort-regime { color:#0f172a; }
  body.theme-light #rsd-workspace .rsd-perftort-bar { background:#EEF4FA; border-color:#B8C7D9; }
  body.theme-light #rsd-workspace .rsd-fit-chart-wrap {
    background:#ffffff; border-color:#B8C7D9;
  }
  /* Decline Analysis sub-panel — navy band for the toggle (matches PRD plot),
     light fit-chart-style canvas, white output card with slate border. */
  body.theme-light #rsd-workspace .rsd-decline-toggle {
    background:#1F3B63; color:#ffffff; border-radius:4px 4px 0 0;
    margin-bottom:0; border-bottom:1px solid #12274A;
  }
  body.theme-light #rsd-workspace .rsd-decline-toggle:hover { background:#243f66; color:#ffffff; }
  body.theme-light #rsd-workspace .rsd-decline-caret { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-decline-toggle-hint { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-decline-toolbar {
    background:#1F3B63; border-bottom:1px solid #12274A;
    margin-bottom:8px; padding:6px 10px 8px;
  }
  body.theme-light #rsd-workspace .rsd-decline-toolbar .rsd-status { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-decline-toolbar .rsd-decl-dwell-label,
  body.theme-light #rsd-workspace .rsd-decline-toolbar .rsd-decl-dwell-unit { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-decline-toolbar #rsd-decl-dwell {
    background:#ffffff; color:#0f172a; border-color:#8FA5C2;
  }
  body.theme-light #rsd-workspace .rsd-decline-canvas-wrap {
    background:#ffffff; border-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-decline-output {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-decline-output-empty { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-decline-headline-label { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-decline-headline-value { color:#0f172a; }
  body.theme-light #rsd-workspace .rsd-decline-headline-unit  { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-decline-stats          { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-decline-quality.q-good     { color:#15803d; background:rgba(22,163,74,0.12); }
  body.theme-light #rsd-workspace .rsd-decline-quality.q-marginal { color:#b45309; background:rgba(245,158,11,0.14); }
  body.theme-light #rsd-workspace .rsd-decline-quality.q-advisory { color:#475569; background:rgba(100,116,139,0.10); }
  body.theme-light #rsd-workspace .rsd-decline-derived { border-top-color:#B8C7D9; }
  body.theme-light #rsd-workspace .rsd-decline-derived-toggle { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-decline-derived-toggle:hover { color:#0f172a; }
  body.theme-light #rsd-workspace .rsd-decline-derived-body label { color:#475569; }
  body.theme-light #rsd-workspace .rsd-decline-derived-body input {
    background:#ffffff; color:#0f172a; border-color:#8FA5C2;
  }
  body.theme-light #rsd-workspace .rsd-decline-derived-body .rsd-decline-derived-unit { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-decline-derived-cl { border-top-color:#B8C7D9; }
  body.theme-light #rsd-workspace .rsd-decline-derived-cl-label { color:#475569; }
  body.theme-light #rsd-workspace .rsd-decline-derived-cl-value { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-decline-derived-cl-tag   { color:#b45309; }
  body.theme-light #rsd-workspace .rsd-empty {
    background:#F8FBFF; border-color:#B8C7D9; color:#64748b;
  }
  /* Project Summary tab */
  body.theme-light #rsd-workspace .rsd-sum-toolbar {
    background:#EEF4FA; border:1px solid #B8C7D9; border-radius:4px;
  }
  body.theme-light #rsd-workspace .rsd-sum-toolbar label { color:#475569; }
  body.theme-light #rsd-workspace .rsd-sum-toolbar select {
    background:#ffffff; border-color:#B8C7D9; color:#0f172a;
  }
  body.theme-light #rsd-workspace .rsd-sum-toolbar select:focus {
    border-color:#1F3B63; outline:none;
  }
  body.theme-light #rsd-workspace .rsd-sum-toolbar button {
    background:#ffffff; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #rsd-workspace .rsd-sum-toolbar button:hover {
    border-color:#8FA5C2; color:#1F3B63; background:#F8FBFF;
  }
  body.theme-light #rsd-workspace .rsd-sum-status { color:#64748b; }
  body.theme-light #rsd-workspace .rsd-sum-chart-wrap {
    background:#F8FBFF; border-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-sum-chart-title { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-sum-chart-header label { color:#475569; }
  body.theme-light #rsd-workspace .rsd-sum-chart-header select,
  body.theme-light #rsd-workspace .rsd-sum-chart-header button {
    background:#ffffff; border-color:#B8C7D9; color:#0f172a;
  }
  body.theme-light #rsd-workspace .rsd-sum-chart-header button:hover {
    border-color:#8FA5C2; color:#1F3B63; background:#EEF4FA;
  }
  body.theme-light #rsd-workspace .rsd-sum-zone-legend { border-top-color:#B8C7D9; color:#64748b; }
  body.theme-light #rsd-workspace .rsd-sum-table th {
    background:#1F3B63; color:#ffffff; border-bottom:2px solid #12274A;
  }
  body.theme-light #rsd-workspace .rsd-sum-table th:hover { color:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-sum-table td {
    border-bottom-color:#D6DEE8; color:#0f172a;
  }
  body.theme-light #rsd-workspace .rsd-sum-table tbody tr:hover {
    background:rgba(31,59,99,0.06);
  }
  body.theme-light #rsd-workspace .rsd-sum-tag.tort     { color:#15803d; background:rgba(22,163,74,0.10); }
  body.theme-light #rsd-workspace .rsd-sum-tag.perf     { color:#991b1b; background:rgba(153,27,27,0.08); }
  body.theme-light #rsd-workspace .rsd-sum-tag.balanced { color:#1F3B63; background:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-sum-tag.clean    { color:#475569; background:#EEF4FA; }
  body.theme-light #rsd-workspace .rsd-sum-tag.failed   { color:#b45309; background:rgba(180,83,9,0.10); }
  body.theme-light #rsd-workspace .rsd-sum-empty { color:#64748b; }
  /* Generate Report modal */
  body.theme-light #rsd-workspace .rsd-rpt-card {
    background:#F8FBFF; border:1px solid #B8C7D9;
    box-shadow:0 12px 40px rgba(15,23,42,0.18);
  }
  body.theme-light #rsd-workspace .rsd-rpt-header {
    background:#1F3B63; color:#ffffff; border-bottom:1px solid #12274A;
  }
  body.theme-light #rsd-workspace .rsd-rpt-header .rrp-close {
    background:rgba(255,255,255,0.14); border-color:rgba(215,226,240,0.62); color:#ffffff;
  }
  body.theme-light #rsd-workspace .rsd-rpt-header .rrp-close:hover {
    background:rgba(248,113,113,0.22); border-color:rgba(252,165,165,0.75); color:#fecaca;
  }
  body.theme-light #rsd-workspace .rsd-rpt-scope label { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-rpt-scope input[type="text"] {
    background:#ffffff; border-color:#B8C7D9; color:#0f172a;
  }
  body.theme-light #rsd-workspace .rsd-rpt-pane {
    background:#ffffff; border-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-rpt-pane-head {
    background:#EEF4FA; border-bottom-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-rpt-pane-head .rrp-pane-title { color:#1F3B63; }
  body.theme-light #rsd-workspace .rsd-rpt-pane-head select,
  body.theme-light #rsd-workspace .rsd-rpt-pane-head .rrp-mini {
    background:#ffffff; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #rsd-workspace .rsd-rpt-pane-head .rrp-mini:hover {
    border-color:#8FA5C2; color:#1F3B63; background:#F8FBFF;
  }
  body.theme-light #rsd-workspace .rsd-rpt-row:hover { background:#EEF4FA; }
  body.theme-light #rsd-workspace .rsd-rpt-row .rrp-row-tag.tort-dominated { color:#15803d; background:rgba(22,163,74,0.10); }
  body.theme-light #rsd-workspace .rsd-rpt-row .rrp-row-tag.perf-limited   { color:#991b1b; background:rgba(153,27,27,0.08); }
  body.theme-light #rsd-workspace .rsd-rpt-row .rrp-row-tag.balanced       { color:#1F3B63; background:#D7E2F0; }
  body.theme-light #rsd-workspace .rsd-rpt-row .rrp-row-tag.clean          { color:#15803d; background:rgba(22,163,74,0.10); }
  body.theme-light #rsd-workspace .rsd-rpt-row .rrp-row-tag.failed         { color:#b45309; background:rgba(180,83,9,0.10); }
  body.theme-light #rsd-workspace .rsd-rpt-footer {
    background:#EEF4FA; border-top-color:#B8C7D9;
  }
  body.theme-light #rsd-workspace .rsd-rpt-footer button {
    background:#ffffff; border-color:#B8C7D9; color:#475569;
  }
  body.theme-light #rsd-workspace .rsd-rpt-footer button:hover {
    border-color:#8FA5C2; color:#1F3B63; background:#F8FBFF;
  }
  body.theme-light #rsd-workspace .rsd-rpt-footer button.primary {
    background:#1F3B63; border-color:#12274A; color:#ffffff;
  }
  body.theme-light #rsd-workspace .rsd-rpt-footer button.primary:hover {
    background:#243f66;
  }
  body.theme-light #rsd-workspace .rsd-rpt-footer button.primary:disabled {
    background:#94a3b8; border-color:#94a3b8; color:#ffffff;
  }
  /* Stage Scorecard — Cost Optimization surface + palette (light mode) */
  body.theme-light .sc-good .sc-value { color: #15803d; }
  body.theme-light .sc-warn .sc-value { color: #b45309; }
  body.theme-light .sc-bad  .sc-value { color: #991b1b; }
  body.theme-light .sc-neutral .sc-value { color: #1F3B63; }
  body.theme-light .sc-adh-on-plan .sc-adh-text { color: #15803d; }
  body.theme-light .sc-adh-diluted .sc-adh-text { color: #b45309; }
  body.theme-light .sc-adh-cut-short .sc-adh-text,
  body.theme-light .sc-adh-under .sc-adh-text { color: #991b1b; }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sched-table-wrap {
    background: #E7EEF7;
    padding: 10px 12px;
    border-radius: 0 0 4px 4px;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-card {
    background: #F8FBFF;
    border-color: #B8C7D9;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-card:hover {
    border-color: #8FA5C2;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
  }
  /* Metric / form labels — navy small caps (matches schedule section banners). */
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-card .sc-label,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-manual-label,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-pick-label,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-ctx-label {
    color: #1F3B63;
    letter-spacing: 1.2px;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-card .sc-sub,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-adherence .sc-sub {
    color: #64748b;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-ctx-strip {
    background: #EEF4FA;
    border-color: #B8C7D9;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-ctx-val {
    color: #1F3B63;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-ctx-empty-strip strong {
    color: #1F3B63;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-ctx-zone-select {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-ctx-zone-select:focus {
    outline-color: #1F3B63;
    border-color: #1F3B63;
  }
  /* Stage adherence — slate summary band (not another white KPI tile). */
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-card.sc-adherence {
    background: #EEF4FA;
    border-color: #B8C7D9;
    border-left: 3px solid #1F3B63;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-fq {
    border: 1px solid #B8C7D9;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-fq.fq-good {
    color: #15803d; background: rgba(22,163,74,0.10);
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-fq.fq-ok {
    color: #b45309; background: rgba(180,83,9,0.10);
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-fq.fq-suspect {
    color: #991b1b; background: rgba(153,27,27,0.08);
  }
  /* Manual entry — white panel on slate workspace. */
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-manual {
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-manual select,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-manual textarea,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-window select,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-result {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-manual select:focus,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-manual textarea:focus,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-window select:focus {
    border-color: #1F3B63;
    outline: none;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-result .sc-avg-val {
    color: #1F3B63;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-radio-group label {
    color: #0f172a;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-radio-group input {
    accent-color: #1F3B63;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-fr-tag.fr-combined {
    color: #15803d;
    background: rgba(22,163,74,0.10);
    border-color: rgba(22,163,74,0.40);
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-fr-tag.fr-primary {
    color: #1F3B63;
    background: #D7E2F0;
    border-color: #B8C7D9;
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-fr-tag.fr-backup {
    color: #b45309;
    background: rgba(180,83,9,0.10);
    border-color: rgba(180,83,9,0.40);
  }
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-fr-tag.fr-none,
  body.theme-light #hist-sched-panel.sched-view-scorecard .sc-avg-fr-tag.fr-unknown {
    color: #64748b;
    background: #EEF4FA;
    border-color: #B8C7D9;
  }
  /* Execution / Completions Treatment Schedule panels — executive navy chrome
     (matches Cost Opt .co-card-header: #1F3B63 band + white active tab pill). */
  body.theme-light #hist-sched-panel,
  body.theme-light #design-sched-panel,
  body.theme-light #design-materials-panel {
    border-color: #B8C7D9;
  }
  body.theme-light #hist-sched-panel .hist-chart-header,
  body.theme-light #design-sched-panel .hist-chart-header,
  body.theme-light #design-materials-panel .hist-chart-header {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #hist-sched-panel .hist-chart-header:hover,
  body.theme-light #design-sched-panel .hist-chart-header:hover,
  body.theme-light #design-materials-panel .hist-chart-header:hover {
    background: #243f66;
  }
  body.theme-light #hist-sched-panel .hist-caret,
  body.theme-light #design-sched-panel .hist-caret,
  body.theme-light #design-materials-panel .hist-caret {
    color: #D7E2F0;
  }
  body.theme-light #hist-sched-panel .hist-chart-header .sm-dim,
  body.theme-light #design-sched-panel .hist-chart-header .sm-dim,
  body.theme-light #design-materials-panel .hist-chart-header .sm-dim {
    color: #D7E2F0;
  }
  body.theme-light #hist-sched-panel .sched-tabs {
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
    padding: 6px 8px 0;
  }
  body.theme-light #hist-sched-panel .sched-tab {
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
  }
  /* Inactive tabs — frosted pill on navy so they read as clickable, not
     floating labels. Active tab stays solid white (rule below). */
  body.theme-light #hist-sched-panel .sched-tab:not(.active) {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(215,226,240,0.62);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  }
  body.theme-light #hist-sched-panel .sched-tab:not(.active):hover {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.78);
  }
  body.theme-light #hist-sched-panel .sched-tab.active {
    color: #1F3B63;
    background: #ffffff;
    border: 1px solid #ffffff;
    box-shadow: none;
  }
  body.theme-light #hist-sched-panel .sched-toolbar,
  body.theme-light #design-sched-panel .sched-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #hist-sched-panel .sched-toolbar .trim-btn,
  body.theme-light #design-sched-panel .sched-toolbar .trim-btn {
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #hist-sched-panel .sched-toolbar .trim-btn:hover,
  body.theme-light #design-sched-panel .sched-toolbar .trim-btn:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
  }
  /* + Step and other primary CTAs on schedule toolbars — navy, not theme accent blue */
  body.theme-light #design-sched-panel .sched-toolbar .trim-btn.primary,
  body.theme-light #hist-sched-panel .sched-toolbar .trim-btn.primary {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
    filter: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  }
  body.theme-light #design-sched-panel .sched-toolbar .trim-btn.primary:hover,
  body.theme-light #hist-sched-panel .sched-toolbar .trim-btn.primary:hover {
    background: #243f66;
    border-color: #12274A;
    color: #ffffff;
    filter: none;
  }
  body.theme-light #hist-sched-panel .sched-table-wrap:not(:has(.sc-root)),
  body.theme-light #design-sched-panel .sched-table-wrap {
    background: #F8FBFF;
  }
  /* Execution Treatment Schedule tables — navy header + slate row surfaces
     (Design / As Pumped / Delta); matches Completions + design-sched-panel. */
  body.theme-light #hist-sched-panel .sched-table thead th {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 2px solid #12274A;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    padding: 6px 8px;
  }
  body.theme-light #hist-sched-panel .sched-table tbody td {
    border-bottom-color: #D6DEE8;
    color: #0f172a;
  }
  body.theme-light #hist-sched-panel .sched-table tbody tr:nth-child(even) td {
    background: #EEF4FA;
  }
  body.theme-light #hist-sched-panel .sched-table tbody tr:hover td {
    background: #D7E2F0;
  }
  body.theme-light #hist-sched-panel .sched-table tbody tr.totals td {
    background: #D7E2F0;
    border-top: 2px solid #B8C7D9;
    font-weight: 700;
  }
  body.theme-light #hist-sched-panel .sched-table tbody tr.totals td.txt {
    color: #1F3B63;
  }
  body.theme-light #hist-sched-panel .sched-toolbar > span {
    color: #64748b;
  }
  body.theme-light #hist-sched-panel .sched-toolbar > span strong {
    color: #1F3B63;
  }
  /* Well Materials Summary — Volumes / Materials Cost / Pumping Costs tabs */
  body.theme-light #design-materials-panel #design-materials-body {
    background: #E7EEF7;
    padding: 10px 12px 14px;
  }
  body.theme-light #design-materials-panel .materials-tabs {
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid #B8C7D9;
    margin: 0;
    padding: 0 6px;
  }
  body.theme-light #design-materials-panel .materials-tab:not(.active) {
    color: #64748b;
  }
  body.theme-light #design-materials-panel .materials-tab:not(.active):hover {
    color: #1F3B63;
  }
  body.theme-light #design-materials-panel .materials-tab.active {
    color: #1F3B63;
    border-bottom-color: #1F3B63;
  }
  body.theme-light #design-materials-panel .materials-grid {
    background: #E7EEF7;
    padding: 10px;
    border-radius: 0;
    gap: 10px;
  }
  body.theme-light #design-materials-panel .materials-section {
    background: #F8FBFF;
    border-color: #B8C7D9;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 10px 12px 12px;
  }
  body.theme-light #design-materials-panel .materials-section h4 {
    color: #ffffff;
    background: #1F3B63;
    margin: -10px -12px 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #12274A;
    border-radius: 4px 4px 0 0;
  }
  body.theme-light #design-materials-panel .materials-section h4 .hdr-control,
  body.theme-light #design-materials-panel .materials-section h4 .hdr-control span {
    color: #D7E2F0 !important;
    font-weight: 400;
  }
  body.theme-light #design-materials-panel .materials-section table thead th {
    background: #243f66;
    color: #ffffff;
    border-bottom: 1px solid #12274A;
    padding: 6px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
  }
  body.theme-light #design-materials-panel .materials-section tbody td {
    border-bottom-color: #D6DEE8;
    color: #0f172a;
  }
  body.theme-light #design-materials-panel .materials-section tbody tr:nth-child(even) td {
    background: #EEF4FA;
  }
  body.theme-light #design-materials-panel .materials-section tbody tr:hover td {
    background: #D7E2F0;
  }
  body.theme-light #design-materials-panel .materials-section tr.totals-row td {
    background: #D7E2F0;
    color: #1F3B63;
    border-top: 2px solid #B8C7D9;
    font-weight: 700;
  }
  body.theme-light #design-materials-panel .cost-input,
  body.theme-light #design-materials-panel .cost-text-input,
  body.theme-light #design-materials-panel .materials-section h4 .hdr-control input {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #design-materials-panel .cost-input:focus,
  body.theme-light #design-materials-panel .cost-text-input:focus {
    border-color: #1F3B63;
    outline: none;
  }
  body.theme-light #design-materials-panel .cost-grand-total {
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 0;
    overflow: hidden;
    margin-top: 10px;
  }
  body.theme-light #design-materials-panel .cost-grand-total .cost-totals-rows {
    padding: 10px 16px 0;
    border-bottom-color: #D6DEE8;
  }
  body.theme-light #design-materials-panel .cost-grand-total .cost-row .lbl {
    color: #475569;
  }
  body.theme-light #design-materials-panel .cost-grand-total .cost-row .amt {
    color: #1F3B63;
  }
  body.theme-light #design-materials-panel .cost-grand-total .cost-final {
    background: #1F3B63;
    padding: 12px 16px;
    margin: 0;
  }
  body.theme-light #design-materials-panel .cost-grand-total .cost-final .lbl {
    color: #D7E2F0;
  }
  body.theme-light #design-materials-panel .cost-grand-total .cost-final .val {
    color: #ffffff;
  }
  body.theme-light #design-materials-panel .cost-grand-total .breakdown {
    padding: 8px 16px 12px;
    color: #475569;
  }
  /* Materials Program dropdown (Treatment Schedule toolbar) — light mode */
  body.theme-light #design-chem-program-dropdown {
    background: #F8FBFF;
    border: 2px solid #1F3B63;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    z-index: 500;
    /* Ring + layered shadow so the panel reads as a floating sheet over the schedule */
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.95),
      0 0 0 4px rgba(31, 59, 99, 0.12),
      0 16px 48px rgba(15, 23, 42, 0.28),
      0 6px 16px rgba(31, 59, 99, 0.2);
  }
  body.theme-light #design-chem-program-dropdown .mp-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #design-chem-program-dropdown .mp-panel-title {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #ffffff;
  }
  /* Solid, self-contained chip: dark navy text on a light background with a
     navy border. Stays readable regardless of the header background, instead
     of relying on faint translucent-white-on-navy (which vanishes if the
     navy header ever fails to paint). */
  body.theme-light #design-chem-program-dropdown .mp-header-btn {
    color: #1F3B63;
    background: #ffffff;
    border: 1px solid #1F3B63;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  }
  body.theme-light #design-chem-program-dropdown .mp-header-btn:hover {
    background: #EAF1FB;
    border-color: #12274A;
    color: #12274A;
  }
  body.theme-light #design-chem-program-dropdown .mp-panel-close {
    background: none;
    border: none;
    color: #D7E2F0;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
  }
  body.theme-light #design-chem-program-dropdown .mp-panel-close:hover {
    color: #ffffff;
  }
  body.theme-light #design-chem-program-dropdown .mp-panel-body {
    padding: 10px 14px 14px;
    background: #E7EEF7;
  }
  body.theme-light #design-chem-program-dropdown .mp-resize-handle {
    background: linear-gradient(135deg, transparent 50%, rgba(31, 59, 99, 0.5) 50%);
  }
  body.theme-light #design-chem-program-dropdown .mp-import-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #64748b;
    min-height: 14px;
    margin-bottom: 4px;
  }
  body.theme-light #design-chem-program-dropdown .mp-section-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 8px;
    padding: 8px 12px;
    background: #1F3B63;
    border-radius: 4px;
    border: 1px solid #12274A;
  }
  body.theme-light #design-chem-program-dropdown .mp-section-title {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #ffffff;
  }
  body.theme-light #design-chem-program-dropdown .mp-section-hdr .trim-btn.primary {
    background: #ffffff;
    border-color: #ffffff;
    color: #1F3B63;
    filter: none;
  }
  body.theme-light #design-chem-program-dropdown .mp-section-hdr .trim-btn.primary:hover {
    background: #EEF4FA;
    color: #1F3B63;
    filter: none;
  }
  body.theme-light #design-chem-program-dropdown #chem-prog-add-go.trim-btn.primary {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
    filter: none;
  }
  body.theme-light #design-chem-program-dropdown #chem-prog-add-go.trim-btn.primary:hover {
    background: #243f66;
    color: #ffffff;
  }
  body.theme-light #design-chem-program-dropdown .tpl-row {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
    border-radius: 4px;
    gap: 8px;
  }
  body.theme-light #design-chem-program-dropdown .tpl-row[data-proppant-row] + .tpl-row {
    margin-top: -4px;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding-top: 4px;
  }
  body.theme-light #design-chem-program-dropdown input,
  body.theme-light #design-chem-program-dropdown select {
    background: #ffffff !important;
    border-color: #B8C7D9 !important;
    color: #0f172a !important;
  }
  body.theme-light #design-chem-program-dropdown input:focus,
  body.theme-light #design-chem-program-dropdown select:focus {
    border-color: #1F3B63 !important;
    outline: none;
  }
  body.theme-light #design-chem-program-dropdown input:disabled {
    background: #EEF4FA !important;
    color: #94a3b8 !important;
  }
  body.theme-light #design-chem-program-dropdown label span,
  body.theme-light #design-chem-program-dropdown span[data-chem-unit-toggle] {
    color: #1F3B63 !important;
  }
  body.theme-light #design-chem-program-dropdown span[style*="font-size:9.5px"] {
    color: #475569 !important;
  }
  body.theme-light #design-chem-program-dropdown .mp-footer-note {
    font-size: 10px;
    color: #64748b;
    margin-top: 12px;
    line-height: 1.45;
    padding: 8px 10px;
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
    border-radius: 4px;
  }
  body.theme-light #design-sched-panel #design-chem-program {
    border-color: #B8C7D9;
    color: #1F3B63;
  }
  body.theme-light #design-sched-panel #design-chem-program:hover {
    border-color: #8FA5C2;
    background: #EEF4FA;
    color: #1F3B63;
  }
  body.theme-light #design-sched-panel #design-chem-program .mp-trigger-icon {
    color: #1F3B63;
  }
  /* Completions Design — workspace + Perforation Design navy chrome */
  body.theme-light #ptab-completions {
    background: #E7EEF7;
  }
  body.theme-light #ptab-completions #comp-subtabs {
    border-bottom: 1px solid #B8C7D9;
  }
  body.theme-light #ptab-completions #comp-subtabs .wd-subtab {
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
    border: 1px solid transparent;
    border-bottom: none;
  }
  body.theme-light #ptab-completions #comp-subtabs .wd-subtab:not(.active) {
    color: #475569;
    background: #EEF4FA;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-completions #comp-subtabs .wd-subtab:not(.active):hover {
    color: #1F3B63;
    background: #F8FBFF;
    border-color: #8FA5C2;
  }
  body.theme-light #ptab-completions #comp-subtabs .wd-subtab.active {
    background: #1F3B63;
    color: #ffffff;
    border-color: #12274A;
  }
  body.theme-light #ptab-completions .perf-section {
    background: #F8FBFF;
    border-color: #B8C7D9;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
  }
  body.theme-light #ptab-completions .perf-section-title {
    background: #1F3B63;
    color: #ffffff;
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-completions .perf-form-grid {
    padding: 12px 14px;
  }
  body.theme-light #ptab-completions .perf-field label {
    color: #1F3B63;
  }
  body.theme-light #ptab-completions .perf-field input {
    background: #ffffff;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-completions .perf-field input:focus {
    border-color: #1F3B63;
    outline: none;
  }
  body.theme-light #ptab-completions .perf-summary {
    background: #EEF4FA;
    border: 1px solid #B8C7D9;
    border-radius: 6px;
    margin-left: 12px;
    margin-right: 12px;
  }
  body.theme-light #ptab-completions .perf-summary .ps-label {
    color: #64748b;
  }
  body.theme-light #ptab-completions .perf-summary .ps-value {
    color: #1F3B63;
  }
  body.theme-light #ptab-completions .perf-actuals-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-completions .perf-actuals-toolbar .trim-btn {
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-completions .perf-actuals-toolbar .trim-btn:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
  }
  body.theme-light #ptab-completions .perf-actuals-toolbar .trim-btn.primary {
    color: #1F3B63;
    background: #ffffff;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-completions .perf-actuals-panel {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-completions .sched-table thead th {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 2px solid #12274A;
    border-right: 1px solid rgba(255,255,255,0.14);
  }
  body.theme-light #ptab-completions .sched-table thead .group-h {
    background: #243f66;
    color: #D7E2F0;
    border-bottom-color: rgba(255,255,255,0.2);
  }
  /* Design Treatment Schedule table — two-row header: collapse empty group band,
     polish column labels (padding, vendor sublines, resizer on navy). */
  body.theme-light #design-sched-panel .sched-table thead tr:first-child th.group-h:empty {
    padding: 0;
    height: 0;
    line-height: 0;
    font-size: 0;
    border: none;
    overflow: hidden;
  }
  body.theme-light #design-sched-panel .sched-table thead tr:first-child th.group-h:not(:empty) {
    padding: 5px 10px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-align: center;
    vertical-align: middle;
    color: #D7E2F0;
    background: #243f66;
    border-bottom: 1px solid rgba(255,255,255,0.22);
    position: sticky;
    top: 0;
    z-index: 4;
  }
  body.theme-light #design-sched-panel .sched-table thead tr:last-child th {
    padding: 8px 10px;
    font-size: 9px;
    letter-spacing: 0.5px;
    line-height: 1.35;
    vertical-align: bottom;
    white-space: normal;
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 2px solid #12274A;
    border-right: 1px solid rgba(255,255,255,0.14);
    position: sticky;
    z-index: 3;
  }
  body.theme-light #design-sched-panel .sched-table thead:has(tr:first-child th.group-h:not(:empty)) tr:last-child th {
    top: 1.65rem;
  }
  body.theme-light #design-sched-panel .sched-table thead:not(:has(tr:first-child th.group-h:not(:empty))) tr:last-child th {
    top: 0;
  }
  body.theme-light #design-sched-panel .sched-table thead th small {
    color: #D7E2F0 !important;
    font-weight: 500;
  }
  body.theme-light #design-sched-panel .sched-table .col-resizer:hover,
  body.theme-light #design-sched-panel .sched-table .col-resizer.dragging {
    background: #93c5fd;
    opacity: 0.85;
  }
  body.theme-light #ptab-completions .sched-table tbody tr:nth-child(even) td {
    background: #EEF4FA;
  }
  body.theme-light #ptab-completions .sched-table tbody tr:hover td {
    background: #D7E2F0;
  }
  body.theme-light #compsub-schedule .hist-toolbar {
    background: #EEF4FA;
    border-bottom: 1px solid #B8C7D9;
    padding: 10px 12px;
  }
  body.theme-light #compsub-schedule .hist-toolbar span,
  body.theme-light #compsub-schedule .hist-toolbar label {
    color: #1F3B63;
  }
  body.theme-light #compsub-schedule .hist-toolbar .pdf-page-info {
    color: #475569;
  }
  body.theme-light #compsub-schedule .hist-toolbar .pdf-btn.secondary {
    border-color: #B8C7D9;
    color: #475569;
    background: #ffffff;
  }
  body.theme-light #compsub-schedule .hist-toolbar .pdf-btn.secondary:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #F8FBFF;
  }
  body.theme-light #compsub-schedule .hist-toolbar .trim-btn {
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #compsub-schedule .hist-toolbar .trim-btn:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
  }
  body.theme-light #compsub-schedule .hist-toolbar .trim-btn.primary {
    color: #1F3B63;
    background: #ffffff;
    border-color: #B8C7D9;
  }
  body.theme-light #compsub-schedule .zone-btn {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #compsub-schedule .zone-btn:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
  }
  body.theme-light #compsub-schedule .zone-btn.active {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
  }
  body.theme-light #compsub-schedule #design-nstages-input {
    background: #ffffff;
    border-color: #B8C7D9;
  }
  body.theme-light #compsub-schedule #design-nstages-input:focus {
    border-color: #1F3B63;
    outline: none;
  }
  /* Frac Operations sub-tabs — navy active pill (Completed Stages / LiveStream) */
  body.theme-light #frac-ops-subtabs {
    background: #EEF4FA;
    border-bottom: 1px solid #B8C7D9;
  }
  body.theme-light #frac-ops-subtabs .frac-subtab {
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
    border-bottom: none;
  }
  body.theme-light #frac-ops-subtabs .frac-subtab:not(.active) {
    color: #475569;
    background: transparent;
  }
  body.theme-light #frac-ops-subtabs .frac-subtab:not(.active):hover {
    color: #1F3B63;
    background: #F8FBFF;
  }
  body.theme-light #frac-ops-subtabs .frac-subtab.active {
    background: #1F3B63;
    color: #ffffff;
    border: 1px solid #12274A;
  }
  /* Execution Chemical Additives Plot — same executive navy banner as
     Treatment Schedule (#hist-sched-panel). Toolbar buttons use the
     frosted inactive / white active pill pattern as sched tabs. */
  body.theme-light #hist-chem-panel {
    border-color: #B8C7D9;
  }
  body.theme-light #hist-chem-panel .hist-chart-header {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #hist-chem-panel .hist-chart-header:hover {
    background: #243f66;
  }
  body.theme-light #hist-chem-panel .hist-caret {
    color: #D7E2F0;
  }
  body.theme-light #hist-chem-panel .chem-toolbar {
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
    padding: 4px 10px 8px;
  }
  body.theme-light #hist-chem-panel .chem-toolbar .trim-sep {
    background: rgba(255,255,255,0.32);
  }
  body.theme-light #hist-chem-panel .chem-toolbar .cm-mode-label,
  body.theme-light #hist-chem-panel .chem-toolbar .ts-dim,
  body.theme-light #hist-chem-panel .chem-toolbar .trim-status .ts-dim {
    color: #D7E2F0;
  }
  body.theme-light #hist-chem-panel .chem-toolbar .trim-status .ts-val {
    color: #ffffff;
  }
  body.theme-light #hist-chem-panel .chem-toolbar .trim-btn:not(.armed) {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(215,226,240,0.62);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  }
  body.theme-light #hist-chem-panel .chem-toolbar .trim-btn:not(.armed):hover {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.78);
    color: #ffffff;
  }
  body.theme-light #hist-chem-panel .chem-toolbar .trim-btn.danger:not(.armed):hover {
    background: rgba(248,113,113,0.22);
    border-color: rgba(252,165,165,0.75);
    color: #fecaca;
  }
  body.theme-light #hist-chem-panel .chem-toolbar .trim-btn.armed {
    color: #1F3B63;
    background: #ffffff;
    border: 1px solid #ffffff;
    box-shadow: none;
  }
  body.theme-light #hist-chem-panel .chem-map-panel {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  /* Completed Stages (Test) — chemicals chart: mirror the navy chem theme */
  body.theme-light #etest-chem-panel { border-color: #B8C7D9; }
  body.theme-light #etest-chem-panel .hist-chart-header {
    background: #1F3B63; color: #ffffff; border-bottom: 1px solid #12274A;
  }
  body.theme-light #etest-chem-panel .hist-chart-header:hover { background: #243f66; }
  body.theme-light #etest-chem-panel .hist-caret { color: #D7E2F0; }
  body.theme-light #etest-chem-panel .hist-chart-header .etest-chart-toggle { color: #D7E2F0; }
  body.theme-light #etest-chem-panel .hist-chart-header .etest-chart-toggle:hover { color: #ffffff; }
  body.theme-light #etest-chem-panel .chem-toolbar {
    background: #1F3B63; border-bottom: 1px solid #12274A; padding: 4px 10px 8px;
  }
  body.theme-light #etest-chem-panel .chem-toolbar .trim-sep { background: rgba(255,255,255,0.32); }
  body.theme-light #etest-chem-panel .chem-toolbar .cm-mode-label,
  body.theme-light #etest-chem-panel .chem-toolbar .ts-dim,
  body.theme-light #etest-chem-panel .chem-toolbar .trim-status .ts-dim { color: #D7E2F0; }
  body.theme-light #etest-chem-panel .chem-toolbar .trim-status .ts-val { color: #ffffff; }
  body.theme-light #etest-chem-panel .chem-toolbar .trim-btn:not(.armed) {
    color: #ffffff; background: rgba(255,255,255,0.14); border: 1px solid rgba(215,226,240,0.62);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  }
  body.theme-light #etest-chem-panel .chem-toolbar .trim-btn:not(.armed):hover {
    background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.78); color: #ffffff;
  }
  body.theme-light #etest-chem-panel .chem-toolbar .trim-btn.danger:not(.armed):hover {
    background: rgba(248,113,113,0.22); border-color: rgba(252,165,165,0.75); color: #fecaca;
  }
  body.theme-light #etest-chem-panel .chem-toolbar .trim-btn.armed {
    color: #1F3B63; background: #ffffff; border: 1px solid #ffffff; box-shadow: none;
  }
  body.theme-light #etest-chem-panel .chem-map-panel { background: #F8FBFF; border-bottom-color: #B8C7D9; }
  body.theme-light #etest-chem-panel > #etest-chem-summary { background: #ffffff; border-bottom-color: #B8C7D9; }
  body.theme-light #etest-chem-panel .hist-resize-handle { background: #EEF4FA; border-top-color: #B8C7D9; }
  body.theme-light #etest-chem-panel .hist-resize-handle .hist-resize-grip,
  body.theme-light #etest-chem-panel .hist-resize-handle .hist-resize-hint { color: #64748b; }
  body.theme-light #etest-chem-panel .hist-resize-handle:hover,
  body.theme-light #etest-chem-panel .hist-resize-handle.dragging { background: #1F3B63; border-top-color: #12274A; }
  /* ── Tier 1: Project shell (sidebar + well rows) — Cost Opt surfaces.
     Sidebar gutter is deliberately darker than the white workspace so the
     project rail reads as its own column (#D6DEE8 vs #ffffff main). */
  body.theme-light .project-sidebar {
    background: #D6DEE8;
    border-right: 1px solid #8FA5C2;
    box-shadow: 2px 0 10px rgba(15,23,42,0.07);
  }
  body.theme-light .project-sidebar::-webkit-scrollbar-track {
    background: rgba(15,23,42,0.06);
  }
  body.theme-light .project-sidebar::-webkit-scrollbar-thumb {
    background: #8FA5C2;
    border-color: #D6DEE8;
  }
  body.theme-light .project-sidebar {
    scrollbar-color: #8FA5C2 rgba(15,23,42,0.06);
  }
  body.theme-light .project-sidebar .panel {
    border-bottom-color: #B8C7D9;
  }
  body.theme-light .project-sidebar .panel-header {
    background: #EEF4FA;
  }
  body.theme-light .project-sidebar .panel-header h2 {
    color: #1F3B63;
  }
  body.theme-light .project-sidebar #proj-well-count {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    background: #1F3B63;
    color: #ffffff;
    border: 1px solid #12274A;
  }
  body.theme-light .project-sidebar .panel-body {
    background: #EEF4FA;
  }
  body.theme-light .project-sidebar .basemap-select,
  body.theme-light .project-sidebar select.basemap-select {
    background: #ffffff;
    border-color: #B8C7D9;
  }
  body.theme-light .project-sidebar .pw-group-label {
    color: #1F3B63;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light .project-sidebar .pw-group-count {
    background: #1F3B63;
    color: #ffffff;
    border: 1px solid #12274A;
  }
  body.theme-light .project-sidebar .pw-group-clear {
    color: #991b1b;
    background: #ffffff;
    border-color: #fca5a5;
  }
  body.theme-light .project-sidebar .pw-group-clear:hover:not(:disabled) {
    color: #ffffff;
    background: #dc2626;
    border-color: #b91c1c;
  }
  body.theme-light .project-sidebar .well-row {
    background: #ffffff;
    border-color: #B8C7D9;
  }
  body.theme-light .project-sidebar .well-row:hover {
    border-color: #8FA5C2;
    background: #F8FBFF;
  }
  body.theme-light .project-sidebar .well-row.selected {
    border-color: #1F3B63;
    background: #C5D4E6;
    box-shadow: inset 4px 0 0 #1F3B63, 0 1px 4px rgba(31,59,99,0.14);
  }
  body.theme-light .project-sidebar .well-row.selected:hover {
    border-color: #1F3B63;
    background: #B8C7D9;
  }
  body.theme-light .project-sidebar .well-row .wr-api {
    color: #1F3B63;
  }
  body.theme-light .project-sidebar .well-row.selected .wr-name {
    color: #1F3B63;
    font-weight: 700;
  }
  body.theme-light .project-sidebar .well-row.selected .wr-api {
    color: #12274A;
  }
  body.theme-light .project-main {
    background: #ffffff;
  }
  body.theme-light .mode-project.visible {
    background: #ffffff;
  }
  body.theme-light .proj-tabs-bar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  /* Reports — executive navy chrome (3-layer: slate workspace, white toolbar, dark PDF canvas). */
  body.theme-light #ptab-reports.proj-tab-panel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-reports > .wd-subtabs {
    margin-bottom: 0;
    padding: 6px 8px 0;
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-reports > .wd-subtabs .wd-subtab {
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
    border: 1px solid transparent;
    border-bottom: none;
  }
  body.theme-light #ptab-reports > .wd-subtabs .wd-subtab:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(215, 226, 240, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  body.theme-light #ptab-reports > .wd-subtabs .wd-subtab:not(.active):hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.78);
    color: #ffffff;
  }
  body.theme-light #ptab-reports > .wd-subtabs .wd-subtab.active {
    color: #1F3B63;
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: none;
  }
  body.theme-light #ptab-reports .wd-subpanel {
    background: #E7EEF7;
  }
  body.theme-light #ptab-reports .daily-subtabs,
  body.theme-light #ptab-reports .frac-subtabs {
    background: #EEF4FA;
    border-bottom-color: #B8C7D9;
    padding: 0 8px;
  }
  body.theme-light #ptab-reports .daily-subtab,
  body.theme-light #ptab-reports .frac-subtab {
    background: transparent;
    color: #64748b;
  }
  body.theme-light #ptab-reports .daily-subtab:hover,
  body.theme-light #ptab-reports .frac-subtab:hover {
    color: #1F3B63;
  }
  body.theme-light #ptab-reports .daily-subtab.active,
  body.theme-light #ptab-reports .frac-subtab.active {
    color: #1F3B63;
    background: #F8FBFF;
    border-bottom-color: #1F3B63;
  }
  body.theme-light #ptab-reports .pdf-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-reports .pdf-toolbar .wh-input,
  body.theme-light #ptab-reports .pdf-toolbar select {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #ptab-reports .pdf-toolbar .wh-input:focus,
  body.theme-light #ptab-reports .pdf-toolbar select:focus {
    border-color: #1F3B63;
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 59, 99, 0.18);
  }
  body.theme-light #ptab-reports .pdf-page-info {
    color: #1F3B63;
  }
  body.theme-light #ptab-reports .pdf-sep {
    background: #B8C7D9;
  }
  body.theme-light #ptab-reports .pdf-btn {
    background: #1F3B63;
    border: 1px solid #12274A;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  body.theme-light #ptab-reports .pdf-btn:hover:not(:disabled) {
    background: #243f66;
    opacity: 1;
  }
  body.theme-light #ptab-reports .pdf-btn.secondary {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
    box-shadow: none;
  }
  body.theme-light #ptab-reports .pdf-btn.secondary:hover:not(:disabled) {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
    opacity: 1;
  }
  body.theme-light #ptab-reports .pdf-btn:disabled {
    opacity: 0.45;
  }
  /* PDF canvas — keep dark surround for document contrast. */
  body.theme-light #ptab-reports .pdf-canvas-wrap {
    background: #1a1a2e;
  }
  body.theme-light #ptab-reports .pdf-status {
    color: #94a3b8;
  }
  body.theme-light #ptab-reports .csv-table th {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 2px solid #12274A;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
  }
  body.theme-light #ptab-reports .csv-table td {
    border-bottom-color: #D6DEE8;
  }
  body.theme-light #ptab-reports .csv-table tbody tr:nth-child(even) td {
    background: #EEF4FA;
  }
  body.theme-light #ptab-reports .csv-table tr:hover td {
    background: #D7E2F0;
  }
  body.theme-light #ptab-reports .xlsx-tabs {
    background: #EEF4FA;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-reports .xlsx-tab.active {
    color: #1F3B63;
    border-bottom-color: #1F3B63;
  }
  /* Daily Log — executive navy chrome + slate/white surfaces. */
  body.theme-light #ptab-dailylog.proj-tab-panel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-dailylog .dl-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .dl-toolbar .wh-input,
  body.theme-light #ptab-dailylog .dl-toolbar select {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #ptab-dailylog .dl-toolbar .wh-input:focus,
  body.theme-light #ptab-dailylog .dl-toolbar select:focus {
    border-color: #1F3B63;
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 59, 99, 0.18);
  }
  body.theme-light #ptab-dailylog .pdf-page-info {
    color: #1F3B63;
  }
  body.theme-light #ptab-dailylog .pdf-sep {
    background: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .pdf-btn {
    background: #1F3B63;
    border: 1px solid #12274A;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  body.theme-light #ptab-dailylog .pdf-btn:hover:not(:disabled) {
    background: #243f66;
    opacity: 1;
  }
  body.theme-light #ptab-dailylog .pdf-btn.secondary {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
    box-shadow: none;
  }
  body.theme-light #ptab-dailylog .pdf-btn.secondary:hover:not(:disabled) {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
    opacity: 1;
  }
  body.theme-light #ptab-dailylog .dl-kpi-strip {
    background: #E7EEF7;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .dl-kpi-card {
    background: #F8FBFF;
    border-color: #B8C7D9;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  body.theme-light #ptab-dailylog .dl-kpi-label {
    color: #1F3B63;
    letter-spacing: 1px;
  }
  body.theme-light #ptab-dailylog .dl-kpi-val {
    color: #0f172a;
  }
  body.theme-light #ptab-dailylog .dl-kpi-val.good { color: #15803d; }
  body.theme-light #ptab-dailylog .dl-kpi-val.warn { color: #b45309; }
  body.theme-light #ptab-dailylog .dl-kpi-val.bad  { color: #991b1b; }
  body.theme-light #ptab-dailylog .dl-hours-strip {
    background: #EEF4FA;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .dl-hours-title {
    color: #1F3B63;
    letter-spacing: 1px;
  }
  body.theme-light #ptab-dailylog .dl-hours-title .dl-clear-filter {
    color: #1F3B63;
  }
  body.theme-light #ptab-dailylog .dl-hour-row {
    background: #F8FBFF;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .dl-hour-row:hover {
    background: #EEF4FA;
    border-color: #8FA5C2;
  }
  body.theme-light #ptab-dailylog .dl-hour-row.active {
    background: #D7E2F0;
    border-color: #1F3B63;
    box-shadow: inset 0 0 0 1px #1F3B63;
  }
  body.theme-light #ptab-dailylog .dl-days-list {
    background: #F8FBFF;
    border-right-color: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .dl-days-head,
  body.theme-light #ptab-dailylog .dl-events-head {
    background: #1F3B63;
    color: #D7E2F0;
    border-bottom-color: #12274A;
    letter-spacing: 1px;
  }
  body.theme-light #ptab-dailylog .dl-day-row {
    border-bottom-color: #D6DEE8;
  }
  body.theme-light #ptab-dailylog .dl-day-row:hover {
    background: #EEF4FA;
  }
  body.theme-light #ptab-dailylog .dl-day-row.active {
    background: #D7E2F0;
    border-left-color: #1F3B63;
  }
  body.theme-light #ptab-dailylog .dl-day-num {
    color: #1F3B63;
  }
  body.theme-light #ptab-dailylog .dl-events-wrap {
    background: #F8FBFF;
  }
  body.theme-light #ptab-dailylog .dl-event-row {
    background: #F8FBFF;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .dl-event-duration {
    background: #EEF4FA;
    color: #1F3B63;
  }
  body.theme-light #ptab-dailylog .dl-evt-btn {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-dailylog .dl-evt-btn:hover {
    color: #1F3B63;
    border-color: #8FA5C2;
    background: #EEF4FA;
  }
  body.theme-light #ptab-dailylog .dl-add-btn {
    border-color: #1F3B63;
    color: #1F3B63;
  }
  body.theme-light #ptab-dailylog .dl-add-btn:hover {
    background: #1F3B63;
    color: #ffffff;
  }
  body.theme-light #ptab-dailylog .dl-edit-form {
    background: #EEF4FA;
    border-left-color: #1F3B63 !important;
  }
  body.theme-light #ptab-dailylog .dl-edit-title {
    color: #1F3B63;
  }
  body.theme-light #ptab-dailylog .dl-edit-grid input,
  body.theme-light #ptab-dailylog .dl-edit-grid select,
  body.theme-light #ptab-dailylog .dl-edit-fullwidth textarea {
    background: #ffffff;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-dailylog .dl-edit-grid input:focus,
  body.theme-light #ptab-dailylog .dl-edit-grid select:focus,
  body.theme-light #ptab-dailylog .dl-edit-fullwidth textarea:focus {
    border-color: #1F3B63;
    box-shadow: 0 0 0 2px rgba(31, 59, 99, 0.18);
  }
  body.theme-light #ptab-dailylog .dl-edit-actions .primary {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
  }
  body.theme-light #ptab-dailylog .dl-edit-actions .primary:hover {
    background: #243f66;
    opacity: 1;
  }
  body.theme-light #ptab-dailylog .dl-edit-actions .secondary {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-dailylog .dl-edit-actions .secondary:hover {
    color: #1F3B63;
    background: #EEF4FA;
  }
  body.theme-light #ptab-dailylog .dl-event-badge.edited {
    color: #b45309;
    background: rgba(180, 83, 9, 0.10);
    border-color: rgba(180, 83, 9, 0.40);
  }
  body.theme-light #ptab-dailylog .dl-event-badge.added {
    color: #15803d;
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.40);
  }
  body.theme-light #ptab-dailylog .dl-save-badge.dirty {
    color: #b45309;
    background: rgba(180, 83, 9, 0.10);
    border-color: rgba(180, 83, 9, 0.40);
  }
  body.theme-light #ptab-dailylog .dl-save-badge.saved {
    color: #15803d;
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.40);
  }
  /* Production — executive navy chrome + slate/white surfaces. */
  body.theme-light #ptab-production.proj-tab-panel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-production .prod-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-production .prod-well-label {
    color: #1F3B63;
  }
  body.theme-light #ptab-production .prod-lag {
    color: #64748b;
  }
  body.theme-light #ptab-production .prod-lag.stale {
    color: #b45309;
  }
  body.theme-light #ptab-production .pdf-sep {
    background: #B8C7D9;
  }
  body.theme-light #ptab-production .pdf-btn {
    background: #1F3B63;
    border: 1px solid #12274A;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  body.theme-light #ptab-production .pdf-btn:hover:not(:disabled) {
    background: #243f66;
    opacity: 1;
  }
  body.theme-light #ptab-production .pdf-btn.secondary {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
    box-shadow: none;
  }
  body.theme-light #ptab-production .pdf-btn.secondary:hover:not(:disabled) {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
    opacity: 1;
  }
  body.theme-light #ptab-production .prod-summary-strip {
    background: #E7EEF7;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-production .prod-kpi-card {
    background: #F8FBFF;
    border-color: #B8C7D9;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  body.theme-light #ptab-production .prod-kpi-label {
    color: #1F3B63;
    letter-spacing: 1px;
  }
  body.theme-light #ptab-production .prod-kpi-val {
    color: #1F3B63;
    font-family: 'JetBrains Mono', monospace;
    font-size: 17px;
  }
  body.theme-light #ptab-production .prod-kpi-sub {
    color: #64748b;
  }
  body.theme-light #ptab-production .prod-chart-section {
    background: #E7EEF7;
    padding: 12px;
  }
  body.theme-light #ptab-production .prod-chart-card {
    background: #F8FBFF;
    border-color: #B8C7D9;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 0;
    overflow: hidden;
  }
  body.theme-light #ptab-production .prod-chart-title {
    color: #D7E2F0;
    background: #1F3B63;
    letter-spacing: 1.2px;
    margin: 0;
    padding: 10px 44px 10px 14px;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-production .prod-chart-wrap {
    padding: 12px 14px 14px;
    background: #F8FBFF;
  }
  body.theme-light #ptab-production .prod-chart-expand {
    top: 6px;
    right: 10px;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(215, 226, 240, 0.62);
    color: #ffffff;
  }
  body.theme-light #ptab-production .prod-chart-expand:hover {
    color: #ffffff;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.28);
  }
  body.theme-light #ptab-production .prod-chart-card.expanded {
    background: #F8FBFF;
    border-color: #1F3B63;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    padding: 0;
  }
  body.theme-light #ptab-production .prod-chart-card.expanded .prod-chart-wrap {
    padding: 16px 18px 18px;
  }
  body.theme-light #ptab-production .prod-empty .prod-empty-title {
    color: #1F3B63;
  }
  /* Frac Analyses — executive navy chrome + slate/white surfaces. */
  body.theme-light #ptab-fracanalyses.proj-tab-panel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-fracanalyses .an-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-fracanalyses .pdf-page-info {
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .pdf-sep {
    background: #B8C7D9;
  }
  body.theme-light #ptab-fracanalyses .pdf-btn.secondary {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
    box-shadow: none;
  }
  body.theme-light #ptab-fracanalyses .pdf-btn.secondary:hover:not(:disabled) {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
    opacity: 1;
  }
  body.theme-light #ptab-fracanalyses .fa-grid {
    background: #E7EEF7;
  }
  /* Analysis 1–5 tab strip — executive navy band (matches Post-Frac subtabs). */
  body.theme-light #ptab-fracanalyses .fa-tabs {
    padding: 6px 8px 0;
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-fracanalyses .fa-tab {
    margin-right: 4px;
    border-radius: 4px 4px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(215, 226, 240, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  body.theme-light #ptab-fracanalyses .fa-tab:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.78);
    color: #ffffff;
  }
  body.theme-light #ptab-fracanalyses .fa-tab.active {
    background: #F8FBFF;
    border-color: #F8FBFF;
    color: #1F3B63;
    font-weight: 600;
    box-shadow: none;
    margin-bottom: -1px;
  }
  body.theme-light #ptab-fracanalyses .fa-tab:not(.active) .fa-tab-subtitle {
    color: #D7E2F0;
  }
  body.theme-light #ptab-fracanalyses .fa-tab:not(.active) .fa-tab-meta {
    color: rgba(215, 226, 240, 0.88);
  }
  body.theme-light #ptab-fracanalyses .fa-tab.active .fa-tab-subtitle {
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-tab.active .fa-tab-meta {
    color: #64748b;
  }
  body.theme-light #ptab-fracanalyses .fa-tab.empty:not(.active) {
    opacity: 0.72;
  }
  body.theme-light #ptab-fracanalyses .fa-tab.empty.active {
    opacity: 1;
  }
  body.theme-light #ptab-fracanalyses .fa-card {
    background: #F8FBFF;
    border-color: #B8C7D9;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  body.theme-light #ptab-fracanalyses .fa-card-header {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-fracanalyses .fa-card-header:hover {
    background: #243f66;
  }
  body.theme-light #ptab-fracanalyses .fa-card-header .fa-caret,
  body.theme-light #ptab-fracanalyses .fa-card-header .fa-summary {
    color: #D7E2F0;
  }
  body.theme-light #ptab-fracanalyses .fa-card-body,
  body.theme-light #ptab-fracanalyses .fa-card-actions,
  body.theme-light #ptab-fracanalyses .fa-v2r-actions {
    background: #F8FBFF;
  }
  body.theme-light #ptab-fracanalyses .fa-well-row {
    border-bottom-color: #D6DEE8;
  }
  body.theme-light #ptab-fracanalyses .fa-well-name {
    color: #0f172a;
  }
  /* Stage pills — old fills were so pale (8% opacity tints) they read as
     ghosted outlines on the white card surface. Bumped to ~18% fills with
     stronger borders so each pill registers as a real chip. Disabled
     (strikethrough) state gets an explicit muted wash so it reads as "off"
     at a glance instead of just struck through. */
  body.theme-light #ptab-fracanalyses .fa-stage-pill {
    background: #E2E8F0;
    border-color: #94A3B8;
    color: #1F3B63;
    font-weight: 600;
  }
  body.theme-light #ptab-fracanalyses .fa-stage-pill.fa-toggle:hover {
    background: #CBD5E1;
    border-color: #64748b;
    color: #0f172a;
  }
  body.theme-light #ptab-fracanalyses .fa-stage-pill.has-timing {
    border-color: rgba(22, 163, 74, 0.65);
    color: #15803d;
    background: rgba(22, 163, 74, 0.18);
  }
  body.theme-light #ptab-fracanalyses .fa-stage-pill.from-log {
    border-color: rgba(180, 83, 9, 0.70);
    color: #b45309;
    background: rgba(180, 83, 9, 0.20);
  }
  body.theme-light #ptab-fracanalyses .fa-stage-pill.disabled {
    background: #F1F5F9;
    border-color: #CBD5E1;
    color: #94A3B8;
    opacity: 0.7;
  }
  body.theme-light #ptab-fracanalyses .fa-timeline-stats {
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-fracanalyses .fa-timeline-stats-row {
    border-bottom-color: #D6DEE8;
    background: #F8FBFF;
  }
  body.theme-light #ptab-fracanalyses .fa-timeline-stats-row.fa-tls-head {
    background: #243f66;
    color: #D7E2F0;
    border-bottom-color: #12274A;
  }
  body.theme-light #ptab-fracanalyses .fa-timeline-stats-row[data-tls-toggle]:hover {
    background: #EEF4FA;
  }
  body.theme-light #ptab-fracanalyses .fa-timeline-stats-row.collapsed:hover {
    background: #EEF4FA;
    opacity: 1;
  }
  body.theme-light #ptab-fracanalyses .fa-timeline-stats-row .fa-tls-well {
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-timeline-wrap,
  body.theme-light #ptab-fracanalyses .fa-v2r-wrap,
  body.theme-light #ptab-fracanalyses .fa-wireline-wrap,
  body.theme-light #ptab-fracanalyses .fa-stagedepth-wrap {
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
  }
  /* Light mode chart section cards — each chart section (timeline /
     wireline / stagedepth / v2r / avgpr) is wrapped by renderFracAnalyses
     in .fa-section-card; here we promote the wrapper to a full bordered
     surface with the section-title acting as the card header and the
     chart wrap inside as the body. The chart wraps' own bg/border are
     suppressed below so they don't double-box. */
  body.theme-light #ptab-fracanalyses .fa-section-card {
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    margin: 14px;
    overflow: hidden;
  }
  body.theme-light #ptab-fracanalyses .fa-section-card .fa-timeline-wrap,
  body.theme-light #ptab-fracanalyses .fa-section-card .fa-v2r-wrap,
  body.theme-light #ptab-fracanalyses .fa-section-card .fa-wireline-wrap,
  body.theme-light #ptab-fracanalyses .fa-section-card .fa-stagedepth-wrap {
    background: transparent;
    border: none;
  }
  /* Section heading bars (WIRELINE PERFORMANCE / STAGE TIME VS PLUG DEPTH /
     etc.) — old pale-blue bg blended into the surrounding card surface and
     made the header bars near-invisible. Switched to a clean white bg with
     a thick navy bottom border so each section reads as a true divider,
     and bumped the label to font-weight 700 for more presence. */
  body.theme-light #ptab-fracanalyses .fa-section-title {
    color: #0f172a;
    background: #ffffff;
    margin: 0;
    padding: 10px 14px;
    border-bottom: 2px solid #1F3B63;
    font-weight: 700;
  }
  /* Predicted run time chips — dark-mode used rgba(0,0,0,0.18) which is a
     dull translucent gray on white. Re-skinned to navy-tinted cards with a
     visible border so each plug-depth chip reads as a deliberate data
     pill, and gave the parent container's top divider a real slate color
     since the dark-mode rgba(255,255,255,0.06) is invisible on white. */
  body.theme-light #ptab-fracanalyses .fa-wireline-prediction {
    border-top-color: #B8C7D9;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-prediction .fa-pred-cell {
    background: rgba(31, 59, 99, 0.08);
    border: 1px solid rgba(31, 59, 99, 0.25);
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-prediction .fa-pred-cell strong {
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-prediction .fa-pred-cell small {
    color: #475569;
  }
  /* Savings outlook callout — dark-mode used a pale mint-green wash that
     looked sickly on the warm-white light surface. Re-skinned to match the
     forest-green palette the .fa-stage-pill.has-timing chips use so it
     reads as the same "positive / on-target" semantic, just bolder. */
  body.theme-light #ptab-fracanalyses .fa-wireline-savings {
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.40);
    color: #166534;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-savings .fa-savings-label {
    color: #15803d;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-savings .fa-savings-text strong {
    color: #15803d;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-savings .fa-savings-noise {
    color: #475569;
  }
  body.theme-light #ptab-fracanalyses .fa-section-title .fa-section-meta {
    color: #64748b;
  }
  body.theme-light #ptab-fracanalyses .fa-section-title .fa-section-meta.fa-avgpr-collective {
    color: #1F3B63;
    border-left-color: #B8C7D9;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-stat {
    background: #F8FBFF;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-stat-label {
    color: #1F3B63;
    letter-spacing: 1px;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-filter select,
  body.theme-light #ptab-fracanalyses .fa-multiselect-toggle,
  body.theme-light #ptab-fracanalyses .fa-v2r-target input[type="number"] {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #ptab-fracanalyses .fa-multiselect-panel {
    background: #F8FBFF;
    border-color: #B8C7D9;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  }
  body.theme-light #ptab-fracanalyses .fa-multiselect-panel label:hover {
    background: #EEF4FA;
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages {
    background: #EEF4FA;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages-title {
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-chip:not(.active) {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-chip:not(.active):hover {
    background: #EEF4FA;
    border-color: #8FA5C2;
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-chip:not(.active)::before {
    opacity: 1;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-chip.active {
    background: var(--chip-color, #1F3B63);
    border-color: var(--chip-color, #1F3B63);
    color: #ffffff;
    font-weight: 700;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-chip.active::before {
    background: rgba(255, 255, 255, 0.92);
    opacity: 1;
  }
  body.theme-light #ptab-fracanalyses .fa-wireline-stats,
  body.theme-light #ptab-fracanalyses .fa-wireline-wells {
    border-bottom-color: #D6DEE8;
  }
  /* Analysis 2 (Volume to Rate) — toolbar, filters, and empty states */
  body.theme-light #ptab-fracanalyses .fa-tab-content {
    background: #F8FBFF;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-actions .trim-btn:not(.primary) {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-actions .trim-btn:not(.primary):hover:not(:disabled) {
    background: #EEF4FA;
    border-color: #8FA5C2;
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-card-actions .trim-btn:not(.primary) {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-fracanalyses .fa-card-actions .trim-btn:not(.primary):hover:not(:disabled) {
    background: #EEF4FA;
    border-color: #8FA5C2;
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages-form .trim-btn.primary {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages-form .trim-btn.primary:hover:not(:disabled) {
    background: #243f66;
    border-color: #12274A;
    color: #ffffff;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-filter,
  body.theme-light #ptab-fracanalyses .fa-v2r-toggle,
  body.theme-light #ptab-fracanalyses .fa-v2r-target {
    color: #475569;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-actions .fa-action-meta,
  body.theme-light #ptab-fracanalyses .fa-card-actions .fa-action-meta {
    color: #64748b;
  }
  body.theme-light #ptab-fracanalyses .fa-multiselect-glyph {
    color: #1F3B63;
  }
  body.theme-light #ptab-fracanalyses .fa-card-empty,
  body.theme-light #ptab-fracanalyses .fa-v2r-empty,
  body.theme-light #ptab-fracanalyses .fa-timeline-empty {
    color: #64748b;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-stat-value {
    color: #0f172a;
  }
  body.theme-light #ptab-fracanalyses .fa-v2r-stat-sub {
    color: #64748b;
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages-form label {
    color: #475569;
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages-form select,
  body.theme-light #ptab-fracanalyses .fa-add-stages-form input[type="text"] {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages-status.ok {
    color: #15803d;
  }
  body.theme-light #ptab-fracanalyses .fa-add-stages-status.err {
    color: #b91c1c;
  }
  /* Post-Frac — executive navy chrome + slate/white surfaces. */
  body.theme-light #ptab-postfrac.proj-tab-panel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-postfrac > #postfrac-subtabs {
    margin-bottom: 0;
    padding: 6px 8px 0;
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-postfrac > #postfrac-subtabs .frac-subtab {
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
    border: 1px solid transparent;
    border-bottom: none;
  }
  body.theme-light #ptab-postfrac > #postfrac-subtabs .frac-subtab:not(.active):not(:disabled) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(215, 226, 240, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  body.theme-light #ptab-postfrac > #postfrac-subtabs .frac-subtab:not(.active):not(:disabled):hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.78);
    color: #ffffff;
  }
  body.theme-light #ptab-postfrac > #postfrac-subtabs .frac-subtab.active {
    color: #1F3B63;
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: none;
  }
  body.theme-light #ptab-postfrac > #postfrac-subtabs .frac-subtab:disabled {
    color: rgba(255, 255, 255, 0.35);
    background: transparent;
    border-color: transparent;
    opacity: 1;
  }
  body.theme-light #ptab-postfrac .pf-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-postfrac .pdf-sep {
    background: #B8C7D9;
  }
  body.theme-light #ptab-postfrac .pdf-btn {
    background: #1F3B63;
    border: 1px solid #12274A;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  body.theme-light #ptab-postfrac .pdf-btn:hover:not(:disabled) {
    background: #243f66;
    opacity: 1;
  }
  body.theme-light #ptab-postfrac .pdf-page-info {
    color: #1F3B63;
  }
  body.theme-light #ptab-postfrac .pf-well-strip {
    background: #EEF4FA;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-postfrac .pf-well-btn {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-postfrac .pf-well-btn:hover {
    color: #1F3B63;
    border-color: #8FA5C2;
    background: #F8FBFF;
  }
  body.theme-light #ptab-postfrac .pf-well-btn.active {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
  }
  body.theme-light #ptab-postfrac .pf-content {
    background: #E7EEF7;
  }
  body.theme-light #ptab-postfrac .tracer-summary-meta {
    background: #EEF4FA;
    border: 1px solid #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #ptab-postfrac .tracer-summary-meta .meta-key {
    color: #64748b;
  }
  body.theme-light #ptab-postfrac .tracer-summary-meta a {
    color: #1F3B63;
  }
  body.theme-light #ptab-postfrac .tracer-summary-table-wrap {
    border-color: #B8C7D9;
    background: #F8FBFF;
  }
  body.theme-light #ptab-postfrac .tracer-summary-table th {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 2px solid #12274A;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
  }
  body.theme-light #ptab-postfrac .tracer-summary-table td {
    border-bottom-color: #D6DEE8;
    color: #0f172a;
  }
  body.theme-light #ptab-postfrac .tracer-summary-table tbody tr:nth-child(even) td {
    background: #EEF4FA;
  }
  body.theme-light #ptab-postfrac #pfsub-flowback,
  body.theme-light #ptab-postfrac #pfsub-earlyprod {
    background: #F8FBFF;
    color: #64748b;
    padding: 24px;
  }
  /* Analysis — executive navy chrome + slate/white surfaces. */
  body.theme-light #ptab-analysis.proj-tab-panel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-analysis .an-toolbar {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-analysis .pdf-page-info {
    color: #1F3B63;
  }
  body.theme-light #ptab-analysis .pdf-sep {
    background: #B8C7D9;
  }
  body.theme-light #ptab-analysis .pdf-btn.secondary {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
    box-shadow: none;
  }
  body.theme-light #ptab-analysis .pdf-btn.secondary:hover:not(:disabled) {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
    opacity: 1;
  }
  body.theme-light #ptab-analysis .an-section {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-analysis .an-section-title {
    color: #1F3B63;
    letter-spacing: 1px;
  }
  body.theme-light #ptab-analysis .an-section-sub,
  body.theme-light #ptab-analysis .an-missing {
    color: #64748b;
  }
  body.theme-light #ptab-analysis .an-chip {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-analysis .an-chip:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
  }
  body.theme-light #ptab-analysis .an-chip.active {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  body.theme-light #ptab-analysis .an-chip.active .an-chip-api {
    color: #D7E2F0;
  }
  body.theme-light #ptab-analysis .an-kpi-table th {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 2px solid #12274A;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
  }
  body.theme-light #ptab-analysis .an-kpi-table td {
    border-bottom-color: #D6DEE8;
    color: #0f172a;
  }
  body.theme-light #ptab-analysis .an-kpi-table tbody tr:nth-child(even) td {
    background: #EEF4FA;
  }
  body.theme-light #ptab-analysis .an-kpi-table tr:hover td {
    background: #D7E2F0;
  }
  body.theme-light #ptab-analysis .an-charts-grid {
    background: #E7EEF7;
  }
  body.theme-light #ptab-analysis .an-chart-card {
    background: #F8FBFF;
    border-color: #B8C7D9;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 0;
    overflow: hidden;
  }
  body.theme-light #ptab-analysis .an-chart-title {
    color: #D7E2F0;
    background: #1F3B63;
    letter-spacing: 1.2px;
    margin: 0;
    padding: 10px 76px 10px 14px;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-analysis .an-chart-wrap {
    padding: 12px 14px 14px;
    background: #F8FBFF;
  }
  body.theme-light #ptab-analysis .an-chart-expand,
  body.theme-light #ptab-analysis .an-chart-adjust {
    top: 6px;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(215, 226, 240, 0.62);
    color: #ffffff;
  }
  body.theme-light #ptab-analysis .an-chart-expand {
    right: 10px;
  }
  body.theme-light #ptab-analysis .an-chart-adjust {
    right: 42px;
  }
  body.theme-light #ptab-analysis .an-chart-expand:hover,
  body.theme-light #ptab-analysis .an-chart-adjust:hover {
    color: #ffffff;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.28);
  }
  body.theme-light #ptab-analysis .an-chart-adjust.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: #ffffff;
    color: #ffffff;
  }
  body.theme-light #ptab-analysis .an-chart-card.expanded {
    background: #F8FBFF;
    border-color: #1F3B63;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    padding: 0;
  }
  body.theme-light #ptab-analysis .an-cost-adjust-panel {
    margin: 0;
    padding: 12px 14px;
    background: #EEF4FA;
    border: none;
    border-bottom: 1px solid #B8C7D9;
    border-radius: 0;
  }
  body.theme-light #ptab-analysis .an-cap-table th {
    color: #1F3B63;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-analysis .an-cap-table tr + tr td {
    border-top-color: #D6DEE8;
  }
  body.theme-light #ptab-analysis .an-cap-input {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #ptab-analysis .an-cap-input:focus {
    border-color: #1F3B63;
    outline: none;
  }
  body.theme-light #ptab-analysis .an-cap-reset,
  body.theme-light #ptab-analysis .an-cap-auto {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #ptab-analysis .an-cap-reset:hover:not(:disabled),
  body.theme-light #ptab-analysis .an-cap-auto:hover {
    color: #1F3B63;
    border-color: #8FA5C2;
    background: #EEF4FA;
  }
  /* Well Data — executive navy chrome (Header / Construction / Trajectory / Surveys). */
  body.theme-light #ptab-welldata.proj-tab-panel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-welldata > .wd-subtabs {
    margin-bottom: 0;
    padding: 6px 8px 0;
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #ptab-welldata > .wd-subtabs .wd-subtab {
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
    border: 1px solid transparent;
    border-bottom: none;
  }
  body.theme-light #ptab-welldata > .wd-subtabs .wd-subtab:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(215, 226, 240, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  body.theme-light #ptab-welldata > .wd-subtabs .wd-subtab:not(.active):hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.78);
    color: #ffffff;
  }
  body.theme-light #ptab-welldata > .wd-subtabs .wd-subtab.active {
    color: #1F3B63;
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: none;
  }
  body.theme-light #ptab-welldata .wh-save-bar {
    margin-top: 0;
    background: #F8FBFF;
    border-color: #B8C7D9;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  body.theme-light #ptab-welldata .wh-save-state {
    color: #64748b;
  }
  body.theme-light #ptab-welldata .wd-subpanel.visible {
    background: #E7EEF7;
  }
  body.theme-light #ptab-welldata .wh-section-title {
    color: #1F3B63;
    border-bottom-color: #B8C7D9;
    letter-spacing: 1.2px;
  }
  body.theme-light #ptab-welldata .wh-label {
    color: #64748b;
  }
  body.theme-light #ptab-welldata .wh-input,
  body.theme-light #ptab-welldata #traj-focus-window {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #0f172a;
  }
  body.theme-light #ptab-welldata .wh-input:focus,
  body.theme-light #ptab-welldata #traj-focus-window:focus {
    border-color: #1F3B63;
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 59, 99, 0.18);
  }
  body.theme-light #ptab-welldata .wh-input:read-only {
    background: #EEF4FA;
    color: #475569;
  }
  body.theme-light #ptab-welldata .pdf-btn {
    background: #1F3B63;
    border: 1px solid #12274A;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  body.theme-light #ptab-welldata .pdf-btn:hover:not(:disabled) {
    background: #243f66;
    opacity: 1;
  }
  body.theme-light #ptab-welldata .pdf-btn.secondary {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
    box-shadow: none;
  }
  body.theme-light #ptab-welldata .pdf-btn.secondary:hover:not(:disabled) {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
    opacity: 1;
  }
  body.theme-light #ptab-welldata .proj-btn {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
  }
  body.theme-light #ptab-welldata .proj-btn:hover:not(:disabled) {
    background: #243f66;
    border-color: #12274A;
  }
  body.theme-light #ptab-welldata #survey-cancel-btn {
    background: #ffffff !important;
    border-color: #B8C7D9 !important;
    color: #475569 !important;
  }
  body.theme-light #ptab-welldata #survey-cancel-btn:hover:not(:disabled) {
    border-color: #8FA5C2 !important;
    color: #1F3B63 !important;
    background: #EEF4FA !important;
  }
  body.theme-light #ptab-welldata .well-row {
    background: #F8FBFF;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-welldata .well-row:hover {
    border-color: #8FA5C2;
    background: #EEF4FA;
  }
  body.theme-light #ptab-welldata #wellbore-diagram-canvas {
    background: #F8FBFF;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-welldata #wdsub-trajectory > div:first-of-type {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
    padding: 10px 12px;
    margin: 0 -16px 0;
    padding-left: 16px;
    padding-right: 16px;
  }
  body.theme-light #ptab-welldata #wdsub-trajectory > div:first-of-type > span:first-of-type {
    color: #1F3B63;
  }
  body.theme-light #ptab-welldata #traj-view-tabs {
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #ptab-welldata #traj-view-tabs .traj-view-btn {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #64748b;
  }
  body.theme-light #ptab-welldata #traj-view-tabs .traj-view-btn:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #EEF4FA;
  }
  body.theme-light #ptab-welldata #traj-view-tabs .traj-view-btn.active {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
  }
  body.theme-light #ptab-welldata #traj-canvas-wrap,
  body.theme-light #ptab-welldata #traj-plan-wrap {
    background: #F8FBFF;
    border: 1px solid #B8C7D9;
    border-radius: 4px;
    padding: 8px 10px;
    margin-top: 8px;
  }
  body.theme-light #ptab-welldata #traj-canvas-wrap > div:last-child {
    border-top-color: #B8C7D9;
  }
  body.theme-light #ptab-welldata #traj-3d-container {
    background: #F8FBFF;
    border-color: #B8C7D9;
  }
  body.theme-light #ptab-welldata #traj-3d-overlay-controls {
    color: #64748b;
  }
  body.theme-light #ptab-welldata #traj-3d-overlay-controls .traj-3d-overlay-toggle:hover {
    color: #1F3B63;
  }
  body.theme-light #ptab-welldata #wdsub-surveys > div > div:first-child {
    border-right-color: #B8C7D9;
  }
  /* ── Tier 2: Historical workspace — Treatment Zone steel strip ── */
  body.theme-light #fracops-historical .hist-toolbar {
    background: #EEF4FA;
    border-bottom: 1px solid #B8C7D9;
    padding: 10px 12px;
  }
  body.theme-light #fracops-historical .hist-zone-title,
  body.theme-light #fracops-historical .hist-toolbar .pdf-page-info {
    color: #1F3B63;
  }
  body.theme-light .hist-zone-title {
    color: #1F3B63;
  }
  body.theme-light #fracops-historical .hist-toolbar .pdf-btn.secondary {
    border-color: #B8C7D9;
    color: #475569;
    background: #ffffff;
  }
  body.theme-light #fracops-historical .hist-toolbar .pdf-btn.secondary:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
    background: #F8FBFF;
  }
  body.theme-light #fracops-historical .zone-btn {
    background: #ffffff;
    border-color: #B8C7D9;
    color: #475569;
  }
  body.theme-light #fracops-historical .zone-btn:hover {
    border-color: #8FA5C2;
    color: #1F3B63;
  }
  body.theme-light #fracops-historical .zone-btn.active {
    background: #1F3B63;
    border-color: #12274A;
    color: #ffffff;
  }
  body.theme-light #fracops-historical .ss-card {
    background: #F8FBFF;
    border-color: #B8C7D9;
  }
  body.theme-light #hist-prd-panel > #stage-summary,
  body.theme-light #hist-chem-panel > #chem-summary {
    background: #ffffff;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #hist-prd-panel > .hist-wellbore-caps {
    background: #ffffff;
    border-top-color: #B8C7D9;
  }
  /* ── Tier 3: App header — light shell, navy accent only (no fill band) ── */
  body.theme-light .app-header {
    background: #F8FBFF;
    border-bottom: 2px solid #1F3B63;
  }
  body.theme-light .app-header .title-main {
    color: #1F3B63;
  }
  body.theme-light .mode-tab.active {
    color: #1F3B63;
    border-bottom-color: #1F3B63;
  }
  body.theme-light .mode-tab:hover {
    color: #475569;
  }
  body.theme-light .theme-toggle {
    background: #EEF4FA;
    border-color: #B8C7D9;
  }
  body.theme-light .theme-toggle .tt-opt.active {
    background: #1F3B63;
    color: #ffffff;
  }
  /* Execution PRD Plot — executive navy banner (title + trim toolbar). */
  body.theme-light #hist-prd-panel {
    border-color: #B8C7D9;
  }
  body.theme-light #hist-prd-panel .hist-chart-header {
    background: #1F3B63;
    color: #ffffff;
    border-bottom: 1px solid #12274A;
  }
  body.theme-light #hist-prd-panel .hist-chart-header:hover {
    background: #243f66;
  }
  body.theme-light #hist-prd-panel .hist-caret {
    color: #D7E2F0;
  }
  body.theme-light #hist-prd-panel .hist-chart-header .hist-stage-nav-indicator,
  body.theme-light #hist-prd-panel .hist-chart-header #hist-stage-nav-num {
    color: #ffffff;
  }
  body.theme-light #hist-prd-panel .hist-chart-header .hist-stage-nav-sep {
    color: #D7E2F0;
  }
  body.theme-light #hist-prd-panel .hist-stage-nav-btn {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border-color: rgba(215,226,240,0.62);
  }
  body.theme-light #hist-prd-panel .hist-stage-nav-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.78);
    color: #ffffff;
  }
  body.theme-light #hist-prd-panel .hist-chart-fullscreen-btn {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border-color: rgba(215,226,240,0.62);
  }
  body.theme-light #hist-prd-panel .hist-chart-fullscreen-btn:hover {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.78);
    color: #ffffff;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar {
    background: #1F3B63;
    border-bottom: 1px solid #12274A;
    padding: 4px 10px 8px;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-sep {
    background: rgba(255,255,255,0.32);
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-checkbox {
    color: #D7E2F0;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-checkbox:hover {
    color: #ffffff;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-checkbox input {
    accent-color: #93c5fd;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .hist-tools-caret {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border-color: rgba(215,226,240,0.62);
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .hist-tools-caret:hover {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.78);
    color: #ffffff;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .analysis-chips .ac-label {
    color: #D7E2F0;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .anlys-chip:not(.active) {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(215,226,240,0.62);
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .anlys-chip:not(.active):hover {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.78);
    color: #ffffff;
  }
  /* Default toolbar controls — frosted pill on navy. */
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn:not(.armed):not(.primary):not(.locked) {
    color: #ffffff;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(215,226,240,0.62);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn:not(.armed):not(.primary):not(.locked):hover {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.78);
    color: #ffffff;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn.danger:not(.armed):not(.locked):hover {
    background: rgba(248,113,113,0.22);
    border-color: rgba(252,165,165,0.75);
    color: #fecaca;
  }
  /* Active / primary — white pill (overrides transit/trend/diag teal/amber armed styles). */
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn.armed,
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn.primary {
    color: #1F3B63;
    background: #ffffff;
    border: 1px solid #ffffff;
    box-shadow: none;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn.primary:hover {
    filter: brightness(0.97);
    color: #1F3B63;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar #hist-transit-toggle.armed + .trim-btn-paired-right,
  body.theme-light #hist-prd-panel .hist-trim-toolbar #hist-trend-toggle.armed + .trim-btn-paired-right,
  body.theme-light #hist-prd-panel .hist-trim-toolbar #hist-diag-toggle.armed + .trim-btn-paired-right {
    color: #1F3B63;
    background: #ffffff;
    border-color: #ffffff;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn-paired-right.active {
    color: #1F3B63;
    background: #EEF4FA;
    border-color: #B8C7D9;
  }
  body.theme-light #hist-prd-panel .hist-trim-toolbar .trim-btn.locked {
    color: #1a1a1a;
    background: #f59e0b;
    border-color: #d97706;
    box-shadow: none;
  }
  body.theme-light #hist-prd-panel .hist-patch-panel,
  body.theme-light #hist-prd-panel .prd-map-panel {
    background: #F8FBFF;
    border-bottom-color: #B8C7D9;
  }
  body.theme-light #hist-prd-panel .hist-resize-handle,
  body.theme-light #hist-chem-panel .hist-resize-handle {
    background: #EEF4FA;
    border-top-color: #B8C7D9;
  }
  body.theme-light #hist-prd-panel .hist-resize-handle .hist-resize-grip,
  body.theme-light #hist-prd-panel .hist-resize-handle .hist-resize-hint,
  body.theme-light #hist-chem-panel .hist-resize-handle .hist-resize-grip,
  body.theme-light #hist-chem-panel .hist-resize-handle .hist-resize-hint {
    color: #64748b;
  }
  body.theme-light #hist-prd-panel .hist-resize-handle:hover,
  body.theme-light #hist-prd-panel .hist-resize-handle.dragging,
  body.theme-light #hist-chem-panel .hist-resize-handle:hover,
  body.theme-light #hist-chem-panel .hist-resize-handle.dragging {
    background: #1F3B63;
    border-top-color: #12274A;
  }
  /* ── Completed Stages (Test) — mirror the navy/steel execution theme so the
        ECharts experiment matches the production Completed Stages tab ── */
  body.theme-light #fracops-echartstest .hist-toolbar {
    background: #EEF4FA; border-bottom: 1px solid #B8C7D9; padding: 10px 12px;
  }
  body.theme-light #fracops-echartstest .hist-zone-title,
  body.theme-light #fracops-echartstest .hist-toolbar .pdf-page-info { color: #1F3B63; }
  body.theme-light #fracops-echartstest .hist-toolbar .pdf-btn.secondary {
    border-color: #B8C7D9; color: #475569; background: #ffffff;
  }
  body.theme-light #fracops-echartstest .hist-toolbar .pdf-btn.secondary:hover {
    border-color: #8FA5C2; color: #1F3B63; background: #F8FBFF;
  }
  body.theme-light #fracops-echartstest .zone-btn { background: #ffffff; border-color: #B8C7D9; color: #475569; }
  body.theme-light #fracops-echartstest .zone-btn:hover { border-color: #8FA5C2; color: #1F3B63; }
  body.theme-light #fracops-echartstest .zone-btn.active { background: #1F3B63; border-color: #12274A; color: #ffffff; }
  body.theme-light #fracops-echartstest .ss-card { background: #F8FBFF; border-color: #B8C7D9; }
  body.theme-light #etest-prd-panel { border-color: #B8C7D9; }
  body.theme-light #etest-prd-panel > #etest-stage-summary { background: #ffffff; border-bottom-color: #B8C7D9; }
  body.theme-light #etest-prd-panel .hist-chart-header {
    background: #1F3B63; color: #ffffff; border-bottom: 1px solid #12274A;
  }
  body.theme-light #etest-prd-panel .hist-chart-header:hover { background: #243f66; }
  body.theme-light #etest-prd-panel .hist-caret { color: #D7E2F0; }
  body.theme-light #etest-prd-panel .hist-chart-header .hist-stage-nav-indicator,
  body.theme-light #etest-prd-panel .hist-chart-header #etest-stage-nav-num { color: #ffffff; }
  body.theme-light #etest-prd-panel .hist-chart-header .hist-stage-nav-sep { color: #D7E2F0; }
  body.theme-light #etest-prd-panel .hist-stage-nav-btn {
    color: #ffffff; background: rgba(255,255,255,0.14); border-color: rgba(215,226,240,0.62);
  }
  body.theme-light #etest-prd-panel .hist-stage-nav-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.78); color: #ffffff;
  }
  body.theme-light #etest-prd-panel .hist-chart-fullscreen-btn {
    color: #ffffff; background: rgba(255,255,255,0.14); border-color: rgba(215,226,240,0.62);
  }
  body.theme-light #etest-prd-panel .hist-chart-fullscreen-btn:hover {
    background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.78); color: #ffffff;
  }
  /* Navy header / toolbar toggles (flags / notes / crosshair / chem) — light text */
  body.theme-light #etest-prd-panel .hist-chart-header .etest-chart-toggle,
  body.theme-light #etest-prd-panel .hist-trim-toolbar .etest-chart-toggle { color: #D7E2F0; }
  body.theme-light #etest-prd-panel .hist-chart-header .etest-chart-toggle:hover,
  body.theme-light #etest-prd-panel .hist-trim-toolbar .etest-chart-toggle:hover { color: #ffffff; }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .etest-chart-toggle input { accent-color: #93c5fd; }
  body.theme-light #etest-prd-panel .hist-trim-toolbar {
    background: #1F3B63; border-bottom: 1px solid #12274A; padding: 4px 10px 8px;
  }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-sep { background: rgba(255,255,255,0.32); }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .hist-tools-caret {
    color: #ffffff; background: rgba(255,255,255,0.14); border-color: rgba(215,226,240,0.62);
  }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .hist-tools-caret:hover {
    background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.78); color: #ffffff;
  }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-btn:not(.armed):not(.primary):not(.locked) {
    color: #ffffff; background: rgba(255,255,255,0.14); border: 1px solid rgba(215,226,240,0.62);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
  }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-btn:not(.armed):not(.primary):not(.locked):hover {
    background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.78); color: #ffffff;
  }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-btn.danger:not(.armed):not(.locked):hover {
    background: rgba(248,113,113,0.22); border-color: rgba(252,165,165,0.75); color: #fecaca;
  }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-btn.armed,
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-btn.primary {
    color: #1F3B63; background: #ffffff; border: 1px solid #ffffff; box-shadow: none;
  }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-btn.primary:hover { filter: brightness(0.97); color: #1F3B63; }
  body.theme-light #etest-prd-panel .hist-trim-toolbar .trim-btn.locked {
    color: #1a1a1a; background: #f59e0b; border-color: #d97706; box-shadow: none;
  }
  body.theme-light .delta-table .status-match { color: #15803d; }
  body.theme-light .delta-table .status-unplanned { color: #b45309; }
  body.theme-light .delta-table .d-warn { color: #b45309; }
  body.theme-light .delta-table .d-bad { color: #991b1b; }
  body.theme-light .ss-var-ok { color: #15803d; }
  body.theme-light .ss-var-warn { color: #b45309; }
  /* Light-mode hovers — white translucent overlays vanish on pale surfaces */
  body.theme-light .panel-header:hover,
  body.theme-light .hist-chart-header:hover,
  body.theme-light .hist-chart-fullscreen-btn:hover,
  body.theme-light .hist-stage-nav-btn:hover:not(:disabled),
  body.theme-light .fa-card-header:hover,
  body.theme-light .fa-timeline-stats-row[data-tls-toggle]:hover,
  body.theme-light .pa-event-row:hover,
  body.theme-light .tracer-summary-table tr:hover td,
  body.theme-light .co-scen-tab:hover {
    background: rgba(15,23,42,0.06);
  }
  body.theme-light .hist-stage-nav-btn:active:not(:disabled) {
    background: rgba(15,23,42,0.10);
  }
  body.theme-light .fa-stage-pill.fa-toggle:hover,
  body.theme-light .fa-timeline-stats-row.collapsed:hover,
  body.theme-light .yac-num:hover,
  body.theme-light .cb-stage-pill:hover,
  body.theme-light .sc-pill:hover,
  body.theme-light .rsd-stage-pill:hover {
    background: rgba(15,23,42,0.08);
  }
  body.theme-light .fa-stage-pill.fa-toggle:hover,
  body.theme-light .cb-stage-pill:hover,
  body.theme-light .sc-pill:hover,
  body.theme-light .rsd-stage-pill:hover {
    border-color: rgba(15,23,42,0.28);
  }
  html, body { height: 100%; font-family: 'IBM Plex Sans', sans-serif; color: var(--text-primary); background: var(--bg-primary); overflow: hidden; }

  .app { display: flex; flex-direction: column; height: 100vh; }

  /* App header — always visible, holds title + mode tabs */
  .app-header {
    position: relative;   /* anchors the centered title + the dark accent rule */
    flex: 0 0 auto;       /* still a flex CHILD of .app column */
    /* GRID ZONES (Dean spec, 2026-07-10): the old flex order/auto-margin chain
       broke whenever the spacer-carrying element was hidden (the forced-dark
       landing hides .theme-toggle → nothing pushed the customer cluster right).
       Explicit columns instead:
         1 brand (auto) | 2 pill zone (1fr, item centered) | 3 wf zone (1fr,
         item centered) | 4 scope | 5 toggle | 6 customer (autos, hard right).
       A display:none item collapses its auto column to 0, so the right anchor
       never depends on any individual control being visible. Column placement
       lives in the "Header layout" block further down. */
    display: grid;
    grid-template-columns: auto 1fr 1fr auto auto auto;
    align-items: center;
    padding: 0 20px; height: 44px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  }
  .app-header .app-title {
    min-width: 0;
    text-align: center; white-space: nowrap; line-height: 1.15;
  }
  /* Narrow laptops: shed the subtitle before anything gets tight */
  @media (max-width: 1500px) { .app-title .title-sub { display: none; } }
  @media (max-width: 1240px) { .app-header .app-title { display: none; } }
  /* Phones (iPhone Safari — Dean, launch day): the fixed grid CLIPPED the
     workflow nav, leaving Execute → Live Ops unreachable in portrait. Below
     820px the header becomes a horizontally SCROLLABLE strip: flex row, no
     shrinking, touch momentum scrolling; every control stays reachable by
     swiping the bar. Grid-column pins on children are neutralized. */
  @media (max-width: 820px) {
    .app-header {
      display: flex; align-items: center; gap: 10px;
      overflow-x: auto; -webkit-overflow-scrolling: touch;
      padding: 0 10px; scrollbar-width: none;
    }
    .app-header::-webkit-scrollbar { display: none; }
    .app-header > * { flex: 0 0 auto; }
    .app-header .mode-tabs, .app-header .wf-bar { justify-self: unset; margin: 0; }
  }
  /* ICOP wordmark — echoes the Live Ops lockup (.lo-icop: Helvetica 800, tight
     tracking, tiny ™) so both shells read as the same product. Color stays
     theme-aware: light = #1F3B63 (body.theme-light rule), dark = #fff. */
  .app-title .title-main {
    font-family: Helvetica, Arial, sans-serif; font-size: 19px; font-weight: 800;
    letter-spacing: 0.5px; color: var(--title-strong);
  }
  .app-title .title-tm {
    font-size: 8px; font-weight: 600; margin-left: 1px;
    color: var(--text-muted); vertical-align: super; line-height: 1;
  }
  .app-title .title-sub {
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 500;
    letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted);
  }
  .app-customer {
    margin-left: auto; position: relative;
    display: flex; align-items: center; gap: 10px;
    text-align: right; white-space: nowrap; line-height: 1.3;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 600;
    letter-spacing: 0.5px; color: var(--text-secondary);
  }
  .app-customer-labels { text-align: right; }
  .app-user {
    font-size: 10px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.3px;
  }
  /* Company signature — quieter than the user email (smaller + faded) */
  .app-attrib {
    font-size: 8.5px; font-weight: 500; color: var(--text-muted);
    letter-spacing: 0.4px; opacity: 0.7;
  }

  /* ── Account chip + account/security popover ──
     The chip is the single visible control in the header's right zone
     (shield-check + org + caret); email, attribution, and Sign Out live in
     the popover. Pill language matches the mode-tabs nav pill per theme.
     The green shield stays the at-a-glance all-ok security affordance. */
  .acct-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 12px; border-radius: 999px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    cursor: pointer; white-space: nowrap;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 600;
    letter-spacing: 0.5px; color: var(--text-secondary);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }
  /* Two-line identity: USER primary (token name/email), org muted beneath */
  .acct-chip-id {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    min-width: 0; text-align: left; line-height: 1.2;
  }
  .acct-chip-user {
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px; color: inherit;
    max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .acct-chip-org {
    font-size: 9px; font-weight: 600; letter-spacing: 0.4px;
    color: var(--text-muted);
    max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  body:not(.theme-light) .acct-chip {
    background: rgba(18,28,48,0.45); border-color: rgba(120,160,255,0.15);
  }
  body.theme-light .acct-chip {
    background: rgba(15,23,42,0.03); border-color: rgba(15,23,42,0.15);
  }
  .acct-chip:hover, .acct-chip:focus-visible {
    color: var(--text-primary);
    border-color: rgba(52,211,153,0.45); background: rgba(52,211,153,0.08);
  }
  .acct-chip[aria-expanded="true"] {
    color: var(--text-primary);
    border-color: rgba(52,211,153,0.55); background: rgba(52,211,153,0.12);
  }
  .acct-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .acct-chip-shield { display: inline-flex; color: #34d399; flex: 0 0 auto; }
  body.theme-light .acct-chip-shield { color: #059669; }
  .acct-chip-caret { font-size: 9px; color: var(--text-muted); line-height: 1; }

  .security-popover {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 4000;
    width: 280px; padding: 0; text-align: left; white-space: normal;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.38);
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .security-popover[hidden] { display: none; }
  .security-popover::before {
    content: ""; position: absolute; top: -6px; right: 14px;
    width: 11px; height: 11px; background: var(--bg-secondary);
    border-left: 1px solid var(--border); border-top: 1px solid var(--border);
    transform: rotate(45deg);
  }
  .security-popover-header {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 13px; border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 700; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--text-primary);
  }
  .security-popover-header svg { color: #34d399; flex: 0 0 auto; }
  body.theme-light .security-popover-header svg { color: #059669; }
  .security-popover-close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    font-size: 18px; line-height: 1; color: var(--text-muted); padding: 0 2px;
  }
  .security-popover-close:hover { color: var(--text-primary); }
  /* Identity block (top of the account popover) */
  .acct-pop-identity {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 12px 13px; border-bottom: 1px solid var(--border);
  }
  .acct-pop-idtext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  /* User leads (matches the chip): email/name primary, org muted beneath */
  .acct-pop-email {
    font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .acct-pop-org {
    font-size: 10.5px; font-weight: 500; color: var(--text-muted);
    letter-spacing: 0.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* Footer: quiet company signature + Sign Out */
  .acct-pop-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 13px; border-top: 1px solid var(--border);
  }
  .acct-pop-attrib {
    font-size: 9px; font-weight: 500; color: var(--text-muted);
    letter-spacing: 0.4px; opacity: 0.7;
  }
  .security-popover .auth-sign-out-btn {
    border-color: var(--border); color: var(--text-secondary);
  }
  .security-popover .auth-sign-out-btn:hover {
    border-color: rgba(239,68,68,0.5); color: #ef4444;
  }
  /* Customer list (only for a login that belongs to more than one customer;
     auth.js _renderCustomerMenu builds it under the identity block) */
  .acct-pop-customers { padding: 8px 6px 7px; border-bottom: 1px solid var(--border); }
  .acct-pop-customers-title {
    padding: 0 7px 5px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--text-muted);
  }
  .acct-pop-customer {
    display: flex; align-items: center; gap: 7px; width: 100%;
    padding: 6px 7px; border: none; border-radius: 5px; background: none;
    font: inherit; font-size: 12px; text-align: left; cursor: pointer;
    color: var(--text-secondary);
  }
  .acct-pop-customer:hover:not([disabled]) { background: rgba(59,130,246,0.14); color: var(--text-primary); }
  .acct-pop-customer.active { color: var(--text-primary); font-weight: 600; cursor: default; }
  .acct-pop-customer-mark { flex: 0 0 12px; font-size: 11px; color: #10b981; }
  .acct-pop-customer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .security-popover-list { list-style: none; margin: 0; padding: 6px 0; }
  .sec-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 13px;
  }
  .sec-icon {
    flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px;
    border-radius: 50%; position: relative;
  }
  .sec-icon::after {
    content: ""; position: absolute; left: 5px; top: 2px;
    width: 4px; height: 8px; border: solid #fff;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .sec-row.ok    .sec-icon { background: #10b981; }
  .sec-row.warn  .sec-icon { background: #f59e0b; }
  .sec-row.warn  .sec-icon::after {
    left: 7px; top: 3px; width: 2px; height: 6px; border: none;
    background: #fff; transform: none; border-radius: 1px;
    box-shadow: 0 8px 0 #fff;
  }
  .sec-text { display: flex; flex-direction: column; gap: 1px; }
  .sec-title { font-size: 12px; font-weight: 600; color: var(--text-primary); letter-spacing: 0.2px; }
  .sec-detail { font-size: 10.5px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.2px; }
  .mode-tabs { display: flex; gap: 0; height: 100%; }
  .mode-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 0 18px; height: 100%;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
  }
  .mode-tab:hover { color: var(--text-secondary); }
  .mode-tab.active { color: var(--title-strong); border-bottom-color: var(--accent); }

  /* Top-nav Project picker — the "Project ▾ <name>" split control (js/proj-nav.js).
     The mode-tab "Project" enters the workspace; this picker opens the switcher. */
  /* ── Header layout (unified branding): ICOP brand (left) → project pill →
     workflow 1·2·3 (centered zones) → scope/toggle/customer (hard right).
     GRID placement (no flex order, no auto-margin spacers — see .app-header).
     The two 1fr zones make the pill sit ~1/3 across and the wf-bar ~2/3
     across; hidden right-side controls collapse their auto columns to 0 so
     the customer cluster stays anchored right on the landing (no toggle) and
     in-project alike. .app-customer's base margin-left:auto is neutralized
     (meaningless inside an auto column, but keeps DevTools honest).
     grid-row: 1 is MANDATORY on every child: DOM order (wf-bar before
     mode-tabs) doesn't match column order, and sparse auto-placement can't
     move backwards — without the explicit row, mode-tabs..customer wrapped
     to a second row below the bar (the 2026-07-10 clipping regression). ── */
  .app-header .app-title    { grid-row: 1; grid-column: 1; margin: 0; }
  .app-header .mode-tabs    { grid-row: 1; grid-column: 2; justify-self: center; margin: 0; }
  .app-header .wf-bar       { grid-row: 1; grid-column: 3; justify-self: center; }
  .app-header .scope-ctl    { grid-row: 1; grid-column: 4; }
  .app-header .theme-toggle { grid-row: 1; grid-column: 5; }
  .app-header .app-customer { grid-row: 1; grid-column: 6; margin-left: 0; }
  .wf-hidden { display: none !important; }

  /* ── Scope lens: Well/Pad/Play + active object ── */
  /* TEMP (2026-07-10, Dean): Scope hidden until it becomes more integral to the
     workflow. To restore, delete this rule — the control + its JS wiring are intact. */
  #scope-ctl { display: none !important; }
  .scope-ctl { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 12px; }
  .scope-lbl {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
  }
  .scope-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
  .scope-seg button {
    background: none; border: none; cursor: pointer; padding: 4px 9px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.5px; color: var(--text-muted);
  }
  .scope-seg button + button { border-left: 1px solid var(--border); }
  .scope-seg button:hover { color: var(--text-primary); }
  .scope-seg button.active { background: var(--accent); color: #fff; }
  .scope-obj {
    font-size: 11px; font-weight: 600; color: var(--text-secondary);
    max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  @media (max-width: 1360px) { .scope-ctl .scope-lbl { display: none; } }
  @media (max-width: 1180px) { .scope-ctl .scope-obj { display: none; } }

  /* ── Workflow bar (js/workflow-nav.js) — the 1·2·3 loop menus ──
     Split control: .wf-btn navigates, .wf-caret-btn opens the menu. The accent
     underline is ACTIVE (the step you're on); .open is a soft highlight only. */
  .wf-bar { display: flex; align-items: center; height: 100%; }
  .wf-cat {
    position: relative; height: 100%; display: flex; align-items: center;
    border-bottom: 2px solid transparent;
  }
  .wf-cat.open { background: color-mix(in srgb, var(--accent) 7%, transparent); }
  .wf-cat.active { border-bottom-color: var(--accent); }
  .wf-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 100%;
    padding: 0 5px 0 13px; background: none; border: none; cursor: pointer;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
    white-space: nowrap;
  }
  .wf-caret-btn {
    height: 100%; padding: 0 11px 0 2px; background: none; border: none; cursor: pointer;
    color: var(--text-muted); display: inline-flex; align-items: center;
  }
  .wf-btn:hover, .wf-caret-btn:hover { color: var(--text-secondary); }
  .wf-cat.open .wf-btn, .wf-cat.open .wf-caret-btn,
  .wf-cat.active .wf-btn, .wf-cat.active .wf-caret-btn { color: var(--title-strong); }
  /* The 1-2-3 loop is Completions' sub-navigation. From Inventory, Map and
     Reservoir it stays on screen as the one-click way in, but no step is
     "where you are" there, so the active underline is dropped. (Land swaps
     the strip for its own lenses.) */
  body[data-mode="inventory"] .wf-cat.active,
  body[data-mode="map"] .wf-cat.active,
  body[data-mode="reservoir"] .wf-cat.active { border-bottom-color: transparent; }
  body[data-mode="inventory"] .wf-cat.active:not(.open) .wf-btn,
  body[data-mode="map"] .wf-cat.active:not(.open) .wf-btn,
  body[data-mode="reservoir"] .wf-cat.active:not(.open) .wf-btn { color: var(--text-muted); }
  .wf-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
    color: #fff; font-size: 10px; font-weight: 700;
  }
  .wf-caret { font-size: 8px; opacity: 0.6; }
  .wf-menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 258px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.4); padding: 6px; z-index: 6000;
    max-height: 74vh; overflow-y: auto;
  }
  .wf-cat.open .wf-menu { display: block; }
  .wf-group {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1.1px; text-transform: uppercase; color: var(--accent);
    padding: 8px 10px 4px;
  }
  /* "Design what?" — the primary artifact question, made prominent; its items
     are the answer (bolder). "To inform your design" divides off the intelligence. */
  .wf-group-primary { color: var(--title-strong); font-size: 10px; padding-top: 4px; }
  .wf-item-primary { font-weight: 700; font-size: 12.5px; }
  .wf-section {
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
    letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-muted);
    padding: 9px 10px 2px; margin-top: 6px; border-top: 1px solid var(--border);
  }
  .wf-item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    border-radius: 5px; padding: 7px 10px; cursor: pointer; font-size: 12px;
    color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif;
  }
  .wf-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .wf-item.wf-dim { opacity: 0.7; }
  .wf-item-scope { float: right; margin-left: 8px; font-size: 9px; font-style: italic; color: var(--text-muted); }
  .wf-menu-note {
    font-size: 10px; font-style: italic; color: var(--text-muted);
    padding: 7px 10px 3px; margin-top: 4px; border-top: 1px solid var(--border);
  }
  .wf-soon {
    font-size: 8px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px;
    padding: 0 3px; margin-left: 4px; vertical-align: middle;
  }

  /* ── Phase B1 stage shell: Design/Execute/Results drives the second row ──
     body.stage-shell (set by workflow-nav.js unless icop_classic_tabs='1' —
     TRANSITIONAL fallback, delete in B3) hides the classic flat strip; the
     stage-scoped #stage-row (rendered from MENUS) takes its place. The strip
     BUTTONS stay in the DOM: switchProjTab still toggles their .active (the
     Phase A workspace capture reads it) and applyTabsForWellGroup still sets
     their inline display (the row filters on it). Aliases, never moves. */
  body.stage-shell #proj-tabs-bar .proj-tab { display: none !important; }
  /* A nav row must never scroll: the bar grows and the row WRAPS if a stage's
     items exceed the width (only reachable on narrow laptops after the
     Completions-Design consolidation). */
  body.stage-shell #proj-tabs-bar { overflow: visible; height: auto; min-height: 38px; }
  #stage-row {
    display: flex; align-items: center; gap: 2px;
    flex-wrap: wrap;
    min-width: 0; flex: 1 1 auto;
  }
  #stage-row .sr-group {
    flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 8px;
    font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--text-muted); opacity: 0.75; margin: 0 2px 0 5px;
  }
  #stage-row .sr-item {
    flex: 0 0 auto; height: 36px; display: inline-flex; align-items: center; gap: 4px;
    padding: 0 7px; background: none; border: none; white-space: nowrap;
    border-bottom: 2px solid transparent; cursor: pointer;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-muted);
  }
  #stage-row .sr-item:hover { color: var(--text-secondary); }
  #stage-row .sr-item.active { color: var(--title-strong); border-bottom-color: var(--accent); }
  #stage-row .sr-item .wf-soon { font-size: 7px; padding: 0 2px; margin-left: 2px; }
  #stage-row .sr-sep { flex: 0 0 auto; width: 1px; height: 16px; background: var(--border); margin: 0 3px; }
  /* Collapsed-group combo ("Completions Design ▾") + its fixed dropdown. */
  #stage-row .sr-combo-caret { font-size: 8px; opacity: 0.7; padding: 2px 2px 2px 3px; }
  #stage-row .sr-combo:hover .sr-combo-caret { opacity: 1; }
  .sr-combo-menu { z-index: 6000; min-width: 200px; }
  .sr-combo-menu .sr-tick { float: right; margin-left: 10px; color: var(--accent); font-weight: 700; }
  .sr-combo-menu .wf-item.sr-combo-cur { color: var(--title-strong); font-weight: 600; }
  /* Live Ops row item: green pulse dot only while a fresh stream matches. */
  #stage-row .sr-item .sr-live-dot { display: none; }
  #stage-row .sr-item.sr-live .sr-live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--icop-green, #2ecc71);
    animation: pl-live-pulse 1.6s ease-in-out infinite;
  }
  #stage-row .sr-item.sr-live { color: var(--icop-green, #2ecc71); }
  /* EXECUTE · LIVE chip on the stage header. */
  .wf-btn .wf-live-chip {
    display: inline-flex; align-items: center; gap: 4px; margin-left: 7px;
    font-size: 8px; font-weight: 700; letter-spacing: 0.9px;
    color: var(--icop-green, #2ecc71);
    border: 1px solid color-mix(in srgb, var(--icop-green, #2ecc71) 45%, transparent);
    border-radius: 8px; padding: 1px 6px;
  }
  .wf-btn .wf-live-chip::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
    background: var(--icop-green, #2ecc71);
    animation: pl-live-pulse 1.6s ease-in-out infinite;
  }

  /* ── Perf-design stepper (1 BOD · 2 Stages & Zipper · 3 Perf · 4 Scheme) ── */
  .cd-stepnum {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
    color: #fff; font-size: 9px; font-weight: 700; margin-right: 5px; vertical-align: -2px;
  }
  .cd-tab-sep { display: inline-block; width: 1px; height: 18px; background: var(--border); margin: 0 8px; vertical-align: middle; }
  .bod-sub {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; font-weight: 400;
    letter-spacing: 0; text-transform: none; color: var(--text-muted); margin-left: 8px;
  }
  .bod-badge {
    font-size: 11.5px; border-radius: 6px; padding: 7px 12px; margin-bottom: 10px;
    border: 1px solid; line-height: 1.4;
  }
  .bod-badge.ok { color: var(--text-secondary); border-color: var(--border); background: color-mix(in srgb, var(--accent) 7%, transparent); }
  .bod-badge.warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 50%, transparent); background: color-mix(in srgb, var(--warning) 8%, transparent); }
  .bod-badge .bod-note { cursor: help; color: var(--accent); }
  .zgp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 3px 0 7px; }
  .zgp-tag {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    color: #fff; background: var(--accent); border-radius: 4px; padding: 2px 7px;
  }
  .zgp-well { font-size: 12px; font-weight: 600; color: var(--text-primary); }
  .zgp-link { color: var(--text-muted); font-size: 12px; }

  /* ── 2 · Lateral Analysis (js/lateral-analysis.js) ── */
  .la-well { margin-bottom: 14px; }
  .la-chips { margin: 6px 0 8px; }
  .la-strip-wrap { margin: 2px 0 10px; }
  .la-strip { display: block; width: 100%; height: auto; }
  .la-strip .la-tick { font-family: 'JetBrains Mono', monospace; font-size: 10px; fill: var(--text-muted); }
  .la-strip .la-lim { font-family: 'JetBrains Mono', monospace; font-size: 10px; fill: var(--accent); }
  .la-strip .la-seg-lbl { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700; fill: var(--text-secondary); }
  .la-strip .la-exc-lbl { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700; letter-spacing: 0.8px; }
  .la-strip-empty { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 6px 0 10px; }
  .la-profile-wrap { margin: 2px 0 0; }
  /* Type-log lithology strip beside the profile — shares its TVD mapping */
  .la-profrow { display: flex; gap: 6px; align-items: stretch; }
  .la-profmain { flex: 1 1 auto; min-width: 0; }
  .la-profside { flex: 0 0 84px; display: flex; }
  .la-topsstrip { display: block; width: 84px; height: 100%; cursor: help; }
  .la-topsstrip-hint {
    flex: 0 0 84px; align-self: center; text-align: center;
    font-size: 9.5px; color: var(--text-muted); font-style: italic; line-height: 1.4;
  }
  .la-tops-lbl { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; font-weight: 700; }
  .la-tops-footer { margin-top: 2px; }
  .la-tops-conflict { color: var(--warning); }
  .la-tops-confirm { color: var(--text-secondary); }
  .la-tops-kbnote { color: var(--text-muted); }
  .la-strip .la-tvd-tick { font-family: 'JetBrains Mono', monospace; font-size: 9px; fill: var(--text-muted); }
  .la-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) minmax(320px, 1.6fr); gap: 14px; align-items: start; }
  @media (max-width: 1100px) { .la-grid { grid-template-columns: 1fr; } }
  .la-block-title {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
  }
  .la-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
  .la-row-tag { font-size: 10.5px; color: var(--text-muted); min-width: 92px; }
  .la-row input[type="number"], .la-row input[type="text"], .la-exc-row input, .la-exc-row select, .la-fault input {
    padding: 4px 7px; background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .la-row input[type="number"], .la-fault input[type="number"] { width: 110px; }
  .la-row input[type="text"] { flex: 1; min-width: 160px; }
  .la-radio { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-primary); cursor: pointer; }
  .la-derived { font-size: 11px; color: var(--text-secondary); margin: 6px 0 2px; }
  .la-empty { font-size: 11px; color: var(--text-muted); font-style: italic; margin: 4px 0; }
  .la-exc-row {
    display: grid; grid-template-columns: 10px 100px 100px 120px 1fr 28px;
    gap: 6px; align-items: center; margin: 4px 0;
  }
  .la-exc-dot { width: 10px; height: 10px; border-radius: 3px; }
  .la-fault {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
    padding-top: 8px; border-top: 1px dashed var(--border);
  }
  .la-fault-pm { color: var(--text-muted); font-size: 12px; }
  .la-fault input[type="number"]:last-of-type { width: 70px; }
  .la-summary { width: 100%; border-collapse: collapse; font-size: 11.5px; }
  .la-summary th {
    text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
    padding: 4px 8px; border-bottom: 1px solid var(--border);
  }
  .la-summary th:nth-child(n+4) { text-align: right; }
  .la-summary td { padding: 5px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); color: var(--text-primary); }
  .la-summary tfoot td { border-bottom: none; border-top: 1px solid var(--border); color: var(--text-secondary); font-weight: 600; }
  .la-empty-cell { color: var(--text-muted); font-style: italic; }
  .la-footnote { font-size: 10.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }

  /* ── Step-1 Data Readiness matrix (js/design-readiness.js) ── */
  .rd-wrap { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; background: color-mix(in srgb, var(--bg-tertiary) 55%, transparent); }
  .rd-head {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px;
  }
  .rd-pad { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 8px; }
  .rd-matrix { width: 100%; border-collapse: collapse; font-size: 11.5px; }
  .rd-matrix th {
    text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
    padding: 3px 8px; border-bottom: 1px solid var(--border);
  }
  .rd-matrix td { padding: 5px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent); color: var(--text-primary); vertical-align: top; }
  .rd-matrix tr:last-child td { border-bottom: none; }
  .rd-chip {
    display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 8.5px;
    font-weight: 700; letter-spacing: 0.8px; border-radius: 8px; padding: 2px 8px;
    border: 1px solid; cursor: help; white-space: nowrap;
  }
  .rd-ok { color: var(--icop-green, #2ecc71); border-color: color-mix(in srgb, var(--icop-green, #2ecc71) 45%, transparent); background: color-mix(in srgb, var(--icop-green, #2ecc71) 9%, transparent); }
  .rd-warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 9%, transparent); }
  .rd-bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 9%, transparent); }
  .rd-muted, .rd-loading { color: var(--text-muted); border-color: var(--border); background: transparent; }
  /* assumed = engineer-specified, no data pedigree — visually BELOW amber in
     confidence: quiet slate, not another warning tint. */
  .rd-assumed {
    color: var(--icop-axlbl, #9fb1c6);
    border-color: color-mix(in srgb, var(--icop-axlbl, #9fb1c6) 40%, transparent);
    background: color-mix(in srgb, var(--icop-axlbl, #9fb1c6) 8%, transparent);
  }
  .rd-unknown { color: var(--text-muted); border-color: color-mix(in srgb, var(--text-muted) 45%, transparent); background: color-mix(in srgb, var(--text-muted) 8%, transparent); }
  .rd-note { display: block; font-size: 9.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }

  /* Collapsible cards + page help (Dean 2026-07-14). Collapse is CSS-hide
     only — the expanded DOM (netP derivation listeners, tooltips, dirty
     state) is never re-rendered by a toggle. */
  .rd-head-row { display: flex; align-items: center; gap: 8px; }
  .rd-head-ctl { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
  .rd-chev {
    background: none; border: 1px solid var(--border); border-radius: 4px;
    color: var(--text-muted); font-size: 11px; line-height: 1; width: 22px; height: 20px;
    cursor: pointer; padding: 0;
  }
  .rd-chev:hover { color: var(--text-primary); border-color: var(--accent); }
  .rd-help-btn {
    background: none; border: 1px solid var(--border); border-radius: 50%;
    color: var(--text-muted); font-size: 11px; font-weight: 700; line-height: 1;
    width: 20px; height: 20px; cursor: pointer; padding: 0;
  }
  .rd-help-btn:hover { color: var(--accent); border-color: var(--accent); }
  .rd-read-collapsed #rd-read-body { display: none; }
  #rd-reservoir.rd-res-collapsed .rd-res-body { display: none; }
  #rd-reservoir.rd-res-collapsed .rd-preset-ctl { display: none !important; }
  .rd-collapse-summary { display: none; font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
  #rd-reservoir.rd-res-collapsed .rd-collapse-summary { display: inline; }
  .rd-dirty-dot { display: none; color: var(--warning); font-size: 12px; line-height: 1; cursor: help; }
  #rd-reservoir.rd-res-isdirty .rd-dirty-dot { display: inline; }
  #rd-chev-res { margin-left: auto; flex: 0 0 auto; }
  /* help drawer — fixed, above the sticky stepper (50) and panel chrome */
  .rd-help-backdrop {
    display: none; position: fixed; inset: 0; z-index: 10004;
    background: rgba(4, 8, 16, 0.45);
  }
  .rd-help-backdrop.open { display: block; }
  .rd-help-drawer {
    position: absolute; top: 0; right: 0; height: 100%; width: min(400px, 92vw);
    background: var(--icop-panel-solid, #101a2c); border-left: 1px solid var(--border);
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.45);
    display: flex; flex-direction: column;
  }
  .rd-help-head {
    display: flex; align-items: center; justify-content: space-between;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--title-strong);
    padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
  }
  .rd-help-x {
    background: none; border: none; color: var(--text-muted); font-size: 18px;
    line-height: 1; cursor: pointer; padding: 0 2px;
  }
  .rd-help-x:hover { color: var(--text-primary); }
  .rd-help-body { padding: 6px 16px 20px; overflow-y: auto; }
  .rd-help-body h4 {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--accent);
    margin: 14px 0 4px;
  }
  .rd-help-body p { font-size: 11.5px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 4px; }
  .rd-help-body b { color: var(--text-primary); font-weight: 600; }
  body.theme-light .rd-help-drawer { background: #ffffff; }

  /* Basis of Design merged card (Dean 2026-07-14): inputs + a derived
     footer readout strip (the old separate DERIVED card), collapsible with
     the same chevron/CSS-hide idiom as the readiness cards above. */
  .bod-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .bod-card-head #bod-chev { margin-left: auto; }
  .bod-collapse-summary { display: none; font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-secondary); font-family: 'IBM Plex Sans', sans-serif; }
  .bod-collapse-summary b { color: var(--title-strong); }
  .bod-card.bod-collapsed .bod-collapse-summary { display: inline; }
  .bod-card.bod-collapsed .bod-card-body { display: none; }
  .bod-dirty-dot { display: none; color: var(--warning); font-size: 12px; line-height: 1; cursor: help; }
  .bod-card.bod-isdirty .bod-dirty-dot { display: inline; }
  /* Derived readout strip — muted, sub-labeled, sits under the inputs */
  .bod-derived-strip {
    margin-top: 10px; padding: 8px 10px; border-radius: 5px;
    background: color-mix(in srgb, var(--bg-tertiary) 45%, transparent);
    border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  }
  .bod-derived-lbl {
    display: block; font-family: 'JetBrains Mono', monospace; font-size: 8.5px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 6px;
  }

  /* Reservoir & Stress group (pad default + per-well overrides) */
  .rd-res-head { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; padding-top: 10px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
  .rd-res-grid { display: flex; flex-direction: column; gap: 3px; }
  /* Scope selector: PAD DEFAULT + one chip per pad well (formation tag from
     the well registry, best-effort). */
  .rd-scope-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
  .rd-scope-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 12px; padding: 4px 12px; cursor: pointer;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted);
  }
  .rd-scope-chip:hover { color: var(--text-secondary); border-color: var(--text-muted); }
  .rd-scope-chip.active { color: var(--title-strong); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .rd-scope-fm {
    font-size: 7.5px; font-weight: 700; letter-spacing: 0.6px;
    color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px;
    padding: 0 4px;
  }
  /* Inherited (pad-default) rows in well scope: muted until first edit. */
  .rd-res-row.rd-inherited input,
  .rd-res-row.rd-inherited select { opacity: 0.55; }
  .rd-scope-tag {
    display: inline-block; margin-left: 5px; font-family: 'JetBrains Mono', monospace;
    font-size: 8px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
    color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px;
  }
  .rd-inherit {
    margin-left: 5px; background: none; border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-muted); font-size: 8.5px; padding: 0 5px; cursor: pointer;
  }
  .rd-inherit:hover { color: var(--accent); border-color: var(--accent); }
  .vd-scope { font-size: 9px; font-style: italic; color: var(--text-muted); }
  /* Unsaved Reservoir & Stress changes: the SAVE button escalates (amber ring)
     until a save succeeds — the passive "Save to persist" hint wasn't enough. */
  .rd-save-dirty {
    border-color: var(--warning) !important;
    box-shadow: 0 0 0 1px var(--warning), 0 0 10px color-mix(in srgb, var(--warning) 35%, transparent);
  }
  /* Educational field tooltips (design-readiness.js RD_TIPS): fixed-position
     popover — the panel's overflow contexts would clip an absolute one. */
  #rd-reservoir [data-rdtipkey] { cursor: help; }
  #bod-volumetric [data-vdtip] { cursor: help; }
  /* Proppant blend component rows (volumetric-design.js). */
  .vd-blend-head { font-size: 11.5px; font-weight: 600; color: var(--text-primary); margin: 10px 0 4px; }
  .vd-comp-row { display: flex; align-items: center; gap: 6px; margin: 3px 0; flex-wrap: wrap; }
  .vd-comp-row select, .vd-comp-row input {
    padding: 3px 7px; background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }
  .vd-comp-row input[data-cf="pct"] { width: 64px; }
  .vd-comp-pct { font-size: 10.5px; color: var(--text-muted); }
  .vd-comp-del {
    background: none; border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-muted); font-size: 11px; padding: 0 6px; cursor: pointer;
  }
  .vd-comp-del:hover { color: var(--danger); border-color: var(--danger); }
  .vd-comp-note { font-size: 9.5px; font-style: italic; color: var(--text-muted); }
  #vd-blend-warn { font-size: 10.5px; margin: 2px 0 4px; }
  /* Design-Achieves verdict banner — the decision output leads the card.
     Verdict tints follow the readiness-pill idiom: amber = conductivity-
     limited, green = balanced, blue/muted = over-conductive. */
  .vd-verdict-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 8px 0; padding: 9px 14px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--icop-radius-sm, 6px);
    background: var(--bg-tertiary);
    font-size: 12.5px; color: var(--text-primary);
  }
  .vd-verdict-row.vd-verdict-muted { cursor: default; color: var(--text-muted); font-style: italic; font-size: 11.5px; }
  .vd-verdict-main { flex: 1 1 auto; min-width: 240px; }
  .vd-verdict-word {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.8px; padding: 2px 8px; border-radius: 8px; border: 1px solid; cursor: help;
  }
  .vd-verdict-limited { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
  .vd-verdict-limited .vd-verdict-word { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 9%, transparent); }
  .vd-verdict-balanced { border-color: color-mix(in srgb, var(--icop-green, #2ecc71) 45%, var(--border)); }
  .vd-verdict-balanced .vd-verdict-word { color: var(--icop-green, #2ecc71); border-color: color-mix(in srgb, var(--icop-green, #2ecc71) 45%, transparent); background: color-mix(in srgb, var(--icop-green, #2ecc71) 9%, transparent); }
  .vd-verdict-over .vd-verdict-word { color: var(--icop-axlbl, #9fb1c6); border-color: color-mix(in srgb, var(--icop-axlbl, #9fb1c6) 45%, transparent); background: color-mix(in srgb, var(--icop-axlbl, #9fb1c6) 9%, transparent); }
  .vd-vchip { display: inline-flex; flex-direction: column; gap: 1px; padding: 2px 10px; border-left: 1px solid var(--border); }
  .vd-vchip-l { font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); }
  .vd-vchip-v { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 600; color: var(--text-primary); }
  /* Perf-generation audit block (perf-design.js genMeta). */
  .pm-genmeta { margin-top: 6px; }
  .pm-genmeta [data-pmtip] { cursor: help; }
  .pm-prelim {
    display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 9px;
    font-weight: 700; letter-spacing: 1px; padding: 2px 8px; border-radius: 8px;
    color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
    background: color-mix(in srgb, var(--warning) 9%, transparent);
  }
  .rd-tip-pop {
    position: fixed; z-index: 10002; pointer-events: none;
    max-width: 350px; padding: 10px 12px;
    background: var(--icop-panel-solid, #101a2c);
    border: 1px solid var(--icop-border, rgba(122,152,193,0.30));
    border-radius: var(--icop-radius-sm, 6px);
    box-shadow: var(--icop-shadow, 0 8px 28px rgba(0,0,0,0.5));
    font-size: 11px; line-height: 1.55; color: var(--icop-text, #dbe6f3);
  }
  /* Tier column widened 92→138px so pill + PAD tag / ↺ inherit sit on ONE
     line in well scope (they wrapped under the longer pills — Dean's
     screenshot); the cell itself is a nowrap inline-flex group. */
  .rd-res-row { display: grid; grid-template-columns: 180px 138px 130px 110px 1fr; gap: 8px; align-items: center; }
  .rd-res-row > span[id^="rd-tier-"] {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  }
  .rd-res-row > span[id^="rd-tier-"] .rd-scope-tag,
  .rd-res-row > span[id^="rd-tier-"] .rd-inherit { margin-left: 0; }   /* the flex gap spaces them */
  @media (max-width: 900px) { .rd-res-row { grid-template-columns: 150px 120px 1fr 100px; } .rd-res-row input[data-rf="note"] { grid-column: 1 / -1; } }
  .rd-res-label { font-size: 11px; color: var(--text-primary); }
  .rd-res-unit { font-size: 9.5px; color: var(--text-muted); margin-left: 3px; }
  /* Muted qualifier line under a field label (e.g. net pressure at shut-in:
     the PKN design-point note — it varies through the stage by nature). */
  .rd-res-sub { display: block; font-size: 8.5px; font-style: italic; color: var(--text-muted); line-height: 1.35; margin-top: 1px; max-width: 240px; }
  .rd-res-row input, .rd-res-row select {
    padding: 3px 7px; background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }

  .rd-preset-ctl { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
  .rd-preset-ctl select {
    padding: 3px 7px; background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; max-width: 150px;
  }
  .rd-xcheck { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding: 6px 8px; border: 1px dashed var(--border); border-radius: 6px; font-size: 10.5px; color: var(--text-secondary); }
  .rd-xcheck label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); }
  .rd-xcheck input {
    width: 64px; padding: 2px 6px; background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }

  /* Volumetric Design (BOD step) */
  .vd-ctx { font-size: 11px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 8px; }
  .vd-warn { color: var(--warning); }
  .vd-chain { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); line-height: 1.6; margin: 8px 0 4px; }
  .vd-recon { font-size: 11px; color: var(--text-secondary); line-height: 1.55; margin: 8px 0 2px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 6px; }
  .vd-fine { font-size: 9.5px; color: var(--text-muted); font-style: italic; margin-top: 6px; line-height: 1.4; }
  .vd-how { margin-top: 8px; font-size: 11px; color: var(--text-secondary); }
  .vd-how summary { cursor: pointer; font-size: 10.5px; color: var(--text-muted); }
  .vd-how ol { margin: 6px 0 4px 18px; line-height: 1.6; }

  /* ── Zipper groups modal (js/zipper-groups.js) ── */
  .zg-overlay {
    position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
  }
  .zg-modal {
    width: 400px; max-width: 92vw; max-height: 80vh; overflow-y: auto;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5); padding: 16px 18px;
  }
  .zg-head {
    font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--title-strong);
    margin-bottom: 6px;
  }
  .zg-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; margin-bottom: 12px; }
  .zg-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .zg-row { display: flex; align-items: center; gap: 10px; }
  .zg-well { flex: 1; font-size: 12px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .zg-sel {
    flex: 0 0 110px; background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; font-size: 11.5px; outline: none;
  }
  .zg-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
  .zg-msg { margin-right: auto; font-size: 10.5px; color: var(--text-muted); }

  /* ── Lateral View embed in Perforation Design (js/log-viewer.js) ── */
  .perf-lateral-wrap {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: 12px; overflow: hidden;
  }
  .perf-lateral-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 14px; border-bottom: 1px solid var(--border);
  }
  .perf-lateral-title {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--title-strong);
  }
  .perf-lateral-sub {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10.5px; font-weight: 400;
    letter-spacing: 0; text-transform: none; color: var(--text-muted);
  }
  .perf-lateral-toggle {
    background: none; border: 1px solid var(--border); border-radius: 5px;
    color: var(--text-secondary); font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 3px 10px; cursor: pointer;
  }
  .perf-lateral-toggle:hover { border-color: var(--text-muted); color: var(--text-primary); }
  .perf-lateral-host { padding: 8px 10px; }

  /* ── Design Intelligence dock (js/design-intel.js) — §4 informing tools ── */
  #ptab-completions { position: relative; padding-right: 30px !important; }
  .comp-intel-dock { position: absolute; top: 0; right: 0; height: 100%; display: flex; flex-direction: row; z-index: 25; }
  .comp-intel-tab {
    width: 30px; height: 100%; background: var(--bg-tertiary); border: none; border-left: 1px solid var(--border);
    cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0;
    color: var(--text-secondary);
  }
  .comp-intel-tab:hover { color: var(--text-primary); background: color-mix(in srgb, var(--accent) 8%, var(--bg-tertiary)); }
  .cid-ic { font-size: 15px; }
  .cid-tab-lbl {
    writing-mode: vertical-rl; font-family: 'JetBrains Mono', monospace; font-size: 9px;
    font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  }
  .comp-intel-panel {
    width: 300px; height: 100%; background: var(--bg-secondary); border-left: 1px solid var(--border);
    overflow-y: auto; display: none; box-shadow: -8px 0 24px rgba(0,0,0,0.18);
  }
  .comp-intel-dock.open .comp-intel-panel { display: block; }
  .cid-head {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
    border-bottom: 1px solid var(--border); font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--title-strong);
  }
  .cid-close { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1; }
  .cid-close:hover { color: var(--text-primary); }
  .cid-note { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 10px 14px; line-height: 1.45; border-bottom: 1px solid var(--border); }
  .cid-grp {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1.1px; text-transform: uppercase; color: var(--accent); padding: 12px 14px 4px;
  }
  .cid-tool {
    display: block; width: calc(100% - 16px); margin: 2px 8px; text-align: left; background: none;
    border: 1px solid transparent; border-radius: 6px; padding: 8px 10px; cursor: pointer;
    font-size: 12px; color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif;
  }
  .cid-tool:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--border); }

  .proj-nav-wrap { position: relative; display: inline-flex; align-items: center; height: 100%; }
  /* One control: icon + PROJECT + the open project's name + caret. The whole
     of it opens the switcher. It is never "active": the project is context,
     and the lit entry in the pill is the workspace on screen. */
  .proj-nav-picker {
    display: inline-flex; align-items: center; gap: 6px; height: 100%;
    background: none; border: none; cursor: pointer;
    padding: 6px 11px 7px; line-height: 1;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px; color: var(--text-secondary);
  }
  .proj-nav-picker:hover { color: var(--text-primary); }
  .proj-nav-picker .tab-icon { font-size: 14px; color: var(--text-muted); }
  .proj-nav-lbl {
    font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); margin-right: 3px;
  }
  body:not(.theme-light) .proj-nav-lbl,
  body:not(.theme-light) .proj-nav-picker .tab-icon { color: #8a95b8; letter-spacing: 0.7px; }
  /* Context (Project, Inventory, Map) | products (Completions, Reservoir, Land). */
  .mode-sep {
    flex: 0 0 1px; width: 1px; height: 16px; align-self: center; margin: 0 5px;
    background: var(--border);
  }
  body:not(.theme-light) .mode-sep { background: rgba(120,160,255,0.22); }
  .proj-nav-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .proj-nav-carets { font-size: 9px; opacity: 0.7; }
  .proj-nav-menu {
    position: absolute; top: 100%; left: 4px; margin-top: 4px; min-width: 230px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.35); padding: 6px; z-index: 6000;
    max-height: 62vh; overflow-y: auto;
  }
  .pnm-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-muted);
    padding: 4px 8px 6px;
  }
  .pnm-empty { font-size: 11.5px; color: var(--text-muted); font-style: italic; padding: 4px 10px 8px; }
  .pnm-item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    border-radius: 5px; padding: 8px 10px; cursor: pointer; font-size: 12px;
    color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif;
  }
  .pnm-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .pnm-item.active { background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 700; }
  .pnm-sep { height: 1px; background: var(--border); margin: 5px 4px; }
  .pnm-new { color: var(--accent); font-weight: 600; }
  .pnm-del { color: var(--danger); }
  /* LiveStream button — opens Live Ops; styled like a mode-tab but is an action,
     not a mode (so it's not wired into switchMode). Project-gated. */
  .liveops-nav-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 0 18px; height: 100%;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer; transition: color 0.15s;
  }
  .liveops-nav-btn:hover { color: var(--title-strong); }
  .liveops-nav-dot { color: #2ecc71; font-size: 9px; line-height: 1; }
  .theme-toggle {
    margin-left: 12px; margin-right: 14px;
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 999px; padding: 3px; cursor: pointer; user-select: none;
  }
  .theme-toggle .tt-opt {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px; color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
  }
  .theme-toggle .tt-opt.active { background: var(--accent); color: #fff; }
  .mode-tab .tab-icon { font-size: 14px; }
  /* Six entries in the pill: below 1900px the icons go, which brings the pill
     back to the width it had with five, so the header fits wherever it fit
     before the Completions entry was added (Land's lens strip is the widest
     right zone and sets the breakpoint). */
  @media (max-width: 1899px) { .mode-tabs .tab-icon { display: none; } }

  /* ── Phase 3 (design unification): in DARK theme the app header adopts the
     Live Ops command-band — same navy gradient, cyan corner glow, and
     cyan→blue accent rule as .lo-header — so platform and console read as
     one product. Mode tabs become the Live Ops glass nav pill with
     illuminated per-mode underlines. Light theme keeps the flat header
     (out of scope by decision). */
  body:not(.theme-light) .app-header {
    background:
      radial-gradient(130% 200% at 11% -10%, rgba(44,195,236,0.12) 0%, rgba(44,195,236,0) 42%),
      linear-gradient(115deg, #0a1322 0%, #0f1d35 48%, #16284a 100%);
    border-bottom-color: #1d2c46;
  }
  body:not(.theme-light) .app-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    pointer-events: none; z-index: 1;
    background: linear-gradient(90deg,
      rgba(44,195,236,0) 0%, rgba(44,195,236,0.5) 16%,
      rgba(59,130,246,0.5) 52%, rgba(44,195,236,0) 100%);
  }
  body:not(.theme-light) .app-title .title-main { color: #fff; }
  body:not(.theme-light) .app-title .title-sub { color: var(--icop-mut); }
  body:not(.theme-light) .mode-tabs {
    height: auto; align-self: center; gap: 4px; padding: 2px 6px;
    background: rgba(18,28,48,0.45); border: 1px solid rgba(120,160,255,0.15);
    border-radius: 14px;
  }
  /* Light theme: same subtle nav pill (was dark-only — light lost the border
     entirely). Active = soft accent chip instead of the dark glow-underline. */
  body.theme-light .mode-tabs {
    height: auto; align-self: center; gap: 4px; padding: 2px 6px;
    background: rgba(15,23,42,0.03); border: 1px solid rgba(15,23,42,0.15);
    border-radius: 14px;
  }
  body.theme-light .mode-tab,
  body.theme-light .liveops-nav-btn {
    height: auto; padding: 6px 11px 7px;
    border-bottom: none; border-radius: 9px; line-height: 1;
  }
  body.theme-light .mode-tab.active {
    /* slate-navy tint (periwinkle rgba(37,99,235,.10) fought the light theme's
       navy/slate language — match the header underline + dark buttons) */
    background: rgba(30, 45, 80, 0.09); color: #1e2d50;
  }
  body:not(.theme-light) .mode-tab,
  body:not(.theme-light) .liveops-nav-btn {
    position: relative; height: auto; padding: 6px 11px 7px;
    border-bottom: none; border-radius: 0;
    color: #8a95b8; letter-spacing: 0.7px; line-height: 1;
    transition: color .12s, text-shadow .12s;
  }
  /* Per-mode accent drives the underline/glow (same cue system as lo-nav) */
  body:not(.theme-light) .mode-tab[data-mode="project"]  { --acc: #69a8ff; }
  body:not(.theme-light) .mode-tab[data-mode="inventory"] { --acc: #e8b64a; }
  body:not(.theme-light) .mode-tab[data-mode="analysis"] { --acc: #7ee787; }
  body:not(.theme-light) .mode-tab[data-mode="map"]      { --acc: #5fd0e6; }
  body:not(.theme-light) .liveops-nav-btn                { --acc: #2ee06a; }
  body:not(.theme-light) .mode-tab:hover,
  body:not(.theme-light) .liveops-nav-btn:hover {
    color: #c6d2ec; text-shadow: 0 0 8px rgba(105,168,255,0.30);
  }
  body:not(.theme-light) .mode-tab.active {
    color: #fff; font-weight: 700;
    text-shadow: 0 0 10px color-mix(in srgb, var(--acc, #69a8ff) 55%, transparent);
  }
  body:not(.theme-light) .mode-tab.active::after {
    content: ""; position: absolute; bottom: 0; left: 9px; right: 9px; height: 2.5px;
    border-radius: 2px; background: var(--acc, #69a8ff);
    box-shadow: 0 0 8px color-mix(in srgb, var(--acc, #69a8ff) 70%, transparent);
  }

  /* Mode container — fills remaining space below header */
  .mode-container { flex: 1; display: flex; overflow: hidden; position: relative; }

  /* Map mode — existing sidebar + resizer + map layout */
  .mode-map { display: flex; width: 100%; height: 100%; }
  .mode-map.hidden { display: none; }

  /* Project mode — sidebar + workspace split (mirrors map layout) */
  .mode-project { width: 100%; height: 100%; display: none; }
  .mode-project.visible { display: flex; }
  .project-sidebar {
    width: 300px; flex: 0 0 300px; min-width: 220px; max-width: 600px;
    background: var(--bg-secondary); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow: hidden; scrollbar-gutter: stable;
  }
  .project-sidebar .panel-proj-meta { flex: 0 0 auto; }
  .project-sidebar .panel-proj-wells {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    border-bottom: none;
  }
  .project-sidebar .panel-proj-wells .panel-header { flex: 0 0 auto; }
  .project-sidebar .panel-body-proj-wells {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
    padding-bottom: 12px;
  }
  .project-sidebar #proj-well-groups.pw-groups {
    flex: 1 1 auto; min-height: 0;
    flex-direction: column;
  }
  /* project-io.js sets style.display = 'block' when showing wells */
  #proj-well-groups.pw-groups[style*="display: block"],
  #proj-well-groups.pw-groups[style*="display:block"] {
    display: flex !important;
  }
  .project-sidebar::-webkit-scrollbar { width: 10px; }
  .project-sidebar::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .project-sidebar::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-secondary); }
  .project-sidebar::-webkit-scrollbar-thumb:hover { background: #4a5568; }
  .project-sidebar { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
  .project-main { flex: 1; background: var(--bg-primary); overflow-y: auto; display: flex; flex-direction: column; }

  /* No project selected yet: hide the Wells-in-Project rail entirely so the
     first-load view isn't a confusing empty sidebar. .project-main is flex:1
     so it fills the full width once the sidebar is gone. Hide only — all
     sidebar DOM/JS wiring stays intact and reappears the instant a project
     loads (project-io.js renderProjectWells removes body.no-project). */
  body.no-project .project-sidebar { display: none; }
  /* Landing is ALWAYS dark (Dean, 2026-07-10): theme.js suppresses a stored
     light preference while no-project is set (without overwriting it), so the
     Dark/Light toggle is meaningless here — hidden until a project loads. */
  body.no-project .theme-toggle { display: none; }
  /* NORRIS (/norris) has no project and keeps the Dark / Light choice (js/land-page.js restores it). */
  .land-page body.no-project .theme-toggle { display: inline-flex; }
  /* Landing: the panel's Select Project button is the ONE project entry point
     (Dean, 2026-07-10) — hide the top-nav Project picker. Inventory stays (it
     exists outside projects), and so does Completions: lit on the landing,
     and the way back to it from Inventory / Map / Reservoir / Land.
     CRITICAL: #proj-nav-menu
     lives INSIDE .proj-nav-wrap, so the wrap must NOT be display:none (a
     display:none ancestor kills the landing button's fixed-position menu).
     display:contents removes the wrap's flex box (no orphan gap in the pill —
     Inventory reads as a single clean control) while leaving the menu
     displayable; the picker button is hidden on its own. */
  body.no-project .proj-nav-wrap { display: contents; }
  body.no-project #proj-nav-caret { display: none; }
  /* Lifecycle (1·2·3) menus on the landing: INERT but LEGIBLE. Pointer events
     off (no clicks, no hover, no menus); landing-panel.js also sets disabled/
     aria-disabled so keyboard activation is blocked. Labels are RAISED from
     the default --text-muted faintness to read as the platform's organizing
     structure (clearly-readable secondary chrome, ≥3:1 on the header band);
     the numbered badges keep a touch of their accent color. */
  body.no-project .wf-bar { pointer-events: none; }
  body.no-project .wf-bar .wf-btn,
  body.no-project .wf-bar .wf-caret-btn { cursor: default; color: var(--icop-axlbl, #9fb1c6); }
  body.no-project .wf-bar .wf-num { opacity: 0.8; }
  body.no-project .wf-bar .wf-cat { border-bottom-color: transparent; }
  /* Centering guards: on the landing NOTHING may share or reshape the content
     area. A leftover .visible on a tab panel (e.g. delete-project doesn't strip
     it) would otherwise trigger the .project-main:has(#ptab-*.visible) layout
     variants; leftover inline display on #proj-no-well would hide the card.
     !important is deliberate — these outrank both the :has() variants (which
     carry #ptab-* specificity) and inline styles, and are scoped to no-project
     only, so every loaded-state layout is untouched. */
  body.no-project .proj-tab-panel { display: none !important; }
  body.no-project #proj-tab-content { display: flex !important; flex-direction: column !important; overflow-y: auto; }
  body.no-project #proj-no-well { display: flex !important; flex: 1 1 auto; width: 100%; }
  /* Center empty-state swap: with no project the plain "select a well" line is
     replaced by the .pe-landing welcome card (wordmark + Select Project +
     optional Recents / Active Live Ops sections — js/landing-panel.js). */
  .proj-empty-state .pe-landing { display: none; }
  body.no-project .proj-empty-state .pe-msg-well { display: none; }
  body.no-project .proj-empty-state .pe-icon { display: none; }
  body.no-project .proj-empty-state .pe-landing {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
  }
  /* Wordmark: same grammar as the header lockup (.title-main / .lo-icop —
     Helvetica 800, tight tracking, tiny superscript ™). */
  .pe-landing .pl-wordmark {
    font-family: Helvetica, Arial, sans-serif; font-size: 21px; font-weight: 800;
    letter-spacing: 0.5px; color: var(--icop-ink);
  }
  .pe-landing .pl-tm {
    font-size: 8px; font-weight: 600; margin-left: 1px;
    color: var(--icop-mut); vertical-align: super; line-height: 1;
  }
  .pe-landing .pl-sub {
    font-size: 13px; line-height: 1.55; max-width: 340px; color: var(--icop-text);
  }
  .pe-landing .pl-select-btn {
    background: var(--icop-blue); color: #fff; border: none; cursor: pointer;
    border-radius: var(--icop-radius-sm, 6px); padding: 10px 22px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12.5px; font-weight: 600;
    letter-spacing: 0.3px;
  }
  .pe-landing .pl-select-btn:hover { filter: brightness(1.12); }
  .pe-landing .pl-section { width: 100%; text-align: left; margin-top: 4px; }
  .pe-landing .pl-sec-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--icop-axlbl, #9fb1c6);   /* final: one step up the muted ladder (was --icop-mut) */
    margin-bottom: 13px;   /* +7px air between label and first row */
  }
  .pe-landing .pl-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 10px;    /* final: ~38px row (33 → 38) — comfier click target */
    cursor: pointer; border: none; border-radius: 0;
  }
  /* 4+ recents: quiet link under the third row — opens the project picker
     (same anchored path as the Select Project button). */
  .pe-landing .pl-view-all {
    display: block; width: 100%; text-align: left; background: none; border: none;
    border-top: 1px solid var(--icop-border-faint);
    padding: 8px 10px 2px; cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; color: var(--icop-mut);
  }
  .pe-landing .pl-view-all:hover { color: var(--icop-text); }
  /* Auto-enter Live Ops notice (step-4 phase 1, landing-panel.js liveToast):
     token-styled, top-center, auto-dismiss ~4s. Sits ABOVE the Live Ops layer
     (z 10000) so the message reads over the console as it opens. Always-dark
     chrome — it accompanies the dark Live Ops surface by definition. */
  .icop-live-toast {
    position: fixed; top: 18px; left: 50%; transform: translate(-50%, -12px);
    z-index: 10001; pointer-events: none; opacity: 0;
    display: flex; align-items: center; gap: 9px;
    background: var(--icop-panel-solid, #101a2c);
    border: 1px solid var(--icop-border, rgba(122,152,193,0.30));
    border-radius: var(--icop-radius-sm, 6px);
    box-shadow: var(--icop-shadow, 0 8px 28px rgba(0,0,0,0.5));
    padding: 10px 16px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    letter-spacing: 0.6px; color: var(--icop-text, #dbe6f3);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .icop-live-toast::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
    background: var(--icop-green, #2ecc71);
    animation: pl-live-pulse 1.6s ease-in-out infinite;
  }
  .icop-live-toast.show { opacity: 1; transform: translate(-50%, 0); }

  /* ── Phase A Project Overview (project-shell.js) ─────────────────────────
     Lives in the #proj-no-well empty-state slot when a project opens with no
     stored workspace. Restrained card, --icop-* tokens, PLAIN dark workspace
     (dense-surface rule — no backdrop photo; the wash stays whatever the
     loaded-project theme provides). overview-mode swaps it in for the plain
     "select a well" message. */
  #proj-overview { display: none; }
  #proj-no-well.overview-mode .pe-panel { display: none; }
  #proj-no-well.overview-mode #proj-overview {
    display: flex; flex-direction: column; gap: 12px;
    width: min(640px, 100%); text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--icop-radius, 12px);
    padding: 26px 32px;
  }
  #proj-overview .po-name {
    font-family: Helvetica, Arial, sans-serif; font-size: 19px; font-weight: 800;
    letter-spacing: 0.5px; color: var(--title-strong, var(--text-primary));
  }
  #proj-overview .po-counts {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: var(--text-muted); margin-top: -8px;
  }
  #proj-overview .po-resume {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; font-style: italic; color: var(--text-muted);
  }
  #proj-overview .po-resume-btn {
    background: none; border: 1px solid var(--border); border-radius: var(--icop-radius-sm, 6px);
    color: var(--accent); font-size: 11px; font-weight: 600; padding: 4px 12px; cursor: pointer;
  }
  #proj-overview .po-resume-btn:hover { border-color: var(--accent); }
  #proj-overview .po-sec-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    margin-top: 4px;
  }
  #proj-overview .po-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; cursor: pointer;
    border-radius: var(--icop-radius-sm, 6px);
  }
  #proj-overview .po-row + .po-row { border-top: 1px solid var(--border); border-radius: 0; }
  #proj-overview .po-row:hover { background: rgba(59,130,246,0.10); }
  #proj-overview .po-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  #proj-overview .po-row-name {
    font-size: 12.5px; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #proj-overview .po-row-api {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #proj-overview .po-badge {
    flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 8.5px;
    font-weight: 700; letter-spacing: 0.8px; padding: 2px 7px; border-radius: 3px;
    color: var(--text-muted); border: 1px solid var(--border);
  }
  #proj-overview .po-chev { flex: 0 0 auto; color: var(--text-muted); font-size: 14px; line-height: 1; }
  #proj-overview .po-row:hover .po-chev { color: var(--text-primary); }
  #proj-overview .po-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  #proj-overview .po-act {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--icop-radius-sm, 6px); padding: 8px 14px; cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 600;
    color: var(--text-primary);
  }
  #proj-overview .po-act:hover { border-color: var(--accent); background: rgba(58,123,213,0.08); }
  #proj-overview .po-act-live { color: var(--icop-green, #2ecc71); }
  /* Clickable affordance: light divider between rows, hover wash, chevron. */
  .pe-landing .pl-row + .pl-row { border-top: 1px solid var(--icop-border-faint); }
  .pe-landing .pl-row:first-child { border-radius: var(--icop-radius-sm, 6px) var(--icop-radius-sm, 6px) 0 0; }
  .pe-landing .pl-row:last-child { border-radius: 0 0 var(--icop-radius-sm, 6px) var(--icop-radius-sm, 6px); }
  .pe-landing .pl-row:hover { background: rgba(59,130,246,0.12); }
  .pe-landing .pl-row-name { font-size: 12.5px; font-weight: 600; color: var(--icop-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pe-landing .pl-row-when { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--icop-mut); flex: 0 0 auto; margin-left: auto; }
  .pe-landing .pl-row-chev {
    flex: 0 0 auto; font-size: 14px; line-height: 1; color: var(--icop-mut);
  }
  .pe-landing .pl-row:hover .pl-row-chev { color: var(--icop-text); }
  /* Active Live Ops tile */
  .pe-landing .pl-live-dot {
    flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
    background: var(--icop-green, #2ecc71);
    animation: pl-live-pulse 1.6s ease-in-out infinite;
  }
  @keyframes pl-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.55); }
    55%      { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
  }
  .pe-landing .pl-live-hint { font-size: 10.5px; font-style: italic; color: var(--icop-mut); flex: 0 0 auto; }
  /* Mapped live tile: explicit deep-link affordance (landing-panel.js
     openLiveDeep). margin-left:auto pushes it to the row's right edge. */
  .pe-landing .pl-live-go {
    flex: 0 0 auto; margin-left: auto;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.6px; white-space: nowrap;
    color: var(--icop-green, #2ecc71);
  }
  .pe-landing .pl-live-mapped:hover .pl-live-go { text-decoration: underline; }
  /* "● LIVE" badge on a Recent Projects row that owns a fresh stream. Sits
     right of the name (margin-left:auto), timestamp keeps the far edge. */
  .pe-landing .pl-live-badge {
    flex: 0 0 auto; margin-left: auto;
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
    letter-spacing: 0.8px; color: var(--icop-green, #2ecc71);
  }
  .pe-landing .pl-live-badge + .pl-row-when { margin-left: 10px; }
  /* Light theme: same structure, ink swapped to the light-header palette. */
  body.theme-light .pe-landing .pl-wordmark { color: #1F3B63; }
  body.theme-light .pe-landing .pl-sub,
  body.theme-light .pe-landing .pl-row-name { color: #33475f; }
  body.theme-light .pe-landing .pl-tm,
  body.theme-light .pe-landing .pl-sec-label,
  body.theme-light .pe-landing .pl-row-when,
  body.theme-light .pe-landing .pl-live-hint { color: #5b6b80; }
  body.theme-light .pe-landing .pl-live-go,
  body.theme-light .pe-landing .pl-live-badge { color: #1e8e50; }
  body.theme-light .pe-landing .pl-row:hover { background: rgba(31,59,99,0.07); }

  /* ── No-project landing backdrop ─────────────────────────────────────────
     Shared ICOP environment asset (same file Live Ops uses — do not duplicate
     the image). Painted on .project-main's ::before, scoped to body.no-project
     so it exists ONLY on the landing: dense work surfaces keep the plain navy
     wash / light background the moment a project loads, and .project-main
     lives only inside #mode-project so inventory/map modes never see it.
     Live Ops' own fixed-layer ::before (z 10000) is untouched. */
  body.no-project .project-main {
    position: relative;
    z-index: 0;            /* stacking context: ::before z-index:-1 paints over
                              .project-main's own background, under content */
  }
  body.no-project .project-main::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-size: cover;
    background-position: center 90%;   /* low horizon — center stays usable */
    background-repeat: no-repeat;
    background-attachment: fixed;
  }
  /* DARK: same family as Live Ops (.45→.58) but a touch deeper — calm landing,
     comfortable contrast for the center prompt. Rich, not murky. */
  body.no-project:not(.theme-light) .project-main::before {
    background-image:
      linear-gradient(180deg, rgba(8,13,24,0.52) 0%, rgba(8,13,24,0.68) 100%),
      url('/assets/ICOP_Background_2560x1440_2.webp');
    filter: contrast(1.05);
  }
  /* LIGHT: same place, morning-lit — heavy near-white wash + desaturation so
     the image is environmental texture behind the light UI, never competing
     with text. */
  body.no-project.theme-light .project-main::before {
    background-image:
      linear-gradient(180deg, rgba(246,249,253,0.84) 0%, rgba(240,246,252,0.90) 100%),
      url('/assets/ICOP_Background_2560x1440_2.webp');
    filter: saturate(0.45) contrast(0.98);
  }
  /* Glass panel mount for the center prompt (and step 3's Welcome panel).
     Unstyled when a project is loaded — pure pass-through wrapper. */
  body.no-project .proj-empty-state .pe-panel {
    padding: 30px 46px;
    width: min(515px, 100%); max-width: 515px;
    border-radius: var(--icop-radius, 12px);
    backdrop-filter: blur(var(--icop-blur, 9px));
    -webkit-backdrop-filter: blur(var(--icop-blur, 9px));
  }
  body.no-project:not(.theme-light) .proj-empty-state .pe-panel {
    /* Approved depth pass: +4% fill over the stock --icop-panel stops
       (0.60/0.50 → 0.64/0.54), border one tier up the ladder
       (--icop-border → --icop-border-strong), and a two-layer soft drop
       shadow beneath. Depth, not glow — ink/hue unchanged. */
    background: linear-gradient(158deg, rgba(24,34,55,0.64) 0%, rgba(13,21,37,0.54) 100%);
    border: 1px solid var(--icop-border-strong);
    box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 3px 10px rgba(0,0,0,0.35);
    color: var(--icop-text);
  }
  body.no-project.theme-light .proj-empty-state .pe-panel {
    background: rgba(255,255,255,0.62);
    border: 1px solid rgba(31,59,99,0.16);
    box-shadow: 0 8px 28px rgba(31,59,99,0.10);
    color: #33475f;
  }

  /* Project right-pane tabs */
  /* Detached-well banner — shown when editing a well's data outside any project */
  .proj-detached-banner {
    flex: 0 0 auto; display: none; align-items: center; gap: 8px;
    background: color-mix(in srgb, var(--accent) 14%, var(--bg-secondary));
    border-bottom: 1px solid var(--accent);
    padding: 7px 16px; font-size: 12px; color: var(--text-primary);
  }
  .proj-detached-banner .pdb-dot {
    flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  }
  .proj-detached-banner strong { font-weight: 700; }

  .proj-tabs-bar {
    flex: 0 0 auto; display: none; align-items: center;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    padding: 0 16px; height: 38px; gap: 0;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;   /* scroll, don't clip, the tab row */
  }
  .proj-tabs-bar::-webkit-scrollbar { height: 5px; }
  .proj-tabs-bar::-webkit-scrollbar-thumb { background: rgba(120,140,180,0.3); border-radius: 3px; }
  .proj-tabs-bar.visible { display: flex; }
  .proj-tabs-bar .proj-tab {
    flex: 0 0 auto;   /* keep full label width; the bar scrolls rather than squishing tabs */
    padding: 0 16px; height: 100%; display: flex; align-items: center; white-space: nowrap;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--text-muted); background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
  }
  .proj-tabs-bar .proj-tab:hover { color: var(--text-secondary); }
  .proj-tabs-bar .proj-tab.active { color: var(--title-strong); border-bottom-color: var(--accent); }
  .proj-tabs-bar .proj-tab.sticky::after {
    content: '\1F4CC';
    margin-left: 6px; font-size: 11px;
    filter: saturate(0.75);
  }
  .proj-tabs-bar .proj-tab.sticky { border-bottom-style: solid; }
  .proj-tabs-bar .proj-tab.sticky:not(.active) {
    border-bottom-color: var(--accent); border-bottom-style: dashed;
  }
  .proj-tab-content { flex: 1; overflow-y: auto; }
  .proj-tab-panel { display: none; padding: 24px; }
  .proj-tab-panel.visible { display: block; }
  /* Well Data sub-tabs */
  .wd-subtabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px;
  }
  /* Completions Design stepper stays pinned while the long design pages
     scroll (Dean 2026-07-14: "it feels unnatural that the 1-2-3-4-5 menus
     disappear"). MEASURED context: the scroll container in project mode is
     #proj-tab-content (inner overflow:auto) and nothing sticky sits above
     the strip INSIDE that scroller — the app header / family bar live
     outside it — so top:0 pins the strip at the scroller's top edge.
     Solid theme background (tokens flip per theme) so cards never ghost
     through; z-index above cards but far below the fixed overlays
     (tooltips 10002, combo/nav menus 6000 — position:fixed besides). */
  #comp-subtabs {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-primary);
    padding-top: 8px;
  }
  .wd-subtab {
    padding: 8px 16px; font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11.5px; font-weight: 600; color: var(--text-muted);
    background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: color 0.15s, border-color 0.15s;
  }
  .wd-subtab:hover { color: var(--text-secondary); }
  .wd-subtab.active { color: var(--title-strong); border-bottom-color: var(--accent); }
  .wd-subpanel { display: none !important; }
  .wd-subpanel.visible { display: block !important; }
  .wd-subpanel.visible[style*="flex"] { display: flex !important; }

  /* Well Header form */
  .wh-section { margin-bottom: 20px; }
  .wh-section-title {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent);
    margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  }
  .wh-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 16px;
  }
  .wh-field { display: flex; flex-direction: column; }
  .wh-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 3px;
  }
  .wh-input {
    padding: 6px 10px; border-radius: 4px; font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px; font-weight: 500; color: var(--text-primary);
    background: var(--bg-tertiary); border: 1px solid var(--border); outline: none;
    transition: border-color 0.15s;
  }
  .wh-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
  .wh-input:read-only { opacity: 0.7; cursor: default; }
  .wh-input::placeholder { color: var(--text-muted); font-style: italic; font-size: 11px; }
  .wh-save-bar {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    margin-top: 24px; padding: 12px 14px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px;
    position: sticky; bottom: 0;
  }
  .wh-save-state {
    margin-right: auto;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.6px;
  }
  .wh-save-state.dirty { color: #f59e0b; }
  .wh-save-state.saving { color: #06b6d4; }
  .wh-save-state.saved { color: #22c55e; }
  .wh-save-state.error { color: #ef4444; }

  /* Historical chart panels */
  .hist-toolbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  }
  .hist-zone-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text-muted);
  }
  .hist-chart-panel {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    margin-bottom: 12px; overflow: hidden;
  }
  /* Toolbar dropdowns (Load Template / Chem Program / Apply Chem Rate) are
     position:absolute inside the toolbar of #design-sched-panel. The panel
     normally clips overflow to keep its rounded corners, but on a fresh well
     with no steps yet the schedule body is too short and the dropdown gets
     cut off. Allow this one panel to overflow so the dropdowns are usable
     before any steps exist. */
  #design-sched-panel { overflow: visible; }
  #design-sched-panel .sched-toolbar { overflow: visible; }
  .hist-chart-header {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; cursor: pointer; user-select: none;
    font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 700;
    letter-spacing: 1.4px; text-transform: uppercase; color: #ffffff;
    overflow: hidden;
  }
  .hist-chart-header > span:first-child {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .hist-chart-header-actions {
    display: inline-flex; align-items: center; gap: 8px;
    flex: 0 0 auto; margin-left: auto;
  }
  .hist-chart-header:hover { background: rgba(255,255,255,0.06); }
  /* Light-mode override — #f1f5f9 (the previous color) was unreadable
     on a white panel background. Use the same dark title color
     (#0f172a, mapped to --title-strong in light mode) for crisp contrast. */
  body.theme-light .hist-chart-header { color: var(--title-strong); }
  .hist-chart-body { padding: 8px; }
  .hist-chart-panel.collapsed .hist-chart-body,
  .hist-chart-panel.collapsed .hist-trim-toolbar,
  .hist-chart-panel.collapsed .hist-patch-panel,
  .hist-chart-panel.collapsed .prd-map-panel,
  .hist-chart-panel.collapsed .chem-toolbar,
  .hist-chart-panel.collapsed .chem-map-panel,
  #hist-prd-panel.collapsed #stage-summary,
  #hist-prd-panel.collapsed #hist-wellbore-caps,
  #hist-prd-panel.collapsed #hist-prd-resize,
  #hist-chem-panel.collapsed #chem-summary { display: none !important; }
  .hist-chart-panel .hist-caret { font-size: 14px; color: var(--text-muted); transition: transform 0.2s; }
  .hist-chart-panel.collapsed .hist-caret { transform: rotate(-90deg); }
  /* Fullscreen toggle button in the PRD panel header — small icon button
     pinned to the right side, before the caret. stopPropagation on click
     so it doesn't trigger the header's collapse-toggle. */
  .hist-chart-fullscreen-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 13px; line-height: 1;
    margin-right: 0;
    font-family: inherit;
    flex: 0 0 auto;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  /* Chem / schedule panels: no stage-nav wrapper — pin lone fullscreen btn right */
  .hist-chart-header > .hist-chart-fullscreen-btn:first-of-type:not(.hist-stage-nav + .hist-chart-fullscreen-btn) {
    margin-left: auto;
  }
  .hist-chart-fullscreen-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
  }
  /* Fullscreen state — PRD panel covers the app viewport. Position fixed
     keeps the browser chrome accessible (so the engineer can still hit
     the back button, switch tabs, etc.) while the chart fills the
     available screen real estate. */
  .hist-chart-panel.fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 40;
    margin: 0; border-radius: 0;
    background: var(--bg-primary);
    display: flex; flex-direction: column;
    padding: 0;
  }
  .hist-chart-panel.fullscreen .hist-chart-header { flex: 0 0 auto; }
  .hist-chart-panel.fullscreen .hist-trim-toolbar,
  .hist-chart-panel.fullscreen .hist-patch-panel,
  .hist-chart-panel.fullscreen .prd-map-panel,
  .hist-chart-panel.fullscreen #stage-summary,
  .hist-chart-panel.fullscreen #etest-stage-summary,
  .hist-chart-panel.fullscreen .hist-wellbore-caps { flex: 0 0 auto; }
  .hist-chart-panel.fullscreen .hist-chart-body {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    padding: 8px;
  }
  .hist-chart-panel.fullscreen .hist-canvas-wrap {
    flex: 1 1 auto; height: auto !important; min-height: 0;
  }
  /* Hide the chart-body resize handle in fullscreen — the panel is
     filling the viewport, no manual sizing needed. */
  .hist-chart-panel.fullscreen .hist-resize-handle { display: none; }
  .hist-chart-panel.fullscreen .hist-zoom-bar { flex: 0 0 auto; }
  /* Stage navigator — lives in the PRD title bar with the fullscreen
     button. Always visible so the engineer has a fast prev/next
     regardless of where the chip strip is scrolled to. Arrows sized
     for 4K displays; X/N indicator keeps the engineer oriented through
     long stage counts. */
  .hist-stage-nav {
    display: inline-flex; align-items: center; gap: 6px;
    flex: 0 0 auto;
    margin-left: 0;
    margin-right: 0;
    cursor: default;
  }
  .hist-chart-header-actions .hist-caret {
    flex: 0 0 auto;
  }
  .hist-stage-nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 18px; line-height: 1;
    font-family: inherit;
    min-width: 32px;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  .hist-stage-nav-btn:hover:not(:disabled) {
    border-color: var(--text-muted);
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
  }
  .hist-stage-nav-btn:active:not(:disabled) {
    background: rgba(255,255,255,0.12);
  }
  .hist-stage-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }
  .hist-stage-nav-indicator {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; font-weight: 700;
    color: var(--text-secondary);
    padding: 0 4px;
    min-width: 64px; text-align: center;
    letter-spacing: 0.5px;
    text-transform: none;
  }
  .hist-stage-nav-indicator .hist-stage-nav-sep { color: var(--text-muted); font-weight: 500; }
  #hist-stage-nav-num { color: var(--title-strong); }
  .hist-canvas-wrap { position: relative; width: 100%; height: 320px; min-height: 200px; }
  .hist-canvas-wrap canvas { width: 100% !important; height: 100% !important; }
  /* PRD chart row — pressure-slider column on the left, canvas in the
     middle, rate + concentration slider columns on the right (visible
     only in fullscreen). All three slider columns share styling. */
  .hist-prd-grid {
    display: flex; gap: 6px;
    width: 100%;
  }
  .hist-chart-panel.fullscreen .hist-prd-grid { flex: 1 1 auto; min-height: 0; }
  .hist-chart-panel.fullscreen .hist-prd-grid .hist-canvas-wrap {
    flex: 1 1 auto; height: auto !important; min-height: 0;
  }
  .hist-prd-grid .hist-canvas-wrap { flex: 1 1 auto; }
  .hist-yzoom-col {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    width: 22px;
    padding: 4px 0;
    flex: 0 0 auto;
  }
  .hist-yzoom-fullscreen-only { display: none; }
  .hist-chart-panel.fullscreen .hist-yzoom-fullscreen-only { display: flex; }
  #hist-prd-panel.zoom-controls-hidden .hist-yzoom-col,
  #hist-prd-panel.zoom-controls-hidden .hist-zoom-bar {
    display: none !important;
  }
  .hist-yzoom-track {
    position: relative;
    flex: 1 1 auto; min-height: 100px;
    width: 22px;
  }
  .hist-yzoom-track .hyz-bg {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%; transform: translateX(-50%);
    width: 4px;
    background: var(--border); border-radius: 2px;
  }
  .hist-yzoom-track .hyz-fill {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    width: 12px;
    background: var(--accent); border-radius: 3px;
    opacity: 0.55; cursor: grab;
  }
  .hist-yzoom-track .hyz-fill:hover { opacity: 0.75; }
  .hist-yzoom-track .hyz-fill.dragging { cursor: grabbing; opacity: 0.85; }
  /* Rectangular thumbs — same 16×12 shape as x-axis zoom / RSD Y-zoom (.rsd-yz-thumb). */
  .hist-yzoom-track .hyz-thumb {
    position: absolute;
    left: 50%; transform: translate(-50%, -50%);
    width: 16px; height: 12px; border-radius: 3px;
    background: var(--accent);
    border: 1px solid var(--bg-secondary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    cursor: ns-resize;
    z-index: 2;
  }
  .hist-yzoom-track .hyz-thumb:hover { filter: brightness(1.15); }
  .hist-yzoom-track .hyz-thumb.dragging { box-shadow: 0 1px 6px rgba(0,0,0,0.7); }
  .hist-yzoom-col .hyz-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px; font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-muted);
  }
  /* Tint the slider parts per axis color so the engineer can map a
     slider to its chart line at a glance. */
  .hist-yzoom-col[data-axis="y"]  .hyz-thumb,
  .hist-yzoom-col[data-axis="y"]  .hyz-fill  { background: #e74c3c; }
  .hist-yzoom-col[data-axis="y1"] .hyz-thumb,
  .hist-yzoom-col[data-axis="y1"] .hyz-fill  { background: #3498db; }
  .hist-yzoom-col[data-axis="y2"] .hyz-thumb,
  .hist-yzoom-col[data-axis="y2"] .hyz-fill  { background: #f39c12; }
  /* Drag strip between chart and time slider — grip + label so users spot it
     without hovering first. */
  .hist-resize-handle {
    flex: 0 0 auto;
    height: 14px;
    cursor: ns-resize;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
  }
  .hist-resize-handle .hist-resize-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    user-select: none;
  }
  .hist-resize-grip {
    width: 28px;
    height: 6px;
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.7;
    background:
      linear-gradient(currentColor, currentColor) center 0 / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) center 50% / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) center 100% / 100% 2px no-repeat;
    transition: color 0.15s, opacity 0.15s;
  }
  .hist-resize-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.85;
    transition: color 0.15s, opacity 0.15s;
  }
  .hist-resize-handle:hover,
  .hist-resize-handle.dragging {
    background: var(--accent);
    border-top-color: var(--accent);
  }
  .hist-resize-handle:hover .hist-resize-grip,
  .hist-resize-handle:hover .hist-resize-hint,
  .hist-resize-handle.dragging .hist-resize-grip,
  .hist-resize-handle.dragging .hist-resize-hint {
    color: #ffffff;
    opacity: 1;
  }

  /* Zone button strip */
  .zone-btn-strip {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 0 4px;
  }
  .zone-btn {
    min-width: 32px; padding: 4px 8px; border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    color: var(--text-secondary); background: var(--bg-tertiary);
    border: 1px solid var(--border); cursor: pointer; transition: all 0.12s; text-align: center;
  }
  .zone-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
  .zone-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .zone-btn.loading { opacity: 0.5; pointer-events: none; }

  /* Stage summary cards — inside PRD panel, between title bar and trim toolbar */
  #hist-prd-panel > #stage-summary {
    padding: 10px 14px;
    margin: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
  }
  .stage-summary {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
  }
  #hist-prd-panel > #stage-summary.stage-summary {
    margin-bottom: 0;
  }
  /* Chemical totals — inside chem panel, between title bar and toolbar */
  #hist-chem-panel > #chem-summary {
    padding: 10px 14px;
    margin: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
  }
  #hist-chem-panel > #chem-summary.stage-summary {
    margin-bottom: 0;
  }
  .ss-card {
    flex: 1; min-width: 120px; padding: 8px 12px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 5px;
  }
  .ss-label { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
  .ss-value { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: var(--title-strong); }
  .ss-unit { font-size: 10px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
  .ss-var { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 500; margin-top: 4px; letter-spacing: 0.3px; }
  .ss-var-ok   { color: #4ade80; }   /* within ±2% of design */
  .ss-var-warn { color: #e6a542; }   /* 2-10% deviation */
  .ss-var-bad  { color: #e74c3c; }   /* >10% deviation */
  .ss-var-na   { color: var(--text-muted); font-style: italic; }  /* no design mapping */

  /* Chem diagnostic cards (Completed Stages test tab) — status dot +
     click-to-isolate affordance. The dot is colored inline (green /
     yellow / red / gray by |variance| vs design). */
  .ss-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 0.5px; }
  #etest-chem-summary .ss-card { cursor: pointer; user-select: none; transition: border-color 0.12s ease; position: relative; }
  #etest-chem-summary .ss-card:hover { border-color: var(--text-muted); }
  #etest-chem-summary .ss-card.selected { border-color: #3498db; box-shadow: inset 0 0 0 1px #3498db; }

  /* Phase 2 — selected-chemical diagnostic mode (Completed Stages test
     tab). DIAG chip on each chem card (fades in on hover), the diag
     header bar (back button + tolerance input), and the KPI card row. */
  .ss-diag-btn {
    position: absolute; top: 5px; right: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
    background: transparent; border: 1px solid var(--border); border-radius: 3px;
    padding: 1px 5px; cursor: pointer; user-select: none; opacity: 0.5;
    transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  }
  #etest-chem-summary .ss-card:hover .ss-diag-btn { opacity: 1; }
  .ss-diag-btn:hover { color: #3498db; border-color: #3498db; }
  .chem-diag-bar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 7px 14px; background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-secondary);
  }
  .chem-diag-title { font-weight: 700; color: var(--title-strong); letter-spacing: 0.4px; }
  .chem-diag-tol { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); cursor: default; }
  .chem-diag-tol input {
    width: 48px; padding: 2px 4px; text-align: right;
    background: var(--bg-tertiary); color: var(--title-strong);
    border: 1px solid var(--border); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .chem-diag-prov {
    font-size: 8px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); font-style: italic; margin-left: 4px;
  }
  .chem-diag-note { color: var(--text-muted); font-style: italic; }
  #etest-chem-diag-kpis {
    padding: 8px 14px; margin: 0;
    background: var(--bg-primary); border-bottom: 1px solid var(--border);
  }
  #etest-chem-diag-kpis .ss-sub {
    font-family: 'JetBrains Mono', monospace; font-size: 8px;
    letter-spacing: 0.4px; color: var(--text-muted); margin-top: 3px;
  }
  /* Conc / % Dsn / Rate buttons don't drive the diag layout — gray them
     while the diagnostic view owns the panel. */
  #etest-chem-toolbar .trim-btn[disabled] { opacity: 0.35; pointer-events: none; }

  /* Wellbore capacity strip — PRD panel footer: pumped-volume landmarks
     (kickoff, perfs, treatment-path casing) for transit + chart review. */
  .hist-wellbore-caps {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; line-height: 1.45;
    color: var(--text-secondary);
    padding: 8px 14px; margin: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 4px 12px;
  }
  #hist-prd-panel > .hist-wellbore-caps,
  #hist-prd-panel > .hist-resize-handle {
    flex: 0 0 auto;
  }
  .hist-wellbore-caps .hwc-tag {
    font-size: 8.5px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
    margin-right: 4px;
  }
  .hist-wellbore-caps .hwc-item { display: inline-flex; align-items: baseline; gap: 4px; }
  .hist-wellbore-caps .hwc-label {
    font-size: 9px; font-weight: 600; letter-spacing: 0.5px;
    text-transform: uppercase; color: var(--text-muted);
  }
  .hist-wellbore-caps .hwc-md { color: var(--text-secondary); }
  .hist-wellbore-caps .hwc-vol {
    color: #93c5fd; font-weight: 700;
  }
  .hist-wellbore-caps .hwc-unit { font-size: 9px; color: var(--text-muted); margin-left: 2px; }
  .hist-wellbore-caps .hwc-sep { color: var(--text-muted); }
  .hist-wellbore-caps .hwc-warn {
    color: #e6a542; font-style: italic; font-size: 9.5px;
  }
  .hist-wellbore-caps .hwc-empty {
    color: var(--text-muted); font-style: italic;
  }
  /* Surface-volume inline input — small numeric field at the end of the
     strip. Matches the muted monospace styling of the rest of the line. */
  .hist-wellbore-caps .hwc-surf-input {
    width: 48px;
    padding: 1px 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 600;
    text-align: right;
  }
  .hist-wellbore-caps .hwc-surf-input:focus {
    outline: 1px solid #93c5fd;
    outline-offset: 0;
  }
  .hist-wellbore-caps .hwc-surf-item .hwc-unit { margin-left: 2px; }

  /* Transit analysis overlay — sits on top of the PRD canvas, drawn only
     while Transit Analysis is armed. Pointer-events disabled so it can
     never steal cursor input from the chart / step overlay underneath.
     Three primitives: cursor anchor (where fluid leaves), kickoff line
     (when that fluid reaches 86°), and the perf band (a thin shaded
     region between top and bottom perf arrival times — usually <2 bbl). */
  .transit-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .transit-overlay .tr-line {
    position: absolute; top: 0; bottom: 0;
    width: 0; border-left: 1.5px dashed;
  }
  .transit-overlay .tr-line.tr-cursor   { border-color: rgba(147,197,253,0.85); }   /* anchor — blue */
  .transit-overlay .tr-line.tr-kickoff  { border-color: rgba(230,165,66,0.95); }    /* kickoff — amber */
  .transit-overlay .tr-band {
    position: absolute; top: 0; bottom: 0;
    background: rgba(231,76,60,0.18);
    border-left: 1.5px solid rgba(231,76,60,0.85);
    border-right: 1.5px solid rgba(231,76,60,0.85);
    min-width: 2px;
  }
  .transit-overlay .tr-label {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700;
    padding: 2px 6px; border-radius: 3px;
    background: rgba(0,0,0,0.78);
    color: #fff;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  }
  .transit-overlay .tr-label.tr-cursor-lbl  { color: #93c5fd; top: 4px; }
  .transit-overlay .tr-label.tr-kickoff-lbl { color: #e6a542; top: 22px; }
  .transit-overlay .tr-label.tr-perf-lbl    { color: #f5a99c; top: 40px; }
  .transit-overlay .tr-label.tr-warn        { color: #e74c3c; }
  /* ΔPfric color chips inside transit labels. The reading is the same
     across all three landmarks so use a shared sign/magnitude palette:
     up-hi (>+300 psi) red, up (+100 to +300) amber, dn (<−100 psi) green,
     neutral white. Chip stays inline with the rest of the label. */
  .transit-overlay .tr-fric {
    font-weight: 700;
    padding: 1px 5px; border-radius: 3px;
    background: rgba(255,255,255,0.06);
  }
  .transit-overlay .tr-fric.tr-fric-up-hi   { color: #ff6b6b; background: rgba(231,76,60,0.22); }
  .transit-overlay .tr-fric.tr-fric-up      { color: #e6a542; background: rgba(230,165,66,0.18); }
  .transit-overlay .tr-fric.tr-fric-dn      { color: #4ade80; background: rgba(74,222,128,0.18); }
  .transit-overlay .tr-fric.tr-fric-neutral { color: #cbd5e1; }

  /* When transit mode is armed, hint cursor + dim the step-marker overlay
     so the engineer focuses on the prediction, and the chart picks up
     a crosshair feel. */
  #hist-prd-wrap.transit-armed { cursor: crosshair; }
  #hist-prd-wrap.transit-armed #hist-prd-overlay { opacity: 0.55; }
  /* While pinned, drop the crosshair so the user can grab the zoom slider
     and other controls without the cursor implying the chart is still
     tracking. The transit overlay itself stays drawn. */
  #hist-prd-wrap.transit-pinned { cursor: default; }
  /* Pinned styling — make the cursor anchor + label visually distinct
     from the live "follow my mouse" state. Brighter, fully opaque blue
     plus a small pin glyph in the label. */
  .transit-overlay .tr-line.tr-cursor.tr-pinned { border-color: rgba(59,130,246,1); border-left-style: solid; }
  .transit-overlay .tr-label.tr-cursor-lbl.tr-pinned {
    color: #fff;
    background: rgba(37,99,235,0.92);
    box-shadow: 0 1px 6px rgba(37,99,235,0.55);
  }
  /* Toolbar button armed state — match other arm-able trim-btns. */
  #hist-transit-toggle.armed {
    background: rgba(147,197,253,0.18);
    border-color: rgba(147,197,253,0.55);
    color: #93c5fd;
  }
  /* Paired button group — Transit Analysis + gear icon read as one
     compound control by sharing the seam between them. */
  .trim-btn-group .trim-btn-paired-left  { border-top-right-radius: 0; border-bottom-right-radius: 0; }
  .trim-btn-group .trim-btn-paired-right {
    border-top-left-radius: 0; border-bottom-left-radius: 0;
    border-left-width: 0;
    padding-left: 6px; padding-right: 6px;
    font-size: 12px;
  }
  .trim-btn-group .trim-btn-paired-right.trim-btn-gear { line-height: 1; }
  #hist-transit-toggle.armed + .trim-btn-paired-right {
    border-color: rgba(147,197,253,0.55);
    color: #93c5fd;
  }
  #hist-transit-settings-btn.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
  }
  /* Settings popup — anchored under the gear, floats above the toolbar. */
  /* Live Wellbore Transit — geometry status readout in the settings popup. */
  .transit-settings-popup .tsp-status {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; line-height: 1.5;
    color: var(--text-secondary);
  }
  .transit-settings-popup .tsp-status-head { font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
  .transit-settings-popup .tsp-status-dim  { color: var(--text-muted); }
  .transit-settings-popup .tsp-status-warn { color: #e67e22; }
  .transit-settings-popup {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 240px;
    max-width: 320px;   /* abs-positioned popups shrink-to-fit: without a cap, one
                           long hint line stretches the popup to max-content width */
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  }
  .transit-settings-popup .tsp-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
  }
  .transit-settings-popup .tsp-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px; line-height: 1;
    padding: 0 6px;
    border-radius: 3px;
  }
  .transit-settings-popup .tsp-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
    border-color: var(--border);
  }
  .transit-settings-popup .tsp-row {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 0;
    cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11.5px;
    color: var(--text-primary);
  }
  .transit-settings-popup .tsp-row input[type="checkbox"] { cursor: pointer; }
  .transit-settings-popup .tsp-label { flex: 1; }
  /* Status line beneath a diagnostic toggle — surfaces WHY a diagnostic
     isn't drawing (no survey, no treatment-path casing flagged, etc.)
     so the engineer doesn't have to debug from DevTools. Hidden when
     empty so the popup stays compact in the happy path. */
  .transit-settings-popup .dp-status {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 10px;
    font-style: italic;
    line-height: 1.35;
    color: var(--text-muted);
    margin: -2px 0 4px 22px;
    max-width: 280px;
  }
  .transit-settings-popup .dp-status:empty { display: none; }
  .transit-settings-popup .dp-status.dp-status-warn { color: #e6a542; }
  .transit-settings-popup .tsp-divider {
    height: 1px; background: var(--border); margin: 6px -2px;
  }
  .transit-settings-popup .tsp-num {
    width: 52px;
    padding: 2px 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; font-weight: 600;
    text-align: right;
  }
  .transit-settings-popup .tsp-unit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; color: var(--text-muted);
  }
  /* When Use Surface Volume is unchecked, mute the numeric input so it's
     visually clear the value isn't active. */
  .transit-settings-popup .tsp-num[disabled] {
    opacity: 0.45; cursor: not-allowed;
  }

  /* Trend Analysis overlay — sits over the PRD canvas, SVG draws the fit
     + forecast line, an absolutely-positioned div carries the slope /
     forecast-pressure label. Pointer-events disabled so the trend tool's
     own click-to-arm handler on the wrap can fire. */
  .trend-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .trend-overlay .trend-svg { width: 100%; height: 100%; display: block; }
  /* Trend callout — pinned to the top-right of the chart area by default,
     compact multi-line readout. Stays out of the data so it never covers
     the line being analyzed. Draggable: mousedown anywhere on the box
     moves it; saved position persists across reloads and stages. */
  .trend-overlay .trend-label {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 600;
    line-height: 1.35;
    padding: 6px 9px; border-radius: 4px;
    background: rgba(0,0,0,0.82);
    border: 1px solid rgba(251,191,119,0.4);
    color: #fbbf77;
    box-shadow: 0 2px 8px rgba(0,0,0,0.45);
    pointer-events: auto;
    cursor: grab;
    user-select: none;
  }
  .trend-overlay .trend-label.tl-dragging,
  .trend-overlay .trend-label:active { cursor: grabbing; }
  /* trend-info is the instructional placeholder while armed but no fit
     yet — keep it non-interactive so cursor passes through to the chart. */
  .trend-overlay .trend-info {
    pointer-events: none; cursor: default;
  }
  .trend-overlay .trend-label .tl-head {
    font-size: 9px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
    display: block; margin-bottom: 2px;
  }
  .trend-overlay .trend-label .tl-slope {
    font-size: 13px; font-weight: 700;
    display: block;
  }
  /* Secondary slope (psi/bbl) — smaller than the primary psi/min line
     but still bold, with a slight color shift so it reads as a related
     sub-metric rather than competing for attention. */
  .trend-overlay .trend-label .tl-slope-2 {
    display: block;
    font-size: 11px; font-weight: 700;
    color: #f5d6a0;
    margin-top: 1px;
  }

  /* Design-overlay end tags — small floating labels anchored to where
     the dashed design lines drop to zero. Rate tag carries the time +
     volume deltas (vs design); conc tag carries the proppant-mass delta.
     Color-coded to match the corresponding line and axis. */
  .design-end-tag {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 600;
    padding: 3px 7px;
    border-radius: 3px;
    background: rgba(0,0,0,0.82);
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.35;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
  }
  .design-end-tag-rate {
    color: #93c5fd;
    border: 1px solid rgba(52,152,219,0.55);
  }
  .design-end-tag-conc {
    color: #fbbf77;
    border: 1px solid rgba(243,156,18,0.55);
  }
  .design-end-tag .det-head {
    display: block;
    font-size: 8px; font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 1px;
  }
  .design-end-tag .det-val {
    display: inline-block;
    font-weight: 700;
  }
  .design-end-tag .det-sep { color: var(--text-muted); margin: 0 3px; }
  /* Quality-coded color hints on each value — matches the Stage
     Scorecard's "did we hit design?" reading rather than a generic
     over/under direction. For proppant (high-good): under-delivery is
     the failure mode; over is neutral. For time + fluid (symmetric):
     either direction's deviation is the failure. Colors picked to avoid
     channel collisions: green/teal (success), amber (caution), red
     (failure), neutral (no base). */
  .design-end-tag .det-good    { color: #4ade80; }   /* close to / better than design */
  .design-end-tag .det-warn    { color: #e6a542; }   /* moderate deviation */
  .design-end-tag .det-bad     { color: #ff6b6b; }   /* significant miss */
  .design-end-tag .det-neutral { color: inherit; }
  .trend-overlay .trend-label .tl-meta {
    display: block; font-weight: 500;
    color: #f1f5f9; opacity: 0.85;
    font-size: 9.5px;
    margin-top: 2px;
  }
  .trend-overlay .trend-label .tl-fcast {
    display: block;
    color: #fbbf77; font-weight: 700;
    margin-top: 2px;
  }
  .trend-overlay .trend-info {
    position: absolute; left: 50%; top: 8px;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 600;
    padding: 4px 8px; border-radius: 3px;
    background: rgba(0,0,0,0.78);
    color: #fbbf77;
  }
  /* Crosshair cursor while Trend Analysis is armed so it's clear a click
     places the anchor. Cursor on the wrap, not the canvas, so it survives
     chart rebuilds. While drag-creating, EW resize cursor; while hovering
     a fit end-handle, EW resize so the engineer knows it's grabbable. */
  #hist-prd-wrap.trend-armed { cursor: crosshair; }
  #hist-prd-wrap.trend-dragging { cursor: ew-resize; }
  #hist-prd-wrap.trend-near-handle { cursor: ew-resize; }
  /* ECharts test panel uses the same .trend-overlay/.trend-band/.trend-label
     CSS, but its wrap has a different id — mirror the cursor rules so
     arming/dragging/handle-hover read the same in both tabs. */
  #etest-prd-wrap.trend-armed { cursor: crosshair; }
  #etest-prd-wrap.trend-dragging { cursor: ew-resize; }
  #etest-prd-wrap.trend-near-handle { cursor: ew-resize; }
  /* Y-axis top drag affordance — hover the top portion of any y-axis to
     see the ns-resize cursor, then click + drag DOWN to lower that
     axis's max (cursor stays "glued to" the new max during the drag).
     Dblclick to reset. .yaxis-dragging keeps the cursor active while
     the drag wanders outside the hit zone. */
  #etest-prd-wrap.yaxis-top-hover { cursor: ns-resize; }
  #etest-prd-wrap.yaxis-dragging  { cursor: ns-resize; }
  /* Translucent amber selection band painted under the fit line — both
     during drag-creating and persistently after the fit is placed. The
     band's left/right edges are the regression's data range. */
  .trend-overlay .trend-band {
    fill: rgba(245,158,11,0.13);
    stroke: rgba(245,158,11,0.35);
    stroke-width: 1;
    stroke-dasharray: 2,3;
  }
  /* Hit-test target zones for the two end-handles. Invisible SVG rects
     sized wider than the visible tick so the grab area is forgiving. */
  .trend-overlay .trend-handle-hit {
    fill: rgba(245,158,11,0); /* invisible but hit-testable */
  }
  #hist-trend-toggle.armed,
  #etest-prd-trend-toggle.armed {
    background: rgba(245,158,11,0.18);
    border-color: rgba(245,158,11,0.55);
    color: #fbbf77;
  }
  #hist-trend-toggle.armed + .trim-btn-paired-right,
  #etest-prd-trend-toggle.armed + .trim-btn-paired-right {
    border-color: rgba(245,158,11,0.55);
    color: #fbbf77;
  }
  #hist-trend-settings-btn.active,
  #etest-prd-trend-settings-btn.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
  }
  .trsp-clear-btn {
    width: 100%;
    margin-top: 4px;
  }
  /* When the engineer's last picked forecast mode was "Fixed", let the
     inline minute input still read as the active value even though the
     radio next to it is the focus. Disabled state is mid-opacity. */
  .transit-settings-popup .tsp-num[disabled] { opacity: 0.45; cursor: not-allowed; }

  /* X-axis dual-thumb zoom slider (overlaid on single track) */
  .hist-zoom-bar {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: var(--bg-tertiary); border-radius: 0 0 6px 6px;
  }
  .hist-zoom-track {
    flex: 1; position: relative; height: 20px;
  }
  .hist-zoom-track .hz-bg {
    position: absolute; top: 8px; left: 0; right: 0; height: 4px;
    background: var(--border); border-radius: 2px;
  }
  .hist-zoom-track .hz-fill {
    position: absolute; top: 4px; height: 12px;
    background: var(--accent); border-radius: 3px; cursor: grab; opacity: 0.6;
  }
  .hist-zoom-track .hz-fill:hover { opacity: 0.8; }
  .hist-zoom-track .hz-fill.dragging { cursor: grabbing; opacity: 0.9; }
  .hist-zoom-track input[type=range] {
    position: absolute; top: 0; left: 0; width: 100%; height: 20px;
    -webkit-appearance: none; appearance: none;
    background: transparent; outline: none; pointer-events: none;
  }
  /* Rectangular thumbs — same shape as Y-axis zoom (.rsd-yz-thumb / .sc-yz-thumb). */
  .hist-zoom-track input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 16px; border-radius: 3px;
    background: var(--accent); cursor: pointer; border: 1px solid var(--bg-secondary);
    pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  }
  .hist-zoom-bar .hz-range { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-secondary); min-width: 100px; text-align: center; white-space: nowrap; }

  /* Stage trim + step marker toolbar */
  .hist-trim-toolbar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 6px 10px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
  }
  .trim-btn {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
    padding: 4px 10px; border-radius: 3px; cursor: pointer;
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border); transition: all 0.12s;
  }
  .trim-btn:hover { border-color: var(--accent); color: var(--text-primary); }
  .trim-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .trim-btn.primary:hover { filter: brightness(1.1); }
  .trim-btn.danger:hover { border-color: var(--danger, #e74c3c); color: var(--danger, #e74c3c); }
  .trim-btn.armed { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--accent-glow); }
  .trim-btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
  .trim-btn.locked { background: #f39c12; border-color: #f39c12; color: #1a1a1a; }
  .trim-btn.locked:hover { filter: brightness(1.05); }
  /* Floating hint for the click-to-toggle x-axis name (Job Time ⇄ Time of Day).
     position:fixed + follows the cursor; centered on it via the -50% transform. */
  .lo-axhint {
    position: fixed; z-index: 10050; pointer-events: none;
    transform: translateX(-50%); opacity: 0; transition: opacity 0.12s;
    background: rgba(13,21,37,0.96); border: 1px solid rgba(159,179,209,0.35);
    color: #dbe6f3; font-family: 'JetBrains Mono', monospace; font-size: 11px;
    padding: 4px 9px; border-radius: 5px; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  }
  .lo-axhint.show { opacity: 1; }
  /* Show-Flags toggle — small checkbox styled to sit beside the trim
     buttons. Toggles only the step markers on the chart. A separate
     Tools caret right after it collapses the step-management controls,
     and the Show-Notes toggle hides the Add Note button. */
  .trim-checkbox {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; user-select: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--text-secondary);
    padding: 4px 4px;
  }
  .trim-checkbox:hover { color: var(--text-primary); }
  .trim-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
  }
  .step-overlay.flags-hidden .step-marker { display: none; }
  .hist-trim-toolbar.tools-collapsed .hist-step-mgmt-btn { display: none; }
  .hist-trim-toolbar.notes-hidden .hist-note-mgmt-btn { display: none; }
  /* Tools-collapse caret — small button between the Show-Flags / Show-Notes
     checkboxes and the step-editing controls. Caret rotates when collapsed. */
  .hist-tools-caret {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; line-height: 1;
    padding: 3px 7px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s;
  }
  .hist-tools-caret:hover { color: var(--text-primary); border-color: var(--accent); }
  .hist-tools-caret .htc-glyph { display: inline-block; transition: transform 0.15s; }
  .hist-trim-toolbar.tools-collapsed .hist-tools-caret .htc-glyph { transform: rotate(-90deg); }
  /* Diagnostics paired button — main button toggles visibility of all
     selected diagnostic lines; gear opens the selection popup.
     Teal-500 hue: saturated enough to read as an active state on the
     dark theme without washing out on the light-mode white toolbar,
     and distinct from Transit (blue) and Trend (amber). */
  #hist-diag-toggle.armed {
    background: rgba(20,184,166,0.18);
    border-color: rgba(20,184,166,0.65);
    color: #14b8a6;
  }
  #hist-diag-toggle.armed + .trim-btn-paired-right {
    border-color: rgba(20,184,166,0.65);
    color: #14b8a6;
  }
  #hist-diag-settings-btn.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
  }

  /* Annotation pins — free-form notes anchored to a time point on the
     chart. Pinned at the chart's bottom edge with a small icon and a
     dashed riser up through the plot area, so they stay clear of step
     flags at the top and the data traces in the middle. Author lives
     only in the edit popup, never on the chart, so screenshots and
     presentations stay clean. */
  .annotation-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .annotation-overlay.notes-hidden { display: none; }
  .annotation-overlay .annotation-marker {
    position: absolute;
    pointer-events: auto;
    transform: translateX(-50%);
    cursor: pointer;
    user-select: none;
  }
  .annotation-overlay .annotation-marker .am-line {
    position: absolute;
    left: 50%; top: 0;
    transform: translateX(-50%);
    width: 0;
    border-left: 1.5px dashed rgba(255,209,102,0.45);
  }
  .annotation-overlay .annotation-marker .am-pin {
    position: absolute;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    border: 1.5px solid rgba(255,209,102,0.85);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 12px; line-height: 1;
    color: #ffd166;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
  }
  .annotation-overlay .annotation-marker:hover .am-pin {
    background: rgba(255,209,102,0.18);
    border-color: rgba(255,209,102,1);
  }
  /* Note text label — lives INSIDE the pin so `bottom: 100%` anchors
     directly above the pin (not the full-height marker). Shown on
     hover; also shown unconditionally when the marker has the
     `.always-visible` class (set via the Always-visible checkbox in
     the edit popup). Vertical position is offset via inline style for
     drag-to-reposition; horizontal stays centered on the pin so the
     label-to-pin riser stays anchored to its data point. Width is
     user-resizable via the right-edge handle (height auto-fits content). */
  .annotation-overlay .annotation-marker .am-pin .am-label {
    position: absolute;
    left: 50%; bottom: 100%;
    transform: translateX(-50%) translateY(-6px);
    background: rgba(0,0,0,0.92);
    color: #f1f5f9;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 10.5px; font-weight: 500;
    padding: 5px 9px;
    border-radius: 3px;
    border: 1px solid rgba(255,209,102,0.55);
    min-width: 80px; max-width: 480px;
    white-space: normal;
    line-height: 1.4;
    display: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    pointer-events: auto;
    cursor: move;
    user-select: none;
  }
  .annotation-overlay .annotation-marker.label-dragging .am-pin .am-label {
    cursor: grabbing;
    border-color: rgba(255,209,102,1);
    box-shadow: 0 4px 12px rgba(255,209,102,0.25);
  }
  /* Width-resize handle on the right edge — thin invisible strip that
     turns amber on hover so the engineer can see they can grab it. */
  .annotation-overlay .annotation-marker .am-pin .am-label .am-label-handle {
    position: absolute;
    right: -4px; top: 6px; bottom: 6px;
    width: 8px;
    cursor: ew-resize;
    background: transparent;
    border-radius: 2px;
  }
  .annotation-overlay .annotation-marker .am-pin .am-label .am-label-handle:hover {
    background: rgba(255,209,102,0.45);
  }
  .annotation-overlay .annotation-marker:hover .am-pin .am-label,
  .annotation-overlay .annotation-marker.always-visible .am-pin .am-label { display: block; }
  /* When always-visible, give the label a faint border + slight emphasis
     so the engineer can tell at a glance which notes are pinned vs.
     which are just hover-preview. */
  .annotation-overlay .annotation-marker.always-visible .am-pin .am-label {
    border-color: rgba(255,209,102,0.85);
    box-shadow: 0 2px 8px rgba(255,209,102,0.18);
  }
  .annotation-overlay .annotation-marker.always-visible .am-pin {
    background: rgba(255,209,102,0.22);
  }

  /* Cursor hint while Add Note is armed — clicking on the chart places
     a fresh annotation at that time. */
  #hist-prd-wrap.note-arming { cursor: crosshair; }
  #hist-note-add.armed {
    background: rgba(255,209,102,0.18);
    border-color: rgba(255,209,102,0.55);
    color: #ffd166;
  }

  /* Edit / view popup — singleton, opens for a marker click or a freshly
     placed pin. Author + timestamp tucked into the footer (muted) so
     the popup itself doesn't read like a forum post but the metadata
     is still accessible. */
  .annotation-popup {
    position: absolute;
    z-index: 60;
    min-width: 260px; max-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,209,102,0.55);
    border-radius: 5px;
    padding: 10px 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.55);
    pointer-events: auto;
  }
  .annotation-popup .ap-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
  }
  .annotation-popup .ap-title { color: #ffd166; }
  .annotation-popup .ap-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px; line-height: 1;
    padding: 0 6px;
    border-radius: 3px;
  }
  .annotation-popup .ap-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
    border-color: var(--border);
  }
  .annotation-popup .ap-text {
    width: 100%; box-sizing: border-box;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 3px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px; line-height: 1.4;
    resize: vertical;
    min-height: 60px;
  }
  .annotation-popup .ap-text:focus {
    outline: 1px solid rgba(255,209,102,0.6);
    outline-offset: 0;
  }
  .annotation-popup .ap-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
  }
  .annotation-popup .ap-author {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--text-muted);
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .annotation-popup .ap-actions {
    display: inline-flex; gap: 6px;
  }
  .annotation-popup .ap-btn {
    padding: 4px 10px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
  }
  .annotation-popup .ap-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
  }
  .annotation-popup .ap-btn.primary {
    background: rgba(255,209,102,0.85);
    border-color: rgba(255,209,102,1);
    color: #1a1a1a;
  }
  .annotation-popup .ap-btn.primary:hover { filter: brightness(1.08); }
  .annotation-popup .ap-btn.ap-delete:hover {
    border-color: #e74c3c; color: #e74c3c;
  }
  /* Always-visible checkbox row — sits between the textarea and the
     footer. Compact, muted styling so it doesn't compete with the note. */
  .annotation-popup .ap-checkbox {
    display: flex; align-items: center; gap: 6px;
    margin: 8px 0 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    cursor: pointer; user-select: none;
  }
  .annotation-popup .ap-checkbox:hover { color: var(--text-primary); }
  .annotation-popup .ap-checkbox input[type="checkbox"] {
    accent-color: #ffd166;
    cursor: pointer;
    margin: 0;
  }
  /* When the stage is locked, marker boxes lose their drag affordance */
  .step-overlay.locked .step-marker .step-box { cursor: default; opacity: 0.85; }
  .step-overlay.locked .step-marker .step-box:hover { background: var(--bg-secondary); border-color: rgba(255,255,255,0.45); }
  .step-overlay.locked .step-marker.flag-one .step-box:hover,
  .step-overlay.locked .step-marker.flag-one .step-box { background: var(--accent); border-color: var(--accent); }
  .step-overlay.locked .step-marker.eof .step-box:hover,
  .step-overlay.locked .step-marker.eof .step-box { background: #f39c12; border-color: #f39c12; }
  /* echarts-prd-test panel: when steps are locked, the step badge
     still turns blue on hover so the user gets feedback that
     dblclick-zoom is available. Production overlays drop the blue
     hover when locked (rule above); these higher-specificity
     selectors restore it just for our test-tab overlays without
     affecting production. The × delete button + drag cursor stay
     suppressed via the inherited locked rules — only the blue hover
     comes back. */
  #etest-prd-step-overlay.locked .step-marker:hover .step-box,
  #etest-chem-step-overlay.locked .step-marker:hover .step-box,
  #etest-prd-step-overlay.locked .step-marker.flag-one:hover .step-box,
  #etest-chem-step-overlay.locked .step-marker.flag-one:hover .step-box,
  #etest-prd-step-overlay.locked .step-marker.eof:hover .step-box,
  #etest-chem-step-overlay.locked .step-marker.eof:hover .step-box {
    background: #3b82f6 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
  }
  .trim-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
  .trim-status {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-secondary); margin-left: auto; padding-left: 8px;
  }
  .trim-status .ts-dim { color: var(--text-muted); }
  .trim-status .ts-val { color: var(--text-primary); font-weight: 600; }

  /* Completed Stages (Test) — chart toggles share one style (toolbar + headers) */
  #fracops-echartstest .etest-chart-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-family: inherit;
    font-size: 11px;
    font-weight: normal;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
  }
  #fracops-echartstest .etest-chart-toggle input {
    margin: 0;
    cursor: pointer;
  }
  #fracops-echartstest .hist-chart-header .etest-chart-toggle {
    flex: 0 0 auto;
  }

  /* Step marker overlay (positioned over chart canvas) */
  .step-overlay {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  }
  /* While Insert Step is armed, the overlay must capture the click so a flag
     can be dropped. The base .step-overlay is pointer-events:none (so chart
     hover/zoom passes through); insert-mode re-enables it only while armed,
     then it reverts on disarm. Without this the left-click "place flag"
     gesture passed straight through the overlay and no flag was added. */
  .step-overlay.insert-mode { cursor: crosshair; pointer-events: auto; }
  /* Each marker positioned by left+top+height from JS so the box sits inside the
     chart plot area (under the legend) and the line spans the plot area. */
  .step-marker {
    position: absolute; width: 0;
    border-left: 1px dashed rgba(255,255,255,0.35);
    pointer-events: none;
  }
  .step-marker.eof { border-left-color: #f39c12; border-left-style: solid; }
  .step-marker .step-box {
    position: absolute; top: 0; left: -11px;
    min-width: 22px; height: 18px; padding: 0 4px;
    background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.45);
    border-radius: 3px; cursor: ew-resize; pointer-events: auto;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    color: #f1f5f9; display: flex; align-items: center; justify-content: center;
    user-select: none; transition: background 0.1s, border-color 0.1s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  }
  .step-marker .step-box:hover { background: var(--accent); border-color: var(--accent); }
  .step-marker.dragging .step-box { background: var(--accent); border-color: var(--accent); }
  .step-marker.eof .step-box {
    background: #f39c12; border-color: #f39c12; color: #1a1a1a;
    left: -16px; min-width: 32px;
  }
  .step-marker.eof .step-box:hover { background: #f5a623; }
  /* Highlight Flag 1 + EOF since they drive the trim window */
  .step-marker.flag-one .step-box {
    background: var(--accent); border-color: var(--accent); color: #fff;
  }
  /* Hover-only delete button for step markers (also right-click works).
     Hidden on EOF and when the stage is locked. */
  .step-marker .step-del {
    position: absolute; top: -9px; left: -7px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #e74c3c; color: #fff; border: 1px solid var(--bg-secondary);
    display: none; align-items: center; justify-content: center;
    font-size: 10px; line-height: 1; cursor: pointer; pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5); padding: 0;
  }
  .step-marker:hover .step-del { display: flex; }
  .step-marker .step-del:hover { background: #c0392b; transform: scale(1.15); }
  .step-overlay.locked .step-marker:hover .step-del,
  .step-marker.eof .step-del { display: none !important; }

  /* Channel patch panel — collapsible editor for masking out bad channel data
     (e.g. densometer not yet zeroed, mag-meter spikes during shutdown).
     Each patch applies a multiplier + offset to a single channel within a raw
     time window and persists in the per-stage overrides JSON. */
  .hist-patch-panel {
    padding: 8px 10px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
  }
  .patch-form {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); letter-spacing: 0.3px;
  }
  .patch-form .pf-label { color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
  .patch-form input, .patch-form select {
    padding: 3px 6px; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }
  .patch-form input[type=number] { width: 64px; }
  .patch-form select { min-width: 140px; }
  .patch-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
  .patch-list:empty::before {
    content: 'No channel patches'; color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .patch-chip {
    padding: 3px 4px 3px 8px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px;
  }
  .patch-chip .chip-x {
    cursor: pointer; color: var(--text-muted); padding: 1px 5px;
    border-radius: 50%; transition: color 0.1s, background 0.1s; line-height: 1;
  }
  .patch-chip .chip-x:hover { color: #fff; background: rgba(231,76,60,0.6); }
  .patch-chip .chip-channel { color: var(--text-primary); font-weight: 600; }

  /* Patch range bands drawn over the chart so the user sees what's masked */
  .patch-band {
    position: absolute; pointer-events: none;
    border-left: 1px dotted rgba(255,255,255,0.4);
    border-right: 1px dotted rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.04);
    overflow: hidden;
  }
  .patch-band .pb-label {
    position: absolute; bottom: 1px; left: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px;
    color: rgba(255,255,255,0.7); white-space: nowrap;
    text-shadow: 0 0 2px rgba(0,0,0,0.8);
  }
  .patch-band[data-channel=pressure] { background: rgba(231,76,60,0.10); border-color: rgba(231,76,60,0.5); }
  .patch-band[data-channel=rate]     { background: rgba(52,152,219,0.10); border-color: rgba(52,152,219,0.5); }
  .patch-band[data-channel=proppant] { background: rgba(243,156,18,0.10); border-color: rgba(243,156,18,0.5); }
  .patch-band[data-channel=inline]   { background: rgba(46,204,113,0.10); border-color: rgba(46,204,113,0.5); }
  .patch-band[data-channel=blender]  { background: rgba(139,69,19,0.15); border-color: rgba(139,69,19,0.5); }

  /* Chemical channel mapping (Chemical Additives Plot toolbar + panel) */
  .chem-toolbar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 6px 10px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
  }
  .chem-toolbar .ts-val { color: var(--text-primary); font-weight: 600; }
  .chem-toolbar .ts-dim { color: var(--text-muted); }
  .chem-map-panel {
    padding: 10px 12px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    max-height: 360px; overflow-y: auto;
  }
  .chem-map-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
  }
  .chem-map-row:last-child { margin-bottom: 0; }
  .chem-map-row .cm-label {
    flex: 0 0 88px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.5px; color: var(--title-strong); text-transform: uppercase;
  }
  .chem-map-row .cm-sub {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px;
    flex: 0 0 32px;
  }
  .chem-map-row select {
    flex: 1; min-width: 120px;
    padding: 3px 6px; background: var(--bg-tertiary);
    border: 1px solid var(--border); color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    border-radius: 3px;
  }
  .chem-map-row select:focus { outline: none; border-color: var(--accent); }
  /* Axis picker (y1/y2/y3) — compact, doesn't grow like the header selects. */
  .chem-map-row select.cm-axis { flex: 0 0 52px; min-width: 0; }
  .chem-map-row.matched .cm-label { color: #2ecc71; }
  /* Alias input for the extra (user-named) chemical rows — sits where the
     fixed cm-label sits on standard rows, same width, but editable. */
  .chem-map-row .cm-alias {
    flex: 0 0 88px;
    padding: 3px 6px; background: var(--bg-tertiary);
    border: 1px solid var(--border); color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.5px; border-radius: 3px;
  }
  .chem-map-row .cm-alias::placeholder { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
  .chem-map-row .cm-alias:focus { outline: none; border-color: var(--accent); }
  .chem-map-row.matched .cm-alias { color: #2ecc71; border-color: #2ecc71; }
  /* Divider label between the fixed CHEM_DEFS rows and the extra slots. */
  .chem-map-divider {
    margin: 8px 0 6px; font-family: 'JetBrains Mono', monospace; font-size: 9px;
    text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted);
    border-top: 1px solid var(--border); padding-top: 7px;
  }
  /* Y-axis max controls row (y1/y2/y3 numeric inputs) above the chem rows. */
  .chem-axis-max-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
  }
  .chem-axis-max-row .cm-axmax {
    flex: 0 0 60px; min-width: 0; padding: 3px 6px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
    font-size: 10px; border-radius: 3px;
  }
  .chem-axis-max-row .cm-axmax::placeholder { color: var(--text-muted); }
  .chem-axis-max-row .cm-axmax:focus { outline: none; border-color: var(--accent); }
  .chem-axis-max-row .cm-axmax-unit {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px;
    margin-left: auto;
  }
  .chem-toolbar .cm-mode-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px;
    margin-right: 2px;
  }

  /* PRD plot channel mapping (Surface Treating Pressure) */
  .prd-map-panel {
    padding: 8px 10px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
  }
  .prd-map-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }
  .prd-map-row .pm-label {
    flex: 0 0 auto;
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--title-strong);
  }
  .prd-map-row select {
    flex: 1 1 220px; min-width: 220px;
    padding: 3px 6px; background: var(--bg-tertiary);
    border: 1px solid var(--border); color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    border-radius: 3px;
  }
  .prd-map-row select:focus { outline: none; border-color: var(--accent); }
  .prd-map-row .prd-map-source { color: var(--text-muted); }
  .prd-map-row .prd-map-source .ts-val { color: #4ade80; font-weight: 600; }
  .prd-map-row .prd-map-source .ts-dim { color: var(--text-muted); }

  /* Frac Analyses tab — summary of stages tagged into each Analysis 1..5 */
  .fa-grid { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  /* Tab-control layout for Frac Analyses — flips the grid container to a
     plain block so the tab strip sits flush at the top and the active
     analysis's card fills the area below. .fa-tabs-mode is added by
     renderFracAnalyses() so the legacy padded-grid styling stays available
     for any other consumer that still uses .fa-grid. */
  .fa-grid.fa-tabs-mode { display: block; padding: 0; gap: 0; }
  .fa-tabs {
    display: flex; gap: 4px;
    padding: 10px 14px 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
  }
  .fa-tab {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent; border-bottom: none;
    border-radius: 4px 4px 0 0;
    color: var(--text-secondary); cursor: pointer;
    font-family: inherit; text-align: left;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
  }
  .fa-tab:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
  .fa-tab.active {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--title-strong); font-weight: 600;
    margin-bottom: -1px;
  }
  .fa-tab.empty { opacity: 0.55; }
  .fa-tab-row {
    display: flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  }
  .fa-tab-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex: 0 0 10px;
  }
  .fa-tab-subtitle {
    font-size: 11px; font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0; text-transform: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
  }
  .fa-tab-meta {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); font-weight: 500; letter-spacing: 0.3px;
  }
  .fa-tab-content { padding: 14px; }
  .fa-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 6px; overflow: hidden;
  }
  .fa-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--title-strong);
    cursor: pointer; user-select: none;
  }
  .fa-card-header:hover { background: rgba(255,255,255,0.08); }
  .fa-card-header .fa-caret {
    font-size: 11px; color: var(--text-muted);
    transition: transform 0.15s ease; margin-right: 4px;
    display: inline-block;
  }
  .fa-card.collapsed .fa-card-header { border-bottom: none; }
  .fa-card.collapsed .fa-card-header .fa-caret { transform: rotate(-90deg); }
  .fa-card.collapsed .fa-card-body,
  .fa-card.collapsed .fa-card-actions,
  .fa-card.collapsed .fa-section-title,
  .fa-card.collapsed .fa-timeline-wrap,
  .fa-card.collapsed .fa-wireline-wrap,
  .fa-card.collapsed .fa-stagedepth-wrap,
  .fa-card.collapsed .fa-v2r-stats,
  .fa-card.collapsed .fa-v2r-actions,
  .fa-card.collapsed .fa-v2r-wrap { display: none; }
  .fa-v2r-actions { padding: 8px 14px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .fa-v2r-actions .fa-action-meta { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; }
  .fa-v2r-filter {
    margin-left: auto; display: flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary); font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
  }
  .fa-v2r-filter select {
    padding: 4px 8px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
    font-size: 11px; min-width: 180px;
  }
  /* Multi-select dropdown — used by Analysis 3's lateral-placement filter so
     engineers can pick multiple zones to compare. Toggle button mimics the
     existing fa-v2r-filter select styling; the panel pops down right-aligned. */
  .fa-multiselect-wrap { position: relative; display: inline-block; }
  .fa-multiselect-toggle {
    padding: 4px 8px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
    font-size: 11px; min-width: 180px; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    text-transform: none; letter-spacing: 0; font-weight: 500;
  }
  .fa-multiselect-toggle:hover { border-color: var(--text-muted); }
  .fa-multiselect-toggle .fa-multiselect-caret { font-size: 9px; color: var(--text-muted); }
  .fa-multiselect-panel {
    position: absolute; top: calc(100% + 4px); right: 0; z-index: 1000;
    min-width: 240px; padding: 4px 0;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 4px; box-shadow: 0 6px 16px rgba(0,0,0,0.5);
  }
  .fa-multiselect-panel.hidden { display: none; }
  .fa-multiselect-panel label {
    display: flex; align-items: center; gap: 8px; padding: 5px 10px;
    cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-primary);
    text-transform: none; letter-spacing: 0; font-weight: 500;
  }
  .fa-multiselect-panel label:hover { background: var(--bg-tertiary); }
  .fa-multiselect-panel input[type="checkbox"] { margin: 0; cursor: pointer; }
  .fa-multiselect-glyph {
    display: inline-block; width: 12px; text-align: center; color: #cbd5e1;
    font-weight: 700;
  }
  .fa-multiselect-actions {
    display: flex; gap: 8px; padding: 4px 10px;
    border-bottom: 1px solid var(--border); margin-bottom: 2px;
  }
  .fa-multiselect-actions button {
    background: transparent; border: none; padding: 2px 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--text-muted); cursor: pointer;
  }
  .fa-multiselect-actions button:hover { color: var(--text-primary); }
  /* SVG dash swatch shown beside each zone glyph in the legend strip when
     the user has 2+ zones selected, so the line-style → zone mapping is
     visible without hunting in the tooltip. */
  .fa-zone-dash-swatch {
    display: inline-block; vertical-align: middle; margin-right: 4px;
  }
  .fa-v2r-toggle {
    display: flex; align-items: center; gap: 5px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary); font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
    cursor: pointer; user-select: none;
  }
  .fa-v2r-toggle input[type="checkbox"] { cursor: pointer; }
  .fa-v2r-target {
    display: flex; align-items: center; gap: 5px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary); font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
  }
  .fa-v2r-target input[type="number"] {
    width: 56px; padding: 3px 6px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
    font-size: 11px; text-align: right;
  }
  .fa-card-header .fa-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
  .fa-card-header .fa-summary {
    margin-left: auto; color: var(--text-muted);
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.5px;
  }
  .fa-card-body { padding: 4px 14px 8px; }
  .fa-card-empty {
    color: var(--text-muted); font-style: italic;
    padding: 10px 14px; font-size: 11px;
  }
  .fa-well-row {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .fa-well-row:last-child { border-bottom: none; }
  .fa-well-name {
    flex: 0 0 320px; font-size: 11px; color: var(--text-primary);
  }
  .fa-well-name small { display: block; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; margin-top: 1px; }
  .fa-well-stages { flex: 1; }
  .fa-stage-pill {
    display: inline-block; padding: 1px 7px; margin: 0 3px 3px 0;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 10px; font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700; color: var(--text-secondary);
  }
  .fa-stage-pill.has-timing { border-color: rgba(46,204,113,0.5); color: #2ecc71; }
  .fa-stage-pill.from-log { border-color: rgba(245,158,11,0.55); color: #f59e0b; }
  .fa-stage-pill.from-log::after {
    content: 'LOG'; margin-left: 4px; padding: 0 3px;
    font-size: 7.5px; font-weight: 800; letter-spacing: 0.4px;
    background: rgba(245,158,11,0.18); border-radius: 3px; vertical-align: 1px;
  }
  .fa-stage-pill.fa-toggle { cursor: pointer; user-select: none; }
  .fa-stage-pill.fa-toggle:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.35); }
  .fa-stage-pill.disabled {
    color: var(--text-muted) !important; border-color: rgba(255,255,255,0.08) !important;
    text-decoration: line-through; opacity: 0.55;
  }
  .fa-stage-pill.disabled:hover { opacity: 0.85; }
  .fa-card-actions { padding: 6px 14px 0; display: flex; gap: 6px; align-items: center; }
  .fa-card-actions .fa-action-meta { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; }
  .fa-timeline-wrap {
    margin: 10px 14px 14px; height: 280px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 8px;
  }
  .fa-timeline-empty {
    padding: 16px; color: var(--text-muted);
    font-style: italic; font-size: 11px; text-align: center;
  }
  /* Per-well median bucket strip above the timeline — wireline / idle / frac / cycle */
  .fa-timeline-stats {
    margin: 6px 14px 0; padding: 0;
    border: 1px solid var(--border); border-radius: 4px;
    overflow: hidden;
  }
  .fa-timeline-stats-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.6fr) repeat(5, 1fr);
    align-items: center;
    padding: 5px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .fa-timeline-stats-row:last-child { border-bottom: none; }
  .fa-timeline-stats-row.fa-tls-head {
    background: rgba(255,255,255,0.03);
    color: var(--text-muted); font-size: 9px;
    text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700;
  }
  /* Data rows are clickable — collapse/expand that well's bars in the chart */
  .fa-timeline-stats-row[data-tls-toggle] { cursor: pointer; user-select: none; }
  .fa-timeline-stats-row[data-tls-toggle]:hover { background: rgba(255,255,255,0.08); }
  .fa-timeline-stats-row.collapsed { opacity: 0.72; }
  .fa-timeline-stats-row.collapsed:hover { opacity: 0.95; background: rgba(255,255,255,0.10); }
  .fa-timeline-stats-row.collapsed .fa-tls-cell { color: var(--text-muted); font-weight: 600; }
  .fa-tls-caret {
    display: inline-block; width: 10px; font-size: 9px; color: var(--text-muted);
    transition: transform 0.15s ease;
  }
  .fa-timeline-stats-row.collapsed .fa-tls-caret { transform: rotate(-90deg); }
  .fa-timeline-stats-row .fa-tls-well {
    display: flex; align-items: center; gap: 6px;
    color: var(--title-strong); font-weight: 600;
  }
  .fa-timeline-stats-row .fa-tls-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex: 0 0 8px;
  }
  .fa-timeline-stats-row .fa-tls-cell {
    color: var(--title-strong); font-weight: 700;
  }
  .fa-timeline-stats-row .fa-tls-cell.fa-tls-wireline { color: #f39c12; }
  .fa-timeline-stats-row .fa-tls-cell.fa-tls-idle     { color: #94a3b8; }
  .fa-timeline-stats-row .fa-tls-cell.fa-tls-frac     { color: #6ea3e8; }
  .fa-timeline-stats-row .fa-tls-cell.fa-tls-n        { color: var(--text-muted); font-weight: 600; }
  /* Analysis 2 — Volume to Rate comparison */
  .fa-v2r-stats {
    display: flex; gap: 8px; padding: 8px 14px 0;
  }
  .fa-v2r-stat {
    flex: 1; padding: 8px 12px;
    background: var(--bg-tertiary); border-radius: 4px;
    border: 1px solid var(--border);
  }
  .fa-v2r-stat.so-none      { border-left: 3px solid #4ade80; }
  .fa-v2r-stat.so-suspected { border-left: 3px solid #e6a542; }
  .fa-v2r-stat.so-confirmed { border-left: 3px solid #e74c3c; }
  .fa-v2r-stat.so-no-data   { border-left: 3px solid var(--text-muted); }
  .fa-v2r-stat-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 4px;
  }
  .fa-v2r-stat-value {
    font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700;
    color: var(--title-strong);
  }
  .fa-v2r-stat-value .fa-v2r-stat-unit {
    font-size: 9px; color: var(--text-secondary); margin-left: 3px; font-weight: 500;
  }
  .fa-v2r-stat-sub {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-muted); margin-top: 3px;
  }
  .fa-v2r-wrap {
    margin: 10px 14px 14px; height: 320px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 8px;
    position: relative;   /* anchor the zoom/enlarge toolbar + drag marquee */
  }
  /* Analysis 4+ chart tools — small overlay toolbar (Reset zoom / Enlarge)
     pinned top-right of any .fa-v2r-wrap. Dim until hovered so it doesn't
     compete with the chart; matches the dark-theme trim-btn styling. */
  .fa-chart-tools {
    position: absolute; top: 6px; right: 10px; z-index: 3;
    display: flex; gap: 5px;
    opacity: 0.45; transition: opacity 0.15s;
  }
  .fa-v2r-wrap:hover .fa-chart-tools { opacity: 1; }
  .fa-chart-tool-btn {
    font-family: inherit; font-size: 10px; line-height: 1;
    padding: 3px 7px; border-radius: 3px; cursor: pointer;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  .fa-chart-tool-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.9);
  }
  /* Drag-select-to-zoom marquee (visual rectangle while dragging). */
  .fa-chart-marquee {
    position: absolute; display: none; z-index: 2;
    pointer-events: none;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.75);
    border-radius: 2px;
  }
  /* Enlarge state — mirror of #rsd-stage-block.rsd-prd-fullscreen: pin the
     wrap to the viewport and let the canvas flex to fill it. Esc / the
     Enlarge button toggle back. */
  .fa-v2r-wrap.fa-chart-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 60;
    margin: 0; border-radius: 0;
    height: auto;
    background: var(--bg-primary);
    padding: 40px 18px 18px;
    display: flex; flex-direction: column;
  }
  .fa-v2r-wrap.fa-chart-fullscreen canvas {
    flex: 1 1 auto; min-height: 0;
  }
  .fa-v2r-wrap.fa-chart-fullscreen .fa-chart-tools {
    top: 10px; right: 16px; opacity: 1;
  }
  /* Analysis 4 — selected stage pill (single-stage mode). Distinct
     from .disabled so the user can see at a glance which stage is in
     the chart. Light-blue fill, dark text, slight halo. */
  .fa-stage-pill.fa-sand-selected {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    font-weight: 600;
  }
  /* Analysis 4 — per-stage metrics table. Two-column key/value, monospace
     values, alternating row tint. */
  /* Context-rug legend — color → proppant mesh + fluid regime, under the
     arc chart. Subtle/diagnostic: small swatches, muted label, wraps. */
  .fa-sand-rug-legend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
    padding: 2px 14px 0; min-height: 14px;
  }
  .fa-sand-rug-legend:empty { display: none; }
  .fa-sand-rug-lbl { font-size: 10px; font-weight: 600; opacity: 0.85; }
  .fa-sand-rug-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; color: var(--text-secondary, #cbd5e1);
  }
  .fa-sand-rug-sw {
    display: inline-block; width: 16px; height: 9px; border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.15);
  }
  .fa-sand-metrics-table {
    margin: 10px 14px 14px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 8px;
  }
  table.fa-sand-metrics {
    width: 100%; border-collapse: collapse; font-size: 11px;
  }
  table.fa-sand-metrics th, table.fa-sand-metrics td {
    padding: 6px 10px; text-align: left; vertical-align: middle;
    border-bottom: 1px solid var(--border);
  }
  table.fa-sand-metrics th {
    color: var(--text-muted); font-weight: 500; width: 45%;
  }
  table.fa-sand-metrics td {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
  }
  table.fa-sand-metrics tr:last-child th, table.fa-sand-metrics tr:last-child td { border-bottom: 0; }

  /* ── Phase D — Sand Entry client narrative / interpretation panel ──── */
  .fa-sand-narrative-card .fa-sand-copy-btn {
    margin-left: 8px; padding: 3px 12px;
    background: var(--bg-tertiary); color: #cbd5e1;
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
  }
  .fa-sand-narrative-card .fa-sand-copy-btn:hover {
    background: rgba(34,211,238,0.14); color: #22d3ee; border-color: rgba(34,211,238,0.5);
  }
  .fa-sand-narrative { margin: 10px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
  .fa-sand-narrative .fa-action-meta { color: var(--text-muted); font-size: 11px; }

  /* Per-stage verdict block — accent-colored left rail keys off the category. */
  .fa-sand-verdict {
    background: var(--bg-tertiary); border-radius: 4px;
    border-left: 3px solid var(--vc, #64748b);
    padding: 11px 14px;
  }
  .fa-sand-verdict-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
  .fa-sand-verdict-badge {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--vc, #cbd5e1);
  }
  .fa-sand-verdict-stage {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
    letter-spacing: 0.4px;
  }
  .fa-sand-verdict-sentence {
    margin: 0; color: var(--text-primary); font-size: 13px; line-height: 1.5;
  }
  .fa-sand-drivers { margin-top: 8px; }
  .fa-sand-drivers > summary {
    cursor: pointer; color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    letter-spacing: 0.5px; text-transform: uppercase; list-style: revert;
  }
  .fa-sand-drivers > summary:hover { color: #cbd5e1; }
  table.fa-sand-drivers-tbl {
    width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px;
  }
  table.fa-sand-drivers-tbl th, table.fa-sand-drivers-tbl td {
    padding: 4px 10px; text-align: left; border-bottom: 1px solid var(--border);
  }
  table.fa-sand-drivers-tbl th { color: var(--text-muted); font-weight: 500; width: 55%; }
  table.fa-sand-drivers-tbl td { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
  table.fa-sand-drivers-tbl tr:last-child th, table.fa-sand-drivers-tbl tr:last-child td { border-bottom: 0; }

  /* Lateral / pad summary block. */
  .fa-sand-padsummary {
    background: var(--bg-tertiary); border-radius: 4px; padding: 11px 14px;
  }
  .fa-sand-padsummary-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: #cbd5e1;
    display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px;
  }
  .fa-sand-padsummary-sub {
    font-weight: 600; letter-spacing: 0.3px; text-transform: none; color: var(--text-muted); font-size: 9.5px;
  }
  .fa-sand-verdict-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
  .fa-sand-verdict-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--vc, #cbd5e1);
    background: color-mix(in srgb, var(--vc, #64748b) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--vc, #64748b) 45%, transparent);
  }
  .fa-sand-padsummary-text {
    margin: 0; color: var(--text-primary); font-size: 12.5px; line-height: 1.55;
  }

  /* Honest caveat line — quiet, always present. */
  .fa-sand-caveat {
    color: var(--text-muted); font-size: 10.5px; line-height: 1.5;
    padding: 8px 12px; border-radius: 4px;
    background: rgba(148,163,184,0.06); border: 1px dashed var(--border);
  }
  .fa-sand-caveat strong { color: #cbd5e1; }

  /* Analysis 4 — zoom-controls row. Sits below the main actions strip
     (still inside .fa-v2r-actions). Tight number inputs keep four
     side-by-side. */
  .fa-sand-zoom-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    width: 100%; margin-top: 6px; padding-top: 6px;
    border-top: 1px dashed var(--border);
  }
  .fa-sand-zoom-row input[type="number"] { width: 76px; }
  /* Analysis 4 — perf strip (lightweight phase timings + sys info).
     Monospace, dim, full-width so the engineer can scan it without it
     stealing focus from the chart. */
  .fa-sand-perf-row {
    margin: 4px 14px 6px;
    padding: 5px 9px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
    line-height: 1.5;
  }
  /* Hide the empty perf container before the first run completes —
     so the strip pops in cleanly when the timing data lands, instead
     of showing an empty bordered box. */
  .fa-sand-perf-row:empty { display: none; }
  .fa-sand-perf-line { color: var(--text-secondary, var(--text-muted)); flex: 1 1 auto; min-width: 0; }
  .fa-sand-perf-line strong { color: var(--text-primary); }
  .fa-sand-perf-sys { font-size: 9.5px; opacity: 0.75; }
  /* Analysis 4 — wellbore footer strip (mirrors the PRD chart footer).
     Compact monospace chips of Lateral Entry / Top Perf / Btm Perf /
     casing / surf vol, so the engineer doesn't have to flip tabs to
     see the geometry behind the analysis. */
  .fa-sand-wellbore-strip {
    margin: 0 14px 8px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--text-primary);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    line-height: 1.5;
  }
  .fa-sand-wellbore-strip:empty { display: none; }
  .fa-sand-wb-label {
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: 4px;
  }
  .fa-sand-wb-item { display: inline-flex; align-items: baseline; gap: 5px; }
  .fa-sand-wb-key  { color: var(--text-muted); }
  .fa-sand-wb-val  { color: var(--text-primary); }
  .fa-sand-wb-sep  { color: var(--text-muted); padding: 0 2px; }
  .fa-sand-wb-casing { color: var(--text-secondary, var(--text-muted)); font-size: 10px; }
  .fa-sand-wb-srctag {
    color: var(--text-muted);
    font-size: 9.5px;
    font-style: italic;
    opacity: 0.85;
    margin-left: 2px;
  }
  .fa-sand-show-slopes {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: var(--text-secondary, var(--text-muted));
    cursor: pointer;
    user-select: none;
    margin-right: 4px;
  }
  .fa-sand-show-slopes input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
  }
  .fa-v2r-empty {
    padding: 20px; color: var(--text-muted);
    font-style: italic; font-size: 11px; text-align: center;
  }
  .fa-add-stages {
    margin: 8px 14px 14px; padding: 10px 12px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px;
  }
  .fa-add-stages-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: #cbd5e1; margin-bottom: 8px;
  }
  .fa-add-stages-form {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  }
  .fa-add-stages-form label {
    display: flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary); font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
  }
  .fa-add-stages-form select,
  .fa-add-stages-form input[type="text"] {
    padding: 4px 8px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
  }
  .fa-add-stages-form select { min-width: 200px; }
  .fa-add-stages-form input[type="text"] { min-width: 180px; }
  .fa-add-stages-status {
    margin-left: 4px; font-family: 'JetBrains Mono', monospace;
    font-size: 10px; color: var(--text-muted);
  }
  .fa-add-stages-status.ok { color: #4ade80; }
  .fa-add-stages-status.err { color: #e74c3c; }
  .fa-card.collapsed .fa-add-stages { display: none; }
  /* Post-Frac tab — Tracer Reports + future flowback / early-prod sub-tabs */
  .pf-toolbar {
    padding: 10px 14px; display: flex; gap: 10px; align-items: center;
    border-bottom: 1px solid var(--border);
  }
  .pf-toolbar .pdf-btn { font-size: 11px; }
  .pf-well-strip {
    padding: 10px 14px; display: flex; gap: 6px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border); align-items: center;
    min-height: 28px;
  }
  .pf-well-btn {
    padding: 4px 10px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: var(--text-secondary); cursor: pointer; user-select: none;
  }
  .pf-well-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
  .pf-well-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .pf-well-btn.no-report { opacity: 0.45; }
  .pf-content { padding: 14px; }
  .pf-empty {
    padding: 30px; text-align: center; color: var(--text-muted);
    font-style: italic; font-size: 12px;
  }
  .tracer-summary-meta {
    display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 14px;
    background: var(--bg-tertiary); border-radius: 4px; margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }
  .tracer-summary-meta .meta-key { color: var(--text-muted); margin-right: 4px; }
  .tracer-summary-meta a { color: var(--accent); text-decoration: none; }
  .tracer-summary-meta a:hover { text-decoration: underline; }
  .tracer-summary-table-wrap {
    max-height: 60vh; overflow: auto; border: 1px solid var(--border);
    border-radius: 4px;
  }
  .tracer-summary-table {
    width: 100%; border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }
  .tracer-summary-table th, .tracer-summary-table td {
    padding: 6px 10px; text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary); white-space: nowrap;
  }
  .tracer-summary-table th {
    background: var(--bg-tertiary); color: var(--text-muted);
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.8px;
    text-transform: uppercase; position: sticky; top: 0; z-index: 1;
  }
  .tracer-summary-table td.txt { text-align: left; font-family: 'IBM Plex Sans', sans-serif; }
  .tracer-summary-table tr:hover td { background: rgba(255,255,255,0.08); }
  .tracer-preview-row {
    display: flex; gap: 10px; padding: 3px 0; font-size: 11px;
    font-family: 'JetBrains Mono', monospace; color: var(--text-primary);
  }
  .tracer-preview-row .key { color: var(--text-muted); min-width: 170px; }
  /* Well Materials Summary — totals across every stage on the well, shown
     under the per-stage Treatment Schedule editor. Refreshes any time the
     active stage's design changes. */
  .materials-strip {
    display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 10px;
  }
  .materials-pill {
    flex: 1; min-width: 140px; padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 5px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .materials-pill .lbl {
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px;
    font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
  }
  .materials-pill .val {
    font-family: 'JetBrains Mono', monospace; font-size: 14px;
    font-weight: 700; color: var(--title-strong);
  }
  .materials-pill .val small {
    font-size: 10px; color: var(--text-secondary); font-weight: 500; margin-left: 3px;
  }
  .materials-pill.water-pill { flex: 1.6; min-width: 200px; }
  .materials-pill .water-mix {
    margin-top: 6px; font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px;
  }
  .materials-pill .water-mix input {
    width: 48px; padding: 1px 4px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    text-align: right;
  }
  .materials-pill .water-breakdown {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-muted); margin-top: 3px; line-height: 1.4;
  }
  /* Frozen first columns (opts.stickyCols) — stay put while scrolling right.
     JS sets position:sticky + the left px per column (widths are resizable);
     this supplies the opaque background, z-index layering, and edge divider.
     Body frozen cells sit above normal cells (1) but below the sticky header;
     frozen header cells are the corner and top everything (4). */
  .sched-table td.sched-frz { position: sticky; z-index: 1; background: var(--bg-secondary); }
  .sched-table thead th.sched-frz { z-index: 4; }
  .sched-table thead th.sched-frz:not(.group-h) { background: var(--bg-secondary); }
  .sched-table thead .group-h.sched-frz { background: var(--bg-tertiary); }
  .sched-table tbody tr:hover td.sched-frz { background: color-mix(in srgb, #3a7bd5 6%, var(--bg-secondary)); }
  .sched-table tbody tr.totals td.sched-frz { background: color-mix(in srgb, #ffffff 2%, var(--bg-secondary)); }
  /* Divider marking the freeze edge (right side of the last frozen column). */
  .sched-table .sched-frz-last { box-shadow: 1px 0 0 0 var(--border), 5px 0 6px -3px rgba(0,0,0,0.45); }
  body.theme-light .sched-table td.sched-frz,
  body.theme-light .sched-table thead th.sched-frz:not(.group-h) { background: #ffffff; }
  body.theme-light .sched-table tbody tr:hover td.sched-frz { background: color-mix(in srgb, #3a7bd5 8%, #ffffff); }
  body.theme-light .sched-table tbody tr.totals td.sched-frz { background: color-mix(in srgb, #000000 3%, #ffffff); }
  body.theme-light .sched-table .sched-frz-last { box-shadow: 1px 0 0 0 var(--border), 5px 0 6px -3px rgba(15,23,42,0.14); }

  /* Long headers (CLEAN VOLUME (BBL), PROPPANT VOLUME (LBS)…) are nowrap by
     default, which floors their column at the one-line header width under auto
     table-layout — so those columns can't be dragged narrower than the label.
     In the DESIGN table, let headers wrap: at default/wide widths they still
     sit on one line, but dragging narrow now shrinks to the widest word. */
  #design-sched-wrap .sched-table thead th { white-space: normal; }

  /* Resizable design-table columns — drag the 5-px strip on the right edge
     of any header. Saved per-column-key in localStorage. */
  .sched-table thead tr:last-child th { position: relative; }
  .sched-table .col-resizer {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 5px; cursor: col-resize; user-select: none;
    z-index: 3;
  }
  .sched-table .col-resizer:hover,
  .sched-table .col-resizer.dragging {
    background: var(--accent); opacity: 0.7;
  }
  /* Default min-widths for the columns most likely to truncate their content
     when filled (CROSSLINK 18#, ACID 7.5% HCl, etc.). User can still drag
     wider — these are floors only. */
  .sched-table th[data-col-key="fluid"]        { min-width: 130px; }
  /* Proppant Type holds long composed names like "20/40 Northern White" —
     give it room by default (still user-resizable wider/narrower). */
  .sched-table th[data-col-key="proppantType"] { min-width: 160px; }
  .sched-table th[data-col-key="name"]         { min-width: 90px; }
  /* Chemical setpoint/total columns must always show at least "x.xx" plus the
     number-input spinner — floor them so dragging can't crush them too narrow. */
  .sched-table th[data-col-key^="chem."]       { min-width: 62px; }
  /* Large-number columns: the editable Clean Volume (GAL) input needs room
     for the value plus the number-spinner buttons (a 5-6 digit entry like
     "10,000" otherwise clips to look like "1000"); the derived LBS totals
     can reach 7 digits with thousands separators. */
  .sched-table th[data-col-key="cleanVolGal"]  { min-width: 52px; }
  .sched-table th[data-col-key="propLbs"]      { min-width: 52px; }
  .sched-table th[data-col-key="cumPropLbs"]   { min-width: 52px; }
  .materials-grid {
    display: grid; gap: 10px; padding-top: 4px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .materials-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 5px;
    padding: 10px 12px;
  }
  .materials-section h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text-muted); margin: 0 0 8px;
    display: flex; align-items: center; gap: 6px;
  }
  .materials-section h4 .hdr-control {
    margin-left: auto; font-weight: 500;
    letter-spacing: 0.3px; text-transform: none;
    color: var(--text-secondary); font-size: 9px;
    display: inline-flex; align-items: center; gap: 4px;
  }
  .materials-section h4 .hdr-control input {
    width: 64px; padding: 2px 5px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    text-align: right;
  }
  .materials-section tr.totals-row td {
    border-top: 1px solid var(--border); font-weight: 700;
    color: var(--title-strong); background: rgba(255,255,255,0.02);
  }
  /* Materials Summary tabs (Volumes / Materials Cost) */
  .materials-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    margin: 6px 0 10px;
  }
  .materials-tab {
    padding: 6px 14px; background: transparent; border: none;
    border-bottom: 2px solid transparent;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); cursor: pointer;
  }
  .materials-tab:hover { color: var(--text-primary); }
  .materials-tab.active {
    color: var(--title-strong); border-bottom-color: var(--accent);
  }
  /* Cost-tab inputs and grand total */
  .cost-input {
    width: 60px; padding: 1px 4px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    text-align: right;
    -moz-appearance: textfield;          /* hide spinners in Firefox */
  }
  .cost-input.tax-input { width: 48px; }   /* tax values are 0-100, narrower */
  .cost-input::-webkit-inner-spin-button,
  .cost-input::-webkit-outer-spin-button {
    -webkit-appearance: none; margin: 0;  /* hide spinners in Chrome / Edge / Safari */
  }
  .cost-input:focus { outline: none; border-color: var(--accent); }
  .cost-grand-total {
    margin-top: 12px; padding: 12px 16px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 5px;
    display: grid; grid-template-columns: 1fr auto; gap: 4px 16px;
    align-items: center;
  }
  .cost-grand-total .cost-totals-rows {
    grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px;
    border-bottom: 1px solid var(--border); padding-bottom: 8px;
  }
  .cost-grand-total .cost-row {
    display: flex; justify-content: space-between; align-items: center;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .cost-grand-total .cost-row .lbl {
    color: var(--text-secondary); display: flex; align-items: center; gap: 4px;
    font-weight: 500; letter-spacing: 0.3px; text-transform: none;
  }
  .cost-grand-total .cost-row .lbl input.cost-input {
    width: 56px; margin-left: 6px;
  }
  .cost-grand-total .cost-row .amt {
    color: var(--text-primary); font-weight: 600;
  }
  .cost-grand-total .cost-final {
    grid-column: 1 / -1; display: flex; justify-content: space-between;
    align-items: center; padding-top: 4px;
  }
  .cost-grand-total .cost-final .lbl {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
  }
  .cost-grand-total .cost-final .val {
    font-family: 'JetBrains Mono', monospace; font-size: 22px;
    font-weight: 700; color: #4ade80;
  }
  .cost-grand-total .breakdown {
    grid-column: 1 / -1;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary);
  }
  .materials-section table {
    width: 100%; border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }
  .materials-section th, .materials-section td {
    padding: 3px 6px; text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary); white-space: nowrap;
  }
  .materials-section th {
    font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase; color: var(--text-muted);
  }
  .materials-section td.txt, .materials-section th.txt {
    text-align: left; font-family: 'IBM Plex Sans', sans-serif;
  }
  .materials-section tr:last-child td { border-bottom: none; }
  .materials-section .empty-row {
    color: var(--text-muted); font-style: italic;
    text-align: center; padding: 12px; font-size: 10.5px;
  }
  #design-materials-panel.collapsed .hist-chart-header { border-bottom: none; }
  #design-materials-panel #design-materials-body { padding: 0 12px 12px; }
  #design-materials-panel.collapsed #design-materials-body { display: none; }

  /* AFE Creator — design slots in the Source Designs section */
  .afe-slot {
    display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 8px 12px;
    align-items: center; padding: 8px 10px; margin-bottom: 6px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px;
  }
  .afe-slot-label {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .afe-slot-label small {
    display: block; font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); margin-top: 1px; letter-spacing: 0.5px;
  }
  .afe-slot-stages {
    display: flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px;
  }
  .afe-slot-stages input {
    width: 60px; background: var(--bg-primary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 3px; padding: 3px 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: right;
  }
  .afe-slot-stages input:focus { outline: none; border-color: var(--accent); }
  .afe-slot-pull {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    padding: 4px 8px; background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: 3px; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.8px;
  }
  .afe-slot-pull:hover { color: var(--accent); border-color: var(--accent); }
  .afe-slot-pull.applied { color: #4ade80; border-color: rgba(74,222,128,0.4); }
  .afe-slot-remove {
    background: transparent; color: var(--text-muted); border: none; cursor: pointer;
    font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 3px;
  }
  .afe-slot-remove:hover { color: var(--danger); background: rgba(231,76,60,0.08); }
  /* .fa-section-card wraps each chart section (timeline, wireline,
     stagedepth, v2r, avgpr) emitted by renderFracAnalyses(). In dark
     mode it's a transparent grouper that just spaces sections apart so
     the existing flat-with-depth look stays intact. Light mode upgrades
     it to a full bordered card surface — see body.theme-light block. */
  .fa-section-card { margin: 14px 0; }
  .fa-section-card:first-child { margin-top: 0; }
  /* Wireline performance — depth-vs-time scatter + regression model */
  .fa-section-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: #cbd5e1; padding: 14px 14px 0;
    display: flex; align-items: center; gap: 8px;
  }
  .fa-section-title .fa-section-meta {
    margin-left: auto; color: var(--text-muted);
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.5px; text-transform: none;
  }
  .fa-section-title .fa-section-meta.fa-avgpr-collective {
    margin-left: 0; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.12);
    color: #cbd5e1; font-weight: 700;
  }
  .fa-section-title .fa-section-meta.fa-avgpr-collective:empty { display: none; }
  .fa-wireline-wrap {
    margin: 8px 14px 14px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 12px;
    display: flex; flex-direction: column; gap: 10px;
  }
  .fa-wireline-stats {
    display: flex; gap: 22px; flex-wrap: wrap; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .fa-wireline-stat { display: flex; flex-direction: column; gap: 2px; font-family: 'JetBrains Mono', monospace; }
  .fa-wireline-stat-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
  .fa-wireline-stat-value { font-size: 14px; color: var(--title-strong); font-weight: 700; }
  .fa-wireline-stat-sub { font-size: 9px; color: var(--text-muted); }
  .fa-wireline-equation {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: #f39c12; padding: 4px 0;
  }
  .fa-wireline-chart-wrap { position: relative; height: 340px; }
  .fa-wireline-controls {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary);
  }
  .fa-wireline-wells {
    display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .fa-wireline-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; cursor: pointer; user-select: none;
    background: rgba(0,0,0,0.18); border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary);
    transition: background 0.1s, border-color 0.1s, color 0.1s;
  }
  .fa-wireline-chip::before {
    content: ''; display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; background: var(--chip-color, #94a3b8);
    flex: 0 0 8px;
  }
  .fa-wireline-chip:hover { background: rgba(0,0,0,0.34); border-color: rgba(255,255,255,0.25); }
  .fa-wireline-chip.active {
    background: var(--chip-color, #3a7bd5); color: #0a0a0a;
    border-color: var(--chip-color, #3a7bd5); font-weight: 700;
  }
  .fa-wireline-chip.active::before { background: #0a0a0a; opacity: 0.45; }
  .fa-wireline-chip small { color: inherit; opacity: 0.65; font-size: 9px; }
  .fa-wireline-controls label {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; user-select: none;
    padding: 3px 8px; background: rgba(0,0,0,0.18); border-radius: 3px;
  }
  .fa-wireline-controls label:hover { background: rgba(0,0,0,0.32); }
  .fa-wireline-controls input[type="checkbox"] { margin: 0; cursor: pointer; }
  .fa-wireline-controls .fa-controls-hint { color: var(--text-muted); font-size: 9px; }
  .fa-wireline-prediction {
    display: flex; gap: 14px; flex-wrap: wrap; padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary);
  }
  .fa-wireline-prediction .fa-pred-cell {
    display: flex; flex-direction: column; gap: 2px;
    padding: 4px 10px; background: rgba(0,0,0,0.18); border-radius: 3px;
  }
  .fa-wireline-prediction .fa-pred-cell strong { color: var(--title-strong); font-size: 11.5px; }
  .fa-wireline-prediction .fa-pred-cell small { color: var(--text-muted); font-size: 8.5px; letter-spacing: 0.3px; text-transform: uppercase; }
  /* Savings outlook — translates regression slope into operational language */
  .fa-wireline-savings {
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
    margin-top: 6px; padding: 7px 12px;
    background: rgba(46,204,113,0.06); border: 1px solid rgba(46,204,113,0.18);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: var(--text-secondary);
  }
  .fa-wireline-savings .fa-savings-label {
    font-size: 9px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
  }
  .fa-wireline-savings .fa-savings-text strong { color: #2ecc71; font-weight: 700; }
  .fa-wireline-savings .fa-savings-noise { color: var(--text-muted); font-size: 9.5px; }
  .fa-wireline-empty {
    padding: 24px; color: var(--text-muted);
    font-style: italic; font-size: 11px; text-align: center;
  }
  .fa-stagedepth-wrap {
    margin: 8px 14px 14px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 12px;
    display: flex; flex-direction: column; gap: 10px;
  }
  /* Per-chemical color override (saved per well in the mapping) */
  .chem-map-row .cm-color {
    flex: 0 0 28px; height: 22px; padding: 0;
    border: 1px solid var(--border); border-radius: 3px;
    cursor: pointer; background: transparent;
  }
  .chem-map-row .cm-color::-webkit-color-swatch-wrapper { padding: 1px; }
  .chem-map-row .cm-color::-webkit-color-swatch { border: none; border-radius: 2px; }
  .chem-map-row .cm-color::-moz-color-swatch { border: none; border-radius: 2px; }
  .chem-map-row .cm-color-reset {
    flex: 0 0 22px; padding: 0; height: 22px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-muted); border-radius: 3px; cursor: pointer;
    font-size: 12px; line-height: 1;
  }
  .chem-map-row .cm-color-reset:hover { color: var(--text-primary); border-color: var(--accent); }
  .chem-map-row .cm-color-reset:disabled {
    opacity: 0.35; cursor: not-allowed; pointer-events: none;
  }

  /* Perforation design form (Completions Design > Perforation Design) */
  .perf-section {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    margin-bottom: 12px; padding: 12px 14px;
  }
  .perf-section-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--title-strong);
    margin-bottom: 10px;
  }
  .perf-form-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px 14px;
  }
  .perf-field label {
    display: block; font-family: 'JetBrains Mono', monospace;
    font-size: 9px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 3px;
  }
  .perf-field input {
    width: 100%; padding: 5px 8px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .perf-field input:focus { outline: none; border-color: var(--accent); }
  .perf-summary {
    display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 14px; background: var(--bg-tertiary);
    border-radius: 4px; margin-bottom: 12px;
  }
  .perf-summary .ps-card { display: flex; flex-direction: column; }
  .perf-summary .ps-label { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
  .perf-summary .ps-value { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: var(--title-strong); }
  .perf-summary .ps-unit { font-size: 10px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }

  /* Perforation Design Method */
  .perf-field select {
    width: 100%; padding: 5px 8px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .perf-field select:focus { outline: none; border-color: var(--accent); }
  .pm-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 14px; margin-bottom: 10px;
  }
  .pm-collar-line {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary);
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 4px;
    padding: 6px 10px; margin-bottom: 10px;
  }
  .pm-haz-section { margin-bottom: 10px; }
  .pm-haz-head {
    display: flex; align-items: center; justify-content: space-between;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 6px;
  }
  .pm-haz-empty { font-size: 11px; color: var(--text-muted); font-style: italic; }
  /* Toe valves (Stage 1 ports) */
  .pm-tv-section { margin-bottom: 10px; }
  .pm-tv-btns { display: inline-flex; gap: 6px; }
  .pm-tv-note { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.4; }
  .pm-tv-row { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
  .pm-tv-label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
    min-width: 56px; text-transform: uppercase; letter-spacing: 0.5px;
  }
  .pm-tv-row input {
    width: 140px; padding: 5px 8px; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .pm-tv-row input:focus { outline: none; border-color: var(--accent); }
  .pm-tv-del { padding: 4px 9px; line-height: 1; }
  .perf-toe-badge {
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
    letter-spacing: 0.6px; background: var(--accent); color: #fff;
    border-radius: 3px; padding: 1px 5px; margin-left: 4px; vertical-align: middle;
  }
  .perf-cl-cell { min-width: 240px; }
  .perf-cl-list { display: flex; flex-wrap: wrap; gap: 4px; }

  /* ── Zipper Design workspace ─────────────────────────────────────────── */
  .zd-controls {
    display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
    margin: 4px 0 14px; padding: 12px 14px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
  }
  .zd-field { display: flex; flex-direction: column; gap: 4px; }
  .zd-field label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted);
  }
  .zd-field select, .zd-field input {
    padding: 6px 9px; min-width: 220px; background: var(--bg-tertiary);
    border: 1px solid var(--border); color: var(--text-primary); border-radius: 3px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px;
  }
  .zd-field.zd-field-sm select, .zd-field.zd-field-sm input { min-width: 120px; }
  .zd-field select:focus, .zd-field input:focus { outline: none; border-color: var(--accent); }
  .zd-status { font-size: 11px; color: var(--text-muted); margin-left: 4px; line-height: 1.4; }
  /* N-well multi-select (checkbox list) + flanking-offset controls */
  .zd-field-wells { min-width: 200px; }
  .zd-well-list {
    display: flex; flex-wrap: wrap; gap: 4px 14px; align-content: flex-start;
    max-width: 340px; max-height: 96px; overflow-y: auto; padding: 6px 9px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 3px;
  }
  .zd-well-opt {
    display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; color: var(--text-primary);
    white-space: nowrap;
  }
  .zd-well-opt input { accent-color: var(--accent); cursor: pointer; }
  .zd-well-empty { font-size: 11px; font-style: italic; color: var(--text-muted); }
  .zd-field-offset { min-width: 190px; }
  .zd-toggle {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; color: var(--text-primary);
    padding: 6px 0; text-transform: none; letter-spacing: 0;
  }
  .zd-toggle input { accent-color: var(--accent); cursor: pointer; }
  .zd-reach-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
  .zd-reach-row input { min-width: 58px; width: 58px; padding: 4px 7px; background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary); border-radius: 3px; font-size: 12px; }
  .zd-info-i {
    display: inline-flex; align-items: center; justify-content: center; cursor: help;
    width: 13px; height: 13px; border-radius: 50%; background: var(--accent); color: #fff;
    font-size: 9px; font-weight: 700; font-style: normal; vertical-align: middle;
  }
  .zd-summary { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
  .zd-card {
    display: flex; flex-direction: column; gap: 2px; padding: 8px 14px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 4px; min-width: 120px;
  }
  .zd-card-l { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
  .zd-card-v { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; color: var(--title-strong); }
  .zd-card-u { font-size: 10px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
  /* Fill the analysis pane vertically (uses the white space on tall/4K screens). */
  #zd-workspace { flex-direction: column; height: 100%; box-sizing: border-box; }
  #zd-results { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .zd-layout {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-rows: 1fr; gap: 16px; align-items: stretch;
    flex: 1; min-height: 0;
  }
  .zd-plan-wrap {
    position: relative; height: 100%; min-height: 360px; padding: 10px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
  }
  /* Round blue help button */
  .zd-help-btn {
    width: 24px; height: 24px; flex: 0 0 auto; padding: 0; border: none; cursor: pointer;
    border-radius: 50%; background: var(--accent); color: #fff;
    font-family: 'IBM Plex Sans', sans-serif; font-weight: 700; font-size: 14px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .zd-help-btn:hover { filter: brightness(1.12); }
  /* Copy-chart button, overlaid on the plan-view panel */
  .zd-chart-copy {
    position: absolute; top: 8px; right: 10px; z-index: 3;
    font-size: 10px; padding: 3px 9px;
  }
  .zd-sequence {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    overflow: hidden; display: flex; flex-direction: column; height: 100%; min-height: 0;
  }
  /* Narrow screens: stack, give each a workable fixed height, let the page scroll. */
  @media (max-width: 1100px) {
    #zd-workspace { height: auto; }
    #zd-results { flex: none; }
    .zd-layout { grid-template-columns: 1fr; grid-template-rows: auto auto; flex: none; }
    .zd-plan-wrap { height: 460px; }
    .zd-sequence { height: auto; max-height: 70vh; }
  }
  .zd-seq-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--title-strong);
  }
  .zd-copy-btn { flex: 0 0 auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
  .zd-seq-sub { display: block; font-weight: 500; font-size: 9px; letter-spacing: 0.3px; text-transform: none; color: var(--text-muted); margin-top: 2px; }
  .zd-seq-scroll { overflow-y: auto; flex: 1; }
  .zd-seq-table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
  .zd-seq-table th {
    position: sticky; top: 0; background: var(--bg-secondary); z-index: 1;
    text-align: left; padding: 6px 8px; color: var(--text-muted); font-size: 9px;
    letter-spacing: 0.4px; text-transform: uppercase; border-bottom: 1px solid var(--border);
  }
  .zd-seq-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }
  /* Per-well row tint driven by the palette color (set inline as --zd-row-tint). */
  .zd-seq-table tbody tr td { background: var(--zd-row-tint, transparent); }
  /* Legacy 2-well tints kept for back-compat with any cached markup. */
  .zd-row-a td { background: color-mix(in srgb, #3b82f6 7%, transparent); }
  .zd-row-b td { background: color-mix(in srgb, #f59e0b 8%, transparent); }
  /* Mark where the active well changes — highlights catch-up runs / alternation */
  .zd-run-start td { border-top: 2px solid var(--accent); }
  .zd-well-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
  .zd-well-dot.a { background: #3b82f6; }
  .zd-well-dot.b { background: #f59e0b; }
  .zd-al { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; }
  .zd-al-hi { background: color-mix(in srgb, #22c55e 22%, transparent); color: #16a34a; }
  .zd-al-mid { background: color-mix(in srgb, #e0a800 22%, transparent); color: #b45309; }
  .zd-al-lo { background: color-mix(in srgb, #ef4444 20%, transparent); color: #dc2626; }
  .zd-al-none { background: var(--bg-tertiary); color: var(--text-muted); font-weight: 500; }
  .zd-al-miss { background: color-mix(in srgb, #ef4444 18%, transparent); color: #dc2626; }
  /* Amber — outer-wing frac-hit into a flanking offset (parent–child) */
  .zd-al-offset { background: color-mix(in srgb, #f59e0b 24%, transparent); color: #b45309; margin-left: 4px; }
  .zd-note-offset { color: var(--text-secondary); }
  .zd-miss-txt { color: #dc2626; font-style: italic; }
  .zd-note { padding: 8px 12px; font-size: 10.5px; color: var(--text-muted); font-style: italic; border-top: 1px solid var(--border); }

  /* ── Zipper Design — light mode: executive navy theme (matches PRD/Exec) ── */
  body.theme-light #zd-workspace .co-title { color: #1F3B63; }
  body.theme-light #zd-workspace .zd-controls { background: #EEF4FA; border-color: #B8C7D9; }
  body.theme-light #zd-workspace .zd-field label { color: #475569; }
  body.theme-light #zd-workspace .zd-field select,
  body.theme-light #zd-workspace .zd-field input {
    background: #ffffff; border-color: #B8C7D9; color: #1F3B63;
  }
  body.theme-light #zd-workspace .zd-field select:focus,
  body.theme-light #zd-workspace .zd-field input:focus { border-color: #1F3B63; }
  body.theme-light #zd-workspace .zd-status { color: #64748b; }
  body.theme-light #zd-workspace .zd-card { background: #F8FBFF; border-color: #B8C7D9; }
  body.theme-light #zd-workspace .zd-card-l { color: #64748b; }
  body.theme-light #zd-workspace .zd-card-v { color: #1F3B63; }
  body.theme-light #zd-workspace .zd-card-u { color: #475569; }
  body.theme-light #zd-workspace .zd-plan-wrap,
  body.theme-light #zd-workspace .zd-sequence { background: #ffffff; border-color: #B8C7D9; }
  body.theme-light #zd-workspace .zd-seq-head {
    background: #1F3B63; color: #ffffff; border-bottom-color: #12274A;
  }
  body.theme-light #zd-workspace .zd-seq-sub { color: #D7E2F0; }
  body.theme-light #zd-workspace .zd-seq-head .zd-copy-btn {
    color: #ffffff; background: rgba(255,255,255,0.14); border: 1px solid rgba(215,226,240,0.62);
  }
  body.theme-light #zd-workspace .zd-seq-head .zd-copy-btn:hover {
    background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.78); color: #ffffff;
  }
  body.theme-light #zd-workspace .zd-seq-table th {
    background: #EEF4FA; color: #1F3B63; border-bottom-color: #B8C7D9;
  }
  body.theme-light #zd-workspace .zd-seq-table td { color: #334155; border-bottom-color: #E6EDF5; }
  body.theme-light #zd-workspace .zd-row-a td { background: color-mix(in srgb, #1F3B63 7%, #ffffff); }
  body.theme-light #zd-workspace .zd-row-b td { background: color-mix(in srgb, #f59e0b 10%, #ffffff); }
  body.theme-light #zd-workspace .zd-run-start td { border-top-color: #1F3B63; }
  body.theme-light #zd-workspace .zd-note { color: #64748b; border-top-color: #B8C7D9; }
  body.theme-light #zd-workspace .zd-al-none { background: #EEF4FA; color: #64748b; }
  body.theme-light #zd-workspace .zd-well-list,
  body.theme-light #zd-workspace .zd-reach-row input {
    background: #F8FBFF; border-color: #B8C7D9; color: #1F3B63;
  }
  body.theme-light #zd-workspace .zd-well-opt,
  body.theme-light #zd-workspace .zd-toggle { color: #334155; }
  body.theme-light #zd-workspace .zd-reach-row { color: #64748b; }
  body.theme-light #zd-workspace .zd-al-offset { background: color-mix(in srgb, #f59e0b 22%, #ffffff); color: #92400e; }

  /* Perforation matrix table (Stage | Plug Depth | Frac Plug Type | clusters) */
  /* ── icopConfirm — in-app confirm dialog (replaces native confirm()) ── */
  .icop-confirm-back { position: fixed; inset: 0; z-index: 100000; background: rgba(6,10,18,0.62);
    display: flex; align-items: center; justify-content: center; }
  .icop-confirm-card { width: 420px; max-width: 92vw; border-radius: 10px; padding: 16px 18px;
    background: var(--bg-secondary, #101827); border: 1px solid var(--border, #2a3648);
    box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
  .icop-confirm-h { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--title-strong, #e8eef5); margin-bottom: 8px; }
  .icop-confirm-body { font-size: 12.5px; line-height: 1.5; color: var(--text-primary, #cfd8e3); }
  .icop-confirm-body p { margin: 0 0 8px; }
  .icop-confirm-body p:last-child { margin-bottom: 0; }
  .icop-confirm-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
  .icop-confirm-btn { padding: 6px 16px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
    cursor: pointer; background: transparent; border: 1px solid var(--border, #2a3648);
    color: var(--text-secondary, #8fa8c8); }
  .icop-confirm-btn:hover { border-color: var(--text-secondary, #8fa8c8); color: var(--text-primary, #cfd8e3); }
  .icop-confirm-btn.primary { background: var(--accent, #3b82f6); border-color: var(--accent, #3b82f6); color: #fff; }
  .icop-confirm-btn.primary:hover { filter: brightness(1.12); }
  .icop-confirm-btn.primary.danger { background: #c0392b; border-color: #c0392b; }
  .icop-confirm-btn:focus-visible { outline: 2px solid var(--accent, #3b82f6); outline-offset: 2px; }

  /* icopPrompt — the text field that replaces native prompt() */
  .icop-confirm-card-prompt { width: 460px; }
  .icop-confirm-field { margin-top: 12px; }
  .icop-confirm-lbl { display: block; font-size: 11px; font-weight: 600; letter-spacing: .3px;
    text-transform: uppercase; color: var(--text-secondary, #8fa8c8); margin-bottom: 5px; }
  .icop-confirm-input { width: 100%; box-sizing: border-box; padding: 7px 10px; border-radius: 6px;
    font-size: 12.5px; font-family: inherit; background: var(--bg-primary, #0a0e14);
    border: 1px solid var(--border, #2a3648); color: var(--text-primary, #cfd8e3); }
  .icop-confirm-input:focus { outline: none; border-color: var(--accent, #3b82f6); }
  textarea.icop-confirm-input { resize: vertical; min-height: 58px; line-height: 1.45; }

  /* icopToast — transient notice (replaces informational alert()) */
  .icop-toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 100001;
    display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
  /* pre-line: a toast is set with textContent, so a message carrying \n (a short
     list, a two-clause notice) would otherwise collapse onto one run-on line. */
  .icop-toast { max-width: 380px; padding: 9px 14px; border-radius: 7px; font-size: 12.5px;
    line-height: 1.45; white-space: pre-line; background: var(--bg-secondary, #101827);
    border: 1px solid var(--border, #2a3648); color: var(--text-primary, #cfd8e3);
    box-shadow: 0 8px 26px rgba(0,0,0,0.4); opacity: 1; transition: opacity .2s ease, transform .2s ease; }
  .icop-toast.error { border-color: #c0392b; color: #f3b8b1; }
  .icop-toast.out { opacity: 0; transform: translateY(6px); }

  /* Themed scrollbars on the completions table wraps — the native light
     scrollbar clashes on the dark surface (Dean). Same idiom as the sidebar. */
  .sched-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
  .sched-table-wrap::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .sched-table-wrap::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-secondary); }
  .sched-table-wrap::-webkit-scrollbar-thumb:hover { background: #4a5568; }
  .sched-table-wrap::-webkit-scrollbar-corner { background: rgba(0,0,0,0.2); }
  body.theme-light .sched-table-wrap::-webkit-scrollbar-track { background: rgba(15,23,42,0.06); }
  body.theme-light .sched-table-wrap::-webkit-scrollbar-thumb { background: #8FA5C2; border-color: #D6DEE8; }
  body.theme-light .sched-table-wrap::-webkit-scrollbar-corner { background: rgba(15,23,42,0.06); }
  .perf-matrix .perf-flush-na { color: var(--text-muted); cursor: help; }
  .perf-matrix { border-collapse: separate; border-spacing: 0; }
  .perf-matrix th, .perf-matrix td {
    text-align: center; white-space: nowrap; padding: 2px 4px;
    border-bottom: 1px solid var(--border);
  }
  .perf-matrix thead th {
    position: sticky; top: 0; z-index: 2; background: var(--bg-secondary);
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.4px; color: var(--text-secondary); padding: 6px 6px;
    border-bottom: 1px solid var(--border);
    text-align: center; white-space: normal; vertical-align: bottom;
    max-width: 96px;
  }
  .perf-matrix td:nth-child(3) { text-align: left; }   /* Frac Plug Type body cells */
  /* Reference (derived, read-only) columns */
  .perf-matrix td.perf-ref {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-secondary); background: color-mix(in srgb, var(--bg-tertiary) 30%, transparent);
  }
  .perf-matrix td.perf-collar-tight { background: #f5a623; color: #1a1a1a; font-weight: 700; }
  .perf-matrix tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-tertiary) 45%, transparent); }
  .perf-matrix tbody tr:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .perf-matrix .perf-stage-cell {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--title-strong);
    text-align: center;
  }
  .perf-gun-banner th {
    position: static; font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 10px;
    text-transform: none; letter-spacing: 0; color: var(--text-secondary);
    background: var(--bg-tertiary); border-top: 1px solid var(--border); text-align: center;
  }
  .perf-matrix .perf-na {
    color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .perf-matrix input {
    width: 100%; min-width: 68px; box-sizing: border-box; text-align: center;
    padding: 4px 5px; background: transparent; border: 1px solid transparent;
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .perf-matrix td:nth-child(3) input { text-align: left; min-width: 130px; }
  /* Cluster depth columns (1-N) — widened so a 5-digit MD + comma reads clearly. */
  .perf-matrix td.perf-cl-input { min-width: 82px; }
  .perf-matrix td.perf-cl-input input { min-width: 78px; }
  .perf-matrix input:hover { border-color: var(--border); background: var(--bg-tertiary); }
  .perf-matrix input:focus { outline: none; border-color: var(--accent); background: var(--bg-secondary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
  .perf-matrix .perf-cl-empty {
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, color-mix(in srgb, var(--text-muted) 12%, transparent) 5px, color-mix(in srgb, var(--text-muted) 12%, transparent) 6px);
  }
  /* Toe valve cell — solid amber so it reads as a fixed port */
  .perf-matrix td.perf-tv-cell { background: #f5a623; }
  /* Paint the amber on the INPUT itself (not just the td) so dark text stays
     readable in dark mode — a transparent input renders dark under color-scheme
     and the td amber only shows as an edge ring. */
  .perf-matrix td.perf-tv-cell input { color: #1a1a1a; font-weight: 700; background: #f5a623; }
  .perf-matrix td.perf-tv-cell input:hover { background: #ffbe3d; border-color: rgba(0,0,0,0.3); }
  .perf-matrix td.perf-tv-cell input:focus { background: #f5a623; border-color: rgba(0,0,0,0.45); box-shadow: 0 0 0 2px rgba(0,0,0,0.3); }
  /* Collar/hazard-moved cell — amber tint + ring */
  .perf-matrix td.perf-cl-moved { background: color-mix(in srgb, #e0a800 18%, transparent); }
  .perf-matrix td.perf-cl-moved input { border-color: #e0a800; font-weight: 600; }

  /* ── Perf Scheme (export-styled, read-only mirror of the field sheet) ── */
  .perf-scheme-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
  }
  .perf-scheme-title {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--title-strong);
  }
  .perf-scheme-sub { font-size: 11px; color: var(--text-muted); font-style: italic; }
  #perf-scheme-export { margin-left: auto; }
  .perf-scheme-sheet {
    border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
    background: var(--bg-secondary);
  }
  .psh-banner {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 10px 14px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
  }
  .psh-well { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700; color: var(--title-strong); }
  .psh-kind {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent);
  }
  .psh-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1px; background: var(--border); padding: 1px;
  }
  .psh-field {
    display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; background: var(--bg-secondary);
  }
  .psh-label {
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
  }
  .psh-value { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: var(--text-primary); }
  .psh-unit { font-size: 10px; font-weight: 400; color: var(--text-muted); }
  .psh-warn {
    padding: 6px 14px; font-family: 'IBM Plex Sans', sans-serif; font-size: 10.5px;
    color: #e0a800; background: color-mix(in srgb, #e0a800 10%, transparent);
    border-top: 1px solid var(--border);
  }
  /* Toe gun override — toggle + revealed sub-grid of inherit-able fields. */
  .perf-toe-gun-toggle { margin: 8px 0 2px; }
  .perf-toe-gun-toggle label {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 11.5px; color: var(--text-secondary);
  }
  .perf-toe-gun-toggle input[type="checkbox"] { cursor: pointer; }
  .perf-toe-gun-block {
    margin-top: 6px; padding: 8px 10px; border-radius: 5px;
    border: 1px dashed var(--border);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
  }

  /* Provenance chip — generated draft vs. user-edited/pasted design of record. */
  .perf-provenance { display: inline-flex; align-items: center; gap: 6px; }
  .perf-prov-chip {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 8px; border-radius: 3px;
    border: 1px solid transparent; cursor: help;
  }
  .perf-prov-chip.prov-gen {
    color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 12%, transparent);
    border-color: color-mix(in srgb, var(--text-muted) 30%, transparent);
  }
  .perf-prov-chip.prov-user {
    color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  }
  .perf-prov-when { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-muted); }
  /* Toe-valve "carried from Lateral Analysis" badge in the method header. */
  .pm-tv-src {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600;
    letter-spacing: 0.4px; color: var(--accent); margin-left: 6px; cursor: help;
  }

  /* Read-only matrix cells (no inputs in the scheme view). */
  .perf-scheme-matrix td { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: center; padding: 5px 8px; }
  .perf-scheme-matrix td.perf-tv-cell { color: #1a1a1a; font-weight: 700; }
  .perf-scheme-matrix td.perf-cl-moved { font-weight: 600; }

  /* Perf design legend */
  .perf-legend {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
    margin: 4px 0 8px; padding: 7px 10px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 4px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10.5px; color: var(--text-secondary);
  }
  .perf-legend-item { display: inline-flex; align-items: center; gap: 6px; }
  .perf-legend-sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--border); }
  .perf-legend-sw.sw-toe { background: #f5a623; border-color: #d4881a; }
  .perf-legend-sw.sw-moved { background: color-mix(in srgb, #e0a800 18%, transparent); border-color: #e0a800; }
  .perf-legend-hint { margin-left: auto; color: var(--text-muted); font-style: italic; }
  .pm-haz-row { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
  .pm-haz-row input {
    padding: 5px 8px; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .pm-haz-row input[data-hz-field="top"], .pm-haz-row input[data-hz-field="bot"] { width: 90px; flex: 0 0 auto; }
  .pm-haz-row input[data-hz-field="reason"] { flex: 1; }
  .pm-haz-row input:focus { outline: none; border-color: var(--accent); }
  .pm-haz-del { padding: 4px 9px; line-height: 1; }
  .pm-actions { display: flex; align-items: center; gap: 10px; }
  .pm-result { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; color: var(--text-muted); line-height: 1.4; }
  .perf-flag { color: #e0a800; cursor: help; }
  .perf-stage-cell.perf-expandable { cursor: pointer; }
  .perf-stage-cell.perf-expandable:hover { color: var(--accent); }
  .perf-detail-row td { background: var(--bg-tertiary); padding: 8px 10px; }
  .perf-cl-detail { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .perf-cl-head {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); margin-right: 6px;
  }
  .perf-cl-chip {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 3px; padding: 2px 7px; color: var(--text-secondary);
  }
  .perf-cl-chip.moved { border-color: #e0a800; color: #e0a800; }

  /* Wireline-perf actuals import + columns */
  .perf-actuals-toolbar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 8px 14px; background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
  }
  .perf-actuals-toolbar .pa-meta {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); margin-left: auto;
  }
  .perf-actuals-panel {
    padding: 10px 14px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
  }
  .perf-actuals-panel textarea {
    width: 100%; min-height: 140px; resize: vertical;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    padding: 8px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
    box-sizing: border-box;
  }
  .perf-actuals-panel textarea:focus { outline: none; border-color: var(--accent); }
  .perf-actuals-panel .pa-actions {
    display: flex; align-items: center; gap: 8px; margin-top: 8px;
  }
  .perf-actuals-panel .pa-result {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-secondary);
  }
  .perf-actuals-panel .pa-result.ok { color: #2ecc71; }
  .perf-actuals-panel .pa-result.err { color: #e74c3c; }

  .sched-table td.act-cell { color: var(--text-secondary); font-style: italic; }
  .sched-table td.act-cell.has-data { color: #2ecc71; font-style: normal; }
  .sched-table td.act-cell.delta-warn { color: #f39c12; font-style: normal; }
  .sched-table td.act-cell.delta-bad  { color: #e74c3c; font-style: normal; }
  .sched-table td.act-cell.act-clickable { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(46,204,113,0.4); }
  .sched-table td.act-cell.act-clickable:hover { text-decoration-color: #2ecc71; background: rgba(46,204,113,0.08); }
  .sched-table tr.actuals-detail-row { background: rgba(46,204,113,0.05); }
  .sched-table tr.actuals-detail-row td {
    padding: 10px 14px; font-size: 10.5px; color: var(--text-secondary);
    border-bottom: 1px solid rgba(46,204,113,0.15); white-space: normal;
  }
  .ac-detail-summary {
    font-family: 'JetBrains Mono', monospace; color: var(--text-primary);
    margin-bottom: 6px; font-size: 10px;
  }
  .ac-detail-perfs strong {
    color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.6px; margin-right: 6px;
  }
  .ac-perf-pill {
    display: inline-block; padding: 1px 7px; margin: 1px 2px;
    background: var(--bg-tertiary); border: 1px solid rgba(46,204,113,0.4);
    border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: #2ecc71;
  }
  .ac-perf-pill .ac-perf-num { color: var(--text-muted); margin-right: 4px; }

  /* Auto-loaded wireline-perf event list (for one-click import) */
  .pa-list-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
  }
  .pa-list-title {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px;
  }
  .pa-event-list {
    max-height: 360px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 4px;
    padding: 4px; background: var(--bg-tertiary); margin-bottom: 8px;
  }
  .pa-event-row {
    display: flex; align-items: center; gap: 10px; padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: var(--text-secondary); cursor: pointer;
  }
  .pa-event-row:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
  .pa-event-row:last-child { border-bottom: none; }
  .pa-event-row input[type=checkbox] { margin: 0; cursor: pointer; flex: 0 0 14px; }
  .pa-event-row .pa-event-stage { color: var(--title-strong); font-weight: 700; flex: 0 0 90px; }
  .pa-event-row .pa-event-summary { flex: 1; }
  .pa-event-row .pa-event-day { color: var(--text-muted); flex: 0 0 60px; text-align: right; }
  .pa-event-row .pa-event-date { color: var(--text-muted); flex: 0 0 84px; text-align: right; }
  .pa-event-row .pa-event-badge {
    background: rgba(46,204,113,0.15); border: 1px solid rgba(46,204,113,0.5);
    color: #2ecc71; padding: 1px 6px; border-radius: 8px; font-size: 8.5px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; flex: 0 0 auto;
  }
  .pa-event-row.imported { opacity: 0.78; }
  .perf-actuals-panel details { margin-top: 12px; }
  .perf-actuals-panel details summary {
    cursor: pointer; color: var(--text-muted); font-size: 11px;
    padding: 4px 0; user-select: none;
  }
  .perf-actuals-panel details summary:hover { color: var(--text-primary); }

  /* Treatment schedule panel — design + as-pumped per stage (config-driven cols) */
  .sched-tabs {
    display: flex; gap: 0; padding: 0 8px;
    background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
  }
  .sched-tab {
    padding: 6px 14px; font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 600;
    color: var(--text-secondary); background: transparent; border: none;
    border-bottom: 2px solid transparent; cursor: pointer; transition: color 0.12s, border-color 0.12s;
  }
  .sched-tab:hover { color: var(--text-primary); }
  .sched-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
  .sched-toolbar {
    display: flex; align-items: center; gap: 6px; padding: 6px 10px;
    border-bottom: 1px solid var(--border); background: var(--bg-secondary);
  }
  .sched-toolbar .sched-meta {
    margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-secondary);
  }
  .sched-toolbar .sched-meta .sm-dim { color: var(--text-muted); }
  .sched-table-wrap { overflow-x: auto; max-height: min(420px, 60vh); overflow-y: auto; }
  .sched-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
  .sched-table thead th {
    position: sticky; top: 0; z-index: 2; background: var(--bg-secondary); color: var(--title-strong);
    font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
    letter-spacing: 0.3px; text-transform: uppercase;
    padding: 3px 4px; text-align: right; border-bottom: 1px solid var(--border);
    border-right: 1px solid rgba(255,255,255,0.04); white-space: nowrap;
  }
  .sched-table thead th:first-child,
  .sched-table thead th.txt { text-align: left; }
  .sched-table thead .group-h {
    text-align: center; background: var(--bg-tertiary);
    font-size: 9px; color: var(--text-secondary); border-bottom-color: rgba(255,255,255,0.08);
  }
  .sched-table tbody td {
    padding: 3px 4px; border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary); white-space: nowrap; text-align: right;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }
  .sched-table tbody td.txt { text-align: left; font-family: 'IBM Plex Sans', sans-serif; }
  .sched-table tbody tr:hover td { background: rgba(58,123,213,0.06); }
  .sched-table tbody td.derived { color: var(--text-secondary); }
  .sched-table tbody td.empty { color: var(--text-muted); font-style: italic; }
  .sched-table tbody tr.totals td {
    border-top: 1px solid var(--border); font-weight: 700; color: var(--title-strong);
    background: rgba(255,255,255,0.02);
  }
  /* Delta tab — color cells by deviation magnitude */
  .delta-table .d-ok   { color: var(--text-primary); }
  .delta-table .d-warn { color: #e6a542; }       /* 2-10% deviation */
  .delta-table .d-bad  { color: #e74c3c; }       /* >10% deviation */
  .delta-table .d-none { color: var(--text-muted); font-style: italic; }
  .delta-table .status-match     { color: #4ade80; }
  .delta-table .status-not-pumped { color: #e74c3c; }
  .delta-table .status-unplanned { color: #e6a542; }
  /* Stage Scorecard tab */
  .sc-fq {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; padding: 6px 12px;
    border-radius: 4px; margin: 8px 0;
  }
  .sc-fq.fq-good    { color: #4ade80; background: rgba(74,222,128,0.08); }
  .sc-fq.fq-ok      { color: #e6a542; background: rgba(230,165,66,0.08); }
  .sc-fq.fq-suspect { color: #e74c3c; background: rgba(231,76,60,0.08); }
  .sc-fq.fq-missing { color: var(--text-muted); }
  /* Stage Context strip — sits above the metric grid, surfaces the
     pasted "Import Stage Metadata" values (zone / lateral position,
     clusters, ISIP, FG, plug MD, breakdown P, design type). */
  .sc-ctx-strip {
    display: flex; flex-wrap: wrap; gap: 14px;
    align-items: center;
    padding: 8px 12px; margin: 8px 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 5px;
  }
  .sc-ctx-strip.sc-ctx-empty-strip {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    font-style: italic;
  }
  .sc-ctx-strip.sc-ctx-empty-strip strong {
    font-style: normal; color: var(--text-secondary);
  }
  .sc-ctx-item {
    display: inline-flex; align-items: baseline; gap: 6px;
  }
  .sc-ctx-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
  }
  .sc-ctx-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px; font-weight: 700; color: var(--title-strong);
  }
  .sc-ctx-val.sc-ctx-empty { color: var(--text-muted); font-weight: 500; }
  .sc-ctx-unit {
    font-size: 9.5px; color: var(--text-secondary);
  }
  .sc-ctx-zone {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    background: color-mix(in srgb, var(--zone-color) 18%, transparent);
    color: var(--zone-color);
    border: 1px solid color-mix(in srgb, var(--zone-color) 50%, transparent);
  }
  /* Editable lateral-position dropdown — neutral when unset, zone-tinted
     once a value is picked so it reads as the same chip as elsewhere. */
  .sc-ctx-zone-select {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    cursor: pointer;
  }
  .sc-ctx-zone-select.sc-ctx-zone-set {
    font-weight: 700;
    background: color-mix(in srgb, var(--zone-color) 18%, transparent);
    color: var(--zone-color);
    border-color: color-mix(in srgb, var(--zone-color) 50%, transparent);
  }
  .sc-ctx-zone-select:focus {
    outline: 2px solid color-mix(in srgb, var(--zone-color) 60%, transparent);
    outline-offset: 1px;
  }
  .sc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px; margin: 8px 0;
  }
  .sc-card {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 5px;
    display: flex; flex-direction: column;
  }
  .sc-card .sc-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 4px;
  }
  .sc-card .sc-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px; font-weight: 700; color: var(--title-strong);
  }
  .sc-card .sc-unit {
    font-size: 10px; font-weight: 500;
    color: var(--text-secondary); margin-left: 3px;
  }
  .sc-card .sc-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; margin-top: 4px;
    color: var(--text-secondary);
  }
  .sc-good .sc-value { color: #4ade80; }
  .sc-warn .sc-value { color: #e6a542; }
  .sc-bad  .sc-value { color: #e74c3c; }
  .sc-none .sc-value { color: var(--text-muted); }
  .sc-neutral .sc-value { color: var(--title-strong); }
  .sc-info .sc-value { color: #93c5fd; }
  /* Execution scorecard — dark mode second pass (Cost Opt–aligned surfaces +
     softened RAG). Scoped to scorecard view; light mode overrides live under
     body.theme-light above. */
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sched-table-wrap {
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: 0 0 4px 4px;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(58,123,213,0.28);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-ctx-strip {
    background: var(--bg-tertiary);
    border: 1px solid rgba(58,123,213,0.22);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-ctx-val {
    color: #c8d6e8;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-neutral .sc-value {
    color: #e2e8f0;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-good .sc-value {
    color: #6ee7b7;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-warn .sc-value {
    color: #d4a574;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-bad .sc-value {
    color: #f87171;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-adh-on-plan .sc-adh-text {
    color: #6ee7b7;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-adh-diluted .sc-adh-text {
    color: #d4a574;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-adh-cut-short .sc-adh-text,
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-adh-under .sc-adh-text {
    color: #f87171;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-fq {
    border: 1px solid rgba(58,123,213,0.28);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-fq.fq-good {
    color: #6ee7b7;
    background: rgba(52,211,153,0.10);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-fq.fq-ok {
    color: #d4a574;
    background: rgba(212,165,116,0.10);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-fq.fq-suspect {
    color: #f87171;
    background: rgba(248,113,113,0.10);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-manual {
    border-top-color: rgba(58,123,213,0.22);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-manual select,
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-manual textarea,
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-avg-window select,
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-avg-result {
    background: var(--bg-secondary);
    border-color: rgba(58,123,213,0.28);
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-radio-group input {
    accent-color: #5b8fd4;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sched-tab.active {
    color: var(--title-strong);
    border-bottom-color: #5b8fd4;
  }
  body:not(.theme-light) #hist-sched-panel.sched-view-scorecard .sc-ctx-zone-select:focus {
    outline-color: #5b8fd4;
  }
  /* Adherence spans the full grid row as a wide verdict strip below the
     8 metric cards — gives it visual weight as the summary read. */
  .sc-adherence {
    grid-column: 1 / -1;
    flex-direction: row; align-items: center; gap: 16px;
  }
  .sc-adherence .sc-label { margin-bottom: 0; min-width: 130px; }
  .sc-adherence .sc-sub   { margin-top: 0; margin-left: auto; }
  .sc-adh-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px; font-weight: 700; margin: 0;
  }
  .sc-adh-on-plan   .sc-adh-text { color: #4ade80; }
  .sc-adh-diluted   .sc-adh-text { color: #e6a542; }
  .sc-adh-cut-short .sc-adh-text { color: #e74c3c; }
  .sc-adh-under     .sc-adh-text { color: #e74c3c; }
  .sc-adh-unknown   .sc-adh-text { color: var(--text-muted); }
  /* Manual entry — screen-out, attribution, notes */
  .sc-manual {
    border-top: 1px solid var(--border);
    padding-top: 12px; margin-top: 8px;
  }
  .sc-manual-row {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px;
  }
  .sc-manual-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
    min-width: 100px; padding-top: 4px;
  }
  .sc-radio-group {
    display: flex; gap: 14px; align-items: center; padding-top: 4px;
  }
  .sc-radio-group label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px; color: var(--text-primary);
    display: flex; align-items: center; gap: 4px; cursor: pointer;
  }
  .sc-manual select, .sc-manual textarea {
    flex: 1; padding: 5px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 3px; font-size: 11px;
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .sc-manual textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; resize: vertical; min-height: 50px;
  }
  /* Avg P/R window — two flag selectors + computed result, sits in the
     manual-entry stack alongside Screen-Out / Attribution / Notes. */
  .sc-avg-window {
    flex: 1; display: flex; flex-direction: column; gap: 6px;
  }
  .sc-avg-pickers {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .sc-avg-pick-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--text-muted);
  }
  .sc-avg-window select {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 3px; font-size: 11px;
    font-family: 'IBM Plex Sans', sans-serif;
    min-width: 140px;
  }
  .sc-avg-result {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-secondary);
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  }
  .sc-avg-result .sc-avg-val {
    font-size: 14px; font-weight: 700; color: #93c5fd;
  }
  .sc-avg-result .sc-avg-unit {
    font-size: 10px; color: var(--text-secondary);
  }
  .sc-avg-result .sc-avg-sep {
    color: var(--text-muted); margin: 0 2px;
  }
  .sc-avg-result .sc-avg-sub {
    font-size: 9.5px; color: var(--text-muted); margin-left: auto;
  }
  /* FR usage tag inside the Avg P/R result bar — small chip after the
     combined gpt number telling the engineer at a glance whether the
     window was primary-only, backup solo, both blenders running, or
     no FR at all. */
  .sc-avg-fr-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; font-weight: 700;
    letter-spacing: 0.5px;
    padding: 1px 6px; border-radius: 8px;
    border: 1px solid transparent;
    cursor: help;
  }
  .sc-avg-fr-tag.fr-combined { color: #4ade80; background: rgba(74,222,128,0.14);  border-color: rgba(74,222,128,0.40); }
  .sc-avg-fr-tag.fr-primary  { color: #93c5fd; background: rgba(147,197,253,0.14); border-color: rgba(147,197,253,0.40); }
  .sc-avg-fr-tag.fr-backup   { color: #e6a542; background: rgba(230,165,66,0.14);  border-color: rgba(230,165,66,0.40); }
  .sc-avg-fr-tag.fr-none     { color: var(--text-muted); background: rgba(127,127,127,0.10); border-color: var(--border); }
  .sc-avg-fr-tag.fr-unknown  { color: var(--text-muted); background: rgba(127,127,127,0.10); border-color: var(--border); }
  .sched-empty {
    padding: 20px; text-align: center; color: var(--text-muted);
    font-size: 11px; font-style: italic;
  }
  /* Treatment-schedule template dropdown (Save / Load templates) */
  .tpl-dropdown {
    position: absolute; top: 100%; left: 0; z-index: 100; margin-top: 4px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 4px; padding: 6px; min-width: 280px; max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.55);
  }
  .tpl-row {
    display: flex; gap: 4px; align-items: center; margin-bottom: 4px;
  }
  .tpl-row:last-child { margin-bottom: 0; }
  .tpl-name {
    flex: 1; text-align: left; padding: 6px 10px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 3px; cursor: pointer; color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif; font-size: 11px;
  }
  .tpl-name small {
    display: block; font-family: 'JetBrains Mono', monospace;
    font-size: 9px; color: var(--text-muted); margin-top: 1px;
  }
  .tpl-name:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
  .tpl-name:hover small { color: rgba(255,255,255,0.8); }
  .tpl-del {
    padding: 3px 8px; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer; border-radius: 3px;
    font-size: 13px; line-height: 1;
  }
  .tpl-del:hover { color: #fff; background: #c0392b; border-color: #c0392b; }
  .tpl-update {
    padding: 3px 8px; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; border-radius: 3px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; line-height: 1.4;
    white-space: nowrap;
  }
  .tpl-update:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
  .tpl-empty {
    padding: 14px; text-align: center; color: var(--text-muted);
    font-style: italic; font-size: 11px;
  }
  /* Save-template dropdown (new template name + overwrite existing) */
  .tpl-save-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); margin: 2px 2px 6px;
  }
  .tpl-close {
    flex: 0 0 auto; padding: 0 6px; background: transparent;
    border: 1px solid transparent; border-radius: 3px;
    color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1.2;
  }
  .tpl-close:hover { color: #fff; background: #c0392b; border-color: #c0392b; }
  /* Per-template "Apply to a range of stages" toggle + panel (Load dropdown) */
  .tpl-range-toggle {
    padding: 3px 8px; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; border-radius: 3px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; line-height: 1.4;
    white-space: nowrap;
  }
  .tpl-range-toggle:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
  .tpl-range-panel {
    margin: -1px 2px 6px; padding: 6px 8px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 0 0 4px 4px;
  }
  .tpl-range-row { display: flex; gap: 4px; align-items: center; }
  .tpl-range-input {
    flex: 1; padding: 5px 8px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif; font-size: 11px;
  }
  .tpl-range-input:focus { outline: none; border-color: var(--accent); }
  .tpl-range-go {
    padding: 5px 12px; background: var(--accent); border: 1px solid var(--accent);
    color: #fff; cursor: pointer; border-radius: 3px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; white-space: nowrap;
  }
  .tpl-range-go:hover { filter: brightness(1.1); }
  .tpl-range-status {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10px;
    color: var(--text-muted); margin-top: 5px; min-height: 12px; line-height: 1.4;
  }
  .tpl-save-new {
    display: flex; gap: 4px; align-items: center; margin-bottom: 8px;
  }
  .tpl-save-input {
    flex: 1; padding: 6px 10px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
  }
  .tpl-save-input:focus { outline: none; border-color: var(--accent); }
  .tpl-save-go {
    padding: 6px 12px; background: var(--accent); border: 1px solid var(--accent);
    color: #fff; cursor: pointer; border-radius: 3px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; white-space: nowrap;
  }
  .tpl-save-go:hover { filter: brightness(1.1); }
  .tpl-save-or {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); margin: 8px 2px 6px;
    border-top: 1px solid var(--border); padding-top: 8px;
  }
  /* Project Materials (Completions Design — Treatment Schedule) */
  .pm-card {
    border: 1px solid var(--border); border-radius: 4px;
    padding: 10px; margin-bottom: 10px;
    background: var(--bg-tertiary);
  }
  .pm-card:last-child { margin-bottom: 0; }
  .pm-row {
    display: flex; gap: 6px; align-items: center; margin-bottom: 8px;
  }
  .pm-input, .pm-select {
    flex: 1; min-width: 0;
    padding: 4px 6px;
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }
  .pm-input:focus, .pm-select:focus { outline: none; border-color: var(--accent); }
  .pm-grid2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  }
  .pm-grid3 {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  }
  .pm-field-label {
    display: block; font-family: 'JetBrains Mono', monospace; font-size: 9px;
    font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 3px;
  }
  .pm-del {
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 3px;
    padding: 3px 8px; cursor: pointer; font-size: 12px; line-height: 1;
  }
  .pm-del:hover { color: #fff; background: #c0392b; border-color: #c0392b; }
  .pm-import-row {
    cursor: pointer; padding: 8px 10px; border-bottom: 1px solid var(--border);
    transition: background 0.1s;
  }
  .pm-import-row:last-child { border-bottom: none; }
  .pm-import-row:hover { background: var(--accent); }
  .pm-import-row:hover .pm-import-row-title { color: #fff; }
  .pm-import-row:hover .pm-import-row-meta { color: rgba(255,255,255,0.8); }
  .pm-import-row-title { font-weight: 600; font-size: 11.5px; color: var(--text-primary); }
  .pm-import-row-meta {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); margin-top: 2px;
  }
  /* Materials Program — elevate above schedule table / toolbars when open */
  #design-chem-program-dropdown,
  #design-chem-program-dropdown.chem-program-dropdown {
    z-index: 500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #design-chem-program-dropdown .mp-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    position: relative;
  }
  #design-chem-program-dropdown .mp-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
  #design-chem-program-dropdown .mp-panel-header {
    cursor: move;
    user-select: none;
  }
  #design-chem-program-dropdown .mp-panel-header button {
    cursor: pointer;
  }
  #design-chem-program-dropdown .mp-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 2;
    background: linear-gradient(135deg, transparent 50%, rgba(31, 59, 99, 0.35) 50%);
    border-bottom-right-radius: 6px;
  }
  body.mp-panel-dragging { cursor: move !important; user-select: none; }
  body.mp-panel-resizing { cursor: nwse-resize !important; user-select: none; }
  /* Materials Program panel (inside #design-chem-program-dropdown) */
  #design-chem-program-dropdown .mp-panel-header {
    display: flex; align-items: center; gap: 8px;
  }
  #design-chem-program-dropdown .mp-panel-title {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
  }
  #design-chem-program-dropdown .mp-panel-close {
    background: none; border: none; cursor: pointer;
    font-size: 18px; line-height: 1; padding: 0 4px;
    color: var(--text-muted);
  }
  #design-chem-program-dropdown .mp-panel-close:hover { color: var(--text-primary); }
  #design-chem-program-dropdown .mp-section-hdr {
    display: flex; align-items: center; gap: 8px;
    margin: 14px 0 8px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  #design-chem-program-dropdown .mp-section-title {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--title-strong);
  }
  #design-chem-program-dropdown .mp-import-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; color: var(--text-muted); min-height: 14px;
  }
  #design-chem-program-dropdown .mp-footer-note {
    font-size: 10px; color: var(--text-muted);
    margin-top: 10px; line-height: 1.4;
  }
  #design-sched-panel #design-chem-program .mp-trigger-icon {
    font-size: 13px; line-height: 1; margin-right: 4px; vertical-align: -1px;
  }

  /* Excel-import modal (Treatment Schedule) */
  .import-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: flex-start; justify-content: center;
  }
  .import-modal-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.65);
  }
  .import-modal-card {
    position: relative; width: min(900px, 92vw); max-height: 88vh;
    margin-top: 4vh;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 6px; display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  }
  .import-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text-primary);
  }
  .import-modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1;
  }
  .import-modal-close:hover { color: var(--text-primary); }
  .import-modal-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
  .import-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 10px 16px; border-top: 1px solid var(--border);
  }
  .import-hint {
    color: var(--text-muted); font-size: 11px; margin: 0 0 10px;
    line-height: 1.5;
  }
  /* Treatment Schedule help modal body */
  .help-body { color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
  .help-body .help-intro {
    color: var(--text-secondary); font-size: 12px; margin: 0 0 14px; line-height: 1.6;
  }
  .help-body h4 {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--text-primary); margin: 16px 0 6px;
    padding-bottom: 4px; border-bottom: 1px solid var(--border);
  }
  .help-body h4:first-child { margin-top: 0; }
  .help-body ul { margin: 0 0 6px; padding-left: 18px; }
  .help-body li { margin: 0 0 5px; }
  .help-body strong { color: var(--text-primary); }
  .help-body code {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 3px; padding: 1px 5px; color: var(--text-primary);
  }
  /* Casing tally → collar locations modal */
  .casing-tally-paste {
    width: 100%; min-height: 120px; resize: vertical; box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.4;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-primary); padding: 8px 10px;
  }
  .casing-tally-paste:focus { outline: none; border-color: var(--accent); }
  .casing-tally-actions {
    display: flex; align-items: center; gap: 8px; margin: 10px 0;
  }
  .casing-tally-msg {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 11px;
    color: var(--text-muted); line-height: 1.4;
  }
  .ct-summary {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px;
  }
  .ct-stat {
    flex: 1 1 110px; display: flex; flex-direction: column; gap: 2px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px; padding: 8px 10px;
  }
  .ct-stat-v {
    font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700;
    color: var(--text-primary);
  }
  .ct-stat-l {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 9.5px;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  }
  .ct-table-wrap { max-height: 42vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; }
  .ct-table {
    width: 100%; border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .ct-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-secondary); color: var(--text-muted);
    font-family: 'IBM Plex Sans', sans-serif; font-size: 9.5px;
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
    text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--border);
  }
  .ct-table th.txt, .ct-table td.txt { text-align: left; }
  .ct-table td {
    text-align: right; padding: 5px 10px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
  }
  .ct-table tbody tr:nth-child(even) { background: rgba(127,127,127,0.05); }
  .import-section {
    margin-bottom: 12px; padding: 10px 12px;
    background: var(--bg-tertiary); border-radius: 4px;
  }
  .import-section h4 {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text-muted); margin: 0 0 8px;
  }
  .import-row {
    display: flex; gap: 10px; padding: 3px 0; font-size: 11px;
    font-family: 'JetBrains Mono', monospace; color: var(--text-primary);
  }
  .import-row .stages { color: var(--accent); min-width: 220px; }
  .import-row .meta { color: var(--text-muted); font-size: 10px; }
  .import-warn { color: #e6a542; font-size: 11px;
    font-family: 'JetBrains Mono', monospace; padding: 2px 0; }
  .import-resolved-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }
  .import-resolved-cell {
    padding: 4px 6px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 3px;
    display: flex; flex-direction: column; gap: 1px;
  }
  .import-resolved-cell .stnum { font-weight: 700; color: var(--text-primary); }
  .import-resolved-cell .stbk { color: var(--text-muted); font-size: 9px; }
  .import-resolved-cell.overlap-winner { border-color: #e6a542; }
  .import-file-input { font-size: 11px; color: var(--text-primary); }
  .import-sheet-row { display: flex; gap: 8px; align-items: center; }
  .import-sheet-row select {
    flex: 1; padding: 4px 6px; background: var(--bg-tertiary);
    border: 1px solid var(--border); color: var(--text-primary);
    border-radius: 3px; font-size: 11px;
  }

  /* Inline editor controls (Design tab) */
  .sched-table input[type=number],
  .sched-table input[type=text],
  .sched-table select {
    width: 100%; min-width: 0; padding: 1px 3px;
    background: var(--bg-tertiary); border: 1px solid transparent;
    color: var(--text-primary); border-radius: 2px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    text-align: right;
  }
  .sched-table td.txt input,
  .sched-table td.txt select { text-align: left; font-family: 'IBM Plex Sans', sans-serif; }
  .sched-table input:focus, .sched-table select:focus {
    outline: none; border-color: var(--accent); background: var(--bg-secondary);
  }
  .sched-table .sched-row-del {
    padding: 1px 8px; font-size: 13px; line-height: 1; border-radius: 3px;
  }
  .sched-table td.row-actions { padding: 2px 4px; text-align: center; }

  /* Y-axis max controls (per scale: pressure / rate / concentration) */
  .yac {
    position: absolute; display: flex; align-items: center; gap: 2px;
    background: rgba(15,20,28,0.85); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 3px; padding: 1px 2px;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: auto; z-index: 5; user-select: none;
  }
  .yac-num {
    background: transparent; border: 1px solid transparent;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    padding: 0 2px; width: 60px; text-align: center; outline: none;
    border-radius: 2px;
  }
  .yac-num:hover { background: rgba(255,255,255,0.10); }
  .yac-num:focus { background: var(--bg-secondary); border-color: var(--accent); }
  .yac-num::-webkit-inner-spin-button, .yac-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .yac-num { -moz-appearance: textfield; }
  .yac-btn {
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 0 5px; font-size: 11px; font-weight: 700;
    cursor: pointer; border-radius: 2px; line-height: 1; height: 14px; min-width: 14px;
  }
  .yac-btn:hover { color: var(--text-primary); border-color: var(--accent); }

  /* Analysis chips — toggle the current stage in/out of one of 5 analyses */
  .analysis-chips { display: inline-flex; gap: 4px; align-items: center; }
  .analysis-chips .ac-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); margin-right: 2px;
  }
  .anlys-chip {
    width: 22px; height: 22px; padding: 0; border-radius: 50%;
    background: var(--bg-secondary); border: 1.5px solid var(--border);
    color: var(--text-muted); cursor: pointer;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.12s, background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
  }
  .anlys-chip:hover { transform: scale(1.12); border-color: var(--text-secondary); color: var(--text-primary); }
  .anlys-chip.active { color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.08); }
  .anlys-chip.active[data-anlys="1"] { background: #3a7bd5; border-color: #3a7bd5; }
  .anlys-chip.active[data-anlys="2"] { background: #27ae60; border-color: #27ae60; }
  .anlys-chip.active[data-anlys="3"] { background: #f39c12; border-color: #f39c12; }
  .anlys-chip.active[data-anlys="4"] { background: #9b59b6; border-color: #9b59b6; }
  .anlys-chip.active[data-anlys="5"] { background: #e84393; border-color: #e84393; }
  .anlys-chip:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

  /* Stage strip button shows a colored stripe at the top when the stage is in
     one or more analyses. Multiple analyses split the stripe into equal
     segments so every membership is visible (e.g. analyses 2 + 3 → half green,
     half orange across the top of the button). */
  .zone-btn.in-analysis {
    background-image: var(--analysis-stripe, none);
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: top left;
    padding-top: 6px;
  }

  /* Import Map dropdown — copies a sibling well's chemical mapping onto the
     current stage. Anchored to the Import Map button in the chem toolbar. */
  .etest-chem-import-wrap { position: relative; display: inline-flex; }
  .etest-chem-import-menu {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
    min-width: 190px; max-height: 280px; overflow-y: auto;
    background: var(--bg-secondary); border: 1.5px solid var(--border);
    border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); padding: 4px;
  }
  .etest-chem-import-item {
    display: block; width: 100%; text-align: left;
    background: transparent; border: 0; border-radius: 4px;
    color: var(--text-primary); cursor: pointer;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    padding: 7px 9px; white-space: nowrap;
  }
  .etest-chem-import-item:hover { background: var(--accent); color: #fff; }
  .etest-chem-import-empty {
    color: var(--text-muted); font-size: 11px; font-style: italic;
    padding: 7px 9px; white-space: nowrap;
  }

  /* Cursor + temporary rubber-band selection while picking a patch range on the chart */
  .step-overlay.select-mode { cursor: crosshair; pointer-events: auto; }
  .patch-selection {
    position: absolute; pointer-events: none;
    background: rgba(58, 123, 213, 0.18);
    border-left: 1px dashed var(--accent);
    border-right: 1px dashed var(--accent);
  }
  /* When the marker's true position is outside the visible zoom range, the box
     is pinned to the chart edge so the user can still see / drag it. */
  .step-marker.clamped .step-box {
    opacity: 0.7; border-style: dashed;
  }
  .step-marker.clamped .step-box::before {
    content: '\00ab'; margin-right: 2px; font-size: 11px; color: inherit; opacity: 0.85;
  }
  .step-marker.clamped.clamped-right .step-box::before { content: ''; }
  .step-marker.clamped.clamped-right .step-box::after {
    content: '\00bb'; margin-left: 2px; font-size: 11px; color: inherit; opacity: 0.85;
  }

  /* PDF viewer */
  .pdf-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 12px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  }
  .pdf-toolbar select, .pdf-toolbar .wh-input,
  .dl-toolbar select, .dl-toolbar .wh-input,
  .an-toolbar select, .an-toolbar .wh-input { font-size: 11px; padding: 5px 8px; }
  .pdf-btn {
    padding: 5px 12px; border-radius: 4px; font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
    background: var(--accent); color: #fff; border: none; cursor: pointer;
    transition: opacity 0.15s;
  }
  .pdf-btn:hover { opacity: 0.85; }
  .pdf-btn:disabled { opacity: 0.4; cursor: default; }
  .pdf-btn.secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
  .pdf-btn.secondary:hover { border-color: var(--text-muted); }
  .pdf-sep { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
  .pdf-page-info { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary); white-space: nowrap; }
  .pdf-canvas-wrap {
    flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center;
    background: #1a1a2e; padding: 16px;
  }
  .pdf-canvas-wrap canvas { box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
  .pdf-status { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); padding: 20px; text-align: center; }

  /* Full-screen PDF overlay */
  .pdf-fullscreen {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.92); display: none;
    flex-direction: column;
  }
  .pdf-fullscreen.open { display: flex; }
  .pdf-fullscreen .pfs-header {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  }
  .pdf-fullscreen .pfs-title {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .pdf-fullscreen .pfs-close {
    padding: 6px 16px; border-radius: 4px; font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 700; background: var(--danger); color: #fff;
    border: none; cursor: pointer; letter-spacing: 0.5px;
  }
  .pdf-fullscreen .pfs-close:hover { opacity: 0.85; }
  .pdf-fullscreen iframe { flex: 1; border: none; }

  /* Frac sub-sub tabs (inside Reports > Frac Services) */
  .frac-subtabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0;
  }
  .frac-subtab {
    padding: 8px 16px; font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: var(--bg-secondary); border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: color 0.15s, border-color 0.15s;
  }
  .frac-subtab:hover { color: var(--text-secondary); }
  .frac-subtab.active { color: var(--title-strong); border-bottom-color: var(--accent); background: var(--bg-primary); }
  /* Wireline Services sub-tabs — mirror .frac-subtab but isolated from its global handlers */
  .wl-subtab {
    padding: 8px 16px; font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: var(--bg-secondary); border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: color 0.15s, border-color 0.15s;
  }
  .wl-subtab:hover { color: var(--text-secondary); }
  .wl-subtab.active { color: var(--title-strong); border-bottom-color: var(--accent); background: var(--bg-primary); }
  body.theme-light #ptab-reports .wl-subtab { background: transparent; color: #64748b; }
  body.theme-light #ptab-reports .wl-subtab:hover { color: #1F3B63; }
  body.theme-light #ptab-reports .wl-subtab.active { color: #1F3B63; background: #F8FBFF; border-bottom-color: #1F3B63; }
  /* CSV table */
  .csv-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .csv-table th {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-secondary); color: var(--title-strong);
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 8px 10px; text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap;
  }
  .csv-table td {
    padding: 5px 10px; border-bottom: 1px solid var(--border);
    color: var(--text-primary); white-space: nowrap; max-width: 300px;
    overflow: hidden; text-overflow: ellipsis;
  }
  .csv-table tr:hover td { background: rgba(58,123,213,0.06); }
  .csv-table td:first-child { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); }

  /* Excel sheet tabs */
  .xlsx-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 8px; }
  .xlsx-tab {
    padding: 6px 14px; font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 600;
    color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: color 0.15s, border-color 0.15s;
  }
  .xlsx-tab:hover { color: var(--text-secondary); }
  .xlsx-tab.active { color: var(--title-strong); border-bottom-color: var(--accent); }

  .frac-panel { display: none; flex-direction: column; height: calc(100vh - 220px); }
  .frac-panel.visible { display: flex; }
  /* Reports tab — flex column so PDF canvas fills remaining project-pane height. */
  .project-main:has(#ptab-reports.visible) {
    overflow: hidden;
  }
  .project-main:has(#ptab-reports.visible) .proj-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-reports.proj-tab-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  #ptab-reports > .wd-subtabs,
  #ptab-reports .daily-subtabs,
  #ptab-reports .frac-subtabs {
    flex: 0 0 auto;
  }
  #ptab-reports .wd-subpanel.visible {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-reports .daily-panel.visible,
  #ptab-reports .frac-panel.visible {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }
  #ptab-reports .pdf-toolbar {
    flex: 0 0 auto;
  }
  #ptab-reports .pdf-canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  #ptab-reports #daily-completion-frames,
  #ptab-reports #daily-drilling-frames,
  #ptab-reports #daily-workover-frames,
  #ptab-reports #frac-frames-container {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    position: relative;
  }
  /* Daily Log — flex column so KPI / hours / day list fill the project pane. */
  .project-main:has(#ptab-dailylog.visible) {
    overflow: hidden;
  }
  .project-main:has(#ptab-dailylog.visible) .proj-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-dailylog.proj-tab-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-dailylog .dl-toolbar {
    flex: 0 0 auto;
  }
  #ptab-dailylog .dl-empty {
    flex: 1 1 auto;
    min-height: 0;
  }
  #ptab-dailylog #dl-body[style*="display: block"],
  #ptab-dailylog #dl-body[style*="display:block"] {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-dailylog .dl-kpi-strip,
  #ptab-dailylog .dl-hours-strip {
    flex: 0 0 auto;
  }
  #ptab-dailylog .dl-main {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }
  /* Production — flex column so chart fills the project pane. */
  .project-main:has(#ptab-production.visible) {
    overflow: hidden;
  }
  .project-main:has(#ptab-production.visible) .proj-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-production.proj-tab-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-production .prod-toolbar {
    flex: 0 0 auto;
  }
  #ptab-production .prod-empty {
    flex: 1 1 auto;
    min-height: 0;
  }
  #ptab-production #prod-body[style*="display: block"],
  #ptab-production #prod-body[style*="display:block"] {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-production .prod-summary-strip {
    flex: 0 0 auto;
  }
  #ptab-production .prod-chart-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
  }
  #ptab-production .prod-chart-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  #ptab-production .prod-chart-wrap {
    flex: 1 1 auto;
    min-height: 280px;
    height: auto;
  }
  /* Frac Analyses — scrollable card stack fills project pane. */
  .project-main:has(#ptab-fracanalyses.visible) {
    overflow: hidden;
  }
  .project-main:has(#ptab-fracanalyses.visible) .proj-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-fracanalyses.proj-tab-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-fracanalyses .an-toolbar {
    flex: 0 0 auto;
  }
  #ptab-fracanalyses .fa-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  /* Post-Frac — tracer panel fills project pane. */
  .project-main:has(#ptab-postfrac.visible) {
    overflow: hidden;
  }
  .project-main:has(#ptab-postfrac.visible) .proj-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-postfrac.proj-tab-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-postfrac > #postfrac-subtabs {
    flex: 0 0 auto;
  }
  #ptab-postfrac .frac-panel.visible {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    overflow: hidden;
  }
  #ptab-postfrac .pf-toolbar,
  #ptab-postfrac .pf-well-strip {
    flex: 0 0 auto;
  }
  #ptab-postfrac .pf-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  #ptab-postfrac .tracer-summary-table-wrap {
    max-height: none;
  }
  /* Analysis — scrollable body fills project pane. */
  .project-main:has(#ptab-analysis.visible) {
    overflow: hidden;
  }
  .project-main:has(#ptab-analysis.visible) .proj-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-analysis.proj-tab-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-analysis .an-toolbar {
    flex: 0 0 auto;
  }
  #ptab-analysis .an-empty {
    flex: 1 1 auto;
    min-height: 0;
  }
  #ptab-analysis #an-body[style*="display: block"],
  #ptab-analysis #an-body[style*="display:block"] {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  #ptab-analysis .an-chart-wrap {
    flex: 0 0 auto;
    min-height: 280px;
    height: 340px;
  }
  #ptab-analysis .an-chart-card.expanded .an-chart-wrap {
    height: calc(100% - 48px);
    min-height: 0;
    flex: 1 1 auto;
  }
  /* Well Data — scrollable subpanels fill project pane. */
  .project-main:has(#ptab-welldata.visible) {
    overflow: hidden;
  }
  .project-main:has(#ptab-welldata.visible) .proj-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  #ptab-welldata.proj-tab-panel.visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }
  #ptab-welldata > .wd-subtabs,
  #ptab-welldata > .wh-save-bar {
    flex: 0 0 auto;
  }
  #ptab-welldata > .wd-subpanel.visible {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px 16px;
  }
  #ptab-welldata #traj-canvas-wrap[style*="display: flex"],
  #ptab-welldata #traj-canvas-wrap[style*="display:flex"] {
    flex: 1 1 auto;
    min-height: 320px;
    max-height: none;
    height: auto !important;
  }
  /* Daily reports (Completion / Drilling / Workover) — mirrors frac styling */
  .daily-subtabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0; }
  .daily-subtab {
    padding: 8px 16px; font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: var(--bg-secondary); border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: color 0.15s, border-color 0.15s;
  }
  .daily-subtab:hover { color: var(--text-secondary); }
  .daily-subtab.active { color: var(--title-strong); border-bottom-color: var(--accent); background: var(--bg-primary); }
  .daily-panel { display: none; flex-direction: column; height: calc(100vh - 260px); }
  .daily-panel.visible { display: flex; }
  /* Daily Log — parsed-JSON analytical view */
  .dl-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
  }
  .dl-empty {
    padding: 60px 20px; text-align: center;
    color: var(--text-muted); font-size: 12px;
  }
  .dl-kpi-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px; padding: 12px;
    border-bottom: 1px solid var(--border); background: var(--bg-secondary);
  }
  .dl-kpi-card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 4px; padding: 10px 12px;
  }
  .dl-kpi-label {
    font-size: 9px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.7px; margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
  }
  .dl-kpi-val {
    font-size: 20px; font-weight: 600; color: var(--title-strong);
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .dl-kpi-sub {
    font-size: 9.5px; color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace; margin-top: 2px;
  }
  .dl-kpi-val.good { color: #22c55e; }
  .dl-kpi-val.warn { color: #f59e0b; }
  .dl-kpi-val.bad  { color: #ef4444; }
  .dl-main {
    display: flex; height: calc(100vh - 420px); min-height: 320px;
  }
  .dl-days-list {
    width: 280px; flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
  }
  .dl-days-head, .dl-events-head {
    padding: 8px 12px; font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.8px;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid var(--border); background: var(--bg-secondary);
  }
  .dl-days-scroll { flex: 1; overflow-y: auto; }
  .dl-day-row {
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.1s;
  }
  .dl-day-row:hover { background: var(--bg-secondary); }
  .dl-day-row.active { background: var(--accent-glow); border-left: 3px solid var(--accent); padding-left: 9px; }
  .dl-day-hdr {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 11px; margin-bottom: 3px;
  }
  .dl-day-num { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--title-strong); }
  .dl-day-date { color: var(--text-secondary); font-size: 10.5px; }
  .dl-day-meta { font-size: 10px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
  .dl-events-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .dl-events-list { flex: 1; overflow-y: auto; padding: 10px 12px; }
  .dl-event-row {
    border: 1px solid var(--border); border-left: 3px solid var(--accent);
    border-radius: 3px; padding: 10px 12px; margin-bottom: 8px;
    background: var(--bg-primary);
  }
  .dl-event-head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 6px;
  }
  .dl-event-time { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-secondary); }
  .dl-event-duration {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    background: var(--bg-tertiary); padding: 2px 7px; border-radius: 3px;
    color: var(--title-strong);
  }
  .dl-event-cat {
    font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.6px;
    padding: 2px 8px; border-radius: 10px; font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    /* Foreground set inline per category fill (see dlTextOnCategoryBg in daily-log.js). */
  }
  .dl-event-act {
    font-weight: 600; color: var(--title-strong); font-size: 12px; margin-bottom: 5px;
  }
  .dl-event-comment {
    font-size: 11px; color: var(--text-secondary); line-height: 1.5;
    white-space: pre-wrap; word-break: break-word;
  }
  .dl-hours-strip {
    padding: 12px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
  }
  .dl-hours-title {
    font-size: 10px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.8px; font-family: 'JetBrains Mono', monospace;
    margin-bottom: 8px;
  }
  .dl-hours-title .dl-clear-filter {
    float: right; cursor: pointer; color: var(--accent);
    text-transform: none; letter-spacing: 0;
  }
  .dl-hours-title .dl-clear-filter:hover { text-decoration: underline; }
  .dl-hours-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 4px;
  }
  .dl-hour-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; padding: 5px 7px; background: var(--bg-primary);
    border-radius: 3px; border: 1px solid var(--border);
    cursor: pointer; transition: background 0.12s, border-color 0.12s;
    user-select: none;
  }
  .dl-hour-row:hover { background: var(--bg-tertiary); border-color: var(--text-muted); }
  .dl-hour-row.active {
    background: var(--accent-glow); border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
  }
  .dl-hour-row.active .dl-hour-label { color: var(--title-strong); font-weight: 600; }
  .dl-hour-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
  .dl-hour-label { flex: 1; color: var(--text-primary); font-size: 10.5px; }
  .dl-hour-val { font-family: 'JetBrains Mono', monospace; color: var(--title-strong); font-size: 10.5px; }
  .dl-hour-count { font-family: 'JetBrains Mono', monospace; color: var(--text-muted); font-size: 9.5px; margin-left: 4px; }
  /* Event edit / add */
  .dl-event-actions {
    display: flex; gap: 4px; margin-left: auto;
  }
  .dl-evt-btn {
    font-size: 10px; padding: 3px 8px; border-radius: 3px;
    border: 1px solid var(--border); background: var(--bg-secondary);
    color: var(--text-secondary); cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .dl-evt-btn:hover { color: var(--title-strong); border-color: var(--text-muted); }
  .dl-evt-btn.danger:hover { color: #ef4444; border-color: #ef4444; }
  .dl-event-badge {
    font-size: 9px; padding: 2px 6px; border-radius: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    font-family: 'JetBrains Mono', monospace;
  }
  .dl-event-badge.edited { background: #f59e0b22; color: #f59e0b; border: 1px solid #f59e0b66; }
  .dl-event-badge.added  { background: #22c55e22; color: #22c55e; border: 1px solid #22c55e66; }
  .dl-event-sub {
    display: inline-block; font-size: 9.5px; padding: 2px 8px;
    border-radius: 3px; background: var(--bg-tertiary);
    color: var(--text-secondary); font-family: 'JetBrains Mono', monospace;
    margin-left: 4px;
  }
  /* Edit/Add form inside event list */
  .dl-edit-form {
    border-left: 3px solid var(--accent) !important;
    background: var(--bg-secondary);
  }
  .dl-edit-title {
    font-size: 10px; color: var(--accent); text-transform: uppercase;
    letter-spacing: 0.8px; font-weight: 600; margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
  }
  .dl-edit-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 10px; margin-bottom: 8px;
  }
  .dl-edit-grid label,
  .dl-edit-fullwidth label {
    display: flex; flex-direction: column; gap: 3px;
    font-size: 9.5px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.6px; font-family: 'JetBrains Mono', monospace;
  }
  .dl-edit-grid input,
  .dl-edit-grid select,
  .dl-edit-fullwidth textarea {
    background: var(--bg-primary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 3px;
    padding: 5px 8px; font-size: 11px;
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .dl-edit-grid input:focus,
  .dl-edit-grid select:focus,
  .dl-edit-fullwidth textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
  }
  .dl-edit-fullwidth { display: block; margin-bottom: 8px; }
  .dl-edit-fullwidth textarea {
    width: 100%; min-height: 60px; resize: vertical;
    font-family: 'IBM Plex Sans', sans-serif; line-height: 1.5;
  }
  .dl-edit-actions {
    display: flex; gap: 6px; justify-content: flex-end;
  }
  .dl-edit-actions button {
    font-size: 11px; padding: 5px 12px; border-radius: 3px;
    border: 1px solid var(--border); cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif; font-weight: 600;
  }
  .dl-edit-actions .primary {
    background: var(--accent); color: #0f172a; border-color: var(--accent);
  }
  .dl-edit-actions .primary:hover { opacity: 0.85; }
  .dl-edit-actions .secondary {
    background: var(--bg-tertiary); color: var(--text-secondary);
  }
  .dl-edit-actions .secondary:hover { color: var(--title-strong); }
  .dl-edit-actions .danger {
    background: transparent; color: #ef4444; border-color: #ef4444;
  }
  .dl-edit-actions .danger:hover { background: #ef444422; }
  .dl-add-btn {
    float: right; font-size: 10px; padding: 4px 10px; border-radius: 3px;
    border: 1px solid var(--accent); background: transparent;
    color: var(--accent); cursor: pointer; font-weight: 600;
    letter-spacing: 0.4px; text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
  }
  .dl-add-btn:hover { background: var(--accent); color: #0f172a; }
  .dl-save-badge {
    display: inline-block; font-size: 9.5px; padding: 2px 8px;
    border-radius: 3px; font-family: 'JetBrains Mono', monospace;
    margin-left: 8px;
  }
  .dl-save-badge.dirty { background: #f59e0b22; color: #f59e0b; border: 1px solid #f59e0b66; }
  .dl-save-badge.saved { background: #22c55e22; color: #22c55e; border: 1px solid #22c55e66; }
  /* Production — single-well monthly history viewer (WOGCC / Athena) */
  .prod-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
  }
  .prod-well-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px; font-weight: 600; color: var(--title-strong);
  }
  .prod-lag {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); margin-left: auto;
  }
  .prod-lag.stale { color: #f59e0b; }
  .prod-empty {
    padding: 60px 20px; text-align: center;
    color: var(--text-muted); font-size: 12px; line-height: 1.6;
  }
  .prod-empty .prod-empty-title {
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    margin-bottom: 8px; letter-spacing: 0.3px;
  }
  .prod-summary-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px; padding: 12px;
    border-bottom: 1px solid var(--border); background: var(--bg-secondary);
  }
  .prod-kpi-card {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 4px; padding: 10px 12px;
  }
  .prod-kpi-label {
    font-size: 9px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.7px; margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
  }
  .prod-kpi-val {
    font-size: 18px; font-weight: 600; color: var(--title-strong);
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .prod-kpi-sub {
    font-size: 9.5px; color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace; margin-top: 2px;
  }
  .prod-chart-section { padding: 14px 16px; }
  .prod-chart-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 4px; padding: 12px; position: relative;
  }
  .prod-chart-title {
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.8px;
    font-family: 'JetBrains Mono', monospace; margin-bottom: 10px;
    padding-right: 34px;
  }
  .prod-chart-wrap { height: 420px; position: relative; }
  .prod-chart-expand {
    position: absolute; top: 8px; right: 8px;
    width: 26px; height: 26px; border-radius: 3px;
    border: 1px solid var(--border); background: var(--bg-primary);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; z-index: 2;
  }
  .prod-chart-expand::before { content: '\26F6'; font-size: 13px; }
  .prod-chart-card.expanded .prod-chart-expand::before { content: '\00D7'; font-size: 18px; }
  .prod-chart-expand:hover { color: var(--title-strong); border-color: var(--accent); }
  .prod-chart-card.expanded {
    position: fixed; top: 24px; left: 24px; right: 24px; bottom: 24px;
    z-index: 1000;
    background: var(--bg-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--accent);
    padding: 18px 20px;
  }
  .prod-chart-card.expanded .prod-chart-wrap { height: calc(100% - 40px); }
  .prod-chart-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
    z-index: 999; display: none;
  }
  .prod-chart-backdrop.open { display: block; }
  /* Analysis — multi-well comparison */
  .an-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
  }
  .an-empty {
    padding: 60px 20px; text-align: center;
    color: var(--text-muted); font-size: 12px;
  }
  .an-section {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  .an-section-title {
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.8px;
    font-family: 'JetBrains Mono', monospace; margin-bottom: 10px;
  }
  .an-section-sub {
    color: var(--text-muted); font-size: 9.5px;
    text-transform: none; letter-spacing: 0; font-weight: 400;
    margin-left: 8px;
  }
  .an-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .an-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 8px; border-radius: 14px;
    border: 1px solid var(--border); background: var(--bg-primary);
    font-size: 11px; color: var(--text-secondary); cursor: pointer;
    transition: all 0.15s; user-select: none;
  }
  .an-chip:hover { border-color: var(--text-muted); color: var(--title-strong); }
  .an-chip.active {
    background: var(--accent-glow);
    border-color: var(--accent); color: var(--title-strong);
  }
  .an-chip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .an-chip-api {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; color: var(--text-muted);
  }
  .an-chip.active .an-chip-api { color: var(--text-secondary); }
  .an-missing {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 10.5px; color: var(--text-muted);
  }
  .an-missing strong {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
  }
  .an-table-wrap { overflow-x: auto; }
  .an-kpi-table {
    width: 100%; border-collapse: collapse; font-size: 11px;
  }
  .an-kpi-table th {
    padding: 8px 10px; text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-muted); background: var(--bg-secondary);
    border-bottom: 1px solid var(--border); white-space: nowrap;
  }
  .an-kpi-table td {
    padding: 8px 10px; border-bottom: 1px solid var(--border);
    color: var(--title-strong); white-space: nowrap;
  }
  .an-kpi-table tr:hover td { background: var(--bg-secondary); }
  .an-kpi-table .num {
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
  }
  .an-kpi-table .well-cell {
    display: flex; align-items: center; gap: 8px;
  }
  .an-kpi-table .well-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  }
  .an-charts-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding: 14px 16px;
  }
  .an-chart-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 4px; padding: 12px; position: relative;
  }
  .an-chart-title {
    font-size: 10px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.8px;
    font-family: 'JetBrains Mono', monospace; margin-bottom: 10px;
    padding-right: 34px;  /* reserve space for the expand button */
  }
  .an-chart-wrap { height: 340px; position: relative; }
  .an-chart-expand {
    position: absolute; top: 8px; right: 8px;
    width: 26px; height: 26px; border-radius: 3px;
    border: 1px solid var(--border); background: var(--bg-primary);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; z-index: 2;
  }
  .an-chart-expand:hover { color: var(--title-strong); border-color: var(--accent); }
  .an-chart-expand::before {
    content: '\26F6'; /* square with four corners — "expand" icon */
    font-size: 13px;
  }
  .an-chart-card.expanded .an-chart-expand::before { content: '\00D7'; font-size: 18px; }
  .an-chart-card.expanded {
    position: fixed; top: 24px; left: 24px; right: 24px; bottom: 24px;
    z-index: 1000;
    background: var(--bg-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--accent);
    padding: 18px 20px;
  }
  .an-chart-card.expanded .an-chart-wrap { height: calc(100% - 40px); }
  .an-chart-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
    z-index: 999; display: none;
  }
  .an-chart-backdrop.open { display: block; }
  @media (max-width: 1100px) {
    .an-charts-grid { grid-template-columns: 1fr; }
  }
  /* Per-well cost-trajectory adjustments */
  .an-chart-adjust {
    position: absolute; top: 8px; right: 40px;
    height: 26px; padding: 0 9px; border-radius: 3px;
    border: 1px solid var(--border); background: var(--bg-primary);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-family: 'IBM Plex Sans', sans-serif;
    z-index: 2;
  }
  .an-chart-adjust:hover { color: var(--text-primary); border-color: var(--accent); }
  .an-chart-adjust.active { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
  .an-cost-adjust-panel {
    margin-bottom: 10px; padding: 10px 12px;
    background: var(--bg-primary); border: 1px solid var(--border); border-radius: 4px;
  }
  .an-cap-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; gap: 12px;
  }
  .an-cap-hint {
    font-size: 10.5px; color: var(--text-muted);
    line-height: 1.4; flex: 1; padding-right: 10px;
  }
  .an-cap-xmax {
    font-size: 11px; color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  }
  .an-cap-xmax .an-cap-input { width: 80px; }
  .an-cap-reset {
    height: 22px; padding: 0 10px; border-radius: 3px;
    border: 1px solid var(--border); background: var(--bg-tertiary);
    color: var(--text-secondary); cursor: pointer;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .an-cap-reset:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
  .an-cap-reset:disabled { opacity: 0.4; cursor: default; }
  .an-cap-table {
    width: 100%; border-collapse: collapse; font-size: 11px;
  }
  .an-cap-table th {
    text-align: left; color: var(--text-muted); font-weight: 600;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 4px 8px; border-bottom: 1px solid var(--border);
  }
  .an-cap-table th.num, .an-cap-table td.num { text-align: right; }
  .an-cap-table td { padding: 4px 8px; vertical-align: middle; }
  .an-cap-table tr + tr td { border-top: 1px solid var(--border); }
  .an-cap-well { display: inline-flex; align-items: center; gap: 8px; color: var(--text-primary); }
  .an-cap-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .an-cap-input {
    width: 110px; height: 22px; padding: 0 6px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    text-align: right;
  }
  .an-cap-input:focus { outline: none; border-color: var(--accent); }
  .an-cap-auto {
    height: 22px; padding: 0 8px; border-radius: 3px;
    border: 1px solid var(--border); background: var(--bg-tertiary);
    color: var(--text-secondary); cursor: pointer;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .an-cap-auto:hover { color: var(--accent); border-color: var(--accent); }

  .proj-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); font-size: 13px; text-align: center; padding: 40px;
  }
  .proj-empty-state .pe-icon { font-size: 36px; opacity: 0.3; margin-bottom: 12px; }
  .proj-btn {
    width: 100%; padding: 9px 12px; border-radius: 5px;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px; font-weight: 600; text-align: left;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
  }
  .proj-btn:hover { border-color: var(--accent); background: rgba(58,123,213,0.08); }
  .well-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px; margin-bottom: 3px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 4px;
    font-size: 11.5px; transition: border-color 0.15s; cursor: pointer;
  }
  .well-row:hover { border-color: var(--text-muted); background: rgba(58,123,213,0.04); }
  .well-row.selected {
    border-color: var(--accent);
    background: rgba(58,123,213,0.08);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .well-row .wr-api { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; color: var(--accent); }
  .well-row .wr-name { font-size: 11.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .well-row .wr-idx { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-muted); margin-right: 8px; min-width: 20px; flex-shrink: 0; }
  .well-row .wr-info { flex: 1; min-width: 0; }

  /* Project Wells groupings — flex layout: operated/non-op cap at N rows,
     offset fills remaining sidebar height (min 2 rows) then scrolls. */
  :root {
    --pw-well-row: 46px; /* well-row padding + 2-line name/api + margin */
    --pw-operated-max-rows: 6;
    --pw-nonop-max-rows: 4;
    --pw-offset-min-rows: 2;
  }
  .pw-group--operated,
  .pw-group--nonop {
    flex: 0 0 auto;
  }
  .pw-group--offset {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
  }
  .pw-group-label {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-muted);
    padding: 4px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
  }
  .pw-group-count {
    font-size: 9px; font-weight: 700;
    background: var(--accent); color: #fff;
    padding: 1px 6px; border-radius: 8px;
  }
  .pw-group-list {
    overflow-x: hidden;
    padding-right: 4px;
  }
  #proj-well-list-operated {
    max-height: calc(var(--pw-well-row) * var(--pw-operated-max-rows));
    overflow-y: auto;
  }
  #proj-well-list-nonop {
    max-height: calc(var(--pw-well-row) * var(--pw-nonop-max-rows));
    overflow-y: auto;
  }
  .pw-group--offset .pw-group-list {
    flex: 1 1 auto; min-height: calc(var(--pw-well-row) * var(--pw-offset-min-rows));
    max-height: none;
    overflow-y: auto;
  }
  .pw-group-list::-webkit-scrollbar { width: 8px; }
  .pw-group-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .pw-group-list::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 4px; }
  .pw-group-list::-webkit-scrollbar-thumb:hover { background: #4a5568; }
  .pw-group-list { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
  .pw-group-divider { height: 14px; flex-shrink: 0; }
  .pw-group-empty { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 4px 2px; }
  .pw-group-clear {
    margin-left: auto;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    padding: 2px 7px; border-radius: 3px; cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  }
  .pw-group-clear:hover:not(:disabled) { color: #fff; background: var(--danger, #e74c3c); border-color: var(--danger, #e74c3c); }
  .pw-group-clear:disabled { opacity: 0.35; cursor: not-allowed; }
  .wr-fav {
    flex-shrink: 0; margin-left: 8px;
    background: none; border: none; padding: 2px 4px; line-height: 1;
    font-size: 16px; cursor: pointer; color: var(--text-muted);
    transition: color 0.15s, transform 0.15s;
  }
  .wr-fav:hover { color: #f1c40f; transform: scale(1.15); }
  .wr-fav.active { color: #f1c40f; text-shadow: 0 0 6px rgba(241,196,15,0.5); }
  /* Production-data badge for offset wells. Distinct from the favorite star:
     hexagon glyph, emerald-green when the well has reported production. */
  .wr-prod {
    flex-shrink: 0; margin-left: 4px;
    background: none; border: none; padding: 2px 4px; line-height: 1;
    font-size: 14px; cursor: pointer; color: var(--text-muted);
    transition: color 0.15s, transform 0.15s, opacity 0.15s;
  }
  .wr-prod:hover { color: #10b981; transform: scale(1.15); }
  .wr-prod.has { color: #10b981; text-shadow: 0 0 6px rgba(16,185,129,0.5); }
  .wr-prod.checking { opacity: 0.35; cursor: progress; }
  .wr-prod.error { color: #ef4444; }
  .wr-remove {
    flex-shrink: 0; margin-left: 4px;
    background: none; border: none; padding: 2px 6px; line-height: 1;
    font-size: 14px; cursor: pointer; color: var(--text-muted);
    border-radius: 3px; opacity: 0.55;
    transition: color 0.15s, background 0.15s, opacity 0.15s, transform 0.15s;
  }
  .well-row:hover .wr-remove { opacity: 1; }
  .wr-remove:hover { color: #fff; background: var(--danger, #e74c3c); transform: scale(1.05); }
  .wr-remove:disabled { opacity: 0.3; cursor: wait; }

  /* New Project modal */
  .np-overlay {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(0,0,0,0.75); display: none;
    align-items: center; justify-content: center;
  }
  .np-overlay.open { display: flex; }
  .np-modal {
    width: 560px; max-width: 92vw; max-height: 86vh;
    display: flex; flex-direction: column;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  }
  .np-modal .np-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
  }
  .np-modal .np-title {
    font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase; color: var(--title-strong);
  }
  .np-modal .np-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
  }
  .np-modal .np-close:hover { color: var(--text-primary); }
  .np-modal .np-body {
    padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
    overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0;
  }
  .np-modal .np-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 4px;
  }
  .np-modal .np-input {
    width: 100%; padding: 8px 10px; border-radius: 5px;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); font-family: inherit; font-size: 12px;
    outline: none;
  }
  .np-modal .np-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
  .np-wells-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 10.5px; color: var(--text-muted);
  }
  .np-wells-head .np-count { color: var(--accent); font-weight: 700; font-family: 'JetBrains Mono', monospace; }
  .np-wells-head .np-selectall { margin-left: auto; cursor: pointer; color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.5px; }
  .np-wells-head .np-selectall:hover { text-decoration: underline; }
  .np-wells-list {
    flex: 1 1 auto; min-height: 160px; max-height: 45vh; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 5px;
    background: var(--bg-primary); padding: 6px;
  }
  .np-wells-list::-webkit-scrollbar { width: 10px; }
  .np-wells-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .np-wells-list::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-primary); }
  .np-well-item {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; margin-bottom: 2px; border-radius: 4px;
    cursor: pointer; transition: background 0.12s;
  }
  .np-well-item:hover { background: rgba(58,123,213,0.08); }
  .np-well-item input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); }
  .np-well-item .npw-name { font-size: 11.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .np-well-item .npw-api { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; color: var(--accent); flex-shrink: 0; }
  .np-well-item .npw-group {
    flex-shrink: 0; margin-left: 8px;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px;
    padding: 3px 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
    cursor: pointer; outline: none;
  }
  .npw-group-wrap { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }
  .npw-group-scope {
    font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.4px;
    text-transform: uppercase; color: var(--text-muted); line-height: 1; white-space: nowrap;
  }

  .np-well-item .npw-group:focus { border-color: var(--accent); }
  .np-well-item--recent { background: rgba(58,123,213,0.08); border-left: 2px solid var(--accent); padding-left: 6px; }
  .np-well-item--recent:hover { background: rgba(58,123,213,0.16); }
  .np-recent-divider {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted);
    padding: 6px 4px 4px; margin-top: 4px; border-top: 1px solid var(--border);
  }
  .np-recent-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent);
    padding: 4px 4px 6px;
  }
  .np-modal .np-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-top: 1px solid var(--border);
  }
  .np-modal .np-msg { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); }
  .np-modal .np-msg.error { color: var(--danger); }
  .np-modal .np-btn {
    padding: 7px 16px; border-radius: 4px; font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    border: 1px solid var(--border); cursor: pointer; transition: opacity 0.15s, border-color 0.15s;
  }
  .np-modal .np-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
  .np-modal .np-btn.primary:hover { opacity: 0.88; }
  .np-modal .np-btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }
  .np-modal .np-btn.ghost { background: transparent; color: var(--text-secondary); }
  .np-modal .np-btn.ghost:hover { border-color: var(--text-muted); color: var(--text-primary); }
  .np-newwell-row { display: flex; gap: 6px; align-items: stretch; }
  .np-newwell-row .np-new-api-wrap { position: relative; flex: 0 0 220px; }
  .np-newwell-row .np-new-api-wrap input.np-new-api { width: 100%; padding-right: 74px; }
  .np-newwell-row .np-new-name { flex: 1 1 auto; min-width: 0; }
  .np-newwell-row .np-btn { flex: 0 0 auto; white-space: nowrap; }
  .np-new-lookup {
    position: absolute; right: 3px; top: 3px; bottom: 3px;
    padding: 0 10px; border-radius: 3px;
    background: var(--accent); color: #fff; border: 1px solid var(--accent);
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase;
    cursor: pointer; visibility: hidden; white-space: nowrap;
    transition: opacity 0.15s;
  }
  .np-new-lookup:hover { opacity: 0.88; }
  .np-new-lookup.visible { visibility: visible; }
  .np-new-lookup:disabled { opacity: 0.5; cursor: default; }
  .np-newwell-msg { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); margin-top: 4px; min-height: 12px; }
  .np-newwell-msg.error { color: var(--danger); }
  .np-newwell-msg.ok { color: #27ae60; }
  .np-op-toggle {
    margin-top: 6px; background: none; border: none; padding: 0; cursor: pointer;
    color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    letter-spacing: 0.4px; text-align: left;
  }
  .np-op-toggle:hover { text-decoration: underline; }
  .np-op-panel { margin-top: 2px; }
  .np-op-results {
    margin-top: 6px; max-height: 220px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 5px; background: var(--bg-primary);
    padding: 4px;
  }
  .np-op-results:empty { display: none; }
  .np-op-results::-webkit-scrollbar { width: 8px; }
  .np-op-results::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .np-op-results::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 4px; }
  .np-op-count { padding: 4px 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); }
  .np-op-bulk-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 8px; margin-bottom: 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }
  .np-op-bulk-link {
    color: var(--accent); cursor: pointer; text-decoration: underline;
    user-select: none;
  }
  .np-op-bulk-link:hover { opacity: 0.85; }
  .np-op-bulk-count { color: var(--text-muted); }
  .np-op-bulk-count.active { color: var(--accent); font-weight: 600; }
  .np-op-bulk-btn {
    margin-left: auto; padding: 5px 12px;
    background: var(--accent); color: #fff; border: none;
    border-radius: 3px; cursor: pointer; font-weight: 600;
    font-size: 10px; font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
  }
  .np-op-bulk-btn:disabled { opacity: 0.4; cursor: default; }
  .np-op-bulk-btn:hover:not(:disabled) { opacity: 0.85; }
  .np-op-more {
    display: flex; justify-content: center; padding: 8px 0;
    margin-top: 4px; border-top: 1px dashed var(--border);
  }
  .np-op-more-btn {
    padding: 5px 14px; background: var(--bg-primary);
    color: var(--accent); border: 1px solid var(--accent);
    border-radius: 3px; cursor: pointer; font-weight: 600;
    font-size: 10px; font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
  }
  .np-op-more-btn:disabled { opacity: 0.5; cursor: default; }
  .np-op-more-btn:hover:not(:disabled) { background: var(--accent); color: #fff; }
  .np-op-result {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 6px 8px; border-radius: 4px;
    border: 1px solid transparent; transition: background 0.12s, border-color 0.12s;
  }
  .np-op-result:hover { background: rgba(58,123,213,0.08); border-color: var(--accent); }
  .np-op-result.bulk-checked { background: rgba(58,123,213,0.15); border-color: var(--accent); }
  .np-op-result-chk {
    margin-top: 3px; flex-shrink: 0; cursor: pointer;
    accent-color: var(--accent); width: 14px; height: 14px;
  }
  .np-op-result-content { flex: 1; cursor: pointer; min-width: 0; }
  .np-op-result-top { font-size: 11.5px; font-weight: 600; color: var(--text-primary); }
  .np-op-result-bot { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); margin-top: 2px; }
  .np-op-result-bot .npr-api { color: var(--accent); font-weight: 600; }
  .np-op-result.filtered-out { display: none; }
  .np-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    padding: 2px 6px; border-radius: 10px;
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
    margin-right: 6px; vertical-align: middle;
  }
  .np-status-badge.active    { background: rgba(34, 197, 94, 0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.4); }
  .np-status-badge.standby   { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.4); }
  .np-status-badge.permit    { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(148,163,184,0.4); }
  .np-status-badge.abandoned { background: rgba(239, 68, 68, 0.15);  color: #ef4444; border: 1px solid rgba(239,68,68,0.4); }
  .np-status-badge.unknown   { background: rgba(100, 116, 139, 0.15); color: #64748b; border: 1px solid rgba(100,116,139,0.4); }
  .np-op-filter {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary); cursor: pointer; user-select: none;
    padding-left: 6px; border-left: 1px solid var(--border); margin-left: 2px;
  }
  .np-op-filter input { margin: 0; accent-color: var(--accent); }
  .np-op-filter:hover { color: var(--title-strong); }
  .np-paste-hint {
    margin-top: 6px; margin-bottom: 6px;
    font-size: 11px; color: var(--text-muted); line-height: 1.4;
  }
  .np-paste-area {
    width: 100%; min-height: 110px; resize: vertical;
    padding: 8px 10px; border-radius: 5px;
    background: var(--bg-primary); border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.4;
    outline: none; transition: border-color 0.15s;
  }
  .np-paste-area:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
  .np-paste-preview {
    flex: 1; font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; color: var(--text-muted);
  }
  .np-paste-preview .hit { color: var(--accent); font-weight: 600; }

  /* Analysis mode — sidebar + workspace split */
  .mode-analysis { width: 100%; height: 100%; display: none; }
  .mode-analysis.visible { display: flex; }
  .analysis-sidebar {
    width: 300px; flex: 0 0 300px; min-width: 220px; max-width: 600px;
    background: var(--bg-secondary); border-right: 1px solid var(--border);
    overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable;
  }
  .analysis-sidebar::-webkit-scrollbar { width: 10px; }
  .analysis-sidebar::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .analysis-sidebar::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-secondary); }
  .analysis-sidebar::-webkit-scrollbar-thumb:hover { background: #4a5568; }
  .analysis-sidebar { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
  .analysis-sidebar .sidebar-header { padding: 18px 20px; border-bottom: 1px solid var(--border); }
  .analysis-sidebar .sidebar-header p { font-size: 11px; color: var(--text-muted); }
  .analysis-main { flex: 1; background: var(--bg-primary); overflow-y: auto; position: relative; }
  /* Themed scrollbar on the analysis workspace scroller — same canonical thin
     bar as .analysis-sidebar/.sidebar (Dean: default white system bar showed
     against the dark theme on Pad Geometry, which scrolls inside this). */
  .analysis-main::-webkit-scrollbar { width: 10px; }
  .analysis-main::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .analysis-main::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-primary); }
  .analysis-main::-webkit-scrollbar-thumb:hover { background: #4a5568; }
  .analysis-main { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
  body.theme-light .analysis-main::-webkit-scrollbar-track { background: rgba(15,23,42,0.06); }
  body.theme-light .analysis-main::-webkit-scrollbar-thumb { background: #8FA5C2; border-color: #D6DEE8; }
  body.theme-light .analysis-main { scrollbar-color: #8FA5C2 rgba(15,23,42,0.06); }
  .analysis-sidebar.collapsed-sidebar { width: 0; min-width: 0; flex: 0 0 0; overflow: hidden; border-right: none; padding: 0; }
  .analysis-sidebar.collapsed-sidebar > * { display: none !important; }
  .analysis-toggle-btn {
    position: absolute; top: 8px; left: 8px; z-index: 30;
    width: 28px; height: 28px; border-radius: 4px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s, color 0.15s;
  }
  .analysis-toggle-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
  /* Toggle now sits top-left (it collapses the left sidebar); give workspace
     headers a small left inset so their titles clear it. */
  .analysis-main .co-header { padding-left: 40px; }

  /* ── Top menu-bar nav (replaces the left card rail) ───────────────────── */
  /* The sidebar stays in the DOM (source of truth + click wiring) but is
     hidden — analysis-nav.js builds the bar + launcher that proxy to it. */
  .mode-analysis .analysis-sidebar { display: none; }
  .mode-analysis .analysis-toggle-btn { display: none; }

  .an-menubar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 2px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    padding: 0 8px; height: 42px;
  }
  .an-menucat { position: relative; height: 42px; display: flex; align-items: center; }
  .an-menubtn {
    background: none; border: none; color: var(--text-secondary); cursor: pointer;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; padding: 0 12px; height: 42px;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  }
  .an-menubtn:hover { color: var(--text-primary); }
  .an-menucat.open .an-menubtn { color: var(--accent); }
  .an-menucaret { font-size: 8px; opacity: 0.65; }
  .an-menu {
    display: none; position: absolute; top: 42px; left: 0;
    min-width: 340px; max-width: 400px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 14px 36px rgba(0,0,0,0.45); padding: 6px; z-index: 40;
    max-height: 74vh; overflow-y: auto;
  }
  .an-menucat.open .an-menu { display: block; }
  .an-menu-item {
    display: flex; gap: 10px; width: 100%; text-align: left; background: none;
    border: none; border-radius: 6px; padding: 8px 10px; cursor: pointer; align-items: flex-start;
  }
  .an-menu-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .an-menu-item.active { background: color-mix(in srgb, var(--accent) 20%, transparent); }
  .an-mi-ic { flex: 0 0 22px; font-size: 15px; line-height: 1.3; color: var(--accent); }
  .an-mi-ic svg { width: 18px; height: 18px; display: block; }
  .an-mi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .an-mi-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
  .an-mi-desc { font-size: 10.5px; color: var(--text-muted); line-height: 1.35; }
  .an-mi-soon {
    font-size: 8px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px;
    padding: 0 3px; margin-left: 4px; vertical-align: middle;
  }
  .an-menu-active {
    margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10px;
    font-weight: 700; letter-spacing: 0.6px; color: var(--text-muted); padding-right: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%;
  }

  /* ── Center launcher (idle empty-state) ───────────────────────────────── */
  .proj-empty-state:has(.an-launcher) {
    display: block; height: auto; min-height: 100%;
    align-items: stretch; justify-content: flex-start; text-align: left; padding: 0;
  }
  .an-launcher { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 28px 40px; }
  .an-launch-head {
    font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
    letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
  }
  .an-launch-cat {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent);
    margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  }
  .an-launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
  .an-launch-tile {
    display: flex; flex-direction: column; gap: 6px; text-align: left;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    padding: 13px 15px; cursor: pointer; transition: border-color 0.15s, transform 0.06s;
  }
  .an-launch-tile:hover { border-color: var(--accent); }
  .an-launch-tile:active { transform: translateY(1px); }
  .an-launch-tile.soon { opacity: 0.62; }
  .an-lt-ic { font-size: 22px; line-height: 1; color: var(--accent); }
  .an-lt-ic svg { width: 26px; height: 26px; display: block; }
  .an-lt-name { font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
  .an-lt-desc {
    font-size: 10.5px; color: var(--text-muted); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }

  /* iframe tools: subtract the menu-bar height so the frame doesn't overscroll */
  .analysis-main > #analysis-frame { height: calc(100% - 43px); }

  /* ── ISIP Analysis workspace (js/isip-analysis.js) ────────────────────── */
  .ia-controls {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 10px 0 12px;
  }
  .ia-wellchips { display: flex; gap: 8px; flex-wrap: wrap; }
  .ia-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px;
    padding: 4px 12px 4px 8px; cursor: pointer; color: var(--text-muted);
    font-size: 11.5px; font-weight: 600; transition: border-color 0.15s, color 0.15s;
  }
  .ia-chip.on { color: var(--text-primary); }
  .ia-chip:hover { border-color: var(--text-muted); }
  .ia-chip-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid; flex: 0 0 auto; }
  .ia-xlabel {
    margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
  }
  .ia-xlabel select {
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px;
    font-size: 11px; outline: none;
  }
  .ia-status { font-size: 12px; color: var(--text-muted); padding: 24px 4px; }
  .ia-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .ia-panel {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px 14px; min-width: 0;
  }
  .ia-span2 { grid-column: 1 / -1; }
  .ia-panel-head {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-secondary);
    margin-bottom: 8px;
  }
  .ia-hint {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; font-weight: 400;
    letter-spacing: 0; text-transform: none; color: var(--text-muted);
  }
  .ia-slopes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
  .ia-slope-chip {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid; border-radius: 4px; padding: 2px 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-primary);
  }
  .ia-chart { width: 100%; }
  @media (max-width: 1100px) { .ia-grid { grid-template-columns: 1fr; } }
  .ia-help-pane {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px;
    background: var(--bg-secondary); border: 1px solid var(--accent); border-radius: 8px;
    padding: 14px 18px; margin: 10px 0 2px;
  }
  .ia-help-col h4 {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.1px; text-transform: uppercase; color: var(--accent);
    margin: 10px 0 4px;
  }
  .ia-help-col h4:first-child { margin-top: 0; }
  .ia-help-col p { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 6px; }
  .ia-help-col p b { color: var(--text-primary); }
  #ia-help.active { border-color: var(--accent); color: var(--accent); }
  @media (max-width: 1100px) { .ia-help-pane { grid-template-columns: 1fr; } }
  .ia-takeaways { display: flex; flex-direction: column; gap: 6px; }
  .ia-tk-row {
    display: flex; gap: 12px; align-items: baseline;
    font-size: 12px; color: var(--text-secondary); line-height: 1.45;
  }
  .ia-tk-row b { color: var(--text-primary); }
  .ia-tk-well {
    flex: 0 0 150px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
    font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
    color: var(--text-muted); text-align: right;
  }
  .ia-tk-drv {
    display: inline-block; border: 1px solid var(--border); border-radius: 4px;
    padding: 1px 7px; margin-right: 5px; font-family: 'JetBrains Mono', monospace;
    font-size: 10px; color: var(--text-secondary);
  }
  .ia-tk-drv.strong { border-color: var(--accent); color: var(--accent); font-weight: 700; }
  .ia-tk-drv.dim { opacity: 0.55; }

  /* Production Charts stats footer */
  .pc-footer {
    margin-top: 10px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
    overflow-x: auto;
  }
  .pc-ftr-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .pc-ftr-table th {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
    padding: 3px 8px; text-align: right; border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .pc-ftr-table td {
    padding: 3px 8px; text-align: right; color: var(--text-secondary);
    white-space: nowrap; border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  }
  .pc-ftr-table tbody tr:last-child td { border-bottom: none; }
  .pc-ftr-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 7%, transparent); }

  /* Controlled Breakdown Analysis workspace */
  .cb-stage-pill {
    cursor: pointer; user-select: none;
    color: var(--text-secondary);
  }
  .cb-stage-pill:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.35); }
  .cb-stage-pill.active {
    background: rgba(58,123,213,0.18); border-color: var(--accent); color: var(--accent);
  }
  /* At least one analysis flag picked → green border outline (only). */
  .cb-stage-pill.has-flags {
    border-color: #2ecc71; color: #2ecc71;
  }
  /* "Use in Analysis" enabled → filled green oval. Wins over has-flags
     since included implies flags. Active (selection) outline still wins
     visually because of border thickness. */
  .cb-stage-pill.included {
    background: #2ecc71; border-color: #27ae60; color: #0b1a10;
  }
  .cb-stage-pill.included:hover {
    background: #27ae60; border-color: #27ae60; color: #0b1a10;
  }
  .cb-stage-pill.included.active {
    background: #2ecc71; color: #0b1a10;
    box-shadow: 0 0 0 1px var(--accent);
  }
  /* "No dominant break" — stage was reviewed but had no observable pancake /
     parting event. Mutually exclusive with `included` in the data model. */
  .cb-stage-pill.no-break {
    background: #e74c3c; border-color: #c0392b; color: #fff;
  }
  .cb-stage-pill.no-break:hover {
    background: #c0392b; border-color: #c0392b; color: #fff;
  }
  .cb-stage-pill.no-break.active {
    background: #e74c3c; color: #fff;
    box-shadow: 0 0 0 1px var(--accent);
  }
  .cb-chart-wrap {
    margin-top: 6px; height: 480px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px; padding: 10px;
  }
  .cb-trim-status {
    margin-top: 14px; padding: 6px 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-secondary); min-height: 18px;
  }
  .cb-trim-status .ts-dim { color: var(--text-muted); }
  .cb-trim-status .ts-val { color: var(--text-primary); font-weight: 600; }

  /* Controlled Breakdown analysis flag toolbar + metrics */
  .cb-flag-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 6px 10px; margin-top: 4px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px;
  }
  .cb-flag-toolbar .cb-include {
    display: flex; align-items: center; gap: 5px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary); font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
    cursor: pointer; user-select: none;
  }
  .cb-flag-toolbar .cb-include input { cursor: pointer; }
  .cb-flag-toolbar .cb-toolbar-sep {
    width: 1px; align-self: stretch; background: var(--border); margin: 0 4px;
  }
  .cb-metrics {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  }
  .cb-metric { display: flex; align-items: baseline; gap: 5px; }
  .cb-metric .m-label {
    color: var(--text-muted); font-size: 9px; font-weight: 700;
    letter-spacing: 0.7px; text-transform: uppercase;
  }
  .cb-metric .m-val { color: var(--text-primary); font-weight: 700; }
  .cb-metric .m-val.pos { color: #2ecc71; }
  .cb-metric .m-val.neg { color: #e74c3c; }
  .cb-metric .m-unit { color: var(--text-muted); font-size: 9px; margin-left: 2px; }

  /* Start/End analysis flag markers — same skeleton as step markers but with
     distinctive solid colors so they read as separate from Flag 1..N + EOF. */
  .cb-anlys-marker {
    position: absolute; width: 0; pointer-events: none;
    border-left: 1px solid;
  }
  .cb-anlys-marker.start { border-left-color: #2ecc71; }
  .cb-anlys-marker.end   { border-left-color: #e74c3c; }
  .cb-anlys-marker .anlys-box {
    position: absolute; top: 22px; left: -14px;
    min-width: 28px; height: 18px; padding: 0 5px;
    border-radius: 3px; pointer-events: auto; cursor: ew-resize;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 800;
    color: #1a1a1a; display: flex; align-items: center; justify-content: center;
    user-select: none; box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: filter 0.1s, box-shadow 0.1s;
  }
  .cb-anlys-marker .anlys-box:hover { filter: brightness(1.1); }
  .cb-anlys-marker.start .anlys-box { background: #2ecc71; border: 1px solid #27ae60; }
  .cb-anlys-marker.end   .anlys-box { background: #e74c3c; border: 1px solid #c0392b; color: #fff; }
  .cb-anlys-marker.dragging .anlys-box {
    filter: brightness(1.2);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.45), 0 1px 4px rgba(0,0,0,0.6);
  }

  /* When a Pick button is armed, the chart overlay shows a crosshair cursor
     and accepts pointer events. */
  #cb-prd-overlay.cb-arm-start, #cb-prd-overlay.cb-arm-end {
    cursor: crosshair; pointer-events: auto;
  }

  /* Import Stage Metadata modal */
  .cb-import-modal {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
  }
  .cb-import-modal.visible { display: flex; }
  .cb-import-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
  }
  .cb-import-card {
    position: relative; z-index: 1;
    width: 720px; max-width: 92vw; max-height: 85vh;
    display: flex; flex-direction: column;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }
  .cb-import-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--title-strong);
  }
  .cb-import-header .imp-close {
    margin-left: auto; width: 26px; height: 26px;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 16px; line-height: 1;
    cursor: pointer; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
  }
  .cb-import-header .imp-close:hover { border-color: var(--danger); color: var(--danger); }
  .cb-import-body {
    padding: 14px 16px; flex: 1; overflow: auto;
    display: flex; flex-direction: column; gap: 10px;
  }
  .cb-import-body label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-secondary);
  }
  .cb-import-body select, .cb-import-body textarea {
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px; padding: 6px 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .cb-import-body textarea {
    width: 100%; resize: vertical; min-height: 140px;
    line-height: 1.4;
  }
  .cb-import-hint {
    font-size: 10.5px; color: var(--text-muted); line-height: 1.5;
  }
  .cb-import-preview {
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 3px; padding: 8px 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: var(--text-secondary); max-height: 180px; overflow: auto;
  }
  .cb-import-preview .ip-row { display: flex; gap: 6px; padding: 1px 0; }
  .cb-import-preview .ip-key { color: var(--text-muted); flex: 0 0 140px; }
  .cb-import-preview .ip-val { color: var(--text-primary); }
  .cb-import-preview .ip-warn { color: #f39c12; }
  .cb-import-preview .ip-err  { color: var(--danger); }
  .cb-import-footer {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-top: 1px solid var(--border);
  }
  .cb-import-status { font-size: 10.5px; color: var(--text-muted); margin-right: auto; }
  .cb-import-status.ok  { color: #2ecc71; }
  .cb-import-status.err { color: var(--danger); }

  /* Aggregate analysis section (scatter + along-lateral panels) */
  .cb-agg-header {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .cb-agg-title {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--title-strong);
  }
  .cb-agg-meta {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted);
  }
  .cb-agg-colorby {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-secondary);
  }
  .cb-agg-colorby .cby-label {
    color: var(--text-muted); margin-right: 4px;
    text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700;
  }
  .cb-agg-colorby .cby-btn {
    padding: 3px 8px; border-radius: 3px; cursor: pointer;
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border);
    font-family: inherit; font-size: 9.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .cb-agg-colorby .cby-btn:hover { border-color: var(--accent); color: var(--text-primary); }
  .cb-agg-colorby .cby-btn.active {
    background: var(--accent); border-color: var(--accent); color: #fff;
  }
  .cb-agg-legend {
    display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-secondary);
  }
  .cb-agg-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
  .cb-agg-legend .lg-dot {
    width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px;
  }
  .cb-agg-empty {
    padding: 20px; text-align: center; font-style: italic;
    font-size: 11px; color: var(--text-muted);
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px;
  }
  .cb-agg-grid {
    display: grid; gap: 10px;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-rows: repeat(3, 220px);
  }
  .cb-agg-grid .cb-agg-scatter { grid-row: span 3; }
  .cb-agg-card {
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px; padding: 8px 10px 10px;
    display: flex; flex-direction: column;
  }
  .cb-agg-card-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.7px; text-transform: uppercase; color: var(--text-secondary);
    margin-bottom: 6px;
  }
  .cb-agg-card-sub {
    font-weight: 500; color: var(--text-muted); margin-left: 6px;
    text-transform: none; letter-spacing: 0.3px;
  }
  .cb-agg-canvas-wrap { flex: 1; position: relative; min-height: 0; }
  .cb-agg-canvas-wrap canvas { width: 100% !important; height: 100% !important; }
  .cb-zone-bars { margin-top: 14px; }
  .cb-zone-bars-header {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .cb-zone-bars-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 220px 220px;
  }
  .cb-no-break-section { margin-top: 14px; }
  .cb-no-break-card { height: 220px; }
  .cb-fg-section { margin-top: 14px; }
  .cb-fg-card { height: 340px; }
  .cb-fg-compare-section { margin-top: 14px; }
  .cb-fg-compare-card { height: 280px; }
  .cb-fg-zone-section { margin-top: 14px; }
  .cb-fg-zone-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
  }
  .cb-fg-zone-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 5px; vertical-align: -1px;
  }

  /* Collapsible PRD section bar — folds the per-stage trim status, flag
     toolbar, chart, and x-zoom slider so the engineer can focus on the
     well list + aggregate views without scrolling past the chart. */
  .cb-prd-toggle {
    display: flex; align-items: center; gap: 6px;
    margin-top: 14px; padding: 8px 4px;
    border-top: 1px solid var(--border);
    cursor: pointer; user-select: none;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-secondary);
  }
  .cb-prd-toggle:hover { color: var(--text-primary); }
  .cb-prd-caret {
    flex: 0 0 12px; font-size: 11px; color: var(--text-muted);
    transition: transform 0.15s; display: inline-block;
  }
  #cb-workspace.cb-prd-collapsed .cb-prd-caret { transform: rotate(-90deg); }
  .cb-prd-toggle-hint {
    margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0.3px;
    color: var(--text-muted); font-size: 9.5px;
  }
  #cb-workspace.cb-prd-collapsed .cb-trim-status,
  #cb-workspace.cb-prd-collapsed .cb-flag-toolbar,
  #cb-workspace.cb-prd-collapsed .cb-chart-wrap,
  #cb-workspace.cb-prd-collapsed #cb-zoom-bar { display: none !important; }

  /* ── Stage Comparison workspace — overlay stages across pressure / rate / proppant ── */
  #sc-workspace { font-family: 'IBM Plex Sans', sans-serif; }
  #sc-workspace .sc-meta {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
    letter-spacing: 0.6px; padding: 0 8px;
  }
  #sc-wells-list {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 12px; max-height: 30vh; overflow-y: auto; margin-bottom: 12px;
  }
  .sc-pill { cursor: pointer; user-select: none; }
  .sc-pill:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.35); }
  .sc-pill.sc-on { background: var(--accent); border-color: var(--accent); color: #fff; }
  .sc-pill.sc-loading { opacity: 0.55; font-style: italic; }
  .sc-charts {
    display: grid; grid-template-columns: 1fr; gap: 10px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 12px;
  }
  .sc-chart-row { display: flex; flex-direction: column; gap: 4px; }
  .sc-chart-label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
  }
  .sc-chart-label .sc-zoom-hint {
    font-weight: 400; text-transform: none; letter-spacing: 0.3px; color: var(--text-muted);
    font-size: 9px; opacity: 0.7;
  }
  .sc-chart-body { display: flex; gap: 6px; height: 220px; }
  .sc-canvas-wrap { position: relative; flex: 1; height: 100%; }
  .sc-yzoom-col {
    display: flex; flex-direction: column; align-items: center;
    padding: 6px 3px; background: var(--bg-tertiary);
    border-radius: 4px; flex: 0 0 14px;
  }
  .sc-yzoom-track {
    position: relative; flex: 1; width: 14px; min-height: 100px;
    cursor: pointer; user-select: none;
  }
  .sc-yzoom-track::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 5px;
    width: 4px; background: var(--border); border-radius: 2px;
  }
  .sc-yz-fill {
    position: absolute; left: 1px; width: 12px;
    background: var(--accent); border-radius: 3px; opacity: 0.55;
    cursor: grab;
  }
  .sc-yz-fill:hover { opacity: 0.75; }
  .sc-yz-fill.dragging { cursor: grabbing; opacity: 0.9; }
  .sc-yz-thumb {
    position: absolute; left: -1px; width: 16px; height: 12px;
    transform: translateY(-50%);
    border-radius: 3px; background: var(--accent);
    border: 1px solid var(--bg-secondary);
    cursor: ns-resize; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 2;
  }
  .sc-yz-thumb:hover { filter: brightness(1.15); }
  /* X-axis time zoom — sits under the top chart but governs all 3 panels.
     Reuses .hist-zoom-track / .hz-bg / .hz-fill from the historical-review slider. */
  .sc-xzoom-bar {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px 0 26px;
    margin-top: 4px;
  }
  .sc-xzoom-bar .hist-zoom-track { flex: 1; min-width: 0; }
  .sc-xzoom-bar .hz-range {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-secondary); min-width: 120px; text-align: center; white-space: nowrap;
  }
  .sc-xzoom-bar .sc-xzoom-hint {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-muted); white-space: nowrap; opacity: 0.75;
  }

  /* ── Rate Step-Down workspace ── */
  #rsd-workspace { font-family: 'IBM Plex Sans', sans-serif; }
  #rsd-wells-list {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 12px; max-height: 28vh; overflow-y: auto; margin-bottom: 12px;
  }
  .rsd-stage-pill { cursor: pointer; user-select: none; }
  .rsd-stage-pill:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.35); }
  .rsd-stage-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .rsd-stage-pill.has-region { border-color: rgba(243,156,18,0.55); color: #f39c12; }
  .rsd-stage-pill.has-plateaus::after {
    content: 'SDT'; margin-left: 4px; padding: 0 3px;
    font-size: 7.5px; font-weight: 800; letter-spacing: 0.4px;
    background: rgba(46,204,113,0.18); color: #2ecc71;
    border-radius: 3px; vertical-align: 1px;
  }
  .rsd-stage-pill.tagged-sdt { border-style: dashed; }

  .rsd-stage-block {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 12px 14px; margin-bottom: 12px;
  }
  .rsd-stage-title {
    font-size: 13px; font-weight: 700; color: var(--title-strong); letter-spacing: 0.3px;
    margin-bottom: 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  }
  .rsd-stage-title small {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); font-weight: 400; letter-spacing: 0.5px;
  }
  .rsd-stage-tag {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    padding: 1px 6px; border-radius: 10px; letter-spacing: 0.4px; font-weight: 600;
    background: rgba(46,204,113,0.18); color: #2ecc71;
    border: 1px solid rgba(46,204,113,0.35);
  }
  /* Test Conditions row — fluid + (future) treatment-path summary. Sits
     between the stage title and the pick toolbar so the engineer sees what
     the SDT fit will use to subtract pipe friction before they run it. */
  .rsd-test-conditions {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 6px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-secondary);
  }
  .rsd-test-conditions label {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-muted);
  }
  .rsd-test-conditions select {
    padding: 4px 8px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 4px;
    color: var(--text-primary); font-family: inherit; font-size: 11px;
    outline: none; min-width: 220px; cursor: pointer;
  }
  .rsd-test-conditions select:focus { border-color: var(--accent); }
  .rsd-test-conditions .rsd-tc-hint {
    color: var(--text-muted); font-size: 10px; font-style: italic; opacity: 0.85;
  }
  .rsd-test-conditions .rsd-tc-link {
    color: var(--accent); cursor: pointer; text-decoration: underline;
    text-underline-offset: 2px;
  }
  .rsd-test-conditions input[type="number"] {
    padding: 4px 6px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 4px;
    color: var(--text-primary); font-family: inherit; font-size: 11px;
    outline: none; width: 70px; text-align: right;
  }
  .rsd-test-conditions input[type="number"]:focus { border-color: var(--accent); }
  .rsd-test-conditions input[type="number"].rsd-mult-override-active {
    border-color: rgba(243,156,18,0.6); background: rgba(243,156,18,0.06);
  }
  .rsd-test-conditions button.rsd-mult-clear {
    padding: 3px 8px; background: transparent;
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-muted); font-family: inherit; font-size: 10px;
    cursor: pointer;
  }
  .rsd-test-conditions button.rsd-mult-clear:hover {
    color: var(--text-primary); border-color: var(--text-muted);
  }
  .rsd-toolbar {
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px;
  }
  /* PRD plot collapse toggle — mirror of the breakdown workspace's
     cb-prd-toggle so the engineer can hide the chart + zoom + pick toolbar
     once plateau picking is done and focus on the decomposition. */
  .rsd-prd-toggle {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; user-select: none;
    background: var(--bg-tertiary); border-radius: 4px; margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-secondary);
  }
  .rsd-prd-toggle:hover { color: var(--text-primary); }
  .rsd-prd-caret {
    flex: 0 0 12px; font-size: 11px; color: var(--text-muted);
    transition: transform 0.15s; display: inline-block;
  }
  #rsd-stage-block.rsd-prd-collapsed .rsd-prd-caret { transform: rotate(-90deg); }
  .rsd-prd-toggle-hint {
    margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0.3px;
    color: var(--text-muted); font-size: 9.5px;
  }
  #rsd-stage-block.rsd-prd-collapsed .rsd-toolbar,
  #rsd-stage-block.rsd-prd-collapsed .rsd-canvas-wrap,
  #rsd-stage-block.rsd-prd-collapsed .rsd-xzoom-bar { display: none !important; }
  /* Fullscreen toggle button — small icon button at the right end of the
     rsd-prd-toggle header. stopPropagation on click so it doesn't trigger
     the header's collapse toggle. Mirrors the historical-review PRD pattern. */
  .rsd-prd-fullscreen-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 13px; line-height: 1;
    font-family: inherit;
    flex: 0 0 auto;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  .rsd-prd-fullscreen-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
  }
  /* Fullscreen state — pin the stage block to the viewport and let the PRD
     canvas flex to fill it. Non-essential children (stage title, test
     conditions row, steps host, summary panel, fit chart) hide so the
     engineer gets a clean PRD-only view. Esc + the button toggle back. */
  #rsd-stage-block.rsd-prd-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 40;
    margin: 0; border-radius: 0;
    background: var(--bg-primary);
    display: flex; flex-direction: column;
    padding: 8px 12px;
    overflow: hidden;
  }
  #rsd-stage-block.rsd-prd-fullscreen .rsd-stage-title,
  #rsd-stage-block.rsd-prd-fullscreen .rsd-test-conditions,
  #rsd-stage-block.rsd-prd-fullscreen #rsd-steps-host,
  #rsd-stage-block.rsd-prd-fullscreen .rsd-summary,
  #rsd-stage-block.rsd-prd-fullscreen .rsd-fit-chart-wrap,
  #rsd-stage-block.rsd-prd-fullscreen .rsd-decline-block { display: none !important; }
  #rsd-stage-block.rsd-prd-fullscreen .rsd-prd-toggle,
  #rsd-stage-block.rsd-prd-fullscreen .rsd-toolbar,
  #rsd-stage-block.rsd-prd-fullscreen .rsd-xzoom-bar { flex: 0 0 auto; }
  #rsd-stage-block.rsd-prd-fullscreen .rsd-canvas-wrap {
    flex: 1 1 auto; height: auto !important; min-height: 0;
  }
  .rsd-toolbar .rsd-sep { flex: 1; }
  .rsd-toolbar .rsd-status {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
    letter-spacing: 0.3px;
  }
  .rsd-canvas-wrap {
    position: relative; height: 320px; margin-bottom: 8px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 6px;
    display: flex; gap: 4px;
  }
  .rsd-canvas-wrap canvas { background: transparent; }
  .rsd-canvas-inner {
    position: relative; flex: 1; min-width: 0;
  }
  .rsd-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
  }
  /* Y-axis zoom columns flanking the chart — pressure (left, red), rate
     (right, blue). Same drag pattern as the Stage Comparison Y-zooms. */
  .rsd-yzoom-col {
    flex: 0 0 14px;
    display: flex; flex-direction: column; align-items: center;
    padding: 2px 0; background: var(--bg-secondary); border-radius: 4px;
  }
  .rsd-yzoom-track {
    position: relative; flex: 1; width: 14px;
    cursor: pointer; user-select: none;
  }
  .rsd-yzoom-track::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 5px;
    width: 4px; background: var(--border); border-radius: 2px;
  }
  .rsd-yz-fill {
    position: absolute; left: 1px; width: 12px;
    background: var(--accent); border-radius: 3px; opacity: 0.55;
    cursor: grab;
  }
  .rsd-yz-fill:hover { opacity: 0.8; }
  .rsd-yz-fill.dragging { cursor: grabbing; opacity: 0.9; }
  .rsd-yz-thumb {
    position: absolute; left: -1px; width: 16px; height: 12px;
    transform: translateY(-50%);
    border-radius: 3px; background: var(--accent);
    border: 1px solid var(--bg-secondary);
    cursor: ns-resize; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 2;
  }
  .rsd-yz-thumb:hover { filter: brightness(1.15); }
  /* Color the axis sliders to match the chart lines */
  .rsd-yzoom-col[data-rsd-yaxis="pressure"] .rsd-yz-fill,
  .rsd-yzoom-col[data-rsd-yaxis="pressure"] .rsd-yz-thumb { background: rgba(231,76,60,0.9); }
  .rsd-yzoom-col[data-rsd-yaxis="rate"]     .rsd-yz-fill,
  .rsd-yzoom-col[data-rsd-yaxis="rate"]     .rsd-yz-thumb { background: rgba(52,152,219,0.9); }
  .rsd-overlay.rsd-arm-region-start,
  .rsd-overlay.rsd-arm-region-end,
  .rsd-overlay.rsd-arm-plateau {
    pointer-events: auto; cursor: crosshair;
  }
  .rsd-overlay .rsd-region-shade {
    position: absolute; top: 0; bottom: 0;
    background: rgba(243,156,18,0.07);
    border-left: 1px dashed rgba(243,156,18,0.7);
    border-right: 1px dashed rgba(243,156,18,0.7);
  }
  .rsd-overlay .rsd-region-tag {
    position: absolute; top: 2px; padding: 1px 5px;
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    background: rgba(243,156,18,0.85); color: #1a1a1a; border-radius: 3px;
    letter-spacing: 0.4px;
  }
  .rsd-overlay .rsd-plateau-shade {
    position: absolute; top: 0; bottom: 0;
    background: rgba(46,204,113,0.13);
    border-left: 1px solid rgba(46,204,113,0.55);
    border-right: 1px solid rgba(46,204,113,0.55);
    pointer-events: auto; cursor: pointer;
  }
  .rsd-overlay .rsd-plateau-shade:hover { background: rgba(46,204,113,0.22); }
  .rsd-overlay .rsd-plateau-shade .rsd-plateau-num {
    position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
    padding: 1px 5px; font-family: 'JetBrains Mono', monospace; font-size: 9px;
    font-weight: 800; background: rgba(46,204,113,0.85); color: #1a1a1a;
    border-radius: 3px; letter-spacing: 0.4px;
  }
  .rsd-overlay .rsd-plateau-shade .rsd-plateau-del {
    position: absolute; top: 2px; right: 2px; width: 14px; height: 14px;
    background: rgba(231,76,60,0.85); color: #fff; border-radius: 3px;
    font-size: 11px; line-height: 14px; text-align: center;
    cursor: pointer; font-weight: 700; user-select: none;
    opacity: 0; transition: opacity 0.1s;
  }
  .rsd-overlay .rsd-plateau-shade:hover .rsd-plateau-del { opacity: 1; }
  .rsd-overlay .rsd-pending-line {
    position: absolute; top: 0; bottom: 0; width: 1px;
    background: rgba(46,204,113,0.9); pointer-events: none;
  }
  /* Region-start hairline shown after the engineer picks the start but before
     the end. Uses the same dashed-orange treatment as the region shade so the
     pending boundary visually telegraphs what's about to become the region. */
  .rsd-overlay .rsd-pending-region-line {
    position: absolute; top: 0; bottom: 0; width: 0;
    border-left: 1px dashed rgba(243,156,18,0.85); pointer-events: none;
  }
  /* Historical-review flags + EOF — reuse the shared .step-marker classes
     defined further up so the RSD chart matches the PRD plot exactly.
     Wrapped in .step-overlay.locked so the markers are read-only here. */

  table.rsd-steps-table {
    border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; width: 100%;
    margin-top: 4px;
  }
  table.rsd-steps-table th, table.rsd-steps-table td {
    border: 1px solid var(--border); padding: 4px 8px; text-align: right; white-space: nowrap;
  }
  table.rsd-steps-table th { background: var(--bg-tertiary); color: var(--text-secondary); font-weight: 600; }
  table.rsd-steps-table td:first-child, table.rsd-steps-table th:first-child { text-align: left; }
  table.rsd-steps-table tr.rsd-isip td { background: var(--bg-tertiary); font-style: italic; color: var(--text-secondary); }
  .rsd-empty {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 32px; text-align: center; color: var(--text-muted); font-style: italic; font-size: 12px;
  }

  /* SDT friction decomposition summary panel + fit-quality chart */
  .rsd-summary {
    margin-top: 12px; padding: 12px 14px;
    background: var(--bg-tertiary); border-radius: 6px;
    border: 1px solid var(--border);
  }
  .rsd-summary-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    padding: 0 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
  }
  .rsd-summary-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 18px; align-items: start;
  }
  .rsd-summary-block {
    display: flex; flex-direction: column; gap: 4px;
  }
  .rsd-summary-block-title {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
    padding: 0 0 4px; border-bottom: 1px dashed var(--border); margin-bottom: 4px;
  }
  .rsd-summary-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .rsd-summary-row .rsd-sum-label { color: var(--text-muted); }
  .rsd-summary-row .rsd-sum-value { color: var(--text-primary); font-weight: 600; text-align: right; }
  .rsd-summary-row .rsd-sum-pct {
    color: var(--text-muted); font-weight: 400; margin-left: 6px; font-size: 10px;
    display: inline-block; min-width: 32px; text-align: right;
  }
  /* qualifier riding inside a value, e.g. the closure pick's method name */
  .rsd-summary-row .rsd-sum-dim { color: var(--text-muted); font-weight: 400; font-size: 10px; }
  .rsd-summary-row.rsd-warn .rsd-sum-value { color: #f39c12; }
  .rsd-summary-row.rsd-good .rsd-sum-value { color: #2ecc71; }
  .rsd-summary-row.rsd-bad  .rsd-sum-value { color: #e74c3c; }
  .rsd-summary-tag {
    display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 8px;
    font-size: 9px; font-weight: 700; letter-spacing: 0.4px;
  }
  .rsd-summary-tag.good { background: rgba(46,204,113,0.18); color: #2ecc71; }
  .rsd-summary-tag.info { background: rgba(127,179,213,0.18); color: #7fb3d5; }
  .rsd-summary-tag.warn { background: rgba(243,156,18,0.18); color: #f39c12; }
  .rsd-summary-tag.bad  { background: rgba(231,76,60,0.18); color: #e74c3c; }
  /* Well-list filter: All stages vs SDT only. Defaults to All; the SDT-only
     mode hides stages without saved region/plateau picks AND collapses wells
     that have zero SDT'd stages, so an engineer working a multi-well project
     with sparse coverage doesn't have to scroll through dozens of unused
     stages. Choice persists in localStorage. */
  .rsd-list-filter {
    display: flex; gap: 6px; align-items: center;
    margin-bottom: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .rsd-list-filter-label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase; color: var(--text-muted); margin-right: 4px;
  }
  .rsd-list-filter-btn {
    padding: 4px 12px; border-radius: 3px; cursor: pointer;
    background: var(--bg-tertiary); color: var(--text-muted);
    border: 1px solid var(--border);
    font-family: inherit; font-size: 11px;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
  }
  .rsd-list-filter-btn:hover { color: var(--text-primary); }
  .rsd-list-filter-btn.active {
    background: var(--bg-secondary); color: var(--text-primary);
    border-color: rgba(52,152,219,0.6);
  }
  .rsd-list-filter-count {
    margin-left: auto; color: var(--text-muted);
    font-size: 10px; font-style: italic;
  }
  /* Workspace tabs (Per-Stage / Project Summary). Sit between the workspace
     header and the per-tab content. Active tab gets a colored underline + the
     non-muted text color; inactive tabs are clickable. */
  .rsd-tabs {
    display: flex; gap: 0; align-items: stretch;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
  }
  .rsd-tab {
    padding: 8px 16px; cursor: pointer;
    background: transparent; border: 0; outline: 0;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    letter-spacing: 0.4px; text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
  }
  .rsd-tab:hover { color: var(--text-primary); }
  .rsd-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent, #3498db);
  }
  .rsd-tab .rsd-tab-count {
    margin-left: 6px; padding: 1px 6px; border-radius: 8px;
    background: rgba(127,179,213,0.18); color: #7fb3d5;
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px;
  }
  /* Project-summary table — one row per SDT'd stage across the project,
     sortable by clicking column headers. Color-coded regime tags match the
     per-stage panel (good/info/bad). */
  .rsd-sum-toolbar {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 10px; font-size: 11px;
  }
  .rsd-sum-toolbar label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
  }
  .rsd-sum-toolbar select {
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 3px;
    padding: 4px 8px; font-size: 11px; min-width: 180px;
  }
  .rsd-sum-toolbar .rsd-sum-spacer { flex: 1; }
  .rsd-sum-toolbar button {
    padding: 4px 12px; border-radius: 3px; cursor: pointer;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); font-size: 11px;
  }
  .rsd-sum-toolbar button:hover { background: var(--bg-secondary); }

  /* Generate Report modal — mirrors cb-import-modal pattern */
  .rsd-rpt-modal {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
  }
  .rsd-rpt-modal.visible { display: flex; }
  .rsd-rpt-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
  }
  .rsd-rpt-card {
    position: relative; z-index: 1;
    width: 960px; max-width: 95vw; max-height: 88vh;
    display: flex; flex-direction: column;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }
  .rsd-rpt-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--title-strong);
  }
  .rsd-rpt-header .rrp-close {
    margin-left: auto; width: 26px; height: 26px;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 16px; line-height: 1;
    cursor: pointer; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
  }
  .rsd-rpt-header .rrp-close:hover { border-color: var(--danger); color: var(--danger); }
  .rsd-rpt-body {
    padding: 14px 16px; flex: 1; overflow: hidden;
    display: flex; flex-direction: column; gap: 10px;
  }
  .rsd-rpt-scope {
    display: flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .rsd-rpt-scope label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--text-secondary);
  }
  .rsd-rpt-scope input[type="text"] {
    flex: 1;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px; padding: 6px 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .rsd-rpt-panes {
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px;
    flex: 1; min-height: 0;
  }
  .rsd-rpt-pane {
    display: flex; flex-direction: column;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px; min-height: 0;
  }
  .rsd-rpt-pane-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-secondary);
  }
  .rsd-rpt-pane-head .rrp-pane-title { color: var(--title-strong); }
  .rsd-rpt-pane-head .rrp-pane-spacer { flex: 1; }
  .rsd-rpt-pane-head select {
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px; padding: 3px 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }
  .rsd-rpt-pane-head .rrp-mini {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: 3px;
    padding: 2px 8px; font-size: 10px; cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
  }
  .rsd-rpt-pane-head .rrp-mini:hover { background: var(--bg-secondary); color: var(--text-primary); }
  .rsd-rpt-list {
    flex: 1; overflow: auto;
    padding: 4px 0;
  }
  .rsd-rpt-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-primary); cursor: pointer;
  }
  .rsd-rpt-row:hover { background: var(--bg-secondary); }
  .rsd-rpt-row input[type="checkbox"] { cursor: pointer; margin: 0; }
  .rsd-rpt-row .rrp-row-meta {
    margin-left: auto; color: var(--text-muted); font-size: 10px;
  }
  .rsd-rpt-row .rrp-row-tag {
    font-size: 9.5px; padding: 1px 6px; border-radius: 2px;
    background: var(--bg-secondary); color: var(--text-secondary);
    letter-spacing: 0.4px;
  }
  .rsd-rpt-row .rrp-row-tag.tort-dominated { background: rgba(46,134,193,0.18); color: #5dade2; }
  .rsd-rpt-row .rrp-row-tag.perf-limited   { background: rgba(231,76,60,0.18);  color: #e74c3c; }
  .rsd-rpt-row .rrp-row-tag.balanced       { background: rgba(127,179,213,0.18); color: #7fb3d5; }
  .rsd-rpt-row .rrp-row-tag.clean          { background: rgba(46,204,113,0.18); color: #2ecc71; }
  .rsd-rpt-row .rrp-row-tag.failed         { background: rgba(231,76,60,0.18);  color: #e74c3c; }
  .rsd-rpt-row.disabled { opacity: 0.45; cursor: default; }
  .rsd-rpt-list-empty {
    padding: 14px; color: var(--text-muted); font-size: 11px;
    font-family: 'JetBrains Mono', monospace; text-align: center;
  }
  .rsd-rpt-opts {
    display: flex; flex-wrap: wrap; gap: 14px;
    padding: 4px 0;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-secondary);
  }
  .rsd-rpt-opts label {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  }
  .rsd-rpt-footer {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-top: 1px solid var(--border);
  }
  .rsd-rpt-count {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-primary); margin-right: auto;
  }
  .rsd-rpt-count .rrp-count-muted { color: var(--text-muted); }
  .rsd-rpt-footer button {
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: 3px; padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; cursor: pointer;
  }
  .rsd-rpt-footer button:hover { background: var(--bg-secondary); }
  .rsd-rpt-footer button.primary {
    background: var(--accent, #2ecc71); color: #fff; border-color: transparent;
  }
  .rsd-rpt-footer button.primary:disabled {
    opacity: 0.4; cursor: not-allowed;
  }
  .rsd-sum-status {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted);
  }
  .rsd-sum-table-host {
    overflow-x: auto;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px;
  }
  .rsd-sum-table {
    width: 100%; border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .rsd-sum-table th, .rsd-sum-table td {
    padding: 6px 10px; text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .rsd-sum-table th {
    color: var(--text-muted); font-weight: 600; font-size: 10px;
    letter-spacing: 0.4px; text-transform: uppercase;
    cursor: pointer; user-select: none;
    background: var(--bg-secondary);
    position: sticky; top: 0; z-index: 1;
  }
  .rsd-sum-table th:hover { color: var(--text-primary); }
  .rsd-sum-table th.sorted::after {
    content: ' ▾'; opacity: 0.7;
  }
  .rsd-sum-table th.sorted.asc::after {
    content: ' ▴'; opacity: 0.7;
  }
  .rsd-sum-table th:first-child, .rsd-sum-table td:first-child,
  .rsd-sum-table .col-text { text-align: left; }
  .rsd-sum-table tbody tr { cursor: pointer; transition: background 0.1s; }
  .rsd-sum-table tbody tr:hover { background: rgba(127,179,213,0.06); }
  .rsd-sum-empty {
    padding: 24px; text-align: center; color: var(--text-muted);
    font-style: italic; font-size: 11px;
  }
  .rsd-sum-tag {
    display: inline-block; padding: 1px 6px; border-radius: 8px;
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px;
  }
  .rsd-sum-tag.tort     { background: rgba(46,204,113,0.18); color: #2ecc71; }
  .rsd-sum-tag.perf     { background: rgba(231,76,60,0.18); color: #e74c3c; }
  .rsd-sum-tag.balanced { background: rgba(127,179,213,0.18); color: #7fb3d5; }
  .rsd-sum-tag.clean    { background: rgba(149,165,166,0.18); color: #95a5a6; }
  .rsd-sum-tag.failed   { background: rgba(243,156,18,0.18); color: #f39c12; }
  .rsd-sum-cell-num     { color: var(--text-primary); font-weight: 600; }
  .rsd-sum-cell-num-mut { color: var(--text-muted); }
  /* Cross-well heel-to-toe chart — sits above the project-summary table.
     One colored line per well, x = top perf MD, y = engineer-selected metric.
     Click a point to jump back to the per-stage view. */
  .rsd-sum-chart-wrap {
    margin-bottom: 10px; padding: 10px 12px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 4px;
  }
  .rsd-sum-chart-wrap.collapsed .rsd-sum-chart-canvas-wrap { display: none; }
  .rsd-sum-chart-header {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .rsd-sum-chart-title {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--text-muted);
  }
  .rsd-sum-chart-header label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
  }
  .rsd-sum-chart-header select {
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 3px;
    padding: 3px 8px; font-size: 11px;
  }
  .rsd-sum-chart-header .rsd-sum-chart-spacer { flex: 1; }
  .rsd-sum-chart-header button {
    padding: 3px 10px; border-radius: 3px; cursor: pointer;
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border); font-size: 10.5px;
  }
  .rsd-sum-chart-header button:hover { background: var(--bg-primary); }
  .rsd-sum-chart-canvas-wrap { height: 280px; position: relative; }
  .rsd-sum-chart-empty {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); font-style: italic; font-size: 11px;
  }
  /* Zone-shape mini-legend below the chart. Engineer reads point COLOR for
     well, point SHAPE for landing-vs-target. Glyph colors are intentionally
     muted (text-secondary) so they don't fight the per-well palette. */
  .rsd-sum-zone-legend {
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted);
  }
  .rsd-sum-zone-legend .rsd-sum-zone-title {
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  }
  .rsd-sum-zone-legend .rsd-sum-zone-item {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-secondary);
  }
  .rsd-sum-zone-legend .rsd-sum-zone-glyph {
    display: inline-block; width: 11px; height: 11px;
    color: var(--text-secondary);
    line-height: 11px; text-align: center; font-size: 12px;
  }
  /* Perf-vs-Tortuosity split bar — at-a-glance regime indicator. Sits below
     the FracPro-style 3-column grid; segments are sized to P_perf and P_NWB
     in psi at Q_max. Colors match the fit-chart legend (perf = blue, NWB = green). */
  .rsd-perftort-wrap {
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  }
  .rsd-perftort-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; margin-bottom: 6px;
  }
  .rsd-perftort-title {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
  }
  .rsd-perftort-regime {
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 600;
    color: var(--text-primary); letter-spacing: 0.2px;
  }
  .rsd-perftort-bar {
    display: flex; height: 22px; width: 100%; border-radius: 4px; overflow: hidden;
    background: var(--bg-secondary); border: 1px solid var(--border);
  }
  .rsd-perftort-seg {
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
    color: rgba(255,255,255,0.92); white-space: nowrap; overflow: hidden;
    transition: width 0.25s ease;
  }
  .rsd-perftort-seg.perf  { background: rgba(52,152,219,0.55); }
  .rsd-perftort-seg.nwb   { background: rgba(46,204,113,0.55); }
  .rsd-perftort-seg.empty {
    flex: 1; background: transparent; color: var(--text-muted); font-style: italic;
  }
  .rsd-perftort-legend {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    margin-top: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted);
  }
  .rsd-perftort-legend-item { display: flex; align-items: center; gap: 6px; }
  .rsd-perftort-swatch {
    display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  }
  .rsd-perftort-swatch.perf { background: rgba(52,152,219,0.55); }
  .rsd-perftort-swatch.nwb  { background: rgba(46,204,113,0.55); }
  .rsd-fit-chart-wrap {
    margin-top: 10px; height: 220px; padding: 6px;
    background: var(--bg-tertiary); border-radius: 4px;
    border: 1px solid var(--border);
  }

  /* ── Decline Analysis sub-panel ─────────────────────────────────
     Sits below the friction-decomp summary + fit chart. Toggle header
     mirrors rsd-prd-toggle; toolbar mirrors rsd-toolbar; output card
     leans on the rsd-summary palette so it reads as part of the same
     workspace. Headline metric is the slope, m = dP/d√τ. */
  .rsd-decline-block { margin-top: 14px; }
  .rsd-decline-toggle {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; user-select: none;
    background: var(--bg-tertiary); border-radius: 4px; margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-secondary);
  }
  .rsd-decline-toggle:hover { color: var(--text-primary); }
  .rsd-decline-caret {
    flex: 0 0 12px; font-size: 11px; color: var(--text-muted);
    transition: transform 0.15s; display: inline-block;
  }
  .rsd-decline-block.collapsed .rsd-decline-caret { transform: rotate(-90deg); }
  .rsd-decline-block.collapsed .rsd-decline-body { display: none; }
  .rsd-decline-toggle-hint {
    margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0.3px;
    color: var(--text-muted); font-size: 9.5px;
  }
  .rsd-decline-toolbar {
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px;
  }
  .rsd-decline-toolbar .rsd-status {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
    letter-spacing: 0.3px; margin-left: 4px;
  }
  .rsd-decl-dwell-label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.3px;
    text-transform: uppercase; font-weight: 600;
    margin-left: 4px;
  }
  #rsd-decl-dwell {
    width: 56px; padding: 3px 6px; font-size: 11px;
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
  }
  .rsd-decl-dwell-unit {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted);
  }
  .rsd-decline-canvas-wrap {
    position: relative; height: 240px; margin-bottom: 8px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 6px;
    border: 1px solid var(--border);
  }
  .rsd-decline-canvas-wrap canvas { background: transparent; }
  /* Output card — mirrors rsd-summary visual. Two rows: headline (slope +
     quality badge), then a collapsible derived row with h_f / E' / C_L. */
  .rsd-decline-output {
    margin-top: 8px; padding: 12px 14px; border-radius: 4px;
    background: var(--bg-secondary); border: 1px solid var(--border);
  }
  .rsd-decline-output-empty {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-muted); font-style: italic; text-align: center;
    padding: 6px 0;
  }
  .rsd-decline-headline {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  }
  .rsd-decline-headline-label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
  }
  .rsd-decline-headline-value {
    font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700;
    color: var(--text-primary); letter-spacing: 0.5px;
  }
  .rsd-decline-headline-unit {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-muted); margin-left: -8px;
  }
  /* Quality badge — dot + label. Color flips by class: .q-good (green),
     .q-marginal (amber), .q-advisory (gray italic). */
  .rsd-decline-quality {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    padding: 3px 10px; border-radius: 10px; font-weight: 600;
    letter-spacing: 0.4px; text-transform: uppercase;
  }
  .rsd-decline-quality .rsd-decline-quality-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  }
  .rsd-decline-quality.q-good     { color:#86efac; background:rgba(34,197,94,0.12); }
  .rsd-decline-quality.q-good .rsd-decline-quality-dot     { background:#22c55e; }
  .rsd-decline-quality.q-marginal { color:#fcd34d; background:rgba(245,158,11,0.14); }
  .rsd-decline-quality.q-marginal .rsd-decline-quality-dot { background:#f59e0b; }
  .rsd-decline-quality.q-advisory { color:#cbd5e1; background:rgba(148,163,184,0.12); font-style: italic; }
  .rsd-decline-quality.q-advisory .rsd-decline-quality-dot { background:#94a3b8; }
  .rsd-decline-stats {
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: var(--text-muted); letter-spacing: 0.3px;
  }
  /* Derived (h_f / E' / C_L) — collapsible row toggled by a small caret. */
  .rsd-decline-derived {
    margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  }
  .rsd-decline-derived-toggle {
    display: flex; align-items: center; gap: 6px; cursor: pointer;
    user-select: none; padding: 2px 0;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
  }
  .rsd-decline-derived-toggle:hover { color: var(--text-secondary); }
  .rsd-decline-derived-caret { font-size: 10px; transition: transform 0.15s; }
  .rsd-decline-derived.expanded .rsd-decline-derived-caret { transform: rotate(0deg); }
  .rsd-decline-derived:not(.expanded) .rsd-decline-derived-caret { transform: rotate(-90deg); }
  .rsd-decline-derived:not(.expanded) .rsd-decline-derived-body { display: none; }
  .rsd-decline-derived-body {
    margin-top: 8px;
    display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px;
    align-items: center;
  }
  .rsd-decline-derived-body label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.3px;
  }
  .rsd-decline-derived-body input {
    width: 110px; padding: 3px 6px; font-size: 11px;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
  }
  .rsd-decline-derived-body .rsd-decline-derived-unit {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted);
  }
  .rsd-decline-derived-cl {
    grid-column: 1 / -1; margin-top: 4px; padding-top: 6px;
    border-top: 1px dashed var(--border);
    display: flex; align-items: baseline; gap: 8px;
  }
  .rsd-decline-derived-cl-label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.3px;
  }
  .rsd-decline-derived-cl-value {
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    color: var(--text-secondary); font-style: italic;
  }
  .rsd-decline-derived-cl-tag {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-muted); letter-spacing: 0.6px;
    text-transform: uppercase; font-style: italic;
  }
  /* Overlay artifacts inside rsd-decline-overlay — dwell-skip band (faint),
     segment fit overlay (bold red line via canvas chart layer is preferable,
     but a span lets us also surface drag handles). */
  #rsd-decline-overlay .rsd-decl-dwell-band {
    position: absolute; top: 0; bottom: 0;
    background: rgba(148,163,184,0.10);
    border-right: 1px dashed rgba(148,163,184,0.45);
    pointer-events: none;
  }
  #rsd-decline-overlay .rsd-decl-seg-handle {
    position: absolute; top: 0; bottom: 0; width: 10px;
    margin-left: -5px; cursor: ew-resize;
    background: rgba(231,76,60,0.18);
    border-left: 1px solid rgba(231,76,60,0.9);
    border-right: 1px solid rgba(231,76,60,0.9);
    pointer-events: auto;   /* overlay parent is pointer-events:none */
    touch-action: none;
  }
  #rsd-decline-overlay .rsd-decl-seg-handle:hover { background: rgba(231,76,60,0.32); }
  #rsd-decline-overlay .rsd-decl-seg-band {
    position: absolute; top: 0; bottom: 0;
    background: rgba(231,76,60,0.06);
    pointer-events: none;
  }
  .rsd-xzoom-bar { padding: 6px 8px; margin: 0 0 10px 0; border-radius: 6px; }
  .rsd-xzoom-bar .rsd-xzoom-hint {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); white-space: nowrap; opacity: 0.85;
  }
  /* ── Friction Curves workspace ── */
  #fc-workspace { font-family: 'IBM Plex Sans', sans-serif; }
  .fc-layout {
    display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start;
  }
  .fc-fluids {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 8px; max-height: calc(100vh - 200px); overflow-y: auto;
  }
  .fc-fluids-head {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
  }
  .fc-fluids-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    flex: 1;
  }
  .fc-fluids-list {}
  .fc-fluid-row {
    display: flex; flex-direction: column; gap: 1px;
    padding: 8px 8px; border-radius: 4px; cursor: pointer;
    border: 1px solid transparent; margin-bottom: 4px;
  }
  .fc-fluid-row:hover { background: var(--bg-tertiary); }
  .fc-fluid-row.active { background: var(--bg-tertiary); border-color: var(--accent); }
  .fc-fluid-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
  .fc-fluid-meta {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); letter-spacing: 0.4px; margin-top: 2px;
  }
  .fc-fluid-pts {
    font-family: 'JetBrains Mono', monospace; font-size: 9px;
    color: var(--text-secondary); letter-spacing: 0.3px; margin-top: 2px;
  }

  .fc-editor {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 14px 16px;
  }
  .fc-editor-empty {
    color: var(--text-muted); font-style: italic; font-size: 12px;
    padding: 32px; text-align: center;
  }
  .fc-form {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    margin-bottom: 14px;
  }
  .fc-field {
    display: flex; flex-direction: column; gap: 3px;
  }
  .fc-field.full { grid-column: 1 / -1; }
  .fc-field label {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    color: var(--text-muted); letter-spacing: 0.6px; text-transform: uppercase;
  }
  .fc-input {
    padding: 6px 10px; border-radius: 4px; font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px; font-weight: 500; color: var(--text-primary);
    background: var(--bg-tertiary); border: 1px solid var(--border); outline: none;
    transition: border-color 0.15s;
  }
  .fc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
  .fc-input::placeholder { color: var(--text-muted); font-style: italic; font-size: 11px; }

  .fc-points-section {
    border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px;
  }
  .fc-points-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  }
  .fc-points-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    flex: 1;
  }
  .fc-rates-bar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 6px 8px; background: var(--bg-tertiary); border-radius: 4px;
    margin-bottom: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
    color: var(--text-secondary);
  }
  .fc-rates-bar label {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); margin-right: 4px;
  }
  .fc-rates-bar .fc-rate-cell {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px 4px; border: 1px solid var(--border); border-radius: 3px;
    background: var(--bg-secondary);
  }
  .fc-rates-bar .fc-rate-cell input {
    width: 50px; padding: 2px 4px; background: transparent; border: none;
    color: var(--text-primary); font-family: inherit; font-size: 11px;
    text-align: right; outline: none;
  }
  .fc-rates-bar .fc-rate-cell input:focus { background: var(--bg-tertiary); }
  .fc-rates-bar .fc-rate-cell .fc-rate-unit { color: var(--text-muted); font-size: 9.5px; }
  .fc-rates-bar .fc-rate-cell .fc-rate-del {
    cursor: pointer; color: var(--text-muted); font-weight: 700;
    padding: 0 2px; user-select: none;
  }
  .fc-rates-bar .fc-rate-cell .fc-rate-del:hover { color: var(--danger, #e74c3c); }
  .fc-rates-bar .fc-add-rate {
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-secondary); font-family: inherit; font-size: 11px;
    padding: 3px 8px; border-radius: 3px; cursor: pointer;
  }
  .fc-rates-bar .fc-add-rate:hover { border-color: var(--accent); color: var(--text-primary); }
  table.fc-points-table {
    border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11px;
    width: 100%;
  }
  table.fc-points-table th, table.fc-points-table td {
    border: 1px solid var(--border); padding: 4px 6px; text-align: right;
  }
  table.fc-points-table th {
    background: var(--bg-tertiary); color: var(--text-secondary); font-weight: 600;
    font-size: 10px; letter-spacing: 0.3px;
  }
  table.fc-points-table th .fc-th-sub {
    display: block; font-weight: 400; font-size: 9px;
    color: var(--text-muted); letter-spacing: 0.4px;
  }
  table.fc-points-table input {
    width: 100%; box-sizing: border-box; padding: 3px 5px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-primary); font-family: inherit; font-size: 11px;
    text-align: right; outline: none;
  }
  table.fc-points-table input:focus { border-color: var(--accent); background: var(--bg-tertiary); }
  table.fc-points-table .fc-pt-del {
    width: 22px; cursor: pointer; color: var(--text-muted); text-align: center;
    user-select: none;
  }
  table.fc-points-table .fc-pt-del:hover { color: var(--danger, #e74c3c); }
  .fc-add-id {
    margin-top: 6px; padding: 4px 10px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-secondary); font-family: 'JetBrains Mono', monospace;
    font-size: 11px; cursor: pointer;
  }
  .fc-add-id:hover { border-color: var(--accent); color: var(--text-primary); }

  /* Treatment-path coverage strip — surfaces which project wells have a
     treatment-path ID that the active fluid library can resolve cleanly. */
  .fc-coverage {
    margin-top: 12px; padding: 10px 12px;
    background: var(--bg-tertiary); border-radius: 4px;
  }
  .fc-cov-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  }
  .fc-cov-summary {
    font-weight: 400; text-transform: none; letter-spacing: 0.3px; opacity: 0.85;
  }
  .fc-cov-summary .fc-cov-sep { opacity: 0.4; margin: 0 6px; }
  .fc-cov-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .fc-cov-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: default;
  }
  .fc-cov-pill .fc-cov-icon { font-weight: 700; }
  .fc-cov-pill .fc-cov-id { font-weight: 600; opacity: 0.95; }
  .fc-cov-pill.exact     { color: #2ecc71; border-color: rgba(46,204,113,0.55); }
  .fc-cov-pill.bracketed { color: #4ade80; border-color: rgba(74,222,128,0.35); }
  .fc-cov-pill.below,
  .fc-cov-pill.above     { color: #f39c12; border-color: rgba(243,156,18,0.55); }
  .fc-cov-pill.missing   { color: var(--text-muted); border-style: dashed; }
  .fc-cov-empty {
    font-style: italic; color: var(--text-muted); font-size: 11px;
    padding: 2px 0;
  }
  .fc-cov-loading {
    font-style: italic; color: var(--text-muted); font-size: 11px;
    padding: 2px 0; opacity: 0.7;
  }

  .fc-chart-wrap {
    height: 200px; margin-top: 12px;
    background: var(--bg-tertiary); border-radius: 4px; padding: 6px;
  }
  .fc-actions {
    display: flex; gap: 8px; margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--border); align-items: center;
  }
  .fc-actions .fc-status {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted); letter-spacing: 0.4px; flex: 1;
  }
  .sc-stats {
    margin-top: 12px; background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 6px; padding: 10px 12px;
  }
  .sc-stats-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    padding: 0 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
  }
  table.sc-table { border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; width: 100%; }
  table.sc-table th, table.sc-table td {
    border: 1px solid var(--border); padding: 4px 8px; text-align: right; white-space: nowrap;
  }
  table.sc-table th { background: var(--bg-tertiary); color: var(--text-secondary); font-weight: 600; }
  table.sc-table td:first-child, table.sc-table th:first-child { text-align: left; }
  table.sc-table tr.sc-median td { background: var(--bg-tertiary); }
  .sc-legend { font-size: 10px; color: var(--text-muted); margin-top: 6px; }
  .sc-empty {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    padding: 32px; text-align: center; color: var(--text-muted); font-style: italic; font-size: 12px;
  }

  /* ── Cluster Efficiency workspace — FFI / OST tracer report viewer ─── */
  #ce-workspace { font-family: 'IBM Plex Sans', sans-serif; }
  .ce-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
  .ce-wells { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 8px; max-height: calc(100vh - 200px); overflow-y: auto; }
  .ce-wells-title {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    padding: 4px 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
  }
  .ce-well-row {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 8px; border-radius: 4px; cursor: pointer;
    border: 1px solid transparent; margin-bottom: 4px;
  }
  .ce-well-row:hover { background: var(--bg-tertiary); }
  .ce-well-row.active { background: var(--bg-tertiary); border-color: var(--accent); }
  .ce-well-row.no-report { opacity: 0.55; }
  .ce-well-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
  .ce-well-api { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--text-muted); letter-spacing: 0.5px; }
  .ce-well-meta { font-size: 9.5px; color: var(--text-secondary); margin-top: 2px; }
  .ce-well-row.no-report .ce-well-meta { font-style: italic; }

  .ce-viewer { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
  .ce-viewer-empty { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 24px; text-align: center; }
  .ce-report-header {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px;
  }
  .ce-report-title { font-size: 13px; font-weight: 700; color: var(--title-strong); letter-spacing: 0.3px; }
  .ce-report-sub  { font-size: 11px; color: var(--text-secondary); }
  .ce-report-formation { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.6px; color: var(--text-muted); margin-left: auto; }

  .ce-tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
  .ce-tab {
    background: transparent; border: 1px solid transparent; border-bottom: none;
    color: var(--text-secondary); font-family: inherit; font-size: 11px; font-weight: 600;
    letter-spacing: 0.4px; padding: 6px 14px; cursor: pointer; border-radius: 4px 4px 0 0;
  }
  .ce-tab:hover { color: var(--text-primary); }
  .ce-tab.active { color: var(--text-primary); background: var(--bg-tertiary); border-color: var(--border); }

  .ce-table-wrap { overflow: auto; max-height: calc(100vh - 320px); border: 1px solid var(--border); border-radius: 4px; }
  table.ce-table { border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; min-width: 100%; }
  table.ce-table th, table.ce-table td {
    border: 1px solid var(--border); padding: 3px 6px; text-align: center; white-space: nowrap;
  }
  table.ce-table thead th { background: var(--bg-tertiary); color: var(--text-secondary); font-weight: 600; position: sticky; top: 0; z-index: 2; }
  table.ce-table thead th.ce-th-well   { font-size: 12px; color: var(--title-strong); letter-spacing: 0.4px; padding: 6px; }
  table.ce-table thead th.ce-th-year   { font-size: 11px; color: var(--text-secondary); }
  table.ce-table thead th.ce-th-date   { font-weight: 500; color: var(--text-secondary); }
  table.ce-table thead th.ce-th-time   { font-weight: 400; color: var(--text-muted); font-size: 9.5px; }
  table.ce-table th.ce-stage-col, table.ce-table td.ce-stage-col {
    text-align: left; min-width: 64px; position: sticky; left: 0; background: var(--bg-secondary); z-index: 3; font-weight: 600;
  }
  table.ce-table th.ce-tracer-col, table.ce-table td.ce-tracer-col {
    text-align: left; min-width: 84px; position: sticky; left: 64px; background: var(--bg-secondary); z-index: 3; color: var(--text-secondary);
  }
  table.ce-table thead th.ce-stage-col, table.ce-table thead th.ce-tracer-col { background: var(--bg-tertiary); }
  table.ce-table th.ce-total-col, table.ce-table td.ce-total-col {
    background: var(--bg-tertiary); font-weight: 700; min-width: 70px;
    position: sticky; right: 0; z-index: 2;
  }
  table.ce-table tbody tr:hover td { outline: 1px solid var(--accent); outline-offset: -1px; }

  /* Heatmap bins (matching the vendor legend: 5-10, 10-25, 25-50, 50-100, 100+).
     Tints chosen to read on both dark and light backgrounds — same hue ramp on
     a fixed dark-on-light fill so the table looks like the printed report. */
  td.ce-bin-0   { background: #ffffff; color: #334155; }
  td.ce-bin-1   { background: #e6e9f4; color: #1e293b; }    /*  1  – <5  */
  td.ce-bin-5   { background: #d3d8ec; color: #1e293b; }    /*  5  – <10 */
  td.ce-bin-10  { background: #b8c0e0; color: #0f172a; }    /* 10  – <25 */
  td.ce-bin-25  { background: #9ca7d3; color: #0f172a; }    /* 25  – <50 */
  td.ce-bin-50  { background: #7d89c6; color: #ffffff; }    /* 50  – <100 */
  td.ce-bin-100 { background: #5a64ad; color: #ffffff; }    /* 100+ */
  td.ce-bin-brl { background: var(--bg-tertiary); color: var(--text-muted); font-style: italic; }
  body.theme-light td.ce-bin-0 { background: #ffffff; }

  .ce-legend { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 10px; color: var(--text-muted); flex-wrap: wrap; }
  .ce-legend-chip { display: inline-flex; align-items: center; gap: 4px; }
  .ce-legend-swatch { display: inline-block; width: 14px; height: 12px; border: 1px solid var(--border); }

  .ce-warn { color: var(--warning); font-size: 11px; padding: 6px 0; }
  .ce-err  { color: var(--danger);  font-size: 11px; padding: 6px 0; }

  /* Daily production panel — drawn under the heatmap once a well has prod data */
  .ce-prod-panel { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
  .ce-prod-header {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
  }
  .ce-prod-title {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--title-strong);
  }
  .ce-prod-meta { font-size: 10.5px; color: var(--text-muted); }
  .ce-prod-toggle {
    margin-left: auto; display: inline-flex; gap: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--text-secondary);
  }
  .ce-prod-toggle button {
    padding: 3px 8px; border-radius: 3px; cursor: pointer;
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border);
    font-family: inherit; font-size: 9.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.6px;
  }
  .ce-prod-toggle button.active {
    background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--accent);
  }
  .ce-prod-canvas-wrap { position: relative; height: 240px; }
  .ce-prod-empty { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 12px 0; }

  /* Collapsible well row in the project wells/stages list */
  .cb-well-toggle {
    cursor: pointer; user-select: none;
    display: flex; align-items: flex-start; gap: 4px;
  }
  .cb-well-toggle:hover .cb-well-name-text { color: var(--accent); }
  .cb-well-caret {
    flex: 0 0 12px; font-size: 11px; color: var(--text-muted);
    margin-top: 2px; transition: transform 0.15s;
    display: inline-block;
  }
  .fa-well-row.cb-well-collapsed .cb-well-caret { transform: rotate(-90deg); }
  .cb-well-summary-text {
    display: none; flex: 1; padding: 6px 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-muted);
  }
  .fa-well-row.cb-well-collapsed .cb-well-summary-text { display: block; }
  .fa-well-row.cb-well-collapsed .fa-well-stages { display: none; }

  /* Per-well "include in aggregate charts" toggle — sits next to the well
     name and dims the whole row when unchecked so the engineer can see at a
     glance which wells are excluded from the scatter / trends / zone bars. */
  .cb-well-include {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 10px; cursor: pointer; user-select: none;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-secondary);
  }
  .cb-well-include input { cursor: pointer; }
  .cb-well-include:hover { color: var(--text-primary); }
  .fa-well-row.cb-well-disabled { opacity: 0.45; }
  .fa-well-row.cb-well-disabled .fa-stage-pill { filter: grayscale(0.7); }

  /* Aggregate-header filter dropdowns (Clusters, Zone). Sit beside Color-by
     and share the same compact uppercase rhythm as the chip groups. */
  .cb-agg-filter .cb-agg-select {
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: 3px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.6px;
    padding: 3px 22px 3px 8px; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
                      linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 11px) center, calc(100% - 7px) center;
    background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
  }
  .cb-agg-filter .cb-agg-select:hover { border-color: var(--accent); color: var(--text-primary); }
  .cb-agg-filter .cb-agg-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
  .cb-agg-filter .cb-agg-select.is-filtering {
    background-color: var(--bg-tertiary); border-color: var(--accent); color: var(--text-primary);
  }

  /* Divider between operated wells and non-op wells in the CB well list. */
  .cb-wells-divider {
    display: flex; align-items: baseline; gap: 10px;
    margin: 8px 0 4px; padding: 6px 8px;
    border-top: 1px solid var(--border);
    background: linear-gradient(to right, var(--bg-tertiary) 0%, transparent 60%);
    font-family: 'JetBrains Mono', monospace;
  }
  .cb-wells-divider-label {
    font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
    text-transform: uppercase; color: var(--text-secondary);
  }
  .cb-wells-divider-meta { font-size: 9.5px; color: var(--text-muted); }

  /* Vertical pressure-axis zoom slider for the CB plot */
  .cb-yzoom-col {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 4px; background: var(--bg-tertiary);
    border-radius: 6px;
  }
  .cb-yzoom-track {
    position: relative; flex: 1; width: 16px; min-height: 200px;
  }
  .cb-yzoom-track::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 6px;
    width: 4px; background: var(--border); border-radius: 2px;
  }
  .cb-yz-fill {
    position: absolute; left: 2px; width: 12px;
    background: var(--accent); border-radius: 3px; opacity: 0.6;
    cursor: grab;
  }
  .cb-yz-fill:hover { opacity: 0.8; }
  .cb-yz-fill.dragging { cursor: grabbing; opacity: 0.9; }
  .cb-yz-thumb {
    position: absolute; left: 0; width: 16px; height: 16px;
    transform: translateY(-50%);
    border-radius: 50%; background: var(--accent);
    border: 2px solid var(--bg-secondary);
    cursor: ns-resize; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    z-index: 2;
  }
  .cb-chart-empty {
    color: var(--text-muted); font-style: italic; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    height: 100%;
  }

  /* Cost Optimization — Energy & FR Trade-Off */
  #energy-fr-workspace { font-family: 'IBM Plex Sans', sans-serif; }
  .ef-toolbar {
    display:flex; align-items:center; gap:8px; flex-wrap:wrap;
    padding:10px 12px; background:var(--bg-secondary);
    border:1px solid var(--border); border-radius:6px; margin-bottom:12px;
  }
  .ef-source { font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--text-secondary); margin-left:auto; }
  .ef-source .src-tag {
    display:inline-block; padding:2px 8px; border-radius:10px;
    background:rgba(74,222,128,0.12); color:#4ade80;
    border:1px solid rgba(74,222,128,0.3); font-weight:600;
  }
  .ef-source .sm-dim { color:var(--text-muted); font-style:italic; }
  .ef-grid-inputs {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(310px, 1fr));
    gap:12px; margin-bottom:12px;
  }
  @media (max-width:700px) { .ef-grid-inputs { grid-template-columns:1fr; } }
  .ef-pill {
    display:inline-block; padding:2px 8px; border-radius:10px;
    font-family:'JetBrains Mono',monospace; font-size:9.5px; font-weight:700;
    letter-spacing:1.0px; text-transform:uppercase;
    border:1px solid var(--border); margin-left:8px;
  }
  .ef-pill.unconstrained { background:rgba(74,222,128,0.10); color:#4ade80; border-color:rgba(74,222,128,0.35); }
  .ef-pill.floor       { background:rgba(99,179,237,0.10); color:#7dd3fc; border-color:rgba(99,179,237,0.35); }
  .ef-pill.pressure    { background:rgba(245,158,11,0.10); color:#f59e0b; border-color:rgba(245,158,11,0.35); }
  .ef-pill.infeasible  { background:rgba(248,113,113,0.10); color:#f87171; border-color:rgba(248,113,113,0.40); }
  .ef-card-body { padding:12px 14px; display:flex; flex-direction:column; gap:9px; }
  .ef-field { display:flex; align-items:center; gap:10px; }
  .ef-field label {
    flex:1; font-family:'JetBrains Mono',monospace; font-size:11px;
    color:var(--text-secondary); display:flex; justify-content:space-between; align-items:baseline;
  }
  .ef-field label .ef-unit {
    font-size:10px; color:var(--text-muted); margin-left:8px;
    letter-spacing:0.5px;
  }
  .ef-field input, .ef-field select {
    width:128px; background:var(--bg-primary);
    border:1px solid var(--border); border-radius:4px;
    color:var(--text-primary); padding:5px 8px;
    font-size:12px; font-family:'JetBrains Mono',monospace; text-align:right;
  }
  .ef-field select { text-align:left; }
  .ef-field input:focus, .ef-field select:focus { outline:none; border-color:var(--accent); }
  .ef-field input[readonly] {
    background:rgba(74,222,128,0.06); color:#4ade80;
    border-color:rgba(74,222,128,0.3); cursor:default;
  }
  .ef-field-derived label { color:#4ade80; }
  .ef-note {
    font-size:11px; color:var(--text-muted); line-height:1.5;
    padding:8px 10px; background:rgba(0,0,0,0.18);
    border-radius:4px; border-left:2px solid var(--accent);
    margin-top:4px;
  }
  .ef-note strong { color:#4ade80; font-family:'JetBrains Mono',monospace; }
  .ef-chart-section { padding:14px 16px; }
  .ef-slider-row {
    display:flex; align-items:center; gap:14px; margin-bottom:14px;
  }
  .ef-slider-label {
    font-family:'JetBrains Mono',monospace; font-size:12px;
    color:var(--text-secondary); white-space:nowrap;
  }
  .ef-slider-label strong {
    display:inline-block; min-width:46px; text-align:right;
    color:#4ade80; font-weight:700; padding:0 4px;
  }
  #ef-c-slider { flex:1; accent-color:#4ade80; }
  .ef-chart-wrap { position:relative; height:340px; }
  .ef-summary-grid {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:10px;
  }
  .ef-metric {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:6px; padding:12px 14px;
  }
  .ef-metric.opt { border-color:rgba(74,222,128,0.5); background:rgba(74,222,128,0.05); }
  .ef-metric.delta-pos { border-color:rgba(74,222,128,0.4); }
  .ef-metric.delta-neg { border-color:rgba(248,113,113,0.4); }
  .ef-metric .ef-m-label {
    font-family:'JetBrains Mono',monospace; font-size:9.5px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted); margin-bottom:6px;
  }
  .ef-metric .ef-m-val {
    font-size:18px; font-weight:700; color:var(--title-strong);
    font-family:'JetBrains Mono',monospace;
  }
  .ef-metric .ef-m-val small { font-size:11px; font-weight:400; color:var(--text-muted); margin-left:4px; }
  .ef-metric .ef-m-sub {
    font-size:10.5px; color:var(--text-muted); margin-top:4px;
    font-family:'JetBrains Mono',monospace;
  }
  .ef-metric.opt .ef-m-val { color:#4ade80; }
  .ef-metric.delta-pos .ef-m-val { color:#4ade80; }
  .ef-metric.delta-neg .ef-m-val { color:#f87171; }

  /* Optimum-vs-Selected comparison table */
  .ef-compare {
    padding:0; overflow-x:auto;
  }
  .ef-compare table {
    width:100%; border-collapse:collapse; font-family:'JetBrains Mono', monospace;
  }
  .ef-compare thead th {
    padding:10px 14px; font-size:9.5px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted);
    text-align:right; border-bottom:1px solid var(--border);
    background:rgba(0,0,0,0.18);
  }
  .ef-compare thead th:first-child { text-align:left; }
  .ef-compare thead th.col-opt { color:#4ade80; }
  .ef-compare thead th.col-sel { color:#f59e0b; }
  .ef-compare thead th .h-sub {
    display:block; font-size:9px; font-weight:400; color:var(--text-muted);
    letter-spacing:0.6px; text-transform:none; margin-top:2px;
  }
  .ef-compare tbody td {
    padding:7px 14px; font-size:12px; color:var(--text-primary);
    text-align:right; border-bottom:1px solid rgba(255,255,255,0.04);
  }
  .ef-compare tbody td.lbl {
    text-align:left; color:var(--text-secondary); font-weight:500;
  }
  .ef-compare tbody td.lbl small {
    color:var(--text-muted); font-weight:400; margin-left:6px;
  }
  .ef-compare tbody tr.section td {
    padding-top:10px; padding-bottom:6px;
    color:var(--text-muted); font-size:9.5px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase;
    border-bottom:1px solid var(--border); background:rgba(0,0,0,0.10);
  }
  .ef-compare tbody tr.total td {
    padding-top:11px; padding-bottom:11px;
    font-size:13px; font-weight:700;
    border-top:1.5px solid var(--border);
    border-bottom:none; background:rgba(74,222,128,0.04);
  }
  .ef-compare tbody tr.total td.lbl { color:var(--title-strong); }
  .ef-compare td.delta-pos { color:#f87171; font-weight:600; }
  .ef-compare td.delta-neg { color:#4ade80; font-weight:600; }
  .ef-compare td.delta-zero { color:var(--text-muted); }
  .ef-compare td.col-opt { color:#4ade80; font-weight:600; }
  .ef-compare td.col-sel { color:#f59e0b; font-weight:600; }
  .ef-compare td .infeasible {
    color:#f87171; font-size:10px; margin-left:6px;
    padding:1px 5px; border-radius:8px;
    background:rgba(248,113,113,0.1); border:1px solid rgba(248,113,113,0.35);
  }

  /* Mode toggle (Optimizer / Quick Estimate) */
  .ef-mode-tabs {
    display:inline-flex; gap:4px; margin-bottom:12px;
    background:var(--bg-secondary); padding:4px;
    border:1px solid var(--border); border-radius:6px;
  }
  .ef-mode-tab {
    padding:6px 16px; font-size:11.5px; font-weight:600;
    background:transparent; color:var(--text-secondary);
    border:1px solid transparent; border-radius:4px;
    cursor:pointer; font-family:inherit;
    text-transform:none; letter-spacing:0.3px;
    transition:background 0.1s, color 0.1s, border-color 0.1s;
  }
  .ef-mode-tab:hover { color:var(--text-primary); }
  .ef-mode-tab.active {
    background:rgba(74,222,128,0.12); color:#4ade80;
    border-color:rgba(74,222,128,0.4);
  }

  /* Quick Estimate panel */
  .ef-quick {
    display:flex; flex-direction:column; gap:12px;
  }
  .ef-quick-cases {
    display:grid; grid-template-columns:1fr 1fr; gap:12px;
  }
  @media (max-width:900px) { .ef-quick-cases { grid-template-columns:1fr; } }
  .ef-quick .co-card.case-1 { border-color:rgba(99,179,237,0.3); }
  .ef-quick .co-card.case-2 { border-color:rgba(245,158,11,0.3); }
  .ef-quick .case-1 .co-card-header { color:#7dd3fc; }
  .ef-quick .case-2 .co-card-header { color:#f59e0b; }
  .ef-quick-shared-grid {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:9px 14px; padding:12px 14px;
  }
  .ef-quick-shared-grid .ef-field input,
  .ef-quick-shared-grid .ef-field select {
    width:110px;
  }
  .ef-quick-actions {
    display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    padding:12px 14px;
  }
  .ef-quick-actions .ef-quick-status {
    font-size:11px; color:var(--text-muted); font-style:italic;
  }
  .ef-quick-calc-btn {
    padding:8px 24px; font-size:13px; font-weight:700;
    background:rgba(74,222,128,0.15); color:#4ade80;
    border:1px solid rgba(74,222,128,0.5); border-radius:5px;
    cursor:pointer; font-family:inherit;
    letter-spacing:0.5px;
    transition:background 0.1s, border-color 0.1s;
  }
  .ef-quick-calc-btn:hover { background:rgba(74,222,128,0.22); border-color:#4ade80; }
  .ef-quick-results {
    padding:0;
  }
  .ef-quick-headline {
    padding:14px 16px; display:flex; align-items:baseline; gap:14px;
    flex-wrap:wrap; border-bottom:1px solid var(--border);
    background:rgba(0,0,0,0.15);
  }
  .ef-quick-headline .lbl {
    font-family:'JetBrains Mono', monospace; font-size:10px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted);
  }
  .ef-quick-headline .val {
    font-size:22px; font-weight:700; font-family:'JetBrains Mono', monospace;
  }
  .ef-quick-headline .val.savings { color:#4ade80; }
  .ef-quick-headline .val.cost { color:#f87171; }
  .ef-quick-headline .sub {
    font-size:11px; color:var(--text-muted); font-family:'JetBrains Mono', monospace;
  }

  /* ── DFIT & Closure Analysis ──────────────────────────────────────────
     Reuses .co-header / .co-title / .co-subtitle / .co-close-btn / .trim-btn.
     These rules cover the source/upload panel, the state slot, and the
     dual-plot dashboard shell (the ECharts plots themselves are TASK #5). */

  /* Contrast lift (dark theme only): the global --text-muted (#556677) /
     --text-secondary (#8899aa) read too dim on the near-black workspace bg —
     descriptions, role chips, tab labels, hints and the overlay empty-state were
     hard to read. Re-scope both variables BRIGHTER within #dfit-workspace so
     every dim element (.co-subtitle, .dfit-imp-*, .dfit-ov-*) lifts at once,
     without touching light mode or the rest of the app's theme. */
  body:not(.theme-light) #dfit-workspace {
    --text-muted: #93a5b8;
    --text-secondary: #bcc9d8;
  }
  /* Placeholders don't inherit text color — give the DFIT inputs an explicit,
     readable placeholder instead of the very dim UA default. */
  body:not(.theme-light) #dfit-workspace textarea::placeholder,
  body:not(.theme-light) #dfit-workspace input::placeholder {
    color:#8395a8; opacity:1;
  }

  #dfit-workspace .dfit-status {
    font-family:'JetBrains Mono', monospace; font-size:10.5px; letter-spacing:0.4px;
    color:var(--text-muted); white-space:nowrap;
  }
  #dfit-workspace .dfit-status.ok { color:#2ecc71; }
  #dfit-workspace .dfit-status.error { color:var(--danger, #e74c3c); }

  .dfit-source {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:6px; padding:12px 14px; margin-bottom:14px;
  }
  .dfit-source-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .dfit-source-spacer { flex:1 1 auto; }
  .dfit-file-btn {
    display:inline-flex; align-items:center; gap:7px;
    font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:600;
    letter-spacing:0.5px; text-transform:uppercase;
    padding:6px 12px; border-radius:4px; cursor:pointer;
    background:var(--bg-tertiary, var(--bg-secondary)); color:var(--text-secondary);
    border:1px dashed var(--border); transition:all 0.12s;
  }
  .dfit-file-btn:hover { border-color:var(--accent); color:var(--text-primary); }
  .dfit-file-icon { font-size:13px; }
  .dfit-file-name {
    font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-primary);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:280px;
  }
  .dfit-source-hint { font-size:11px; color:var(--text-muted); line-height:1.5; margin-top:8px; }
  .dfit-source-hint code {
    font-family:'JetBrains Mono', monospace; font-size:10.5px;
    background:var(--bg-tertiary, rgba(127,127,127,0.12)); padding:1px 5px; border-radius:3px;
    color:var(--text-secondary);
  }

  .dfit-state {
    display:flex; align-items:center; justify-content:center;
    min-height:280px; border:1px solid var(--border); border-radius:8px;
    background:var(--bg-secondary);
  }
  .dfit-state-empty, .dfit-state-loading, .dfit-state-error {
    display:flex; flex-direction:column; align-items:center; gap:10px;
    text-align:center; padding:32px 24px; max-width:520px;
    color:var(--text-secondary); font-size:13px; line-height:1.6;
  }
  .dfit-state-icon { font-size:30px; opacity:0.9; color:#5fa8e6; line-height:0; }
  .dfit-state-icon svg { width:40px; height:40px; }
  .dfit-state-error { color:var(--danger, #e74c3c); }
  .dfit-state-error-detail {
    font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-muted);
    line-height:1.5; word-break:break-word;
  }
  .dfit-spinner {
    width:26px; height:26px; border-radius:50%;
    border:3px solid var(--border); border-top-color:var(--accent);
    animation:dfit-spin 0.8s linear infinite;
  }
  @keyframes dfit-spin { to { transform:rotate(360deg); } }

  /* Dashboard shell — dual plot cards side-by-side, readout rail underneath.
     The plot bodies are containers the ECharts instances mount into (#5). */
  .dfit-dashboard { display:flex; flex-direction:column; gap:14px; }
  .dfit-plots { display:flex; gap:14px; flex-wrap:wrap; }
  .dfit-plot-card {
    flex:1 1 420px; min-width:340px;
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:8px; padding:12px 14px;
  }
  .dfit-plot-title {
    font-family:'JetBrains Mono', monospace; font-size:11px; font-weight:700;
    letter-spacing:0.8px; text-transform:uppercase; color:var(--text-secondary);
    margin-bottom:10px;
  }
  .dfit-plot-canvas { width:100%; height:420px; position:relative; }
  .dfit-plot-placeholder, .dfit-readouts-placeholder {
    display:flex; align-items:center; justify-content:center; height:100%;
    min-height:60px; padding:16px; text-align:center;
    font-family:'JetBrains Mono', monospace; font-size:11px;
    color:var(--text-muted); border:1px dashed var(--border); border-radius:6px;
  }
  .dfit-readouts {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:8px; padding:14px 16px;
  }
  .dfit-ro-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
  .dfit-ro-title {
    font-family:'JetBrains Mono', monospace; font-size:11px; font-weight:700;
    letter-spacing:0.8px; text-transform:uppercase; color:var(--text-secondary);
  }
  /* Four live readout cards — Pc / net / η / process_time. The "hot" one (Pc)
     gets an accent ring so the dragged value reads as the primary output. */
  .dfit-ro-live { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
  .dfit-ro-card {
    flex:1 1 150px; min-width:130px;
    background:var(--bg-tertiary, rgba(127,127,127,0.06));
    border:1px solid var(--border); border-radius:7px; padding:10px 12px;
  }
  .dfit-ro-card.hot { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent-glow, rgba(59,130,246,0.25)); }
  .dfit-ro-label {
    font-family:'JetBrains Mono', monospace; font-size:9px; letter-spacing:0.6px;
    text-transform:uppercase; color:var(--text-muted); margin-bottom:5px;
  }
  .dfit-ro-value {
    font-size:19px; font-weight:700; color:var(--title-strong); line-height:1.1;
    font-variant-numeric:tabular-nums;
  }
  .dfit-ro-sub { font-size:10px; color:var(--text-muted); margin-top:4px; }
  .dfit-ro-approx {
    font-family:'JetBrains Mono', monospace; font-size:9px; font-weight:600;
    color:#e67e22; background:rgba(230,126,34,0.14); padding:1px 5px;
    border-radius:3px; vertical-align:middle; cursor:help;
  }
  /* Surface-referenced provenance tag (channel != btmh, not BHP-corrected) */
  .dfit-ro-surface {
    font-family:'JetBrains Mono', monospace; font-size:9px; font-weight:600;
    color:#3b9ae1; background:rgba(59,154,225,0.16); padding:1px 5px;
    border-radius:3px; vertical-align:middle; cursor:help;
  }
  /* AI pick / rationale / override-diff strip */
  .dfit-ai-pick { font-size:12px; color:var(--text-secondary); margin-bottom:4px; }
  .dfit-ai-rationale { font-size:11px; color:var(--text-muted); line-height:1.5; margin-bottom:6px; }
  .dfit-ai-diff {
    font-size:11px; color:#f1c40f; line-height:1.5; margin-bottom:6px;
    border-left:2px solid rgba(241,196,15,0.5); padding-left:8px;
  }
  /* Secondary read-only engine scalars */
  .dfit-ro-mini { display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:8px; padding-top:10px; border-top:1px solid var(--border); }
  .dfit-ro-mini-item {
    display:flex; gap:7px; align-items:baseline;
    font-family:'JetBrains Mono', monospace; font-size:11px;
  }
  .dfit-ro-mini-item span { color:var(--text-muted); }
  .dfit-ro-mini-item b { color:var(--text-primary); font-variant-numeric:tabular-nums; }
  .dfit-prov {
    font-family:'JetBrains Mono', monospace; font-size:10px; color:var(--text-muted);
    margin-top:10px; opacity:0.85;
  }

  /* ── DFIT Data Import (Task #6): dual-input ingestion + column-map wizard ── */
  .dfit-imp { display:flex; flex-direction:column; gap:14px; }
  .dfit-imp-head { }
  .dfit-imp-title {
    font-family:'JetBrains Mono', monospace; font-size:12px; font-weight:700;
    letter-spacing:0.8px; text-transform:uppercase; color:var(--text-secondary); margin-bottom:6px;
  }
  .dfit-imp-sub { font-size:12px; color:var(--text-muted); line-height:1.5; max-width:760px; }

  /* role status chips — which legs are ingested + analysis-ready hint */
  .dfit-imp-roles {
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:6px; padding:10px 12px;
  }
  .dfit-imp-rolechip {
    display:inline-flex; align-items:center; gap:7px;
    padding:5px 10px; border-radius:5px; border:1px solid var(--border);
    background:var(--bg-tertiary, rgba(127,127,127,0.06));
  }
  .dfit-imp-rolechip-dot {
    width:8px; height:8px; border-radius:50%; background:var(--text-muted); opacity:0.5; flex:none;
  }
  .dfit-imp-rolechip.have .dfit-imp-rolechip-dot { background:#2ecc71; opacity:1; }
  .dfit-imp-rolechip-name { font-size:11px; color:var(--text-secondary); }
  .dfit-imp-rolechip.have .dfit-imp-rolechip-name { color:var(--text-primary); }
  .dfit-imp-rolechip-detail {
    font-family:'JetBrains Mono', monospace; font-size:9.5px; color:var(--text-muted);
  }
  .dfit-imp-rolenote { margin-left:auto; }
  .dfit-imp-ready {
    font-family:'JetBrains Mono', monospace; font-size:10px; letter-spacing:0.4px;
    color:var(--text-muted);
  }
  .dfit-imp-ready.ok { color:#2ecc71; }

  /* tabs */
  .dfit-imp-tabs { display:flex; gap:4px; border-bottom:1px solid var(--border); }
  .dfit-imp-tab {
    appearance:none; background:transparent; border:none; cursor:pointer;
    font-family:'JetBrains Mono', monospace; font-size:10.5px; font-weight:600;
    letter-spacing:0.4px; text-transform:uppercase; color:var(--text-muted);
    padding:8px 14px; border-bottom:2px solid transparent; margin-bottom:-1px; transition:all 0.12s;
  }
  .dfit-imp-tab:hover { color:var(--text-secondary); }
  .dfit-imp-tab.active { color:var(--text-primary); border-bottom-color:var(--accent); }

  /* paste tab */
  .dfit-imp-paste-wrap { display:flex; flex-direction:column; gap:8px; }
  .dfit-imp-paste {
    width:100%; resize:vertical; box-sizing:border-box;
    font-family:'JetBrains Mono', monospace; font-size:11px; line-height:1.5;
    color:var(--text-primary); background:var(--bg-secondary);
    border:1px solid var(--border); border-radius:6px; padding:10px 12px;
  }
  .dfit-imp-paste:focus { outline:none; border-color:var(--accent); }
  .dfit-imp-paste-actions { display:flex; align-items:center; gap:12px; }
  .dfit-imp-hint { font-size:11px; color:var(--text-muted); }

  /* file tab */
  .dfit-imp-file-wrap { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }

  /* column-map wizard */
  .dfit-imp-wizard {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:8px; padding:14px 16px;
  }
  .dfit-imp-wz-grid {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
    gap:12px 16px; margin-bottom:14px;
  }
  .dfit-imp-wz-field { display:flex; flex-direction:column; gap:5px; }
  .dfit-imp-wz-field label {
    font-family:'JetBrains Mono', monospace; font-size:9px; letter-spacing:0.5px;
    text-transform:uppercase; color:var(--text-muted);
  }
  .dfit-imp-opt { text-transform:none; letter-spacing:0; color:var(--text-muted); opacity:0.7; }
  .dfit-imp-wz-field select, .dfit-imp-num {
    box-sizing:border-box; width:100%;
    font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-primary);
    background:var(--bg-tertiary, var(--bg-secondary)); border:1px solid var(--border);
    border-radius:4px; padding:6px 8px;
  }
  .dfit-imp-wz-field select:focus, .dfit-imp-num:focus { outline:none; border-color:var(--accent); }

  /* preview grid — mapped columns highlighted */
  .dfit-imp-preview { margin-bottom:12px; }
  .dfit-imp-preview-scroll { overflow:auto; max-height:240px; border:1px solid var(--border); border-radius:6px; }
  .dfit-imp-preview-tbl { border-collapse:collapse; width:100%; font-family:'JetBrains Mono', monospace; font-size:10.5px; }
  .dfit-imp-preview-tbl th, .dfit-imp-preview-tbl td {
    padding:4px 9px; text-align:right; white-space:nowrap;
    border-bottom:1px solid var(--border); color:var(--text-secondary);
  }
  .dfit-imp-preview-tbl th {
    position:sticky; top:0; background:var(--bg-secondary); color:var(--text-muted);
    font-weight:600; text-align:right; z-index:1;
  }
  .dfit-imp-preview-tbl td.map-time, .dfit-imp-preview-tbl th.map-time { background:rgba(95,214,230,0.10); color:var(--text-primary); }
  .dfit-imp-preview-tbl td.map-pressure, .dfit-imp-preview-tbl th.map-pressure { background:rgba(241,196,15,0.10); color:var(--text-primary); }
  .dfit-imp-preview-tbl td.map-rate, .dfit-imp-preview-tbl th.map-rate { background:rgba(46,204,113,0.10); color:var(--text-primary); }
  .dfit-imp-maptag {
    display:block; font-size:8px; font-weight:700; letter-spacing:0.5px; text-transform:uppercase;
    margin-bottom:2px;
  }
  .dfit-imp-maptag.time { color:#5fd6e6; }
  .dfit-imp-maptag.pressure { color:#f1c40f; }
  .dfit-imp-maptag.rate { color:#2ecc71; }
  .dfit-imp-preview-more { font-size:10px; color:var(--text-muted); margin-top:6px; text-align:center; }

  .dfit-imp-wz-actions { display:flex; align-items:center; gap:10px; }
  .dfit-imp-rowcount { font-family:'JetBrains Mono', monospace; font-size:10.5px; color:var(--text-muted); }

  .dfit-imp-status {
    font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-muted); min-height:16px;
  }
  .dfit-imp-status.ok { color:#2ecc71; }
  .dfit-imp-status.error { color:var(--danger, #e74c3c); }

  /* ── Run Combined Analysis bar (Task #11) ── */
  .dfit-imp-analyze {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:6px; padding:12px 14px;
  }
  .dfit-imp-analyze-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .dfit-imp-analyze-row #dfit-imp-label { flex:2 1 280px; }
  .dfit-imp-analyze-row #dfit-imp-an-notes { flex:1 1 200px; }
  .dfit-imp-analyze-row .trim-btn { flex:0 0 auto; }
  .dfit-imp-analyze-hint { font-size:11px; color:var(--text-muted); line-height:1.5; margin-top:8px; }

  /* results: validation banner + Cs/wbs block */
  .dfit-imp-results:empty { display:none; }
  .dfit-imp-vbanner {
    display:flex; flex-wrap:wrap; align-items:center; gap:8px;
    font-size:12px; line-height:1.5; color:var(--text-secondary);
    border:1px solid var(--border); border-left-width:3px; border-radius:6px;
    padding:10px 12px; margin-top:4px;
  }
  .dfit-imp-vbanner.ok { border-left-color:#2ecc71; }
  .dfit-imp-vbanner.warn { border-left-color:#e6b422; }
  .dfit-imp-vbanner.error { border-left-color:var(--danger, #e74c3c); }
  .dfit-imp-vbanner b { color:var(--text-primary); }
  .dfit-imp-vbanner .dfit-spinner { width:16px; height:16px; border-width:2px; }
  .dfit-imp-vdetail {
    width:100%; font-family:'JetBrains Mono', monospace; font-size:11px;
    color:var(--text-muted); word-break:break-word;
  }
  .dfit-imp-vlist { width:100%; margin:4px 0 0; padding-left:18px; }
  .dfit-imp-vlist li { font-size:11.5px; line-height:1.6; margin-bottom:2px; }
  .dfit-imp-vlist li.err { color:var(--danger, #e74c3c); }
  .dfit-imp-vlist li.warn { color:#e6b422; }
  .dfit-imp-vlist code {
    font-family:'JetBrains Mono', monospace; font-size:10.5px;
    background:var(--bg-tertiary, rgba(127,127,127,0.12)); padding:1px 5px; border-radius:3px;
  }
  .dfit-imp-vfield { font-family:'JetBrains Mono', monospace; font-size:10px; color:var(--text-muted); opacity:0.8; }

  .dfit-imp-wbs {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:6px; padding:12px 14px; margin-top:10px;
  }
  .dfit-imp-wbs-title {
    font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700;
    letter-spacing:0.6px; text-transform:uppercase; color:var(--text-muted); margin-bottom:10px;
  }
  .dfit-imp-wbs-grid {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:10px;
  }
  .dfit-imp-wbs-cell {
    background:var(--bg-tertiary, rgba(127,127,127,0.06));
    border:1px solid var(--border); border-radius:7px; padding:10px 12px;
  }
  .dfit-imp-wbs-label {
    font-family:'JetBrains Mono', monospace; font-size:9px; letter-spacing:0.5px;
    text-transform:uppercase; color:var(--text-muted); margin-bottom:5px;
  }
  .dfit-imp-wbs-value { font-size:16px; font-weight:700; color:var(--title-strong); font-variant-numeric:tabular-nums; }
  .dfit-imp-wbs-sub { font-size:10px; color:var(--text-muted); margin-top:3px; }
  .dfit-imp-note { font-size:11.5px; color:var(--text-muted); margin-top:8px; font-style:italic; }

  /* saved-analyses list */
  .dfit-imp-analyses:empty { display:none; }
  .dfit-imp-an-head {
    font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700;
    letter-spacing:0.6px; text-transform:uppercase; color:var(--text-muted); margin-bottom:8px;
  }
  .dfit-imp-an-list { display:flex; flex-direction:column; gap:6px; }
  .dfit-imp-an-item {
    display:flex; flex-direction:column; gap:2px; text-align:left; cursor:pointer;
    background:var(--bg-secondary); border:1px solid var(--border); border-radius:6px;
    padding:8px 12px; transition:all 0.12s;
  }
  .dfit-imp-an-item:hover { border-color:var(--accent); }
  .dfit-imp-an-item.active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent-glow, rgba(59,130,246,0.25)); }
  .dfit-imp-an-label { font-size:12px; color:var(--text-primary); }
  .dfit-imp-an-meta { font-family:'JetBrains Mono', monospace; font-size:9.5px; color:var(--text-muted); }

  /* ── DFIT gauge overlay (Task #7): surface vs downhole falloff ── */
  .dfit-ov-card {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:8px; padding:12px 14px; margin-bottom:14px;
  }
  .dfit-ov-title {
    font-family:'JetBrains Mono', monospace; font-size:11px; font-weight:700;
    letter-spacing:0.8px; text-transform:uppercase; color:var(--text-secondary); margin-bottom:10px;
  }
  .dfit-ov-plot { width:100%; height:360px; position:relative; }
  .dfit-ov-empty {
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
    height:100%; min-height:120px; padding:24px; text-align:center;
    font-size:12px; line-height:1.6; color:var(--text-muted);
    border:1px dashed var(--border); border-radius:6px;
  }
  .dfit-ov-noteslot { margin-top:10px; }
  .dfit-ov-note { font-size:11.5px; line-height:1.6; color:var(--text-secondary); }
  .dfit-ov-note b { color:var(--text-primary); font-variant-numeric:tabular-nums; }
  .dfit-ov-note-tag {
    display:inline-block; font-family:'JetBrains Mono', monospace; font-size:9px; font-weight:700;
    letter-spacing:0.5px; text-transform:uppercase; padding:2px 7px; border-radius:3px; margin-right:4px;
    vertical-align:middle;
  }
  .dfit-ov-note-tag.surface { color:#3b9ae1; background:rgba(59,154,225,0.16); }
  .dfit-ov-note-tag.downhole { color:#2ecc71; background:rgba(46,204,113,0.16); }
  .dfit-ov-pending {
    font-family:'JetBrains Mono', monospace; font-size:9.5px; color:var(--text-muted);
    font-style:italic;
  }

  /* ── DFIT IMPORT WIZARD (js/dfit-wizard.js) ──────────────────────────────
     Guided 7-step record builder. Lives inside #dfit-workspace, so it inherits
     the brighter --text-muted/--text-secondary contrast scope set above. */
  .dfit-wz { display:flex; flex-direction:column; gap:14px; }

  /* ── workflow ribbon — true wizard stepper (Live Ops glass + glow idiom) ── */
  .dfit-wz-ribbon {
    display:flex; align-items:center; gap:0; padding:14px 18px; border-radius:12px; position:relative; overflow-x:auto;
    background:linear-gradient(135deg, rgba(13,26,49,0.88) 0%, rgba(16,32,60,0.72) 55%, rgba(13,22,40,0.88) 100%);
    border:1px solid rgba(122,152,193,0.22);
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 24px rgba(0,0,0,0.30);
  }
  .dfit-wz-ribbon::after {
    content:""; position:absolute; left:0; right:0; bottom:-1px; height:1px; pointer-events:none;
    background:linear-gradient(90deg, rgba(44,195,236,0) 0%, rgba(44,195,236,0.5) 16%, rgba(59,130,246,0.5) 52%, rgba(44,195,236,0) 100%);
  }
  .dfit-wz-rstep {
    display:flex; flex-direction:column; align-items:center; gap:8px; flex:0 0 auto;
    appearance:none; background:transparent; border:none; cursor:pointer; padding:0 4px; min-width:62px;
  }
  .dfit-wz-rstep[disabled] { cursor:default; }
  .dfit-wz-rbadge {
    display:flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:50%;
    font-family:'JetBrains Mono', monospace; font-size:13px; font-weight:700; flex:0 0 auto;
    border:1.5px solid rgba(122,152,193,0.40); background:rgba(10,16,28,0.5); color:var(--text-muted);
    transition:background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
  }
  .dfit-wz-rlabel {
    font-family:'JetBrains Mono', monospace; font-size:9.5px; font-weight:700; letter-spacing:1px;
    text-transform:uppercase; color:var(--text-muted); white-space:nowrap; transition:color .18s ease;
  }
  /* current = ICOP-blue glow; completed = green check; future = muted (defaults). */
  .dfit-wz-rstep.active .dfit-wz-rbadge {
    background:#2d6cdf; border-color:#5fa8e6; color:#fff;
    box-shadow:0 0 0 4px rgba(59,130,246,0.18), 0 0 16px rgba(59,130,246,0.55);
  }
  .dfit-wz-rstep.active .dfit-wz-rlabel { color:#cfe2ff; }
  .dfit-wz-rstep.done .dfit-wz-rbadge { background:rgba(46,204,113,0.16); border-color:#2ecc71; color:#2ecc71; }
  .dfit-wz-rstep.done .dfit-wz-rlabel { color:#2ecc71; }
  .dfit-wz-rstep:not([disabled]):hover .dfit-wz-rbadge { border-color:#5fa8e6; }
  .dfit-wz-rconn { flex:1 1 auto; min-width:14px; height:2px; border-radius:2px; margin:0 -2px 18px; background:rgba(122,152,193,0.22); }
  .dfit-wz-rconn.fill { background:linear-gradient(90deg, #2ecc71, #2d6cdf); }

  /* ── step header band: eyebrow + big title + description ── */
  .dfit-wz-stephdr { padding:2px 2px 0; }
  .dfit-wz-eyebrow {
    font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700; letter-spacing:1.8px;
    text-transform:uppercase; color:#5fa8e6; margin-bottom:5px;
  }
  .dfit-wz-bigtitle {
    font-family:Helvetica, Arial, sans-serif; font-size:23px; font-weight:800; line-height:1.12;
    color:var(--title-strong); margin-bottom:6px;
  }

  /* ── body: premium glass card with depth + faint blue edge glow ── */
  .dfit-wz-body {
    background:linear-gradient(180deg, rgba(18,28,48,0.55) 0%, rgba(10,16,28,0.45) 100%);
    border:1px solid rgba(122,152,193,0.22); border-radius:12px; padding:18px 20px; min-height:190px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.04), 0 0 0 1px rgba(59,130,246,0.04), 0 10px 30px rgba(0,0,0,0.32);
  }
  .dfit-wz-sub { font-size:12.5px; color:var(--text-secondary); line-height:1.55; max-width:820px; margin-bottom:2px; }
  .dfit-wz-sub b { color:var(--text-primary); }

  /* nav buttons — clearer primary "Next" action */
  .dfit-wz-navbtn { padding:9px 18px; font-size:12px; font-weight:600; }
  #dfit-wz-next.dfit-wz-navbtn:not(:disabled) { box-shadow:0 0 14px rgba(59,130,246,0.30); }

  /* ── step 1: well search / lookup ── */
  .dfit-wz-searchrow { display:flex; gap:8px; align-items:center; }
  .dfit-wz-searchrow .dfit-wz-input { flex:1 1 auto; }
  .dfit-wz-wellresults { display:flex; flex-direction:column; gap:6px; margin-top:10px; max-height:300px; overflow:auto; }
  .dfit-wz-wellrow {
    display:flex; flex-direction:column; gap:3px; text-align:left; width:100%; appearance:none; cursor:pointer;
    background:rgba(255,255,255,0.02); border:1px solid var(--border); border-radius:7px; padding:9px 12px;
    transition:border-color .15s ease, background .15s ease;
  }
  .dfit-wz-wellrow:hover { border-color:#5fa8e6; background:rgba(59,130,246,0.07); }
  .dfit-wz-wellrow-name { font-size:13px; color:var(--text-primary); font-weight:600; }
  .dfit-wz-wellrow-meta { font-family:'JetBrains Mono', monospace; font-size:10px; color:var(--text-muted); }
  .dfit-wz-wellhint { font-size:11.5px; color:var(--text-secondary); padding:6px 2px; }
  .dfit-wz-linkbtn { appearance:none; background:none; border:none; cursor:pointer; color:#5fa8e6;
    font:inherit; font-size:11.5px; text-decoration:underline; padding:0; }

  .dfit-wz-selcard {
    display:flex; align-items:center; gap:14px; margin-top:14px; padding:14px 16px; border-radius:10px;
    background:linear-gradient(135deg, rgba(13,26,49,0.7), rgba(16,32,60,0.5));
    border:1px solid rgba(59,130,246,0.45);
    box-shadow:inset 0 0 0 1px rgba(59,130,246,0.10), 0 0 18px rgba(59,130,246,0.12);
  }
  .dfit-wz-selcheck {
    flex:0 0 auto; width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:rgba(46,204,113,0.16); border:1.5px solid #2ecc71; color:#2ecc71; font-size:16px; font-weight:700;
  }
  .dfit-wz-selmain { flex:1 1 auto; min-width:0; }
  .dfit-wz-selname { font-family:Helvetica, Arial, sans-serif; font-size:16px; font-weight:700; color:var(--title-strong); }
  .dfit-wz-selapi { font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-secondary); margin-top:2px; }
  .dfit-wz-selnote { font-size:11.5px; color:var(--text-secondary); margin-top:5px; }
  .dfit-wz-selnote .ok, .dfit-wz-note .ok { color:#2ecc71; }
  .dfit-wz-selchange { flex:0 0 auto; }

  /* well data library */
  .dfit-wz-libwrap { margin-top:14px; }
  .dfit-wz-libcount { display:block; font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700;
    letter-spacing:0.8px; text-transform:uppercase; color:var(--text-secondary); margin-bottom:8px; }
  .dfit-wz-libfilter { width:100%; margin-bottom:12px; }
  .dfit-wz-libmore { margin-top:8px; }
  .dfit-wz-badge { display:inline-block; margin-left:8px; font-family:'JetBrains Mono', monospace; font-size:8.5px;
    font-weight:700; letter-spacing:0.4px; text-transform:uppercase; color:#2ecc71; background:rgba(46,204,113,0.14);
    border:1px solid rgba(46,204,113,0.4); border-radius:3px; padding:1px 5px; vertical-align:middle; }
  .dfit-wz-regwrap { margin-top:16px; border-top:1px solid var(--border); padding-top:12px; }
  .dfit-wz-regwrap > summary {
    cursor:pointer; font-family:'JetBrains Mono', monospace; font-size:10.5px; font-weight:600; letter-spacing:0.4px;
    color:#5fa8e6; list-style:none; user-select:none;
  }
  .dfit-wz-regwrap > summary::-webkit-details-marker { display:none; }
  .dfit-wz-regwrap > summary::before { content:"\25B8  "; color:var(--text-muted); }
  .dfit-wz-regwrap[open] > summary::before { content:"\25BE  "; }
  .dfit-wz-regwrap .dfit-wz-searchrow { margin-top:10px; }

  /* back-to-hub link in the wizard shell */
  .dfit-wz-home { align-self:flex-start; appearance:none; background:transparent; border:none; cursor:pointer;
    font-family:'JetBrains Mono', monospace; font-size:10.5px; font-weight:600; letter-spacing:0.4px; color:#5fa8e6; padding:0 0 2px; }
  .dfit-wz-home:hover { text-decoration:underline; }

  /* ── DFIT HOME hub (js/dfit-home.js) ─────────────────────────────────────── */
  .dfit-home { display:flex; flex-direction:column; gap:14px; }
  .dfit-home-sub { font-size:13px; color:var(--text-secondary); }
  .dfit-home-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:12px; align-items:stretch; }
  .dfit-home-card {
    position:relative; display:flex; flex-direction:column; gap:7px; padding:14px 16px; border-radius:11px; min-height:118px;
    background:linear-gradient(180deg, rgba(18,28,48,0.55) 0%, rgba(10,16,28,0.45) 100%);
    border:1px solid rgba(122,152,193,0.22);
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 22px rgba(0,0,0,0.30);
    transition:border-color .16s ease, box-shadow .16s ease;
  }
  .dfit-home-card::before { content:""; position:absolute; left:0; right:0; top:0; height:3px; border-radius:11px 11px 0 0; }
  .dfit-home-card.existing::before { background:linear-gradient(90deg, #3b9ae1, #2d6cdf); }
  .dfit-home-card.continue::before { background:linear-gradient(90deg, #e6b422, #e68a2a); }
  .dfit-home-card.new::before      { background:linear-gradient(90deg, #2ecc71, #1f9d8a); }
  /* New DFIT dominates — brighter green edge + glow, it's the ~90% action. */
  .dfit-home-card.new {
    border-color:rgba(46,204,113,0.55);
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.05), 0 0 0 1px rgba(46,204,113,0.18), 0 0 22px rgba(46,204,113,0.20), 0 8px 22px rgba(0,0,0,0.30);
  }
  .dfit-home-card-head { display:flex; align-items:center; gap:9px; }
  .dfit-home-card-icon { display:inline-flex; line-height:1; color:var(--text-secondary); }
  .dfit-home-card-icon svg { width:20px; height:20px; display:block; }
  .dfit-home-card.existing .dfit-home-card-icon { color:#3b9ae1; }
  .dfit-home-card.continue .dfit-home-card-icon { color:#e6b422; }
  .dfit-home-card.new .dfit-home-card-icon { color:#2ecc71; }
  .dfit-home-card-title { font-family:Helvetica, Arial, sans-serif; font-size:15px; font-weight:800; color:var(--title-strong); }
  .dfit-home-card-n { color:var(--text-secondary); font-weight:700; }
  .dfit-home-muted { font-size:12px; color:var(--text-secondary); line-height:1.5; flex:1 1 auto; }
  .dfit-home-cta { align-self:flex-start; margin-top:6px; padding:10px 20px; font-size:12.5px; font-weight:700;
    box-shadow:0 0 16px rgba(46,204,113,0.35); }

  /* Recent DFIT Activity — becomes the working home view as records accrue */
  .dfit-home-recent { margin-top:4px; }
  .dfit-home-recent-h { font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700; letter-spacing:1.2px;
    text-transform:uppercase; color:var(--text-secondary); margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid var(--border); }
  .dfit-home-actlist { display:flex; flex-direction:column; gap:6px; }
  .dfit-home-act { display:grid; grid-template-columns:1.4fr 1.3fr auto auto; align-items:center; gap:14px; width:100%;
    text-align:left; appearance:none; cursor:pointer; background:rgba(255,255,255,0.02); border:1px solid var(--border);
    border-radius:8px; padding:9px 13px; transition:border-color .15s ease, background .15s ease; }
  .dfit-home-act:hover { border-color:#5fa8e6; background:rgba(59,130,246,0.07); }
  .dfit-home-act.prog:hover { border-color:#e6b422; background:rgba(230,180,34,0.07); }
  .dfit-home-act-name { font-size:13px; font-weight:600; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .dfit-home-act-when { font-family:'JetBrains Mono', monospace; font-size:10px; color:var(--text-muted); white-space:nowrap; }
  .dfit-home-act-go { font-family:'JetBrains Mono', monospace; font-size:10.5px; font-weight:700; color:#5fa8e6; white-space:nowrap; }
  .dfit-home-act.prog .dfit-home-act-go { color:#e6b422; }
  .dfit-home-badge { display:inline-block; font-family:'JetBrains Mono', monospace; font-size:9px; font-weight:700;
    letter-spacing:0.4px; text-transform:uppercase; padding:2px 7px; border-radius:3px; white-space:nowrap; }
  .dfit-home-badge.done { color:#2ecc71; background:rgba(46,204,113,0.14); border:1px solid rgba(46,204,113,0.4); }
  .dfit-home-badge.prog { color:#e6b422; background:rgba(230,180,34,0.14); border:1px solid rgba(230,180,34,0.4); }

  /* empty state — no records yet */
  .dfit-home-empty { display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px;
    padding:34px 24px; border:1px dashed var(--border); border-radius:12px; margin-top:4px; }
  .dfit-home-empty-icon { color:#5fa8e6; opacity:0.92; line-height:0; }
  .dfit-home-empty-icon svg { width:46px; height:46px; }
  .dfit-home-empty-title { font-family:Helvetica, Arial, sans-serif; font-size:17px; font-weight:800; color:var(--title-strong); }
  .dfit-home-empty-text { font-size:12.5px; color:var(--text-secondary); line-height:1.55; max-width:440px; }
  .dfit-home-empty .dfit-home-cta { align-self:center; }
  .dfit-wz-subhead {
    font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700; letter-spacing:0.8px;
    text-transform:uppercase; color:var(--text-secondary); margin:16px 0 8px;
  }
  .dfit-wz-help { font-size:11.5px; line-height:1.55; color:var(--text-secondary); margin:-2px 0 10px; max-width:880px; }
  .dfit-wz-help b { color:var(--text-primary); }
  #dfit-wz-iface-readout { margin-top:8px; color:var(--text-muted); }
  #dfit-wz-iface-readout b { color:#5fd6e6; }

  /* data-source mode toggle (separate legs vs one combined file) */
  .dfit-wz-modetoggle { display:flex; gap:8px; margin:4px 0 14px; }
  .dfit-wz-modebtn {
    flex:1 1 0; appearance:none; cursor:pointer; padding:10px 12px; border-radius:8px;
    background:rgba(255,255,255,0.02); border:1px solid var(--border); color:var(--text-secondary);
    font-family:'JetBrains Mono', monospace; font-size:11px; font-weight:600; letter-spacing:0.3px;
    transition:border-color .15s ease, background .15s ease, color .15s ease;
  }
  .dfit-wz-modebtn:hover { border-color:#5fa8e6; color:var(--text-primary); }
  .dfit-wz-modebtn.active {
    border-color:rgba(59,130,246,0.55); color:var(--title-strong);
    background:linear-gradient(135deg, rgba(13,26,49,0.7), rgba(16,32,60,0.5));
    box-shadow:inset 0 0 0 1px rgba(59,130,246,0.12), 0 0 14px rgba(59,130,246,0.12);
  }

  /* fields + inputs */
  .dfit-wz-field { display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
  .dfit-wz-field.inline { margin-bottom:0; }
  .dfit-wz-field label {
    font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:600; letter-spacing:0.4px;
    text-transform:uppercase; color:var(--text-secondary);
  }
  .dfit-wz-opt { text-transform:none; letter-spacing:0; color:var(--text-muted); }
  .dfit-wz-input, .dfit-wz-textarea {
    background:var(--bg-primary, #0d1219); border:1px solid var(--border); border-radius:5px;
    color:var(--text-primary); font-size:12px; padding:8px 10px; font-family:inherit;
  }
  .dfit-wz-input.sm { max-width:200px; }
  .dfit-wz-input:focus, .dfit-wz-textarea:focus { outline:none; border-color:var(--accent); }
  .dfit-wz-textarea { width:100%; resize:vertical; font-family:'JetBrains Mono', monospace; font-size:11px; line-height:1.5; }
  .dfit-wz-readout { font-size:12px; color:var(--text-primary); padding:4px 0; }
  .dfit-wz-note { font-size:11.5px; color:var(--text-secondary); line-height:1.5; margin-top:6px; }
  .dfit-wz-note .ok, .dfit-wz-status.ok, .ok { }
  .dfit-wz-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:10px 0; }
  .dfit-wz-src { font-family:'JetBrains Mono', monospace; font-size:10px; color:var(--text-muted); }

  .dfit-wz-okbox { font-size:12px; color:var(--text-primary); background:rgba(46,204,113,0.10);
    border-left:3px solid #2ecc71; border-radius:4px; padding:9px 12px; margin-bottom:12px; }
  .dfit-wz-okbox b { color:#2ecc71; }
  .dfit-wz-warnbox { font-size:12px; color:var(--text-secondary); background:rgba(230,180,34,0.10);
    border-left:3px solid #e6b422; border-radius:4px; padding:9px 12px; margin-bottom:12px; }

  /* editable geometry grids */
  .dfit-wz-grid { display:grid; gap:6px; align-items:center; margin-bottom:8px; }
  .dfit-wz-grid.perf { grid-template-columns: 1.2fr 1fr 1fr 0.9fr 0.9fr 0.9fr 28px; }
  .dfit-wz-grid.tub  { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 28px; }
  .dfit-wz-gh { font-family:'JetBrains Mono', monospace; font-size:9px; font-weight:700; letter-spacing:0.4px;
    text-transform:uppercase; color:var(--text-muted); }
  .dfit-wz-cell {
    background:var(--bg-primary, #0d1219); border:1px solid var(--border); border-radius:4px;
    color:var(--text-primary); font-size:11.5px; padding:6px 8px; font-family:'JetBrains Mono', monospace; width:100%;
  }
  .dfit-wz-cell:focus { outline:none; border-color:var(--accent); }
  .dfit-wz-cell.ro { background:transparent; border-color:transparent; color:var(--text-muted); }
  .dfit-wz-del { appearance:none; background:transparent; border:1px solid var(--border); border-radius:4px;
    color:var(--text-muted); cursor:pointer; font-size:14px; line-height:1; width:26px; height:26px; }
  .dfit-wz-del:hover { color:var(--danger, #e74c3c); border-color:var(--danger, #e74c3c); }

  /* data-step tabs + column map */
  .dfit-wz-tabs { display:flex; gap:4px; border-bottom:1px solid var(--border); margin:6px 0 12px; }
  .dfit-wz-tab { appearance:none; background:transparent; border:none; cursor:pointer; padding:8px 12px;
    font-family:'JetBrains Mono', monospace; font-size:10.5px; font-weight:600; letter-spacing:0.4px;
    text-transform:uppercase; color:var(--text-muted); border-bottom:2px solid transparent; }
  .dfit-wz-tab:hover { color:var(--text-secondary); }
  .dfit-wz-tab.active { color:var(--text-primary); border-bottom-color:var(--accent); }
  .dfit-wz-maptitle { font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700;
    letter-spacing:0.8px; text-transform:uppercase; color:var(--text-secondary); margin:12px 0 8px; }
  .dfit-wz-maprow { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; margin-bottom:12px; }

  .dfit-wz-pvscroll { overflow:auto; max-height:200px; border:1px solid var(--border); border-radius:6px; margin-bottom:10px; }
  .dfit-wz-pvtbl { border-collapse:collapse; width:100%; font-family:'JetBrains Mono', monospace; font-size:10.5px; }
  .dfit-wz-pvtbl th, .dfit-wz-pvtbl td { border:1px solid var(--border); padding:4px 8px; text-align:left; white-space:nowrap; color:var(--text-secondary); }
  .dfit-wz-pvtbl th { position:sticky; top:0; background:var(--bg-secondary); color:var(--text-primary); }
  .dfit-wz-pvtbl td.map-time, .dfit-wz-pvtbl th.map-time { background:rgba(95,214,230,0.12); color:var(--text-primary); }
  .dfit-wz-pvtbl td.map-pressure, .dfit-wz-pvtbl th.map-pressure { background:rgba(241,196,15,0.12); color:var(--text-primary); }
  .dfit-wz-pvtbl td.map-rate, .dfit-wz-pvtbl th.map-rate { background:rgba(46,204,113,0.12); color:var(--text-primary); }
  .dfit-wz-tag { display:inline-block; font-size:8.5px; font-weight:700; text-transform:uppercase;
    letter-spacing:0.4px; margin-right:5px; padding:1px 4px; border-radius:3px; }
  .dfit-wz-tag.time { color:#5fd6e6; } .dfit-wz-tag.pressure { color:#f1c40f; } .dfit-wz-tag.rate { color:#2ecc71; }

  /* review + results */
  .dfit-wz-review { border:1px solid var(--border); border-radius:6px; overflow:hidden; margin-bottom:12px; }
  .dfit-wz-revrow { display:flex; gap:14px; padding:9px 12px; border-bottom:1px solid var(--border); font-size:12px; }
  .dfit-wz-revrow:last-child { border-bottom:none; }
  .dfit-wz-revk { flex:0 0 130px; font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700;
    letter-spacing:0.4px; text-transform:uppercase; color:var(--text-secondary); }
  .dfit-wz-revv { color:var(--text-primary); }

  .dfit-wz-results:empty { display:none; }
  .dfit-wz-vbanner { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--text-secondary);
    background:rgba(255,255,255,0.03); border-left:3px solid var(--accent); border-radius:4px; padding:10px 12px; margin:10px 0; }
  .dfit-wz-vbanner.ok { border-left-color:#2ecc71; }
  .dfit-wz-vbanner.warn { border-left-color:#e6b422; }
  .dfit-wz-vbanner.error { border-left-color:var(--danger, #e74c3c); }
  .dfit-wz-vbanner b { color:var(--text-primary); }
  .dfit-wz-vbanner ul { margin:4px 0 0; padding-left:18px; }
  .dfit-wz-vbanner li { font-size:11.5px; line-height:1.6; }
  .dfit-wz-vbanner li.err { color:var(--danger, #e74c3c); } .dfit-wz-vbanner li.warn { color:#e6b422; }
  .dfit-wz-vbanner code { font-family:'JetBrains Mono', monospace; font-size:10px; background:rgba(0,0,0,0.25); padding:1px 5px; border-radius:3px; }

  .dfit-wz-wbs { border:1px solid var(--border); border-radius:6px; padding:12px; margin:10px 0; }
  .dfit-wz-wbs-title { font-family:'JetBrains Mono', monospace; font-size:10px; font-weight:700; letter-spacing:0.8px;
    text-transform:uppercase; color:var(--text-secondary); margin-bottom:8px; }
  .dfit-wz-wbs-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:10px; }
  .dfit-wz-wbs-cell { background:rgba(255,255,255,0.03); border:1px solid var(--border); border-radius:5px; padding:9px 11px; }
  .dfit-wz-wbs-l { font-size:10px; color:var(--text-secondary); }
  .dfit-wz-wbs-v { font-size:16px; font-weight:700; color:var(--title-strong); font-variant-numeric:tabular-nums; margin:2px 0; }
  .dfit-wz-wbs-s { font-size:10px; color:var(--text-muted); }
  .dfit-wz-note { font-size:11.5px; color:var(--text-muted); font-style:italic; margin-top:8px; }

  .dfit-wz-an-list { display:flex; flex-direction:column; gap:6px; }
  .dfit-wz-an-item { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%;
    appearance:none; cursor:pointer; text-align:left; background:rgba(255,255,255,0.02);
    border:1px solid var(--border); border-radius:5px; padding:8px 11px; }
  .dfit-wz-an-item:hover { border-color:var(--accent); }
  .dfit-wz-an-item.active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent-glow, rgba(58,123,213,0.25)); }
  .dfit-wz-an-label { font-size:12px; color:var(--text-primary); }

  /* status + footer */
  .dfit-wz-status { font-size:11.5px; min-height:16px; color:var(--text-secondary); }
  .dfit-wz-status.ok { color:#2ecc71; } .dfit-wz-status.error { color:var(--danger, #e74c3c); }
  .dfit-wz-foot { display:flex; align-items:center; gap:12px; padding-top:6px; border-top:1px solid var(--border); }
  .dfit-wz-foot-spacer { flex:1 1 auto; }
  .dfit-wz-stephint { font-size:11px; color:var(--text-muted); }

  /* Cost Optimization — Treatment Schedule sandbox */
  .co-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
  .co-title { font-size:18px; font-weight:700; color:var(--title-strong); margin-bottom:4px; }
  .co-subtitle { font-size:12px; color:var(--text-muted); max-width:760px; line-height:1.5; }
  .co-close-btn {
    width:30px; height:30px; border-radius:4px; background:transparent;
    border:1px solid var(--border); color:var(--text-secondary);
    font-size:18px; line-height:1; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
  }
  .co-close-btn:hover { border-color:var(--danger); color:var(--danger); }
  .co-toolbar {
    display:flex; align-items:center; gap:8px; flex-wrap:wrap;
    padding:10px 12px; background:var(--bg-secondary);
    border:1px solid var(--border); border-radius:6px; margin-bottom:12px;
  }
  .co-source { font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--text-secondary); }
  /* Copy-from-Scenario dropdown */
  .co-clone-wrap { position:relative; display:inline-block; }
  .co-clone-dropdown {
    position:absolute; top:100%; left:0; z-index:100;
    min-width:300px; max-width:420px;
    margin-top:4px;
    background:var(--bg-secondary);
    border:1px solid var(--border); border-radius:6px;
    box-shadow:0 8px 24px rgba(0,0,0,0.45);
    padding:6px 0;
  }
  .co-clone-dropdown .co-clone-title {
    padding:6px 14px 8px;
    font-family:'JetBrains Mono',monospace; font-size:9.5px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted);
    border-bottom:1px solid var(--border);
  }
  .co-clone-dropdown .co-clone-empty {
    padding:14px; font-size:11.5px; font-style:italic;
    color:var(--text-muted); text-align:center;
  }
  .co-clone-item {
    display:flex; flex-direction:column; gap:2px;
    padding:8px 14px; cursor:pointer;
    border-bottom:1px solid var(--border);
    transition:background 0.1s, color 0.1s;
  }
  .co-clone-item:last-child { border-bottom:none; }
  .co-clone-item:hover { background:rgba(74,222,128,0.08); }
  .co-clone-item-name {
    font-size:12px; font-weight:600; color:var(--title-strong);
    display:flex; align-items:baseline; gap:8px;
  }
  .co-clone-item-num {
    display:inline-flex; align-items:center; justify-content:center;
    width:18px; height:18px; border-radius:9px;
    background:rgba(74,222,128,0.12); color:#4ade80;
    border:1px solid rgba(74,222,128,0.3);
    font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:700;
  }
  .co-clone-item-source {
    font-size:10.5px; color:var(--text-muted);
    font-family:'JetBrains Mono',monospace; margin-left:26px;
  }
  .co-clone-item-mode {
    margin-left:26px; font-size:10px; color:var(--text-muted);
  }
  .co-clone-item-mode .badge {
    display:inline-block; padding:1px 6px; border-radius:8px;
    font-family:'JetBrains Mono',monospace; font-size:9.5px; font-weight:600;
    border:1px solid var(--border);
  }
  .co-clone-item-mode .badge.step { background:rgba(74,222,128,0.10); color:#4ade80; border-color:rgba(74,222,128,0.35); }
  .co-clone-item-mode .badge.ramp { background:rgba(99,179,237,0.10); color:#7dd3fc; border-color:rgba(99,179,237,0.35); }
  .co-source .src-tag {
    display:inline-block; padding:2px 8px; border-radius:10px;
    background:rgba(74,222,128,0.12); color:#4ade80;
    border:1px solid rgba(74,222,128,0.3); font-weight:600;
  }
  .co-source .sm-dim { color:var(--text-muted); font-style:italic; }
  .co-card {
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:6px; margin-bottom:12px; overflow:hidden;
  }
  .co-card-header {
    padding:10px 14px; font-family:'JetBrains Mono',monospace;
    font-size:10px; font-weight:700; letter-spacing:1.2px;
    text-transform:uppercase; color:var(--text-muted);
    border-bottom:1px solid var(--border); background:rgba(0,0,0,0.15);
    display:flex; align-items:center; justify-content:space-between;
  }
  .co-card-sub {
    font-family:'JetBrains Mono',monospace; font-size:10px;
    font-weight:400; letter-spacing:0.6px; text-transform:none;
    color:var(--text-muted);
  }
  /* Sand Step / Sand Ramp design sub-tabs (inside Treatment Schedule card header) */
  .co-design-tabs {
    display:inline-flex; gap:4px; margin-left:auto;
  }
  .co-design-tab {
    padding:4px 12px; font-size:11px; font-weight:600;
    background:transparent; color:var(--text-secondary);
    border:1px solid var(--border); border-radius:4px;
    cursor:pointer; font-family:inherit;
    text-transform:none; letter-spacing:0;
    transition:background 0.1s, color 0.1s, border-color 0.1s;
  }
  .co-design-tab:hover { color:var(--text-primary); border-color:var(--text-muted); }
  .co-design-tab.active {
    background:rgba(74,222,128,0.12); color:#4ade80;
    border-color:rgba(74,222,128,0.4);
  }
  .co-design-pane { display:none; }
  .co-design-pane.visible { display:block; }
  /* Ramp Designer */
  .co-ramp-section {
    padding:14px 16px; border-bottom:1px solid var(--border);
  }
  .co-ramp-section:last-child { border-bottom:none; }
  .co-ramp-section h5 {
    font-family:'JetBrains Mono',monospace; font-size:10px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted); margin:0 0 10px 0;
  }
  .co-ramp-globals {
    display:flex; gap:18px; flex-wrap:wrap; align-items:flex-end;
  }
  .co-ramp-field {
    display:flex; flex-direction:column; gap:4px;
  }
  .co-ramp-field label {
    font-family:'JetBrains Mono',monospace; font-size:9.5px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted);
  }
  .co-ramp-field input {
    width:110px; background:var(--bg-primary);
    border:1px solid var(--border); border-radius:4px;
    color:var(--text-primary); padding:5px 8px;
    font-size:12px; font-family:'JetBrains Mono',monospace; text-align:right;
  }
  .co-ramp-field input:focus { outline:none; border-color:var(--accent); }
  .co-ramp-field .unit { font-size:11px; color:var(--text-muted); align-self:center; }
  .co-ramp-field-row { display:flex; align-items:center; gap:6px; }
  .co-ramp-split { flex:1; min-width:280px; }
  .co-ramp-split-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
  .co-ramp-split-item {
    display:flex; align-items:center; gap:4px;
    padding:3px 8px; border-radius:4px;
    background:rgba(0,0,0,0.18); border:1px solid var(--border);
  }
  .co-ramp-split-item .lbl {
    font-family:'JetBrains Mono',monospace; font-size:10px;
    color:var(--text-muted); letter-spacing:0.5px;
  }
  .co-ramp-split-item input {
    width:64px; background:var(--bg-primary);
    border:1px solid var(--border); border-radius:3px;
    color:var(--text-primary); padding:2px 5px;
    font-size:11px; font-family:'JetBrains Mono',monospace;
    text-align:right;
  }
  .co-ramp-split-item input:focus { outline:none; border-color:var(--accent); }
  .co-ramp-split-item .unit { font-size:10px; color:var(--text-muted); }
  .co-ramp-split-total {
    font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:600;
    color:#4ade80; padding:3px 8px; border-radius:10px;
    background:rgba(74,222,128,0.08); border:1px solid rgba(74,222,128,0.3);
  }
  .co-ramp-split-total.warn {
    color:#f59e0b; background:rgba(245,158,11,0.08); border-color:rgba(245,158,11,0.3);
  }
  .co-ramp-totals {
    display:flex; gap:14px; flex-wrap:wrap; margin-top:14px;
    padding-top:12px; border-top:1px dashed var(--border);
  }
  .co-ramp-total-pill {
    padding:6px 12px; border-radius:14px;
    background:rgba(74,222,128,0.08); border:1px solid rgba(74,222,128,0.3);
    display:flex; align-items:baseline; gap:8px;
  }
  .co-ramp-total-pill.warn {
    background:rgba(245,158,11,0.08); border-color:rgba(245,158,11,0.3);
  }
  .co-ramp-total-pill .lbl {
    font-family:'JetBrains Mono',monospace; font-size:9px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted);
  }
  .co-ramp-total-pill .val {
    font-size:13px; font-weight:700; color:#4ade80;
    font-family:'JetBrains Mono',monospace;
  }
  .co-ramp-total-pill.warn .val { color:#f59e0b; }
  .co-ramp-total-pill .val small { font-size:10px; font-weight:400; color:var(--text-muted); margin-left:4px; }
  .co-ramp-pads {
    display:grid; grid-template-columns:1fr 1fr; gap:12px;
  }
  @media (max-width:900px) { .co-ramp-pads { grid-template-columns:1fr; } }
  .co-ramp-card {
    background:rgba(0,0,0,0.18); border:1px solid var(--border); border-radius:6px;
    padding:12px 14px;
  }
  .co-ramp-card-title {
    font-size:12px; font-weight:600; color:var(--title-strong);
    margin-bottom:8px; display:flex; justify-content:space-between; align-items:baseline; gap:10px;
  }
  .co-ramp-card-title .badge {
    font-family:'JetBrains Mono',monospace; font-size:10px;
    font-weight:600; color:var(--text-muted);
    padding:2px 8px; border-radius:10px;
    background:rgba(0,0,0,0.25); border:1px solid var(--border);
  }
  .co-ramp-card-title .badge.proppant { color:#fbbf24; border-color:rgba(251,191,36,0.3); background:rgba(251,191,36,0.08); }
  .co-ramp-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; }
  .co-ramp-row .arrow { color:var(--text-muted); }
  .co-ramp-derived {
    margin-top:10px; padding:8px 10px;
    background:rgba(0,0,0,0.18); border-radius:4px;
    font-family:'JetBrains Mono',monospace; font-size:10.5px;
    color:var(--text-secondary); line-height:1.7;
  }
  .co-ramp-derived strong { color:var(--title-strong); font-weight:600; }
  .co-ramp-derived .err { color:#f87171; }
  /* Solver mode + Apply button */
  .co-ramp-solver {
    display:flex; align-items:center; justify-content:space-between;
    gap:16px; flex-wrap:wrap;
    padding-top:12px; margin-top:12px;
    border-top:1px dashed var(--border);
  }
  .co-ramp-solver-mode {
    display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  }
  .co-ramp-solver-mode > .lbl {
    font-family:'JetBrains Mono',monospace; font-size:9.5px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted);
  }
  .co-ramp-solver-mode label {
    display:inline-flex; align-items:center; gap:6px;
    font-size:12px; color:var(--text-secondary);
    cursor:pointer; padding:4px 10px;
    border:1px solid var(--border); border-radius:14px;
    transition:background 0.1s, color 0.1s, border-color 0.1s;
  }
  .co-ramp-solver-mode label:hover { color:var(--text-primary); }
  .co-ramp-solver-mode label input { margin:0; cursor:pointer; }
  .co-ramp-solver-mode label:has(input:checked) {
    background:rgba(74,222,128,0.12); color:#4ade80;
    border-color:rgba(74,222,128,0.4); font-weight:600;
  }
  .co-solver-hint {
    font-size:11px; color:var(--text-muted); font-style:italic;
    margin-left:6px;
  }
  /* Diagnostics strip */
  .co-ramp-diagnostics {
    display:flex; flex-direction:column;
  }
  .co-ramp-diag-row {
    padding:10px 14px; border-bottom:1px solid var(--border);
  }
  .co-ramp-diag-row:last-child { border-bottom:none; }
  .co-ramp-diag-name {
    font-size:12px; font-weight:600; color:var(--title-strong);
    margin-bottom:4px;
  }
  .co-ramp-diag-stats {
    display:flex; gap:18px; flex-wrap:wrap;
    font-size:11px; color:var(--text-secondary);
    font-family:'JetBrains Mono',monospace;
  }
  .co-ramp-diag-stats.secondary {
    font-size:10.5px; color:var(--text-muted); margin-top:3px;
  }
  .co-ramp-diag-stats strong {
    color:var(--title-strong); font-weight:600;
  }
  .co-ramp-diag-stats .dim { color:var(--text-muted); font-style:italic; }
  .co-ramp-diag-delta {
    padding:1px 8px; border-radius:10px; font-weight:600;
  }
  .co-ramp-diag-delta.good {
    color:#4ade80; background:rgba(74,222,128,0.12);
    border:1px solid rgba(74,222,128,0.3);
  }
  .co-ramp-diag-delta.low {
    color:#f87171; background:rgba(248,113,113,0.12);
    border:1px solid rgba(248,113,113,0.3);
  }
  .co-ramp-diag-delta.high {
    color:#fbbf24; background:rgba(251,191,36,0.12);
    border:1px solid rgba(251,191,36,0.3);
  }
  .co-ramp-diag-delta.na { color:var(--text-muted); }
  .co-ramp-diag-slope.over {
    color:#f87171; font-weight:600;
    padding:1px 8px; border-radius:8px;
    background:rgba(248,113,113,0.10);
    border:1px solid rgba(248,113,113,0.3);
  }
  /* 2-column globals: controls/solver on the left, total cost panel on the right */
  .co-ramp-globals-layout {
    display:grid; grid-template-columns:1fr 280px; gap:16px;
  }
  @media (max-width:1100px) {
    .co-ramp-globals-layout { grid-template-columns:1fr; }
  }
  .co-ramp-globals-main { min-width:0; }
  .co-ramp-globals-cost { display:flex; }
  .co-ramp-cost-card {
    flex:1; padding:16px 18px;
    background:rgba(74,222,128,0.06);
    border:1px solid rgba(74,222,128,0.3);
    border-radius:6px;
    display:flex; flex-direction:column; gap:0;
    align-self:flex-start;
  }
  /* Title is centered + uppercase + spaced so the panel reads as a
     summary card, not a bullet list. Sized to anchor the panel — bumped
     to 17px / 800 weight so it matches the visual weight of the column
     headers and the grand-total value below it. */
  .co-ramp-cost-title {
    font-family:'JetBrains Mono',monospace; font-size:17px;
    font-weight:800; letter-spacing:2.4px; text-transform:uppercase;
    color:var(--text-primary); text-align:center;
    padding-bottom:12px; margin-bottom:12px;
    border-bottom:1px solid var(--border);
  }
  .co-ramp-cost-rows { display:flex; flex-direction:column; gap:0; }
  /* Materials / Pumping / Wireline are grouped — each group is a tight
     cluster with its subtotal at the top, indented detail lines under it,
     and a slim spacer between groups so the eye can chunk the breakdown. */
  .co-ramp-cost-group {
    display:flex; flex-direction:column; gap:3px;
    padding-bottom:8px; margin-bottom:8px;
    border-bottom:1px dashed var(--border);
  }
  .co-ramp-cost-group:last-of-type { margin-bottom:10px; }
  .co-ramp-cost-row {
    display:flex; justify-content:space-between; align-items:baseline;
    font-family:'JetBrains Mono',monospace;
  }
  .co-ramp-cost-row .lbl {
    font-size:11px; color:var(--text-secondary);
    padding-left:12px;          /* indent detail lines under their subtotal */
  }
  .co-ramp-cost-row .val {
    font-size:12.5px; font-weight:600; color:var(--title-strong);
  }
  .co-ramp-cost-row .val.sub {
    font-size:11px; font-weight:400; color:var(--text-muted);
  }
  .co-ramp-cost-row .dim { color:var(--text-muted); font-style:italic; }
  /* Subtotal row (Materials / Pumping / Wireline header line) — flush
     left, bold, slightly larger so it anchors each group. */
  .co-ramp-cost-row.subtotal { padding-bottom:2px; }
  .co-ramp-cost-row.subtotal .lbl {
    padding-left:0; font-size:11.5px; font-weight:600;
    color:var(--title-strong); text-transform:uppercase; letter-spacing:0.6px;
  }
  .co-ramp-cost-row.total {
    padding-top:6px; margin-top:2px;
    border-top:2px solid var(--border);
  }
  .co-ramp-cost-row.total .lbl {
    padding-left:0; font-size:11px; font-weight:600;
    color:var(--text-secondary); letter-spacing:0.4px;
  }
  .co-ramp-cost-row.total .val.big {
    font-size:22px; font-weight:700; color:#4ade80;
    letter-spacing:0.5px;
  }
  /* Per-stage breakout — replaces the duplicate well-total row. Small,
     muted, sits below the grand-total rule as a single-line context line
     ("89 stages   $54K / stage"). */
  .co-ramp-cost-perstage {
    display:flex; justify-content:space-between; align-items:baseline;
    margin-top:6px; padding-top:4px;
    font-family:'JetBrains Mono',monospace;
  }
  .co-ramp-cost-perstage .lbl {
    font-size:10px; color:var(--text-muted); letter-spacing:0.4px;
  }
  .co-ramp-cost-perstage .val {
    font-size:12px; font-weight:600; color:var(--text-secondary);
  }
  .co-ramp-cost-perstage .val small {
    font-size:10px; font-weight:400; color:var(--text-muted); margin-left:2px;
  }
  /* Step Design Settings sub-section (inside Step Design Globals) */
  .co-step-settings {
    margin-top:14px; padding-top:12px;
    border-top:1px dashed var(--border);
  }
  .co-step-settings h6 {
    font-family:'JetBrains Mono',monospace; font-size:9.5px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted);
    margin:0 0 8px 0;
  }
  .co-step-settings-grid {
    display:flex; align-items:flex-end; gap:14px; flex-wrap:wrap;
    margin-bottom:10px;
  }
  .co-step-min-display {
    align-self:center;
    font-family:'JetBrains Mono',monospace; font-size:11px;
    color:var(--text-muted);
    padding:6px 12px; border-radius:14px;
    background:rgba(0,0,0,0.18); border:1px solid var(--border);
  }
  .co-step-min-display strong { color:var(--title-strong); font-weight:600; }
  .co-step-ramps {
    display:flex; flex-direction:column; gap:6px; margin-bottom:10px;
  }
  .co-step-ramp-row {
    display:flex; align-items:center; gap:8px; flex-wrap:wrap;
    font-size:12px; color:var(--text-secondary);
    padding:6px 10px; background:rgba(0,0,0,0.18);
    border:1px solid var(--border); border-radius:4px;
  }
  .co-step-ramp-row .co-step-ramp-label {
    font-weight:600; color:var(--title-strong);
    min-width:80px;
    font-family:'JetBrains Mono',monospace; font-size:11px;
  }
  .co-step-ramp-row input {
    width:64px; background:var(--bg-primary); border:1px solid var(--border);
    border-radius:3px; color:var(--text-primary);
    padding:3px 6px; font-size:11px; text-align:right;
    font-family:'JetBrains Mono',monospace;
  }
  .co-step-ramp-row input:focus { outline:none; border-color:var(--accent); }
  .co-step-ramp-row .lbl {
    font-size:10.5px; color:var(--text-muted);
    font-family:'JetBrains Mono',monospace; letter-spacing:0.6px;
  }
  .co-step-ramp-row .arr,
  .co-step-ramp-row .sep { color:var(--text-muted); }
  .co-ramp-plan-row .co-ramp-plan-pt {
    background:var(--bg-primary); color:var(--text-primary);
    border:1px solid var(--border); border-radius:3px;
    padding:3px 6px; font-size:11px;
    font-family:'JetBrains Mono',monospace;
    min-width:130px;
  }
  .co-ramp-plan-row .co-ramp-plan-mode {
    display:inline-flex; border:1px solid var(--border); border-radius:3px; overflow:hidden;
  }
  .co-ramp-plan-row .co-ramp-plan-mode-btn {
    background:var(--bg-primary); color:var(--text-muted);
    border:none; padding:3px 9px; font-size:10.5px;
    font-family:'JetBrains Mono',monospace; letter-spacing:0.5px;
    cursor:pointer;
  }
  .co-ramp-plan-row .co-ramp-plan-mode-btn + .co-ramp-plan-mode-btn {
    border-left:1px solid var(--border);
  }
  .co-ramp-plan-row .co-ramp-plan-mode-btn.active {
    background:rgba(74,222,128,0.18); color:#4ade80; font-weight:600;
  }
  .co-ramp-plan-row .co-ramp-plan-mode-btn:hover:not(.active) {
    background:rgba(255,255,255,0.05); color:var(--text-primary);
  }
  .co-ramp-plan-row .co-ramp-plan-remove {
    margin-left:auto; background:transparent; color:var(--text-muted);
    border:1px solid var(--border); border-radius:3px;
    width:22px; height:22px; padding:0; cursor:pointer;
    font-size:14px; line-height:1; display:flex; align-items:center; justify-content:center;
  }
  .co-ramp-plan-row .co-ramp-plan-remove:hover {
    color:#f87171; border-color:rgba(248,113,113,0.5); background:rgba(248,113,113,0.08);
  }
  .co-step-apply-row {
    display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    margin-top:10px;
  }
  .co-step-apply-row button[disabled] {
    opacity:0.55; cursor:not-allowed;
  }
  .co-step-apply-hint {
    font-size:11px; color:var(--text-muted); font-style:italic;
  }

  /* Lateral × Stage Length → # Stages bar (above the materials strip) */
  .co-stages-bar {
    display:flex; align-items:center; gap:14px; flex-wrap:wrap;
    padding:10px 14px; border-bottom:1px solid var(--border);
    background:rgba(0,0,0,0.18);
  }
  .co-stages-field {
    display:flex; align-items:center; gap:6px;
  }
  .co-stages-field label {
    font-family:'JetBrains Mono',monospace; font-size:9.5px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted);
  }
  .co-stages-field input {
    width:90px; background:var(--bg-primary);
    border:1px solid var(--border); border-radius:4px;
    color:var(--text-primary); padding:4px 8px;
    font-size:12px; font-family:'JetBrains Mono',monospace; text-align:right;
  }
  .co-stages-field input:focus { outline:none; border-color:var(--accent); }
  .co-stages-field .unit { font-size:11px; color:var(--text-muted); }
  .co-stages-arrow { color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
  .co-stages-result {
    display:flex; align-items:baseline; gap:6px;
    padding:4px 12px; background:rgba(74,222,128,0.08);
    border:1px solid rgba(74,222,128,0.3); border-radius:14px;
  }
  .co-stages-result .lbl {
    font-family:'JetBrains Mono',monospace; font-size:9.5px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted);
  }
  .co-stages-result .val {
    font-size:14px; font-weight:700; color:#4ade80;
    font-family:'JetBrains Mono',monospace;
  }
  .co-stages-result .val small { font-size:10px; font-weight:400; color:var(--text-muted); margin-left:4px; }
  .co-stages-hint {
    font-size:11px; color:var(--text-muted); font-style:italic;
    margin-left:auto;
  }
  /* Scenario tabs — 10 slots + Compare */
  .co-scenario-tabs {
    display:flex; align-items:stretch; gap:4px; flex-wrap:wrap;
    padding:6px; background:var(--bg-secondary);
    border:1px solid var(--border); border-radius:6px; margin-bottom:12px;
    position:sticky; top:-1px; z-index:20;
    box-shadow:0 4px 10px -6px rgba(0,0,0,0.55);
  }
  .co-scen-tab {
    display:flex; align-items:center; gap:8px;
    padding:6px 12px; background:transparent;
    border:1px solid transparent; border-radius:4px;
    color:var(--text-secondary); cursor:pointer;
    font-family:inherit; font-size:12px;
    transition:background 0.1s, border-color 0.1s, color 0.1s;
  }
  .co-scen-tab:hover { background:rgba(255,255,255,0.08); color:var(--text-primary); }
  .co-scen-tab.active {
    background:var(--bg-primary); border-color:var(--border);
    color:var(--title-strong); font-weight:600;
  }
  .co-scen-tab.active.compare { border-color:rgba(74,222,128,0.4); }
  .co-scen-tab.has-data { color:var(--text-primary); }
  .co-scen-tab.has-data .co-scen-num {
    background:rgba(74,222,128,0.15); color:#4ade80;
    border-color:rgba(74,222,128,0.4);
  }
  .co-scen-num {
    display:inline-flex; align-items:center; justify-content:center;
    width:22px; height:22px; border-radius:11px;
    background:rgba(0,0,0,0.25); border:1px solid var(--border);
    font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:700;
  }
  .co-scen-name { white-space:nowrap; }
  .co-scen-tab-sep {
    width:1px; background:var(--border); margin:4px 6px;
  }
  .co-scen-tab.compare .co-scen-num {
    background:rgba(74,222,128,0.1); color:#4ade80;
    border-color:rgba(74,222,128,0.3);
  }
  /* Inline name input on the toolbar */
  .co-name-label {
    font-family:'JetBrains Mono',monospace; font-size:9.5px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted);
  }
  .co-name-input {
    background:var(--bg-primary); border:1px solid var(--border);
    border-radius:4px; color:var(--text-primary);
    padding:4px 8px; font-size:11px; min-width:180px;
    font-family:inherit;
  }
  .co-name-input:focus { outline:none; border-color:var(--accent); }
  .co-name-input:disabled { opacity:0.4; cursor:not-allowed; }
  /* Compare table */
  .co-compare-table {
    width:100%; border-collapse:collapse;
  }
  .co-compare-table th, .co-compare-table td {
    padding:8px 12px; font-size:12px;
    border-bottom:1px solid var(--border); text-align:right;
    white-space:nowrap;
  }
  .co-compare-table th:first-child, .co-compare-table td:first-child {
    text-align:left; color:var(--text-secondary); position:sticky; left:0;
    background:var(--bg-secondary); z-index:1;
    border-right:1px solid var(--border);
  }
  .co-compare-table thead th {
    font-family:'JetBrains Mono',monospace; font-size:10px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted); background:rgba(0,0,0,0.18);
    border-bottom:1px solid var(--border);
  }
  .co-compare-table thead th .scen-slot {
    display:block; font-size:12px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase;
    color:var(--title-strong); margin-bottom:3px;
  }
  .co-compare-table thead th .scen-name {
    display:block; font-size:11px; font-weight:600;
    color:var(--title-strong); text-transform:none; letter-spacing:0;
    margin-top:0;
  }
  .co-compare-table thead th .scen-source {
    display:block; font-size:9.5px; font-weight:400;
    color:var(--text-muted); text-transform:none; letter-spacing:0;
    margin-top:1px;
  }
  .co-compare-table thead th .scen-mode-badge {
    display:inline-block; margin-top:5px;
    padding:2px 8px; border-radius:10px;
    font-family:'JetBrains Mono',monospace; font-size:9.5px;
    font-weight:700; letter-spacing:0.6px; text-transform:none;
    border:1px solid var(--border);
  }
  .co-compare-table thead th .scen-mode-badge.step {
    background:rgba(74,222,128,0.10); color:#4ade80;
    border-color:rgba(74,222,128,0.35);
  }
  .co-compare-table thead th .scen-mode-badge.ramp {
    background:rgba(99,179,237,0.10); color:#7dd3fc;
    border-color:rgba(99,179,237,0.35);
  }
  .co-compare-table tr.section-header td {
    background:rgba(0,0,0,0.15);
    font-family:'JetBrains Mono',monospace; font-size:10px;
    font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted); padding:6px 12px;
  }
  .co-compare-table tr.totals td {
    background:rgba(74,222,128,0.05);
    font-weight:700; color:var(--title-strong);
    border-top:1px solid var(--border);
  }
  .co-compare-table td.empty {
    color:var(--text-muted); font-style:italic;
  }
  .co-compare-table td.best {
    color:#4ade80; font-weight:600;
  }
  .co-compare-table td.worst {
    color:#f87171;
  }
  .co-compare-wrap {
    overflow-x:auto; padding:0;
  }
  /* Compare-view hide / restore — per-column ✕ on each <th>, plus a chip
     above the table that lists hidden scenarios and a "Show all" link.
     Session-only filter (state in costOptState._compareHidden). */
  .co-compare-table thead th { position:relative; }
  .co-compare-table thead th:first-child { position:sticky; }
  .co-compare-hide-btn {
    position:absolute; top:4px; right:4px;
    width:18px; height:18px; padding:0;
    display:inline-flex; align-items:center; justify-content:center;
    background:transparent; border:1px solid transparent; border-radius:3px;
    color:var(--text-muted); font-size:14px; line-height:1; cursor:pointer;
    transition:background 0.1s, color 0.1s, border-color 0.1s;
  }
  .co-compare-hide-btn:hover {
    background:rgba(248,113,113,0.12);
    border-color:rgba(248,113,113,0.35);
    color:#f87171;
  }
  .co-compare-hidden-chip {
    display:flex; flex-wrap:wrap; align-items:center; gap:6px;
    padding:6px 10px; margin-bottom:8px;
    background:var(--bg-tertiary); border:1px solid var(--border); border-radius:6px;
    font-family:'JetBrains Mono', monospace; font-size:10.5px;
    color:var(--text-secondary);
  }
  .co-compare-hidden-label { font-weight:700; letter-spacing:0.8px; text-transform:uppercase; color:var(--text-muted); }
  .co-compare-hidden-pill {
    padding:3px 8px; border-radius:11px;
    background:rgba(0,0,0,0.18); border:1px solid var(--border);
    color:var(--text-secondary); font-family:inherit; font-size:10.5px; cursor:pointer;
    transition:background 0.1s, border-color 0.1s, color 0.1s;
  }
  .co-compare-hidden-pill:hover {
    background:rgba(58,123,213,0.15); border-color:var(--accent); color:var(--title-strong);
  }
  .co-compare-hidden-sep { color:var(--text-muted); opacity:0.6; }
  .co-compare-show-all {
    padding:3px 10px; border-radius:4px;
    background:transparent; border:1px solid var(--accent);
    color:var(--accent); font-family:inherit; font-size:10.5px; cursor:pointer;
    transition:background 0.1s, color 0.1s;
  }
  .co-compare-show-all:hover {
    background:var(--accent); color:#ffffff;
  }
  body.theme-light .co-compare-hidden-chip { background:#F1F5F9; }
  body.theme-light .co-compare-hidden-pill { background:#ffffff; }
  body.theme-light .co-compare-hide-btn:hover {
    background:rgba(220,38,38,0.10); border-color:rgba(220,38,38,0.45); color:#b91c1c;
  }
  /* Picker modal */
  .co-picker-modal {
    position:fixed; inset:0; z-index:9000;
    display:flex; align-items:center; justify-content:center;
  }
  .co-picker-backdrop {
    position:absolute; inset:0; background:rgba(0,0,0,0.6);
  }
  .co-picker-card {
    position:relative; width:min(680px, 92vw); max-height:80vh;
    background:var(--bg-secondary); border:1px solid var(--border);
    border-radius:8px; display:flex; flex-direction:column;
    box-shadow:0 20px 60px rgba(0,0,0,0.5);
  }
  .co-picker-header {
    padding:14px 18px; border-bottom:1px solid var(--border);
    display:flex; justify-content:space-between; align-items:center;
    font-weight:600; color:var(--title-strong);
  }
  .co-picker-wellbar {
    padding:12px 18px; border-bottom:1px solid var(--border);
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
    background:rgba(0,0,0,0.12);
  }
  .co-picker-wellbar label {
    font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:700;
    letter-spacing:1.2px; text-transform:uppercase; color:var(--text-muted);
  }
  .co-picker-wellbar select {
    flex:1; min-width:240px;
    background:var(--bg-primary); border:1px solid var(--border);
    border-radius:4px; color:var(--text-primary);
    padding:6px 8px; font-size:12px;
  }
  .co-picker-wellbar select:focus { outline:none; border-color:var(--accent); }
  .co-picker-wellmeta {
    font-family:'JetBrains Mono',monospace; font-size:10.5px;
    color:var(--text-muted); margin-left:auto;
  }
  .co-picker-body { flex:1; overflow-y:auto; padding:8px 0; }
  .co-picker-footer {
    padding:10px 18px; border-top:1px solid var(--border);
    display:flex; justify-content:space-between; align-items:center; gap:12px;
  }
  .co-picker-hint { font-size:11px; color:var(--text-muted); font-style:italic; }
  .co-pick-well {
    padding:10px 18px; border-bottom:1px solid var(--border);
    background:rgba(0,0,0,0.12);
    font-family:'JetBrains Mono',monospace; font-size:11px;
    font-weight:700; color:var(--text-secondary);
    display:flex; justify-content:space-between; align-items:baseline; gap:10px;
  }
  .co-pick-well .co-pick-well-meta {
    font-size:10px; font-weight:400; color:var(--text-muted);
  }
  .co-pick-stage {
    padding:8px 18px 8px 32px; border-bottom:1px solid var(--border);
    cursor:pointer; display:flex; justify-content:space-between;
    align-items:center; gap:12px; font-size:12px;
    transition: background 0.1s, color 0.1s;
  }
  .co-pick-stage:hover { background:rgba(74,222,128,0.08); color:var(--title-strong); }
  .co-pick-stage .co-pick-stage-meta { color:var(--text-muted); font-size:11px; font-family:'JetBrains Mono',monospace; }
  .co-pick-empty {
    padding:10px 18px 12px 32px; font-size:11px;
    color:var(--text-muted); font-style:italic;
    border-bottom:1px solid var(--border);
  }

  /* Workspace placeholder cards */
  .workspace { max-width: 1000px; margin: 0 auto; }
  .workspace h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
  .workspace .ws-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 30px; }
  .ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .ws-card {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    padding: 24px; transition: border-color 0.15s;
  }
  .ws-card:hover { border-color: var(--text-muted); }
  .ws-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
  .ws-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
  .ws-card .ws-icon {
    font-size: 30px; margin-bottom: 12px; line-height: 1;
    /* Full opacity — 0.5 made native emoji look washed out in both themes. */
  }
  .ws-card .ws-icon svg { width: 32px; height: 32px; display: block; }

  /* Sidebar */
  .sidebar { width: 300px; flex: 0 0 300px; min-width: 220px; max-width: 600px; background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; }

  /* Sidebar resizer — draggable divider between sidebar and map */
  .sidebar-resizer {
    flex: 0 0 5px; width: 5px; background: transparent;
    cursor: ew-resize; position: relative; z-index: 550;
    transition: background 0.15s;
  }
  .sidebar-resizer:hover, .sidebar-resizer.dragging { background: var(--accent); }
  .sidebar-resizer::before {
    content: ''; position: absolute; inset: 0 -3px;
  }
  body.resizing { cursor: ew-resize; user-select: none; }
  body.resizing * { cursor: ew-resize !important; }
  .sidebar-header { padding: 18px 20px; border-bottom: 1px solid var(--border); }
  .sidebar-header h1 { font-size: 14px; font-weight: 600; letter-spacing: 0.5px; }
  .sidebar-header p { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

  .panel { border-bottom: 1px solid var(--border); }
  .panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; cursor: pointer; user-select: none;
    transition: background 0.15s;
  }
  .panel-header:hover { background: rgba(255,255,255,0.06); }
  .panel-header h2 { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--title-strong); margin: 0; }
  .panel-caret {
    font-size: 16px; color: var(--text-secondary);
    transition: transform 0.2s;
  }
  .panel.collapsed .panel-caret { transform: rotate(-90deg); }
  .panel-actions { display: flex; align-items: center; gap: 8px; }
  .panel-icon-btn {
    width: 20px; height: 20px; padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-tertiary); color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
  }
  .panel-icon-btn:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
  .panel-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
  .panel-icon-btn:disabled:hover { color: var(--text-secondary); border-color: var(--border); background: var(--bg-tertiary); }
  .panel-icon-btn--danger { font-size: 11px; }
  .panel-icon-btn--danger:hover { color: #fff; border-color: #ef4444; background: #ef4444; }
  .panel-body { padding: 0 20px 16px; }
  .panel.collapsed .panel-body { display: none !important; }
  /* Collapse-all button in sidebar header */
  .collapse-all-btn {
    background: var(--bg-tertiary); color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600;
    letter-spacing: 1.2px; text-transform: uppercase;
    padding: 4px 9px; margin-top: 8px; cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
  }
  .collapse-all-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }

  /* Basemap select */
  select.basemap-select {
    width: 100%; padding: 8px 10px; border-radius: 5px;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); font-family: inherit; font-size: 12px;
    cursor: pointer; outline: none;
  }
  select.basemap-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

  /* Layer toggles */
  .layer-toggle {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 5px;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
  }
  .layer-toggle:hover { border-color: var(--text-muted); }
  .layer-toggle.active { border-color: var(--accent); background: rgba(58,123,213,0.08); }
  .toggle-track { width: 28px; height: 15px; background: #2a3545; border-radius: 10px; position: relative; transition: background 0.2s; flex-shrink: 0; }
  .toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #8899aa; transition: transform 0.2s, background 0.2s; }
  .layer-toggle.active .toggle-track { background: var(--accent); }
  .layer-toggle.active .toggle-track::after { transform: translateX(13px); background: #fff; }
  .toggle-swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
  .toggle-label { flex: 1; font-size: 12px; font-weight: 500; }
  .toggle-label .hint { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; margin-top: 1px; }

  /* Scroll the sidebar if it overflows */
  .sidebar { overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
  .sidebar::-webkit-scrollbar { width: 10px; }
  .sidebar::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
  .sidebar::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-secondary); }
  .sidebar::-webkit-scrollbar-thumb:hover { background: #4a5568; }
  .sidebar { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }

  /* Contour selector */
  .contour-select {
    width: 100%; padding: 7px 10px; border-radius: 5px;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); font-family: inherit; font-size: 12px;
    cursor: pointer; outline: none; margin-bottom: 8px;
  }
  .contour-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
  .contour-select option { background: var(--bg-secondary); color: var(--text-primary); }

  /* Multi-select dropdown (formations) */
  .ms-wrap { position: relative; margin-bottom: 8px; }
  .ms-toggle {
    width: 100%; padding: 7px 10px; border-radius: 5px;
    background: var(--bg-tertiary); color: var(--text-muted);
    border: 1px solid var(--border); font-family: inherit; font-size: 12px; font-weight: 500;
    cursor: pointer; text-align: left; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
  }
  .ms-toggle.has-selection { color: var(--text-primary); }
  .ms-toggle.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
  .ms-toggle .ms-caret { font-size: 10px; color: var(--text-muted); }
  .ms-dropdown {
    position: absolute; top: calc(100% + 2px); left: 0; right: 0;
    max-height: 260px; overflow-y: auto;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 5px;
    z-index: 300; display: none; box-shadow: 0 8px 24px rgba(0,0,0,0.5); padding: 4px 0;
  }
  .ms-dropdown.open { display: block; }
  .ms-dropdown::-webkit-scrollbar { width: 5px; }
  .ms-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  .ms-opt {
    padding: 7px 10px; font-size: 12px; color: var(--text-primary);
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: background 0.1s;
  }
  .ms-opt:hover { background: var(--bg-tertiary); }
  .ms-opt.selected { color: #fff; font-weight: 600; }
  .ms-opt .ms-check {
    width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--border);
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: transparent; transition: all 0.15s;
  }
  .ms-opt.selected .ms-check { border-color: var(--accent); background: var(--accent); color: #fff; }
  .ms-opt .ms-code { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-secondary); font-weight: 600; flex-shrink: 0; }
  .ms-opt.selected .ms-code { color: #fff; }
  .ms-opt .ms-name { flex: 1; }

  /* Formation filter dropdown: taller, with basin section headers */
  .fm-dropdown { max-height: 420px; }
  .fm-section-hdr {
    padding: 6px 10px 4px; margin-top: 4px;
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.3px; text-transform: uppercase;
    color: var(--text-muted); border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
    position: sticky; top: 0; z-index: 1;
  }
  .fm-section-hdr:first-child { border-top: none; margin-top: 0; }
  .fm-section-hdr .fm-state { color: var(--accent); margin-right: 6px; }
  .fm-dropdown .ms-opt { padding: 5px 10px 5px 14px; font-size: 11.5px; }
  .fm-dropdown .ms-opt .ms-name { font-size: 11.5px; }
  /* Section header hover state — used by the popup dropdown's click-to-toggle-all behavior. */
  #lf-fm-dropdown .fm-section-hdr:hover { color: var(--text-primary); background: rgba(58,123,213,0.10); }
  /* Small state-visibility checkboxes that live in the popup formation dropdown's
     clear row, letting the user hide/show OK or WY sections without clearing selections. */
  .fm-state-tog {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 6px; border: 1px solid var(--border); border-radius: 3px;
    cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    color: var(--text-muted); user-select: none;
  }
  .fm-state-tog:hover { color: var(--text-primary); border-color: var(--accent); }
  .fm-state-cb {
    width: 11px; height: 11px; border: 1.5px solid var(--text-muted); border-radius: 2px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 8px; line-height: 1; color: transparent; box-sizing: border-box;
  }
  .fm-state-tog.on { color: var(--text-primary); border-color: var(--accent); }
  .fm-state-tog.on .fm-state-cb { background: var(--accent); border-color: var(--accent); color: #fff; }
  .fm-clear-row {
    padding: 7px 10px; display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    font-weight: 700; letter-spacing: 0.6px; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg-secondary); z-index: 2;
  }
  .fm-clear-row:hover { background: var(--bg-tertiary); color: var(--text-primary); }
  .fm-clear-row .fm-clear-count {
    margin-left: auto; background: var(--accent); color: #fff;
    padding: 1px 6px; border-radius: 8px; font-size: 9px;
  }

  .contour-status { font-family: 'JetBrains Mono', monospace; font-size: 10px; margin-top: 4px; display: none; }
  .contour-status.visible { display: block; }
  .contour-status.loading { color: var(--warning); }
  .contour-status.error { color: var(--danger); }

  /* Checkbox row (used for Well Type filter) */
  .cbx-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 2px; cursor: pointer; user-select: none;
    font-size: 11.5px; color: var(--text-primary);
  }
  .cbx-row:hover { color: #fff; }
  .cbx-box {
    width: 14px; height: 14px; border-radius: 3px;
    border: 1.5px solid var(--border); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: transparent; transition: all 0.15s;
  }
  .cbx-row.on .cbx-box { border-color: var(--accent); background: var(--accent); color: #fff; }
  .cbx-swatch { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #333; flex-shrink: 0; }
  .cbx-label { flex: 1; }

  /* Area-select live rectangle (styled via Leaflet L.rectangle options, but we
     also style the cursor on the map-area when area-select mode is active) */
  .map-area.area-select-active #map { cursor: crosshair; }
  .area-select-rect { pointer-events: none; }

  /* Area-select results modal — reuses np-overlay / np-modal look */
  .as-form-filter-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 6px; border: 1px solid var(--border); border-radius: 5px;
    background: var(--bg-primary);
    max-height: 84px; overflow-y: auto;
  }
  .as-form-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 11px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-tertiary);
    font-size: 10.5px; font-family: 'JetBrains Mono', monospace;
    font-weight: 600; color: var(--text-muted);
    transition: all 0.12s;
  }
  .as-form-chip:hover { border-color: var(--accent); color: var(--text-primary); }
  .as-form-chip.on {
    background: var(--accent); color: #fff; border-color: var(--accent);
  }
  .as-form-chip .as-form-count {
    background: rgba(255,255,255,0.2); color: inherit;
    padding: 1px 6px; border-radius: 8px; font-size: 9px;
  }
  .as-form-chip:not(.on) .as-form-count {
    background: rgba(255,255,255,0.06); color: var(--text-muted);
  }
  .as-form-empty {
    font-size: 10.5px; color: var(--text-muted); font-style: italic; padding: 3px;
  }
  .as-well-item {
    display: grid; grid-template-columns: 20px 1fr auto auto;
    align-items: center; gap: 10px;
    padding: 6px 8px; margin-bottom: 2px; border-radius: 4px;
    cursor: pointer; transition: background 0.12s;
  }
  .as-well-item:hover { background: rgba(58,123,213,0.08); }
  .as-well-item input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); margin: 0; }
  .as-well-item .asw-name { font-size: 11.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-well-item .asw-api  { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; color: var(--accent); }
  .as-well-item .asw-form { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500; color: var(--text-muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .as-well-item.dim { opacity: 0.35; }
  .as-well-item.already-in {
    background: rgba(39,174,96,0.10); border-left: 2px solid #27ae60;
  }
  .as-well-item.already-in .asw-already-tag {
    font-size: 9px; letter-spacing: 0.4px; text-transform: uppercase;
    color: #27ae60; font-family: 'JetBrains Mono', monospace;
  }

  /* Inspect radio list */
  .inspect-list { display: flex; flex-direction: column; gap: 4px; }
  .inspect-opt {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 5px;
    cursor: pointer; font-size: 12px; font-weight: 500; transition: border-color 0.15s, background 0.15s;
  }
  .inspect-opt:hover { border-color: var(--text-muted); }
  .inspect-opt.selected { border-color: var(--accent); background: rgba(58,123,213,0.08); }
  .inspect-radio {
    width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border);
    flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s;
  }
  .inspect-opt.selected .inspect-radio { border-color: var(--accent); }
  .inspect-opt.selected .inspect-radio::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
  .inspect-swatch { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }
  .inspect-label { flex: 1; }
  .inspect-hint {
    font-size: 10.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.45;
  }

  /* Land card (hover + pin) */
  .land-card {
    position: absolute; z-index: 600; min-width: 240px; max-width: 300px;
    background: rgba(17,24,32,0.97); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-primary); box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    pointer-events: none; display: none; overflow: hidden; backdrop-filter: blur(6px);
  }
  .land-card .lc-header {
    padding: 7px 11px; color: #fff; font-weight: 700; font-size: 12px; letter-spacing: 0.3px; position: relative;
  }
  .land-card .lc-header.fee      { background: linear-gradient(90deg,#27ae60,#1e8449); }
  .land-card .lc-header.blm      { background: linear-gradient(90deg,#f39c12,#d4860a); }
  .land-card .lc-header.state    { background: linear-gradient(90deg,#9b59b6,#7d3c98); }
  .land-card .lc-header.wellTops { background: linear-gradient(90deg,#00cec9,#00a8a3); }
  .land-card .lc-header.wellboreSticks { background: linear-gradient(90deg,#e74c3c,#c0392b); }
  .land-card .lc-header.wellSurface { background: linear-gradient(90deg,#27ae60,#1f7a43); }
  .land-card .lc-header-sub { font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600; opacity: 0.88; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
  .land-card.pinned { pointer-events: auto; box-shadow: 0 8px 28px rgba(0,0,0,0.6); border-color: var(--accent); }
  .land-card .lc-close {
    position: absolute; top: 5px; right: 7px; width: 20px; height: 20px; border-radius: 3px;
    background: rgba(255,255,255,0.15); color: #fff; border: none; cursor: pointer;
    font-size: 14px; line-height: 1; display: none; align-items: center; justify-content: center; font-weight: 700;
  }
  .land-card.pinned .lc-close { display: flex; }
  .land-card .lc-close:hover { background: rgba(255,255,255,0.3); }
  .land-card .lc-pin-hint { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-muted); padding: 3px 11px 7px; border-top: 1px solid var(--border); display: block; letter-spacing: 0.5px; }
  .land-card.pinned .lc-pin-hint { display: none; }
  .land-card .lc-action-bar { padding: 8px 11px 10px; border-top: 1px solid var(--border); display: none; flex-direction: column; gap: 5px; }
  .land-card.pinned .lc-action-bar { display: flex; }
  .land-card .lc-offset-group {
    background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border);
    border-radius: 4px; padding: 5px 8px; font-size: 11px; font-family: inherit;
    cursor: pointer; outline: none;
  }
  .land-card .lc-offset-group:focus { border-color: var(--accent); }
  .land-card .lc-offset-btn {
    background: var(--accent); color: #fff; border: none; border-radius: 4px;
    padding: 6px 10px; font-size: 11px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: opacity 0.15s, background 0.15s;
  }
  .land-card .lc-offset-btn:hover:not(:disabled) { opacity: 0.9; }
  .land-card .lc-offset-btn:disabled { background: #555; color: #aaa; cursor: not-allowed; }
  /* .added is also :disabled — the :disabled gray (#aaa) text was riding on the
     green background, unreadable. Pin the added state to white-on-green. */
  .land-card .lc-offset-btn.added,
  .land-card .lc-offset-btn.added:disabled { background: #27ae60; color: #fff; font-weight: 700; cursor: default; }
  .land-card .lc-offset-msg { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-muted); letter-spacing: 0.3px; min-height: 11px; }
  .land-card .lc-offset-msg.error { color: var(--danger, #e74c3c); }
  .land-card .lc-offset-msg.ok    { color: #27ae60; }
  .land-card .lc-body { padding: 8px 11px 10px; max-height: 360px; overflow-y: auto; }
  .land-card .lc-row { display: flex; justify-content: space-between; gap: 10px; padding: 2.5px 0; font-size: 11px; }
  /* Card has a hardcoded dark backdrop in both themes, so pin label/value colors to
     theme-independent values — otherwise light mode renders dark text on dark card. */
  .land-card .lc-label { color: #8899aa; white-space: nowrap; }
  .land-card .lc-val { color: #e2e8f0; font-weight: 600; text-align: right; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
  body.theme-light .land-card { color: #e2e8f0; }
  body.theme-light .land-card .lc-pin-hint,
  body.theme-light .land-card .lc-offset-msg { color: #8899aa; }
  .land-card .lc-val.emph { color: var(--accent); }
  .land-card .lc-tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px; }
  .land-card .lc-tag.active   { background: rgba(39,174,96,0.18);   color: #27ae60; }
  .land-card .lc-tag.hbp      { background: rgba(41,128,185,0.18);  color: #3498db; }
  .land-card .lc-tag.past     { background: rgba(231,76,60,0.18);   color: #e74c3c; }
  .land-card .lc-tag.released { background: rgba(127,140,141,0.2);  color: #95a5a6; }
  .land-card .lc-tag.unk      { background: rgba(136,136,136,0.2);  color: #bbb; }

  /* Crosshair cursor when inspection is active */
  .map-area.inspect-active #map { cursor: crosshair; }

  /* PLSS township labels (on-map) */
  .plss-label-marker {
    background: none !important; border: none !important; box-shadow: none !important;
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600;
    letter-spacing: 0.3px; color: #ff8888;
    text-shadow: 0 0 3px rgba(0,0,0,0.95), 0 0 6px rgba(0,0,0,0.8), 1px 1px 2px rgba(0,0,0,0.9);
    white-space: nowrap; pointer-events: none; opacity: 0.9;
    text-align: center; transform: translate(-50%, -50%);
  }

  /* Contour labels (on-map) */
  .contour-label {
    background: transparent; border: none; font-size: 9px; font-weight: bold; color: #222;
    white-space: nowrap; pointer-events: none;
    text-shadow: 1px 1px 2px white, -1px -1px 2px white, 1px -1px 2px white, -1px 1px 2px white;
  }

  /* Map */
  .map-area { flex: 1; position: relative; }
  #map { width: 100%; height: 100%; background: var(--bg-primary); }

  /* Legend */
  .legend {
    position: absolute; top: 12px; right: 12px; z-index: 500;
    background: rgba(17,24,32,0.92); border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 12px; font-size: 11.5px; color: var(--text-primary);
    min-width: 160px; backdrop-filter: blur(8px);
  }
  .legend.collapsed { padding: 6px 10px; min-width: 0; }
  .legend-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    cursor: pointer; user-select: none;
  }
  .legend h3 { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #f1f5f9; margin: 0; }
  .legend-caret {
    color: #f1f5f9; font-size: 10px; line-height: 1;
    transition: transform 150ms ease;
  }
  .legend.collapsed .legend-caret { transform: rotate(-90deg); }
  .legend-header:hover .legend-caret { color: var(--accent); }
  #legend-body { margin-top: 8px; }
  .legend.collapsed #legend-body { display: none; }
  .legend.collapsed .legend-header { margin: 0; }
  .legend-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
  .legend-swatch { width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0; }
  .legend-empty { color: var(--text-secondary); font-size: 11px; font-style: italic; }
  /* Legend keeps its dark backdrop in both themes — pin its text light so labels stay readable. */
  body.theme-light .legend { color: #e2e8f0; }
  body.theme-light .legend-empty { color: #8899aa; }

  /* Project Wells markers — colored squares rendered via L.divIcon */
  .pwm-icon { background: transparent; border: none; }
  .pwm-square {
    border-style: solid; border-width: 1.5px; border-radius: 1px;
    box-shadow: 0 0 2px rgba(0,0,0,0.55);
    box-sizing: border-box;
  }

  /* Loading */
  .loading {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 600;
    background: rgba(17,24,32,0.95); padding: 14px 22px; border-radius: 6px;
    border: 1px solid var(--border); font-size: 12px; color: var(--text-secondary);
  }
  .loading.hidden { display: none; }

  /* Zoom level indicator — sits directly under Leaflet's +/- zoom control.
     Hidden by default; flashes visible for 10s after a zoom action, then fades out. */
  .zoom-indicator {
    position: absolute; top: 73px; left: 13px; width: 34px; z-index: 500;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    color: var(--accent); background: var(--bg-secondary);
    padding: 2px 0; border-radius: 3px; pointer-events: none;
    border: 1px solid var(--border); text-align: center; box-sizing: border-box;
    opacity: 0; transition: opacity 220ms ease;
  }
  .zoom-indicator.visible { opacity: 1; }
  /* Non-touch browsers: leaflet-bar has no border and buttons are 26px, so shrink to match. */
  html:not(.leaflet-touch) .zoom-indicator { width: 26px; }

  /* Imagery date indicator */
  .imagery-date {
    position: absolute; bottom: 24px; left: 10px; z-index: 500;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500;
    color: #ddd; background: rgba(0,0,0,0.6);
    padding: 3px 8px; border-radius: 3px; pointer-events: none;
    display: none;
  }

  /* Leaflet overrides */
  .leaflet-control-attribution { font-size: 10px; background: rgba(17,24,32,0.8) !important; color: var(--text-muted) !important; }
  .leaflet-control-attribution a { color: var(--text-secondary) !important; }
  .leaflet-bar a { background: var(--bg-secondary) !important; color: var(--accent) !important; border-color: var(--border) !important; }
  .leaflet-bar a:hover { background: var(--bg-tertiary) !important; border-color: var(--accent) !important; }

  /* On-map Layers Control (collapsible) — sits in the top-left, just right of Leaflet's zoom control.
     Leaflet zoom is at left:10px and ~30px wide, so 54px places these buttons cleanly to its right. */
  .map-layers-ctl { position: absolute; top: 10px; left: 50px; z-index: 600; pointer-events: auto; }
  .mlc-btn-row { display: flex; gap: 6px; }
  .mlc-btn {
    width: 34px; height: 34px; padding: 0;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.45);
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  }
  .mlc-btn:hover { background: var(--bg-tertiary); border-color: var(--accent); }
  .mlc-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .mlc-btn svg { width: 18px; height: 18px; pointer-events: none; }
  .mlc-panel {
    display: none; margin-top: 6px;
    background: rgba(17,24,32,0.95); border: 1px solid var(--border); border-radius: 6px;
    min-width: 250px; backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.55);
    /* The Geology section made the panel taller than short viewports; scroll
       inside the panel rather than clipping rows. */
    overflow-y: auto; overflow-x: hidden; max-height: calc(100vh - 140px);
  }
  .mlc-panel.open { display: block; }
  .mlc-head {
    display: grid; grid-template-columns: 28px 28px 1fr; align-items: center; gap: 6px;
    padding: 7px 10px; border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: #f1f5f9;
  }
  .mlc-head .mlc-h-icon { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }
  .mlc-head .mlc-h-icon svg { width: 14px; height: 14px; }
  .mlc-section-label {
    font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
    padding: 9px 10px 3px;
  }
  .mlc-row {
    display: grid; grid-template-columns: 28px 28px 1fr; align-items: center; gap: 6px;
    padding: 5px 10px; font-size: 11.5px; color: var(--text-primary);
  }
  .mlc-row:hover { background: rgba(58,123,213,0.08); }
  .mlc-radio, .mlc-check { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .mlc-radio-dot {
    width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--text-muted);
    box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  }
  .mlc-row.sel .mlc-radio-dot { border-color: var(--accent); }
  .mlc-row.sel .mlc-radio-dot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
  .mlc-check-box {
    width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--text-muted);
    box-sizing: border-box; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; line-height: 1;
  }
  .mlc-row.on .mlc-check-box { background: var(--accent); border-color: var(--accent); }
  .mlc-row.on .mlc-check-box::after { content: '\2714'; }
  /* Indented sub-row for "Show Laterals" beneath the Wells row.
     Flexbox keeps the check and label tight; left padding puts it clearly under
     the parent row's name area so the hierarchy reads at a glance. */
  .mlc-subrow {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 10px 5px 70px; font-size: 10.5px; color: #8899aa; cursor: pointer;
  }
  .mlc-subrow:hover { background: rgba(58,123,213,0.06); }
  .mlc-subrow .mlc-check { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
  .mlc-subrow.on .mlc-check-box { background: var(--accent); border-color: var(--accent); }
  .mlc-subrow.on .mlc-check-box::after { content: '\2714'; }
  .mlc-name { display: flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer; }
  .mlc-swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); }
  .mlc-icon-swatch { width: 14px; height: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #f1c40f; }
  .mlc-icon-swatch svg { width: 14px; height: 14px; filter: drop-shadow(0 0 1px rgba(0,0,0,0.4)); }
  .mlc-bm-select {
    flex: 1; min-width: 0; padding: 3px 6px; border-radius: 4px;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border); font-family: inherit; font-size: 11px;
    cursor: pointer; outline: none;
  }
  .mlc-bm-select:focus { border-color: var(--accent); }
  .mlc-row.disabled-bm .mlc-bm-select { opacity: 0.5; cursor: not-allowed; }
  body.theme-light .mlc-panel { background: rgba(241,245,249,0.96); }
  body.theme-light .mlc-row { color: var(--text-primary); }
  body.theme-light .mlc-head { color: var(--text-primary); }
  /* Footer of the layers widget — divider + placeholder for the future shapefile importer. */
  .mlc-divider {
    height: 1px; margin: 8px 0 0; background: var(--border); opacity: 0.7;
  }
  .mlc-action-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 9px 12px; margin: 0;
    background: transparent; border: 0; border-top: 0; cursor: pointer;
    color: var(--text-primary); font-family: inherit; font-size: 11.5px;
    text-align: left;
  }
  .mlc-action-btn:hover { background: rgba(58,123,213,0.12); color: var(--accent); }
  .mlc-action-icon { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }

  /* Per-layer filter icon (Horizontal Laterals row) */
  .mlc-filter-btn {
    width: 18px; height: 18px; padding: 0;
    background: transparent; border: 1px solid transparent; border-radius: 3px;
    color: var(--text-muted); cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; margin-left: 6px;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  }
  .mlc-filter-btn:hover { color: var(--accent); border-color: var(--accent); }
  .mlc-filter-btn.has-filter { color: var(--accent); border-color: var(--accent); background: rgba(58,123,213,0.12); }
  .mlc-filter-btn svg { width: 13px; height: 13px; pointer-events: none; }

  /* Lateral Filter modal */
  .lf-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9000;
    display: none; align-items: center; justify-content: center;
  }
  .lf-overlay.open { display: flex; }
  .lf-modal {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    width: 760px; max-width: 95vw; padding: 0; color: var(--text-primary);
    box-shadow: 0 10px 36px rgba(0,0,0,0.55);
    font-family: inherit;
  }
  .lf-grid {
    display: grid; grid-template-columns: 200px 1fr 1fr; gap: 18px; padding: 14px;
  }
  .lf-col { display: flex; flex-direction: column; gap: 12px; }
  .lf-types-list { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
  .lf-type-row {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 4px 6px 4px 2px; font-size: 11.5px; color: var(--text-primary);
    border-radius: 3px;
  }
  .lf-type-row:hover { background: rgba(58,123,213,0.08); }
  .lf-type-cb {
    width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 9px; line-height: 1; flex-shrink: 0; box-sizing: border-box;
  }
  .lf-type-row.on .lf-type-cb { background: var(--accent); border-color: var(--accent); }
  .lf-type-row.on .lf-type-cb::after { content: '\2714'; }
  .lf-type-color {
    width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; border: 1px solid #333;
  }
  /* Sub-row variant for indented children (fee status sub-types under "Fee" parent). */
  .lf-type-row.lf-type-sub {
    padding-left: 22px; font-size: 11px; color: var(--text-secondary);
  }
  .lf-type-row.lf-type-sub.disabled { opacity: 0.45; }
  .lf-section-spacer { height: 6px; }
  .lf-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary); border-radius: 8px 8px 0 0;
  }
  .lf-head h3 {
    margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 11px;
    font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-primary);
  }
  .lf-close {
    background: transparent; border: 0; color: var(--text-muted); cursor: pointer;
    font-size: 18px; line-height: 1; padding: 0 4px;
  }
  .lf-close:hover { color: var(--accent); }
  .lf-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
  .lf-field { display: flex; flex-direction: column; gap: 4px; }
  .lf-field label {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-secondary);
  }
  .lf-field input {
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 4px;
    padding: 7px 9px; color: var(--text-primary); font-family: inherit; font-size: 12px;
    outline: none;
  }
  .lf-field input:focus { border-color: var(--accent); }
  .lf-field .lf-hint { font-size: 10.5px; color: var(--text-muted); line-height: 1.35; }
  .lf-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 14px; border-top: 1px solid var(--border);
  }
  .lf-btn {
    padding: 7px 14px; border-radius: 4px; font-family: inherit; font-size: 11.5px;
    font-weight: 600; cursor: pointer; border: 1px solid var(--border);
    background: var(--bg-tertiary); color: var(--text-primary);
  }
  .lf-btn:hover { border-color: var(--accent); }
  .lf-btn.lf-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .lf-btn.lf-btn-primary:hover { filter: brightness(1.1); }

  #traj-3d-overlay-controls {
    position: absolute; top: 8px; left: 10px;
    display: flex; flex-direction: column; gap: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    letter-spacing: 0.6px; text-transform: uppercase;
    color: var(--text-muted); user-select: none;
  }
  #traj-3d-overlay-controls .traj-3d-overlay-toggle {
    display: flex; align-items: center; gap: 6px; cursor: pointer;
  }
  #traj-3d-overlay-controls .traj-3d-overlay-toggle:hover { color: var(--text-primary); }
  #traj-3d-overlay-controls .traj-3d-overlay-toggle input[type="checkbox"] {
    margin: 0; width: 11px; height: 11px; accent-color: var(--accent); cursor: pointer;
  }
  #traj-3d-overlay-controls .traj-3d-overlay-toggle-sub { margin-left: 14px; font-size: 9.5px; }
  #traj-3d-overlay-controls[data-survey-state="off"] .traj-3d-overlay-toggle-sub,
  #traj-3d-overlay-controls[data-survey-state="unavailable"] .traj-3d-overlay-toggle-sub {
    opacity: 0.4; pointer-events: none;
  }
  #traj-3d-overlay-controls[data-survey-state="unavailable"] .traj-3d-overlay-toggle:first-child {
    opacity: 0.5; pointer-events: none;
  }
  #traj-3d-overlay-controls .traj-3d-overlay-unavailable {
    display: none;
    font-style: italic; text-transform: none; letter-spacing: 0;
    font-size: 9.5px; color: var(--text-muted); padding-top: 2px;
  }
  #traj-3d-overlay-controls[data-survey-state="unavailable"] .traj-3d-overlay-unavailable {
    display: block;
  }

/* ══════════════════════════════════════════════════════════════════════
   COGNITO AUTH OVERLAY
   Ported from the ICOP-PRO monolith. Self-contained (own colors/fonts) so
   it renders before the app theme is applied. Hidden in test mode by
   js/auth.js via the .hidden class.
   ══════════════════════════════════════════════════════════════════════ */
/* Auth gate wears the shared ICOP environment (Dean, 2026-07-10): same
   mountain/data backdrop + glass card language as the forced-dark landing, so
   login → landing reads as one continuous place. Always-dark by design — the
   overlay renders pre-theme, matching the forced-dark landing decision. */
#auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--icop-bg, #0a0f1a);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  font-family: Calibri, Arial, sans-serif;
}
/* Backdrop on its own layer (Live Ops / landing ::before idiom): the overlay's
   fixed position + z-index makes it a stacking context, so z-index:-1 paints
   above the overlay's own background but under the card. Same asset + the
   landing's dark overlay family. */
#auth-overlay::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(8,13,24,0.52) 0%, rgba(8,13,24,0.68) 100%),
    url('/assets/ICOP_Background_2560x1440_2.webp');
  background-size: cover;
  background-position: center 90%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: contrast(1.05);
}
#auth-overlay.hidden { display: none; }
.auth-card {
  /* Landing glass-card language: deepened --icop-panel fill, strong border,
     layered shadow, blur. */
  background: linear-gradient(158deg, rgba(24,34,55,0.64) 0%, rgba(13,21,37,0.54) 100%);
  border: 1px solid var(--icop-border-strong, rgba(122,152,193,0.60));
  border-radius: var(--icop-radius, 12px);
  padding: 50px 46px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 3px 10px rgba(0,0,0,0.35);
  backdrop-filter: blur(var(--icop-blur, 9px));
  -webkit-backdrop-filter: blur(var(--icop-blur, 9px));
  max-width: 420px;
  width: 90%;
  color: var(--icop-text, #dbe6f3);
}
.auth-card h1 {
  /* ICOP wordmark — lockup grammar (Helvetica 800, tight tracking), solid
     light ink like the Welcome panel's wordmark (the old navy gradient text
     fill was built for the white card and vanishes on glass). */
  font-family: Helvetica, Arial, sans-serif;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--icop-ink, #f1f6fd);
  margin-bottom: 8px;
}
.auth-card h1 .auth-tm {
  font-size: 11px;
  font-weight: 600;
  margin-left: 1px;
  vertical-align: super;
  line-height: 1;
  color: var(--icop-mut, #8294ad);
}
.auth-card .subtitle {
  font-size: 13px;
  color: var(--icop-axlbl, #9fb1c6);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.auth-card .auth-by {
  /* Company signature — quiet attribution beneath the product mark */
  font-size: 11px;
  color: var(--icop-mut, #8294ad);
  letter-spacing: 0.3px;
  margin-bottom: 28px;
}
.auth-card .status {
  font-size: 14px;
  color: var(--icop-axlbl, #9fb1c6);
  margin-bottom: 25px;
}
.auth-card .sign-in-btn {
  /* Same accent-blue button language as the landing's Select Project. */
  display: inline-block;
  padding: 14px 40px;
  background-color: var(--icop-blue, #3b82f6);
  color: #fff;
  border: none;
  border-radius: var(--icop-radius-sm, 6px);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
  font-family: 'IBM Plex Sans', Calibri, Arial, sans-serif;
}
.auth-card .sign-in-btn:hover {
  filter: brightness(1.12);
}
.auth-card .auth-forgot {
  margin-top: 14px;
  font-family: Calibri, Arial, sans-serif;
  font-size: 13px;
}
.auth-card .auth-forgot a {
  color: #8ab6f5;   /* light accent — readable link on the dark glass */
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.auth-card .auth-forgot a:hover {
  border-bottom-color: #8ab6f5;
}
/* Customer picker on a fresh sign-in (auth.js _pickCustomer): one row per
   customer the login belongs to. */
.auth-card .customer-pick { display: flex; flex-direction: column; gap: 10px; }
.auth-card .customer-pick-btn {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; padding: 13px 16px;
  background: rgba(59,130,246,0.10);
  border: 1px solid var(--icop-border-strong, rgba(122,152,193,0.60));
  border-radius: var(--icop-radius-sm, 6px);
  color: var(--icop-text, #dbe6f3);
  font-family: 'IBM Plex Sans', Calibri, Arial, sans-serif;
  font-size: 15px; font-weight: 600; letter-spacing: 0.2px; text-align: left;
  cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.auth-card .customer-pick-btn:hover,
.auth-card .customer-pick-btn:focus-visible {
  background: var(--icop-blue, #3b82f6); border-color: var(--icop-blue, #3b82f6); color: #fff; outline: none;
}
.auth-card .customer-pick-note {
  font-size: 11px; font-weight: 500; letter-spacing: 0.3px; opacity: 0.7; white-space: nowrap;
}
.auth-card .user-info {
  font-size: 13px;
  color: var(--icop-text, #dbe6f3);
  margin-top: 15px;
}
.auth-sign-out-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--icop-border, rgba(122,152,193,0.30));
  border-radius: 4px;
  color: var(--icop-mut, #8294ad);
  font-size: 12px;
  cursor: pointer;
  font-family: Calibri, Arial, sans-serif;
  transition: all 0.2s;
}
.auth-sign-out-btn:hover {
  border-color: var(--icop-border-strong, rgba(122,152,193,0.60));
  color: var(--icop-text, #dbe6f3);
}

/* ── Live Stream viewer (Execution → Frac → LiveStream) ──────────────── */
#ls-root { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.ls-statusbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: 6px;
}
.ls-dot { width: 10px; height: 10px; border-radius: 50%; background: #888; flex: 0 0 auto; }
.ls-dot.ls-live { background: #2ecc71; box-shadow: 0 0 0 0 rgba(46,204,113,0.6); animation: ls-pulse 1.6s infinite; }
.ls-dot.ls-connecting { background: #f39c12; }
.ls-dot.ls-idle { background: #888; }
.ls-dot.ls-error { background: #e74c3c; }
@keyframes ls-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,204,113,0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}
.ls-conn { font-weight: 700; font-size: 12px; letter-spacing: 0.5px; color: var(--title-strong); }
#ls-stage-select {
  padding: 4px 8px; background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: 4px; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.ls-meta { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.ls-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ls-kpi {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px;
}
.ls-kpi-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 4px;
}
.ls-kpi-val { font-size: 24px; font-weight: 700; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.ls-kpi-unit { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 3px; }
.ls-chart-wrap {
  width: 100%; height: 460px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px;
}
#ls-chart { width: 100%; height: 100%; }
.ls-note { font-size: 11px; color: var(--text-muted); margin: 0; font-style: italic; }
@media (max-width: 900px) { .ls-kpis { grid-template-columns: repeat(2, 1fr); } }

/* Channel selection sidebar + chart layout */
.ls-main { display: flex; gap: 12px; align-items: flex-start; }
.ls-side { flex: 0 0 210px; }
.ls-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ls-channels-card {
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 7px;
  padding: 10px 12px; max-height: 540px; overflow-y: auto;
}
.ls-channels-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ls-channels-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-weight: 600;
}
.ls-show-all-lbl {
  display: flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
}
.ls-show-all-lbl input { cursor: pointer; margin: 0; }
.ls-channel-search {
  width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 4px 7px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 10px;
}
.ls-channel-search:focus { outline: none; border-color: var(--accent); }
.ls-ch.ls-ch-dim { opacity: 0.5; }
.ls-ch-tag {
  margin-left: auto; font-size: 8px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 3px;
}
.ls-ch {
  display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-primary);
}
.ls-ch input { cursor: pointer; margin: 0; flex: 0 0 auto; }
.ls-ch-sw { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.ls-ch-empty, .ls-kpi-empty { font-size: 11px; color: var(--text-muted); font-style: italic; }
.ls-kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ls-kpi-val { font-size: 20px; }
@media (max-width: 1100px) { .ls-side { flex-basis: 170px; } }

/* ════════════════════════════════════════════════════════════════════
 * Live Ops — full-screen pad-level operations console (js/live-ops.js)
 * ════════════════════════════════════════════════════════════════════ */
.liveops-launch {
  margin-left: auto; padding: 5px 12px; border-radius: 4px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; background: var(--accent, #2d6cdf); color: #fff; border: none;
  white-space: nowrap;
}
.liveops-launch:hover { opacity: 0.88; }
.liveops-launch.glow {
  background: #2ecc71; color: #06210f;
  animation: liveops-glow 1.6s ease-in-out infinite;
}
@keyframes liveops-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
}

.live-ops-fullscreen {
  position: fixed; inset: 0; z-index: 10000;
  display: none; flex-direction: column;
  background-color: #0a0f1a;
}
/* ICOP report cover as the page backdrop — on its own layer (z-index:-1) so the
   contrast filter touches only the image, not the panels/text. Darkened a touch;
   shows through the transparent .lo-main / .lo-charts behind the chart cards. */
.live-ops-fullscreen::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(8,13,24,0.45) 0%, rgba(8,13,24,0.58) 100%),
    url('/assets/ICOP_Background_2560x1440_2.webp');
  background-size: cover;
  background-position: center 90%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: contrast(1.05);
}
/* Settings → Appearance → Background image OFF: a quiet navy wash instead of
   the photo. Same tonal family as the panels so contrast is unchanged; no
   imagery to fight a screen grab. */
.live-ops-fullscreen.lo-nobg::before {
  background-image: linear-gradient(180deg, #0e1626 0%, #0a101d 55%, #080c16 100%);
  background-attachment: scroll;
  filter: none;
}
.live-ops-fullscreen.open { display: flex; }
/* ── Live Ops command bar — branded to match the Wireline Pad Report header band.
   Dark in both themes (the bar carries the brand, like the PDF). Three zones:
   left = ICOP lockup + LIVE OPS/operator, center = Current Stage, right = nav. */
.live-ops-fullscreen {
  --lo-ink: #f1f6fd; --lo-mut: #8294ad; --lo-cyan: #2cc3ec; --lo-blue: #3b82f6;
  --lo-div: #3a5882; --lo-green: #2ecc71;
}
.lo-header {
  position: relative;
  flex: 0 0 auto; display: flex; align-items: center; gap: 18px;
  padding: 7px 16px; color: var(--lo-ink);
  /* Diagonal navy→blue gradient + a faint cyan glow under the ICOP lockup, so the
     bar reads like the report header band — one ICOP ecosystem across PDF + live. */
  background:
    radial-gradient(130% 200% at 11% -10%, rgba(44,195,236,0.12) 0%, rgba(44,195,236,0) 42%),
    linear-gradient(115deg, #0a1322 0%, #0f1d35 48%, #16284a 100%);
  border-bottom: 1px solid #1d2c46;
}
/* Cyan→blue accent rule along the bottom edge — echoes the report's divider */
.lo-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(44,195,236,0) 0%, rgba(44,195,236,0.5) 16%,
    rgba(59,130,246,0.5) 52%, rgba(44,195,236,0) 100%);
}
.lo-hz { display: flex; align-items: center; min-width: 0; }
.lo-hz-left { gap: 13px; flex: 0 0 auto; }
.lo-hz-center { flex: 1 1 auto; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; text-align: center; }
.lo-hz-right { gap: 10px; flex: 0 0 auto; margin-left: auto; }

/* ICOP wordmark + tagline lockup (mirrors report _header_band) */
.lo-wordmark { display: inline-flex; align-items: flex-start; line-height: 1; }
.lo-icop { font-family: Helvetica, Arial, sans-serif; font-weight: 800; font-size: 21px;
  letter-spacing: 0.5px; color: #fff; }
.lo-tm { font-size: 8px; font-weight: 600; margin-left: 1px; color: var(--lo-mut); }
.lo-tagline { display: flex; flex-direction: column; line-height: 1.18; }
.lo-tagline span { font-family: 'JetBrains Mono', monospace; font-size: 7px; font-weight: 600;
  letter-spacing: 1.1px; text-transform: uppercase; color: var(--lo-mut); }
.lo-brand-div { width: 1px; height: 30px; background: var(--lo-div); flex: 0 0 auto; }

.lo-opzone { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
/* LIVE OPS — operational beacon: a green pill that says "this screen is live" at a glance */
.lo-brand { display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: rgba(46,224,106,0.10); border: 1px solid rgba(46,224,106,0.38);
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 800;
  letter-spacing: 1.7px; color: #54e08c; }
.lo-livedot { width: 9px; height: 9px; border-radius: 50%; background: #2ee06a; flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(46,224,106,0.55), 0 0 8px 1px rgba(46,224,106,0.7);
  animation: lo-beacon 1.8s ease-out infinite; }
@keyframes lo-beacon {
  0%   { box-shadow: 0 0 0 0 rgba(46,224,106,0.5),  0 0 8px 1px rgba(46,224,106,0.7); }
  70%  { box-shadow: 0 0 0 7px rgba(46,224,106,0),   0 0 8px 1px rgba(46,224,106,0.45); }
  100% { box-shadow: 0 0 0 0 rgba(46,224,106,0),     0 0 8px 1px rgba(46,224,106,0.7); }
}
@media (prefers-reduced-motion: reduce) { .lo-livedot { animation: none; } }
/* Return — a chip sibling to the LIVE OPS pill, sitting just left of it. Neutral slate
   (green stays reserved for the live beacon) but the same pill shape + mono type, so the
   two read as a matched pair. Click returns to the platform (id=lo-close → liveOpsClose). */
.lo-return-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 3px 11px 3px 8px; border-radius: 999px;
  background: rgba(122,152,193,0.10); border: 1px solid rgba(122,152,193,0.34);
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 800;
  letter-spacing: 1.2px; color: #aebfd6;
  transition: background .15s ease, border-color .15s ease, color .15s ease; }
.lo-return-chip svg { width: 14px; height: 14px; flex: 0 0 auto; opacity: 0.85; }
.lo-return-chip:hover { background: rgba(122,152,193,0.18); border-color: rgba(122,152,193,0.6);
  color: #e7eefb; }
.lo-return-chip:hover svg { opacity: 1; }
.lo-project {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  color: var(--lo-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Customer + Pad Name lockup (report typography: Helvetica, cyan bullet separators) */
.lo-padzone { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Mobile-only elements — hidden on desktop (desktop keeps the LIVE OPS pill +
   top-nav project picker). Shown inside the phone media query below. */
.lo-pad-livedot { display: none; }
.lo-set-switchproj { display: none; }
.lo-customer { font-family: Helvetica, Arial, sans-serif; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.2px; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-padname { font-family: Helvetica, Arial, sans-serif; font-size: 11.5px; font-weight: 600;
  color: #cdd9ea; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-padname .sep { color: var(--lo-cyan); font-weight: 700; }

/* Center — Current Stage readout */
.lo-curstage-line { display: flex; align-items: baseline; gap: 9px; max-width: 100%; }
.lo-curstage-label { font-family: Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 0.2px; color: #eaf1fb; white-space: nowrap; flex: 0 0 auto; }
.lo-curstage-main { font-family: Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.3px; color: var(--lo-cyan);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lo-curstage-main .cs-sep { padding: 0 5px; opacity: 0.85; }
.lo-curstage-sub { font-family: Helvetica, Arial, sans-serif; font-size: 10.5px;
  color: var(--lo-mut); margin-top: 1px; }

/* Right — section nav (inert: no handlers wired yet) */
/* Typography-first nav (Bloomberg / Petra / Kingdom feel): no icons, no button
   fills. Mode is communicated by bright text + a thin illuminated underline, not
   a filled capsule. The container is a faint navy frame that blends into the
   header rather than reading as a separate widget. */
.lo-nav { display: flex; align-items: center; gap: 6px; padding: 2px 6px;
  background: rgba(18,28,48,0.45); border: 1px solid rgba(120,160,255,0.15); border-radius: 14px; }
.lo-nav-tab { position: relative; display: inline-flex; align-items: center; padding: 6px 9px 7px;
  background: transparent; border: 0; border-radius: 0; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  letter-spacing: 0.7px; text-transform: uppercase; color: #8a95b8; line-height: 1;
  transition: color .12s, text-shadow .12s; }
/* Per-discipline accent drives the underline/glow (telemetry color cue, subtle) */
.lo-nav-tab[data-lonav="timeline"]  { --acc: #5fd0e6; }
.lo-nav-tab[data-lonav="wireline"]  { --acc: #69a8ff; }
.lo-nav-tab[data-lonav="frac"]      { --acc: #ffb347; }
.lo-nav-tab[data-lonav="analytics"] { --acc: #7ee787; }
.lo-nav-tab[data-lonav="reports"]   { --acc: #c084fc; }
.lo-nav-tab:hover { color: #c6d2ec; text-shadow: 0 0 8px rgba(105,168,255,0.30); }
.lo-nav-tab.active { color: #fff; font-weight: 700;
  text-shadow: 0 0 10px color-mix(in srgb, var(--acc, #69a8ff) 55%, transparent); }
/* Thin illuminated underline centered beneath the active label (out of flow, so
   switching modes never nudges the row). */
.lo-nav-tab.active::after { content: ""; position: absolute; bottom: 0; left: 9px; right: 9px; height: 2.5px;
  border-radius: 2px; background: var(--acc, #69a8ff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--acc, #69a8ff) 70%, transparent); }

.lo-header-status { display: flex; align-items: center; gap: 8px; }
.lo-header .ls-conn { color: var(--lo-ink); }
.lo-header .ls-meta { color: var(--lo-mut); margin-left: 0; }
/* Return — secondary nav: dark glass, dimmer than the primary nav tabs */
.lo-return { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 6px;
  height: 32px; box-sizing: border-box; margin-left: 2px;
  background: rgba(15,25,50,0.65); border: 1px solid rgba(120,140,180,0.25); border-radius: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  color: rgba(205,217,234,0.62); line-height: 1; cursor: pointer;
  transition: color .12s, background .12s, border-color .12s, box-shadow .12s; }
.lo-return svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0.9; }
.lo-return span { opacity: 0.82; }
.lo-return:hover { color: rgba(225,235,250,0.95); background: rgba(22,38,72,0.78);
  border-color: rgba(150,180,255,0.5); box-shadow: 0 0 12px rgba(105,168,255,0.18); }
.lo-return:hover svg { opacity: 1; }
/* Settings gear — the one surviving icon. Circular outline, no fill, part of the
   nav system: same visual weight, subtle blue hover glow. */
.lo-theme-btn {
  background: transparent; border: 1px solid rgba(120,160,255,0.22); border-radius: 50%; cursor: pointer;
  color: #8a95b8; line-height: 0; width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .12s, border-color .12s, box-shadow .12s;
}
.lo-theme-btn svg { width: 15px; height: 15px; }
.lo-theme-btn:hover { color: #e6edfb; border-color: rgba(150,180,255,0.5);
  box-shadow: 0 0 10px rgba(105,168,255,0.25); }

/* Narrow viewports: tighten nav spacing (text stays — it's the affordance now) */
@media (max-width: 1180px) {
  .lo-nav { gap: 2px; padding: 2px 4px; }
  .lo-nav-tab { padding: 6px 6px 7px; letter-spacing: 0.4px; }
  .lo-tagline { display: none; }
}
@media (max-width: 980px) {
  .lo-curstage-sub { display: none; }
}

/* ── Phones: Live Ops stays operable (Dean, launch day). The upper/lower tab
   bars already scroll (.lo-lower-tabs); this handles the strip + nav. Catches
   BOTH portrait (≤820px) AND landscape phones (short viewport ≤500px tall,
   which are wider than 820) so the compact layout applies in both. Additive —
   desktop untouched. ── */
@media (max-width: 820px), (max-height: 500px) {
  /* Top row becomes an IDENTITY + live-status bar (Dean): mobile is Live Ops,
     so the "← Project" chip and the "LIVE OPS" pill (both redundant/​leading to
     the non-mobile workbench) are dropped. In their place, the client + pad
     line — prefixed by the live-dot — so a glance (and any screenshot to the
     client) shows who + where + that it's live. Row: ICOP ┆ ● Customer · Pad ⚙.
     Escape to another pad lives in the gear menu (Switch Project). */
  .lo-return-chip,                       /* ← Project chip  */
  .lo-opzone,                            /* LIVE OPS pill   */
  .lo-hz-left .lo-brand-div { display: none; }   /* now-orphaned dividers */
  .lo-pad-livedot { display: inline-block; }
  /* Switch Project: a plain Project dropdown (same pattern as Time Zone), set
     off from Tours below by a divider + spacing so it reads as its own thing. */
  .lo-set-switchproj {
    display: block;
    padding-bottom: 16px; margin-bottom: 4px;
    border-bottom: 1px solid var(--lo-div);
  }
  /* Client + pad on one line, with a single divider re-introduced before it. */
  .lo-padzone {
    flex-direction: row; align-items: center; gap: 6px;
    border-left: 1px solid var(--lo-div); padding-left: 10px;
  }
  .lo-customer { font-size: 12px; }
  .lo-padname::before { content: "· "; color: var(--lo-cyan); font-weight: 700; }
  .lo-padname:empty::before { content: ""; }

  /* Landing/login (no project yet): the 1-2-3 workflow steps and the Inventory
     tab are premature — the only action is Select Project in the panel (Dean). */
  body.no-project .wf-bar,
  body.no-project .mode-tab[data-mode="inventory"] { display: none; }

  /* Current Stage readout: drop on phones — placeholder text ("Current St…")
     just crowded the header and shoved the gear off-screen (Dean). Compound
     selector so it beats the later base `.lo-hz-center { display:flex }`. */
  .lo-header .lo-hz-center { display: none; }

  /* Header must never push the gear off-screen: tighten it, let the left zone
     shrink, and ellipsize the pad name (was flex:0 0 auto → fixed width). */
  .lo-header { gap: 8px; padding: 6px 10px; }
  .lo-hz-left { flex: 1 1 auto; min-width: 0; gap: 8px; overflow: hidden; }
  .lo-padzone { min-width: 0; overflow: hidden; }
  .lo-padname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lo-hz-right { flex: 0 0 auto; }

  /* View nav: moved by JS (_mobileNavReflow) to sit BELOW the well cards as a
     thin full-width row. Only Wireline/Frac/Materials matter in the field —
     Timeline and Reports are hidden here. Buttons stretch to fill the width. */
  .lo-nav {
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
    width: 100%; box-sizing: border-box; justify-content: stretch;
    padding: 4px 8px; gap: 6px; margin: 0 0 4px;
  }
  .lo-nav::-webkit-scrollbar { display: none; }
  .lo-nav-tab { flex: 1 1 0; justify-content: center; }
  /* Hide Timeline + the Reports dropdown on phones (Dean). Compound/id selectors
     so they out-rank the later base tab rules. */
  .lo-nav .lo-nav-tab[data-lonav="timeline"],
  .lo-nav #lo-reports-dd { display: none; }
  /* Hide the Pad Overview rail on phones (Dean) — the chart/panel takes the
     full lower width. Compound selector (.lo-main .lo-side) so it out-ranks
     the base `.lo-side { display: flex }` that appears later in the file. */
  .lo-main .lo-side { display: none; }

  /* ── Phone frac/wireline view model ──────────────────────────────────────
     Section nav gone (the well cards carry well+op via F/WL); #lo-mviews is the
     single view selector. Both tab strips are hidden — the view row drives them
     and the stage dropdown is relocated into it. */
  #lo-nav { display: none; }
  #lo-upper .lo-lower-tabs,
  #lo-lower .lo-lower-tabs { display: none; }

  /* Contextual view row: op views (scroll) + relocated stage dropdown + pinned
     Materials. */
  #lo-mviews {
    display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box;
    padding: 5px 8px; margin: 0 0 4px; background: rgba(10,18,32,0.55);
    border-top: 1px solid var(--lo-div); border-bottom: 1px solid var(--lo-div);
  }
  #lo-mviews .lo-mviews-btns { display: flex; align-items: center; gap: 2px; flex: 1 1 auto;
    min-width: 0; overflow-x: auto; scrollbar-width: none; }
  #lo-mviews .lo-mviews-btns::-webkit-scrollbar { display: none; }
  .lo-mview {
    flex: 0 0 auto; padding: 7px 6px; border-radius: 8px; border: 1px solid transparent;
    background: none; color: var(--lo-mut, #8294ad); cursor: pointer;
    font: 700 11px/1 'JetBrains Mono', monospace; letter-spacing: 0.2px; text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
  }
  .lo-mview.sel { color: #fff; background: rgba(59,130,246,0.2); border-color: rgba(59,130,246,0.5); }
  .lo-mview-matl { flex: 0 0 auto; margin-left: 2px; padding-left: 12px;
    border-left: 1px solid var(--lo-div); }

  /* Stage bar: the LIVE/stage dropdown on its own thin row below the view row
     (off the crowded view row; near Ghost Stages on PRD). Shown by _syncMStage
     only when there are stages. */
  #lo-mstage { display: none; align-items: center; gap: 8px; width: 100%;
    box-sizing: border-box; padding: 4px 8px; margin: 0 0 4px;
    border-bottom: 1px solid var(--lo-div); background: rgba(10,18,32,0.35); }
  #lo-mstage .lo-uptab-actions { display: flex; margin: 0; }
  #lo-mstage .lo-wl-stage { font-size: 13px; min-width: 160px; }

  /* PRD control row shrinks to just Ghost Stages (the live view is ghosts-first;
     Steps/Crosshair stay ON by default, their toggles hidden). The paired groups
     carry inline display, so !important is required to beat it. */
  .lo-prd-toolbar > * { display: none !important; }
  .lo-prd-toolbar > .trim-btn-group:last-child { display: inline-flex !important; }
  /* Ghost Stages setup popup: the group sits at the LEFT of the toolbar, so the
     default right:0 anchor spilled the popup off the left edge (both orientations).
     Left-anchor it and cap the width to the viewport. */
  #lo-prd-ghost-pop { left: 0; right: auto; max-width: calc(100vw - 20px); }
  .lo-prd-toolbar { padding: 6px 8px; gap: 6px; min-height: 0; }
  /* Chem control row: hide the config actions (Map Channels / Chemical Map /
     Channel Assignments — set up on desktop), keep only the Raw toggle live. */
  .lo-chem-toolbar #lo-chem-map,
  .lo-chem-toolbar #lo-chem-pumpmap,
  .lo-chem-toolbar #lo-chem-assign { display: none; }
  .lo-chem-toolbar { padding: 4px 2px 6px; }
  /* Enlarge is a desktop control — mobile uses the landscape full-screen instead. */
  #lo-upper-enlarge { display: none; }

  /* One panel at a time. Default = upper chart; .lo-mv-lower → lower panel. */
  .lo-plot-wrap.lo-mv-lower #lo-upper { display: none; }
  .lo-plot-wrap.lo-mv-lower #lo-lower { display: flex; flex: 1; }
  .lo-plot-wrap:not(.lo-mv-lower) #lo-lower { display: none; }
  .lo-plot-wrap:not(.lo-mv-lower) #lo-upper { flex: 1; }

  /* F/WL segment on each card: second line under the name (always fits the thin
     card). The live op glows; the viewed op (focused well) is selected. */
  .lo-ops-card.lo-ops-active .lo-ops-fwl { display: inline-flex; margin-top: 5px; align-self: flex-start;
    border: 1px solid var(--lo-div); border-radius: 7px; overflow: hidden; }
  .lo-fwl-btn { position: relative; padding: 5px 9px; min-width: 30px; background: none; border: none;
    cursor: pointer; color: var(--lo-mut, #8294ad); font: 800 10px/1 'JetBrains Mono', monospace; letter-spacing: 0.5px; }
  .lo-fwl-btn + .lo-fwl-btn { border-left: 1px solid var(--lo-div); }
  .lo-fwl-btn.sel { color: #fff; background: rgba(59,130,246,0.24); }
  .lo-fwl-btn.live::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px;
    border-radius: 50%; background: #2ee06a; box-shadow: 0 0 5px rgba(46,224,106,0.9); }
  /* Cards grow to two lines now they carry F/WL — align contents to the top. */
  .lo-ops-card.lo-ops-active { align-items: flex-start; }

  /* Top strip wraps: row 1 = pad-% circle + the three thin well cards;
     row 2 = Today's Tour. */
  .lo-opsbar { flex-wrap: wrap; gap: 6px; padding: 6px 8px 4px; align-items: flex-start; }
  /* Pad progress shrinks to just the donut (the %), inline at the row start —
     the label/stage text drops (the donut carries it). */
  /* Pad-summary donut is a proper tappable CARD (Dean): gold left stripe (distinct
     from the wells' R/W/B), card bg/border, no chevron. Tap → Today's Tour. */
  .lo-ops-card.lo-ops-progress {
    flex: 0 0 auto; max-width: none; min-width: 0; gap: 0; position: relative;
    align-self: stretch;                    /* match the well cards' (taller) height */
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 8px 7px 8px 13px;              /* donut at TOP; the space below is held for the future events button */
    background: rgba(20,32,52,0.5); border: 1px solid var(--lo-div); border-radius: 8px;
    box-shadow: none;
  }
  .lo-ops-progress .lo-ops-gold {
    display: block; position: absolute; top: 0; bottom: 0; left: 0; right: auto;
    width: 6px; height: auto; border-radius: 8px 0 0 8px; background: #e0a726;
  }
  .lo-ops-progress .lo-ops-meta { display: none; }
  .lo-ops-progress .lo-donut { width: 52px; height: 52px; }
  /* Ops-strip collapse toggle: unneeded with the thin cards (Dean). Compound
     selector so it beats the later base .lo-ops-toggle rule. */
  .lo-opsbar .lo-ops-toggle { display: none; }
  /* Hide Today's Tour on phones (Dean) — secondary summary; its counts live
     in Materials + the collapsed strip. Compound selector (.lo-ops-card.
     lo-ops-tour) so it out-ranks the later base `.lo-ops-card { display:flex }`.
     (Same cascade trap defeated the earlier flex-row attempt.) */
  .lo-ops-card.lo-ops-tour { display: none; }

  /* THIN well cards: the R/W/B classification strip is the primary identifier
     (a fat left bar), with an abbreviated name + status tag. The rig icon,
     live KPIs, and stage line drop — tap the card to focus a well and read
     detail in the chart/numeric panel below. */
  .lo-ops-card.lo-ops-active {
    flex: 1 1 0; min-width: 0; max-width: none; gap: 7px;
    padding: 8px 8px 8px 13px; border-radius: 8px; align-items: center;
  }
  .lo-ops-active .lo-ops-rig,
  .lo-ops-active .lo-ops-statusline,
  .lo-ops-active .lo-sub-kpis,
  .lo-ops-active .lo-ops-cdot-wrap { display: none; }
  .lo-ops-active .lo-ops-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .lo-ops-active .lo-ops-big { order: 1; font-size: 13px; line-height: 1.1; }   /* name STARTS the card (Dean) */
  .lo-ops-active .lo-ops-wname { display: none; }
  .lo-ops-active .lo-ops-wshort { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .lo-ops-active .lo-ops-mstage { display: block; order: 2; margin-top: 1px;
    font: 700 12px/1.1 'JetBrains Mono', monospace; letter-spacing: 0.3px; color: var(--lo-cyan, #2cc3ec); }
  .lo-ops-active .lo-ops-mstage b { color: #fff; font-size: 15px; }
  .lo-ops-active .lo-ops-mstage-tot { display: block; margin-top: 1px;
    color: var(--lo-mut, #8294ad); font-weight: 600; font-size: 10px; letter-spacing: 0.2px; }
  .lo-ops-active .lo-ops-mstage-el { display: block; margin-top: 2px;
    color: var(--lo-mut, #8294ad); font: 600 10px/1.1 'JetBrains Mono', monospace; letter-spacing: 0.2px; }
  .lo-ops-active .lo-ops-fwl { order: 3; }                         /* F/WL under the stage number */
  .lo-ops-active .lo-ops-label { order: 4; font-size: 0; }         /* status tag last; hide "Well Status" text, keep the tag */
  .lo-ops-active .lo-ops-statustag { font-size: 9.5px; margin-left: 0; letter-spacing: 0.2px; }
  .lo-ops-active .lo-ops-timer-hdr { display: none; }              /* mobile shows the timer in the stage block instead */
  /* Strip → tall left bar, the dominant color cue. */
  .lo-ops-active .lo-ops-stripe {
    top: 0; bottom: 0; left: 0; right: auto; width: 6px; height: auto;
    border-radius: 8px 0 0 8px;
  }

  /* ── Materials view on phones: lead with Inventory + Runway; the wide
     7-column planning ledger is a desk artifact and is dropped. ──────────── */
  .lomat-view { padding: 8px 10px 16px; }
  .lomat-summary-card { display: none; }               /* wide ledger table — overflows 375px */
  /* .lomat-view scope raises specificity above the base `.lomat-mobinv-card
     { display:none }` rule, which is defined later in the file. */
  .lomat-view .lomat-mobinv-card { display: block; }   /* the compact replacement leads */
  .lomat-rate-card .lomat-runway { display: none; }    /* runway now lives in the inventory block */
  .lomat-rate-chart { height: 220px; }
  .lomat-rate-chart.split { height: 300px; }
  .lomat-rate-card .lomat-seg { margin-left: 0; }       /* let the mode/layout toggles wrap */
  /* Detail cards (frac pit, AST/tanks, design sources) collapse behind the
     "Show detail" expander; the Sand card stays (deliveries/reconcile are
     actionable in the field). */
  .lomat-detail-card { display: none; }
  .lomat-show-detail .lomat-detail-card { display: block; }
  /* Any residual wide table scrolls inside its own card — never the page. */
  #lomat-sand, #lomat-pit-svg { overflow-x: auto; }
  .lomat-pit-controls { gap: 8px 12px; }
}

.lo-main { flex: 1; display: flex; min-height: 0; }
.lo-side {
  flex: 0 0 186px; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid rgba(58,88,130,0.30);
  background: linear-gradient(180deg, rgba(13,21,37,0.82) 0%, rgba(10,16,28,0.74) 100%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.lo-side-head {
  flex: 0 0 auto; padding: 9px 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--lo-mut, #8294ad); border-bottom: 1px solid rgba(58,88,130,0.32);
  display: flex; align-items: center; gap: 6px;
}
.lo-side-collapse { margin-left: auto; background: transparent; border: none; color: var(--lo-mut, #8294ad);
  cursor: pointer; font-size: 11px; line-height: 1; padding: 2px 3px; transition: color .12s; }
.lo-side-collapse:hover { color: var(--lo-cyan, #2cc3ec); }
.lo-side.lo-side-collapsed { flex: 0 0 26px; }
.lo-side.lo-side-collapsed .lo-side-head-text { display: none; }
.lo-side.lo-side-collapsed #lo-rail { display: none; }
.lo-side.lo-side-collapsed .lo-side-head { justify-content: center; padding: 6px 2px; }
.lo-side.lo-side-collapsed .lo-side-collapse { margin-left: 0; }
.lo-rail { flex: 1; overflow-y: auto; padding: 8px 6px; }
/* Dark-theme scrollbars inside the Live Ops console. The default OS light scrollbar
   on the pad-overview rail/overlay read as a bright gutter against the dark backdrop
   (Dean). Scoped to the overlay so every scroll child (rail, opsbar, dro-view, CCL
   log) matches — tuned a shade darker than the project-view #3a4558 to sit on the
   deeper Live Ops wash. */
.live-ops-fullscreen ::-webkit-scrollbar,
.live-ops-fullscreen::-webkit-scrollbar { width: 10px; height: 10px; }
.live-ops-fullscreen ::-webkit-scrollbar-track,
.live-ops-fullscreen::-webkit-scrollbar-track { background: rgba(0,0,0,0.28); }
.live-ops-fullscreen ::-webkit-scrollbar-thumb,
.live-ops-fullscreen::-webkit-scrollbar-thumb {
  background: #2c3d57; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box;
}
.live-ops-fullscreen ::-webkit-scrollbar-thumb:hover,
.live-ops-fullscreen::-webkit-scrollbar-thumb:hover { background: #3a5882; }
.live-ops-fullscreen ::-webkit-scrollbar-corner,
.live-ops-fullscreen::-webkit-scrollbar-corner { background: transparent; }
.live-ops-fullscreen, .live-ops-fullscreen * { scrollbar-width: thin; scrollbar-color: #2c3d57 rgba(0,0,0,0.28); }
/* Pinned report-style branding band — anchors the rail at the lower-left. */
.lo-side-foot {
  flex: 0 0 auto; padding: 10px 12px 12px; border-top: 1px solid rgba(58,88,130,0.32);
  display: flex; flex-direction: column; gap: 1px;
}
.lo-foot-gen { font-family: Helvetica, Arial, sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: 0.5px; color: var(--lo-mut, #8294ad); }
.lo-foot-brand { font-family: Helvetica, Arial, sans-serif; font-size: 17px; font-weight: 700;
  letter-spacing: 0.2px; color: #d3e0f2; }
.lo-side.lo-side-collapsed .lo-side-foot { display: none; }
.lo-pad-group { margin-bottom: 6px; }
.lo-pad-head {
  display: flex; align-items: baseline; gap: 5px; padding: 3px 5px 2px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-secondary);
}
.lo-pad-name { font-weight: 700; letter-spacing: 0.3px; }
.lo-pad-no { color: var(--text-muted); font-size: 8px; }
.lo-well {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px; margin: 1px 0;
  border-radius: 4px; cursor: pointer; border: 1px solid transparent;
}
.lo-well:hover { background: var(--bg-hover, rgba(255,255,255,0.04)); }
.lo-well.selected { background: var(--bg-hover, rgba(45,108,223,0.16)); border-color: var(--accent, #2d6cdf); }
.lo-role {
  flex: 0 0 auto; min-width: 28px; text-align: center; padding: 1px 4px; border-radius: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700; letter-spacing: 0.3px;
  cursor: pointer; user-select: none;
}
.lo-role-frac { background: #2ecc71; color: #06210f; }
.lo-role-wireline { background: #f1c40f; color: #2b2102; }
.lo-role-zipper { background: #5e83a8; color: #061320; }
.lo-role-idle { background: var(--border); color: var(--text-muted); }
/* Calm (non-pulsing) dot for a MONITORED zipper reading — live but not pumping. */
.lo-zip-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #5e83a8; margin-left: 6px; vertical-align: middle; }
.lo-well-meta { display: flex; flex-direction: column; min-width: 0; }
.lo-well-name {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lo-well-sub { font-size: 8px; color: var(--text-muted); }
.lo-empty { padding: 14px 10px; font-size: 10.5px; color: var(--text-muted); line-height: 1.55; }
.lo-empty span { font-size: 9.5px; opacity: 0.8; }

.lo-charts { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 10px 14px; gap: 10px; }
/* Wireline | Frac mode toggle (segmented) */
.lo-mode { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.lo-mode-btn {
  background: transparent; border: none; cursor: pointer; padding: 4px 13px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-muted); line-height: 1.4;
}
.lo-mode-btn + .lo-mode-btn { border-left: 1px solid var(--border); }
.lo-mode-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.lo-mode-btn.active { background: var(--accent); color: #fff; }
/* mode-driven upper-tab visibility — Conveyance Analytics (wellbore) is a wireline
   tool, so it only shows in wireline mode (with Wireline Pumpdown). */
#lo-upper.mode-wireline .lo-tab[data-uptab="prd"],
#lo-upper.mode-wireline .lo-tab[data-uptab="stepdown"],
#lo-upper.mode-wireline .lo-tab[data-uptab="sandentry"],
#lo-upper.mode-wireline .lo-tab[data-uptab="nolte"] { display: none; }
/* Isolation is pad-wide evidence (wireline seal tests + frac triplets) — it
   shows in BOTH modes. */
#lo-upper.mode-frac .lo-tab[data-uptab="wlpump"],
#lo-upper.mode-frac .lo-tab[data-uptab="wellbore"] { display: none; }

/* ── Isolation tab — per-stage seal verdict cards + pad trend ── */
/* Flex-sized like every other pane body (height:100% raced the first layout
   when the tab opened in the same tick as a panel collapse → oversized canvas
   with the x-axis clipped off the card). */
.lo-iso { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.lo-iso-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; }
.lo-iso-title { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted, #9fb3d1); }
.lo-iso-mtoggle { display: inline-flex; gap: 4px; margin-left: 14px; }
/* display:inline-flex outranks the UA's [hidden]{display:none} — without this,
   JS hidden-toggles set the attribute but the element stayed visible. */
.lo-iso-mtoggle[hidden] { display: none; }
.lo-iso-fraclink { cursor: pointer; }
.lo-iso-fraclink:hover { text-decoration: underline; text-decoration-color: rgba(159,179,209,.6); }
.lo-iso-status { font-size: 11px; color: var(--text-muted, #9fb3d1); margin-left: auto; }
/* Engine-staleness badge: quiet by default, amber call-to-action when the
   engine is behind the rig. Explicit [hidden] guard — .trim-btn's display
   would otherwise outrank the UA [hidden]{display:none} (see mtoggle note). */
.lo-iso-stale { font-size: 11px; }
.lo-iso-stale[hidden] { display: none; }
.lo-iso-stale small { opacity: .7; font-size: 10px; }
.lo-iso-stale.stale { color: #f1c40f; border-color: rgba(241,196,15,.5); background: rgba(241,196,15,.08); }
.lo-iso-stale.stale:hover { background: rgba(241,196,15,.16); }
/* Tracer assignment editor */
.lo-modal-back { position: fixed; inset: 0; background: rgba(6,10,18,.62); z-index: 10050; display: flex; align-items: center; justify-content: center; }
/* NOTE: do NOT use a bare .lo-modal class — a later rule (~12615) sets it
   display:none. The tracer card styles live on the unique .lo-tracer-modal. */
.lo-tracer-modal { background: #0e1726; border: 1px solid #24344d; border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.55); padding: 18px 20px 16px; width: 560px; max-width: 92vw; }
.lo-modal-h { font-size: 14px; font-weight: 700; color: #e8eef5; margin-bottom: 10px; }
.lo-modal-sub { font-size: 11px; font-weight: 500; color: #5fd6e6; margin-left: 8px; }
.lo-tracer-help { font-size: 11.5px; line-height: 1.5; color: #9fb3d1; margin-bottom: 10px; }
.lo-tracer-ta { width: 100%; height: 200px; box-sizing: border-box; background: #0a1322; color: #d8e2ee; border: 1px solid #24344d; border-radius: 6px; padding: 8px 10px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; white-space: pre; }
.lo-tracer-ta:focus { outline: none; border-color: #3f6f86; }
.lo-tracer-preview { min-height: 22px; margin: 8px 0 4px; }
.lo-tracer-counts { display: flex; gap: 16px; font-size: 12px; color: #cfd8e3; }
.lo-tracer-counts b { color: #5fd6e6; font-size: 14px; }
.lo-tracer-dim { color: #6c7a90; }
/* Field pumpdown-volume entry modal (replaces the browser prompt). */
.lo-vol-modal { background: #0e1726; border: 1px solid #24344d; border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.55); padding: 18px 20px 16px; width: 340px; max-width: 92vw; }
.lo-vol-row { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.lo-vol-input { flex: 1; min-width: 0; background: #0a1322; color: #eaf1f9; border: 1px solid #24344d; border-radius: 6px; padding: 10px 12px; font: 700 22px/1 'JetBrains Mono', ui-monospace, monospace; }
.lo-vol-input:focus { outline: none; border-color: #3f6f86; }
.lo-vol-unit { font: 600 13px 'JetBrains Mono', ui-monospace, monospace; color: #9fb3d1; }
.lo-vol-help { font-size: 11.5px; line-height: 1.5; color: #9fb3d1; margin-bottom: 12px; }
.lo-vol-clear { margin-right: auto; }
.lo-tracer-warn { font-size: 11.5px; color: #f1c40f; margin-bottom: 6px; }
.lo-modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
/* G-Function closure override editor rows + AI-rationale panel */
.lo-gf-ovrow { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.lo-gf-ovrow label { font-size: 11px; color: #9fb3d1; min-width: 56px; }
.lo-gf-ovrow input.lo-wl-stage { padding: 4px 8px; }
.lo-iso-gf-summary { flex: 0 0 auto; padding: 6px 12px 8px; font-size: 12px; line-height: 1.5;
  border-left: 3px solid rgba(46,204,113,.5); margin: 0 10px 4px; background: rgba(46,204,113,.05); border-radius: 0 6px 6px 0; }
.lo-iso-gf-summary .lo-iso-row { color: #cfd8e3; }
.lo-iso-gf-summary .lo-iso-conf { font-size: 11px; color: #9fb3d1; margin-top: 2px; }
.lo-iso-summary { flex: 0 0 auto; display: flex; align-items: baseline; gap: 18px; padding: 4px 10px 8px; flex-wrap: wrap; }
.lo-iso-sum-item { display: flex; align-items: baseline; gap: 7px; }
.lo-iso-sum-n { font-size: 26px; font-weight: 800; line-height: 1; }
.lo-iso-sum-k { font-size: 9px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted, #9fb3d1); }
.lo-iso-sum-rate { font-size: 13px; font-weight: 700; color: var(--text-primary, #e2e8f0); padding-left: 18px; border-left: 1px solid rgba(159,179,209,.25); }
.lo-iso-sum-rate small { font-weight: 400; color: var(--text-muted, #9fb3d1); }
/* Subtitle block — declares the metric once, so the chart canvas stays bare. */
.lo-iso-sub { flex: 0 0 auto; padding: 2px 10px 4px; }
.lo-iso-sub-metric { font-size: 12px; font-weight: 700; color: var(--text-primary, #e2e8f0); }
.lo-iso-sub-line { font-size: 10px; color: var(--text-muted, #9fb3d1); line-height: 1.4; }
/* The trend plot is the hero (~55%) when there's room — but the card grid has a
   HARD floor (flex-shrink 0) so on short screens (laptop + lower panel up) the
   chart compresses instead of the cards being clipped out of existence. */
.lo-iso-chart { flex: 1 1 55%; min-height: 170px; }
.lo-iso-grid { flex: 1 0 180px; min-height: 180px; overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: start; padding: 6px 8px 10px; }
/* TEMP: per-stage verdict cards hidden pending redesign (Dean, June 12) — the
   render pipeline still runs (summary chips + WL chart need its computations);
   delete this one rule to bring the cards back. */
.lo-iso-grid { display: none; }
/* TEMP: WL Seal metric button hidden with them — frac ΔTP is the only view for
   now; the toggle wiring stays. Delete this rule to restore. */
#lo-iso-m-wl { display: none; }
/* TEMP: summary KPI strip (WL counts + isolation rate) hidden pending metric
   verification before customer exposure (Dean, June 12). Computation still
   runs; delete this rule to restore. */
#lo-iso-summary { display: none; }
/* Stage Isolation Report generator restored to the Reports menu (analysis
   verified + deviation-band synthesis shipped, June 16). */
/* TEMP: envelope nav (All Stages / ‹ ›) hidden — inactive in the current
   display mode (Dean, June 12). Clicking the FRAC ΔTP toggle still returns
   from an envelope to the overview. Delete this rule to restore. */
#lo-iso-env-nav { display: none !important; }
.lo-iso-grid::-webkit-scrollbar { width: 10px; }
.lo-iso-grid::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.lo-iso-grid::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid #0d1525; }
.lo-iso-grid::-webkit-scrollbar-thumb:hover { background: #4a5568; }
.lo-iso-grid { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
.lo-iso-col-head { font-size: 12px; font-weight: 800; color: var(--text-primary, #e2e8f0); padding: 2px 2px 4px; border-bottom: 1px solid rgba(159,179,209,.25); position: sticky; top: 0; background: #0d1525; z-index: 1; }
.lo-iso-card { border: 1px solid rgba(159,179,209,.18); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; background: rgba(20,30,50,.45); }
.lo-iso-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.lo-iso-stage { font-size: 13px; font-weight: 800; color: var(--text-primary, #e2e8f0); }
.lo-iso-type { font-size: 10px; color: var(--text-muted, #9fb3d1); }
/* Verdict row — the status IS the answer, so it dominates the card. */
.lo-iso-verdict { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.lo-iso-verdict .lo-iso-dp { font-size: 15px; font-weight: 800; color: var(--text-primary, #e2e8f0); font-family: 'JetBrains Mono', monospace; }
.lo-iso-conf { font-size: 10px; color: var(--text-muted, #9fb3d1); margin: 0 0 4px; }
.lo-iso-chip { font-size: 12px; font-weight: 800; letter-spacing: .6px; padding: 3px 12px; border-radius: 10px; white-space: nowrap; }
.lo-iso-chip.small { font-size: 9px; padding: 2px 7px; margin-left: auto; }
.lo-iso-chip.sealed  { background: rgba(46,204,113,.18); color: #2ecc71; border: 1px solid rgba(46,204,113,.5); }
.lo-iso-chip.partial { background: rgba(241,196,15,.15); color: #f1c40f; border: 1px solid rgba(241,196,15,.45); }
.lo-iso-chip.open    { background: rgba(231,76,60,.15);  color: #e74c3c; border: 1px solid rgba(231,76,60,.5); }
.lo-iso-chip.nodata  { background: rgba(159,179,209,.12); color: #9fb3d1; border: 1px solid rgba(159,179,209,.35); }
.lo-iso-chip.ball    { background: rgba(95,208,230,.12);  color: #5fd0e6; border: 1px solid rgba(95,208,230,.4); }
.lo-iso-row { font-size: 11px; color: var(--text-secondary, #cbd5e1); line-height: 1.5; font-family: 'JetBrains Mono', monospace; }
.lo-iso-row b { color: var(--text-primary, #e2e8f0); }
.lo-iso-note { font-size: 10px; color: var(--text-muted, #9fb3d1); line-height: 1.4; }
/* mode-driven lower-tab visibility + numeric panel swap */
#lo-lower.mode-frac .lo-tab[data-lotab="perfs"],
#lo-lower.mode-frac .lo-tab[data-lotab="ccllog"],
#lo-lower.mode-frac .lo-tab[data-lotab="wlevents"] { display: none; }
.lo-ccllog-wrap { flex: 1; min-height: 0; display: flex; gap: 10px; width: 100%; }
.lo-ccllog { flex: 1; min-height: 0; min-width: 0; }   /* chart fills the row */
.lo-shotsheet { flex: 0 0 236px; min-height: 0; overflow: auto; border-left: 1px solid var(--border); padding: 4px 2px 4px 12px; }
.lo-ss-empty { color: var(--text-muted); font-size: 12px; padding: 12px 4px; }
.lo-ss-h { font: 700 12px 'JetBrains Mono', monospace; color: #cbd5e1; letter-spacing: 0.5px; margin-bottom: 8px; }
.lo-ss-sub { font-weight: 500; font-size: 10px; color: var(--text-muted); letter-spacing: 0.3px; }
.lo-ss-misrun { color: #ff8a5b; font-weight: 700; }
.lo-ss-table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.lo-ss-table th { text-align: right; color: var(--text-muted); font-weight: 600; font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 5px; border-bottom: 1px solid var(--border); }
.lo-ss-table td { text-align: right; padding: 3px 5px; color: var(--text-secondary); white-space: nowrap; }
.lo-ss-g { text-align: left !important; color: #f1c40f !important; font-weight: 700; }
.lo-ss-plug td { color: #9fb3d1; border-top: 1px solid var(--border); }
.lo-ss-plug .lo-ss-g { color: #7aa0d0 !important; }
.lo-ss-misfire td { color: #ff8a5b; }
/* Wireline Events table */
.lo-wl-events { height: 100%; overflow: auto; padding: 4px 6px; }
.lo-wlev-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.lo-wlev-tbl th { text-align: left; position: sticky; top: 0; background: var(--bg-secondary); color: var(--text-muted);
  font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lo-wlev-tbl td { padding: 3px 8px; border-bottom: 1px solid rgba(127, 140, 160, 0.12); color: var(--text-secondary); }
.lo-wlev-tbl tr:hover td { background: rgba(127, 140, 160, 0.08); }
.lo-wlev-time { font-family: 'JetBrains Mono', monospace; white-space: nowrap; color: var(--title-strong); }
/* pumpdown volume summary */
.lo-wlev-vol { display: flex; gap: 16px; flex-wrap: wrap; padding: 6px 10px; margin-bottom: 4px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.lo-wlev-vol span { color: var(--text-secondary); }
.lo-wlev-vol b { color: var(--title-strong); font-weight: 600; margin-right: 4px; }
/* synthetic (derived) events — Enter/Exit Lateral */
.lo-wlev-tbl tr.lo-wlev-synth td { color: #e67e22; font-style: italic; }
.lo-wlev-tbl tr.lo-wlev-synth td:nth-child(2) { font-weight: 600; }
#lo-lower.mode-wireline .lo-tab[data-lotab="schedule"],
#lo-lower.mode-wireline .lo-tab[data-lotab="volumes"],
#lo-lower.mode-wireline .lo-tab[data-lotab="plot"] { display: none; }
#lo-lower.mode-frac #lo-wl-numeric { display: none; }
#lo-lower.mode-wireline #lo-chem-numeric { display: none; }
/* wireline numeric panel — reuses the .lo-num cell styling */
.lo-wl-numeric {
  flex: 1; min-height: 0; overflow: auto; padding: 14px;
  display: flex; flex-wrap: wrap; gap: 12px; align-content: start;
}
.lo-wl-numeric > .lo-num { flex: 1 1 150px; min-width: 0; }
.lo-wl-numeric > .lo-wlnum-narrow { flex: 0 0 92px; }   /* Stage — needs little room */
.lo-wlnum-narrow .lo-num-val { font-size: 30px; }
/* Combined electrical cell (Current / Voltage) — two colored values, one line. */
/* Stacked current-over-voltage (Dean). Each number sits in a fixed-width, right-
   aligned field so a negative sign extends leftward without moving the value, and
   the A/V units lock into the same column no matter how wide the numbers get. */
.lo-num-elec { font-size: 19px; flex-direction: column; align-items: flex-start; gap: 0; flex-wrap: nowrap; line-height: 1.08; font-variant-numeric: tabular-nums; }
.lo-elec-line { display: flex; align-items: baseline; white-space: nowrap; }
.lo-elec-sign { display: inline-block; width: 0.72ch; text-align: right; }
.lo-elec-mag { display: inline-block; min-width: 3.4ch; text-align: right; }
.lo-num-elec small { font-size: 10px; margin-left: 2px; }
.lo-elec-sep { color: var(--text-muted); opacity: 0.4; font-weight: 400; }
/* Gun-fire flash — big -ve current transient turns the Current/Voltage cell red. */
@keyframes lo-fire-pulse { 0%, 100% { background: rgba(231,76,60,0.28); } 50% { background: rgba(231,76,60,0.52); } }
.lo-num-firing { border-color: rgba(231,76,60,0.75) !important;
  animation: lo-fire-pulse 0.7s ease-in-out infinite; box-shadow: 0 0 18px rgba(231,76,60,0.45); }
#lo-lower.lo-compact .lo-wl-numeric { max-height: 236px; }
.lo-wlnum { position: relative; }
.lo-wlnum-x { position: absolute; top: 3px; right: 5px; background: none; border: none; color: var(--text-muted);
  font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0 2px; }
.lo-wlnum:hover .lo-wlnum-x { opacity: 0.85; }
.lo-wlnum-x:hover { color: #ff8a7a; }
.lo-wlnum-add { display: flex; align-items: center; justify-content: center; padding: 0; }
.lo-wlnum-sel { width: 100%; height: 100%; min-height: 56px; background: var(--bg-tertiary);
  border: 1px dashed var(--border); color: var(--text-secondary); border-radius: 6px; padding: 8px 10px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace; cursor: pointer; }
/* Perforation Schedule (wireline mode) */
.lo-perfs { flex: 1; min-height: 0; min-width: 0; overflow: hidden; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.lo-perfs-head { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
  color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.lo-perfs-tag { font-size: 8px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; }
.lo-perfs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
/* Single-line perf summary after the Planned chip (replaces the summary cards) */
.lo-perfs-line { font-weight: 400; color: var(--text-secondary); font-size: 12px; margin-left: 10px; }
/* Design-constant chips in the ribbon (reviewer) — the repeated per-pad constants
   (clusters/SPF/EHD/spacing/phasing) as compact chips instead of header prose. */
.lo-perfs-chips { display: inline-flex; gap: 6px; margin-left: 12px; vertical-align: 1px; flex-wrap: wrap; }
.lo-perfs-chip {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; white-space: nowrap;
  color: #9ec9e8; background: rgba(44,195,236,0.10); border: 1px solid rgba(44,195,236,0.28);
  border-radius: 3px; padding: 2px 7px;
}
.lo-perfs-grid:empty { display: none; }
/* full-schedule dxDataGrid (all stages). The host is a relative, flex-sized,
   clipped wrapper; the grid lives in an absolutely-positioned inner div so its
   wide cluster matrix can't stretch the ancestors and it owns both scrollbars. */
.lo-perfs-dx { position: relative; flex: 1 1 0; min-height: 240px; min-width: 0; overflow: hidden; }
.lo-perfs-dx-fit { position: absolute; inset: 0; }
/* ── ICOP theme layer over the stock DevExtreme dark skin (reviewer): navy
   surfaces recessed into the panel, no per-cell borders (row separators + group
   edges only), grouped mono headers, cyan selection language. Scoped to
   .lo-perfs-dx so other dx surfaces (Gantt, channel grids) keep the stock theme. */
.lo-perfs-dx .dx-datagrid { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-variant-numeric: tabular-nums;
  background-color: rgba(15,24,41,0.92); color: #c7d3e4; }
.lo-perfs-dx .dx-datagrid .dx-datagrid-headers {
  background-color: rgba(26,38,62,0.95); color: #8fa3bd; border-bottom: 1px solid rgba(58,88,130,0.45);
}
.lo-perfs-dx .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
  background: transparent; border-left: none; border-right: none; border-bottom: 1px solid rgba(58,88,130,0.28);
  font-size: 9px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #8fa3bd;
}
/* band (group) captions one notch brighter than leaf captions; cluster numbers brighter still */
.lo-perfs-dx .dx-datagrid-headers .dx-row:first-child > td { color: #a9bdd6; }
.lo-perfs-dx .dx-datagrid-rowsview { background-color: transparent; border-top: none; }
.lo-perfs-dx .dx-datagrid .dx-row-lines > td,
.lo-perfs-dx .dx-datagrid-rowsview .dx-row > td {
  background-color: rgba(18,28,48,0.55); border-left: none; border-right: none;
  border-top: none; border-bottom: 1px solid rgba(58,88,130,0.14);
}
/* alternate rows: a 2–3% lift only */
.lo-perfs-dx .dx-datagrid-rowsview .dx-row-alt > td { background-color: rgba(26,38,60,0.55) !important; }
/* frozen identity block (Stage · Plug · Isolation) — slightly distinct surface */
.lo-perfs-dx .dx-datagrid-content-fixed .dx-row > td { background-color: rgba(24,35,56,0.97); }
.lo-perfs-dx .dx-datagrid-content-fixed .dx-row-alt > td { background-color: rgba(29,41,64,0.97) !important; }
/* group edges + faint cluster column guides (exact alignment matters there) */
.lo-perfs-dx td.lo-perf-group-edge { border-left: 1px solid rgba(58,88,130,0.45) !important; }
.lo-perfs-dx td.lo-perf-cl { border-left: 1px dotted rgba(58,88,130,0.16) !important; }
/* selected stage = one continuous object: cyan left rail + blue fill + bright text */
.lo-perfs-dx .lo-perf-active-row > td {
  background-color: rgba(44,127,222,0.18) !important; font-weight: 700; color: #eaf3ff;
}
.lo-perfs-dx .lo-perf-active-row > td:first-child { box-shadow: inset 3px 0 0 0 var(--lo-cyan, #2cc3ec); }
/* completed stages dimmed; upcoming neutral */
.lo-perfs-dx .lo-perf-done-row > td { opacity: 0.6; }
/* thin status bar instead of the heavy opaque footer */
.lo-perfs-dx .dx-datagrid-total-footer {
  background-color: rgba(26,38,62,0.92); border-top: 1px solid rgba(58,88,130,0.4);
}
.lo-perfs-dx .dx-datagrid-total-footer .dx-datagrid-summary-item {
  font-size: 10px; color: #8fa3bd; font-weight: 600;
}
.lo-perfs-dx .dx-datagrid-total-footer .dx-row > td { padding-top: 3px; padding-bottom: 3px; border: none; background: transparent; }
.lo-charts-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
/* Wireline stage selector — replaces the Load-earlier button on the Wireline view.
   Styled to match .trim-btn so the charts bar stays one visual system. */
.lo-wl-stage {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 8px; border-radius: 3px; cursor: pointer;
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--border); transition: all 0.12s;
}
.lo-wl-stage:hover { border-color: var(--accent); color: var(--text-primary); }
.lo-wl-stage.hist { border-color: #e07b39; color: #e07b39; }
/* Theme the select's popup-list scrollbar (Chrome applies these to the dropdown;
   scrollbar-width/color is the standards path, ::-webkit-* the legacy one). */
.lo-wl-stage { scrollbar-width: thin; scrollbar-color: rgba(120,140,180,0.45) rgba(20,30,50,0.6); }
.lo-wl-stage::-webkit-scrollbar { width: 8px; }
.lo-wl-stage::-webkit-scrollbar-thumb { background: rgba(120,140,180,0.45); border-radius: 4px; }
.lo-wl-stage::-webkit-scrollbar-thumb:hover { background: rgba(140,165,210,0.65); }
.lo-wl-stage::-webkit-scrollbar-track { background: rgba(20,30,50,0.6); }
.lo-bind-lbl { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.lo-bind {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 10px;
  padding: 4px 6px; max-width: 230px;
}
.lo-sched-btn {
  padding: 6px 12px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.lo-sched-btn:hover { border-color: var(--accent, #2d6cdf); }

/* ACTIVE strip — one compact live PRD card per streaming well */
/* ── Recent Events (rail) — 3 wells, last 3 events each ── */
.lo-revents { padding: 10px 7px 4px; border-top: 1px solid rgba(58,88,130,0.32); margin-top: 8px; }
.lo-revents-h { font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 0.7px; text-transform: uppercase; color: var(--lo-mut, #8294ad); margin-bottom: 6px; }
.lo-rev-well { font-family: Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700;
  color: #cdd9ea; margin: 7px 0 2px; }
.lo-rev-row { display: flex; align-items: center; gap: 8px; padding: 3px 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.lo-rev-time { flex: 0 0 auto; width: 34px; color: var(--lo-mut, #8294ad); }
.lo-rev-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.lo-rev-name { flex: 1 1 auto; min-width: 0; color: #dbe6f3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-rev-depth { flex: 0 0 auto; color: var(--lo-mut, #8294ad); }

/* ── Frac ghost-stages popup (PRD) ── */
.lo-fg-pop { width: 232px; }
.lo-fg-pop .lo-wb-ghost-tree { max-height: 270px; overflow-y: auto; }
/* Completed Stages ghost tree — plain-HTML details/checkbox variant (no DevExtreme). */
.eg-tree details { margin: 2px 0; }
.eg-tree summary {
  cursor: pointer; font-size: 11px; font-weight: 700; color: var(--text-primary, #e2e8f0);
  padding: 3px 4px; border-radius: 4px; user-select: none; list-style-position: inside;
}
.eg-tree summary:hover { background: rgba(90,140,220,0.12); }
.eg-tree .eg-stage-row {
  display: flex; align-items: center; gap: 7px; padding: 2px 4px 2px 18px;
  font-size: 11px; color: var(--text-muted, #9fb3d1); cursor: pointer; border-radius: 4px;
}
.eg-tree .eg-stage-row:hover { background: rgba(90,140,220,0.10); color: var(--text-primary, #e2e8f0); }
.eg-tree .eg-stage-row.eg-row-locked { opacity: .55; cursor: default; }
.eg-tree .eg-stage-row.eg-row-locked:hover { background: none; color: var(--text-muted, #9fb3d1); }
.eg-tree-empty { font-size: 11px; color: var(--text-muted, #9fb3d1); opacity: .7; padding: 4px; }
/* Isolation-class chip (Auto / Pods / Plugs / All) + POD/PLG/TOE badges.
   Badges reuse the chart's pod orange / plug gray family; the dim class is
   emphasis-only (dimmed stages stay selectable). */
.lo-fg-class-row { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.lo-fg-class-row .tsp-label { flex: 0 0 auto; }
.lo-fg-class-seg {
  display: inline-flex; border: 1px solid rgba(120,160,255,0.25);
  border-radius: 6px; overflow: hidden;
}
.lo-fg-class-seg button {
  font-size: 10px; line-height: 1; padding: 4px 8px; background: transparent;
  border: none; color: var(--text-muted, #9fb3d1); cursor: pointer; white-space: nowrap;
}
.lo-fg-class-seg button + button { border-left: 1px solid rgba(120,160,255,0.18); }
.lo-fg-class-seg button:hover { background: rgba(90,140,220,0.12); color: var(--text-primary, #e2e8f0); }
.lo-fg-class-seg button.on { background: rgba(90,140,220,0.24); color: #e2ecfa; }
.lo-fg-badge {
  display: inline-block; font-size: 8px; font-weight: 700; letter-spacing: .4px;
  padding: 1px 4px; border-radius: 4px; margin-left: 4px; vertical-align: 1px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.lo-fg-badge-pod { color: #e67e22; background: rgba(230,126,34,0.16); }
.lo-fg-badge-plg { color: #9aa6b4; background: rgba(154,166,180,0.16); }
.lo-fg-badge-toe { color: #7fd4ff; background: rgba(127,212,255,0.12); }
.lo-fg-dim { opacity: .45; }

/* ── Modern help button (Completed Stages PRD header) ─────────────────── */
.etest-help-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-right: 10px;
  font: 600 11px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .4px; color: #aecbeb;
  background: linear-gradient(160deg, rgba(37,58,92,0.55), rgba(20,32,52,0.75));
  border: 1px solid rgba(120,160,220,0.35); border-radius: 999px; padding: 4px 12px 4px 6px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, color .15s;
}
.etest-help-btn:hover { color: #e2ecfa; border-color: rgba(140,190,255,0.7); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.etest-help-btn.armed {
  color: #fff; border-color: rgba(96,165,250,0.9);
  background: linear-gradient(160deg, rgba(37,99,235,0.45), rgba(30,58,138,0.55));
  box-shadow: 0 0 12px rgba(59,130,246,0.35);
}
.etest-help-btn .ehb-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(96,165,250,0.25); border: 1px solid rgba(140,190,255,0.5);
  color: #cfe3ff; font-size: 10px; font-weight: 700;
}

/* ── Help panel topic list (right rail, click to jump) ────────────────── */
.ehp-toc-title {
  font: 700 9px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .8px;
  text-transform: uppercase; color: #64748b; padding: 2px 8px 6px;
}
.ehp-toc-item {
  display: block; width: 100%; text-align: left; background: transparent;
  border: none; border-left: 2px solid transparent; border-radius: 0 5px 5px 0;
  color: #7f95b3; font: 500 10px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .2px;
  padding: 5px 8px; cursor: pointer; white-space: normal; line-height: 1.25;
}
.ehp-toc-item:hover { color: #dbe6f3; background: rgba(90,140,220,0.10); }
.ehp-toc-item.active { color: #60a5fa; border-left-color: #60a5fa; background: rgba(59,130,246,0.08); }
/* Thin overlay-style scrollbars on both columns — the default pair of full-width
   bars met in the middle of the panel and read as clutter. */
#etest-prd-help-body, #etest-prd-help-toc {
  scrollbar-width: thin; scrollbar-color: rgba(100,140,190,0.35) transparent;
}
#etest-prd-help-body::-webkit-scrollbar, #etest-prd-help-toc::-webkit-scrollbar { width: 6px; }
#etest-prd-help-body::-webkit-scrollbar-track, #etest-prd-help-toc::-webkit-scrollbar-track { background: transparent; }
#etest-prd-help-body::-webkit-scrollbar-thumb, #etest-prd-help-toc::-webkit-scrollbar-thumb {
  background: rgba(100,140,190,0.30); border-radius: 3px;
}
#etest-prd-help-body::-webkit-scrollbar-thumb:hover, #etest-prd-help-toc::-webkit-scrollbar-thumb:hover {
  background: rgba(140,180,230,0.50);
}

/* ── Reports nav dropdown ── */
.lo-nav-dd { position: relative; display: inline-flex; }
.lo-nav-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 232px;
  display: none; flex-direction: column; padding: 5px; z-index: 70;
  background: linear-gradient(158deg, rgba(26,37,60,0.98) 0%, rgba(14,22,38,0.99) 100%);
  border: 1px solid rgba(122,152,193,0.25); border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.55); }
.lo-nav-menu.open { display: flex; }
.lo-menu-item { text-align: left; background: transparent; border: none; border-radius: 7px;
  padding: 9px 12px; color: #dbe6f3; font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px; cursor: pointer; }
.lo-menu-item:hover:not(:disabled) { background: rgba(255,255,255,0.06); color: #fff; }
.lo-menu-item:disabled { color: var(--lo-mut, #8294ad); opacity: 0.5; cursor: not-allowed; }
.lo-menu-status { padding: 4px 12px 2px; font-size: 10px; color: var(--lo-mut, #8294ad); }
.lo-menu-status:empty { display: none; }

/* ===================== Drillout view (draft mockup — dummy data) ===================== */
.lo-nav-tab[data-lonav="drillout"] { --acc: #ff7a59; }
.lo-main { position: relative; }
.dro-view { position: absolute; inset: 0; z-index: 60; overflow: auto; padding: 12px 14px 16px;
  background: radial-gradient(120% 80% at 50% -10%, #10192b 0%, #0a0f1a 60%, #070b13 100%); }
.dro-view[hidden] { display: none; }
.dro-soon-wrap { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  pointer-events: none; background: rgba(7,11,19,0.42); }
.dro-soon-chip { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 22px 50px; border-radius: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 30px; font-weight: 800; letter-spacing: 4px; color: #fff;
  background: linear-gradient(150deg, rgba(255,122,89,0.22), rgba(20,30,50,0.55));
  border: 1.5px solid rgba(255,122,89,0.5); box-shadow: 0 16px 60px rgba(0,0,0,0.6), 0 0 44px rgba(255,122,89,0.22); }
.dro-soon-chip small { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; color: #b9c6da; text-transform: none; }
.dro-soon-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff7a59; box-shadow: 0 0 10px #ff7a59; }
.dro-dash { opacity: 0.97; }
.dro-kpis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 9px; margin-bottom: 10px; }
.dro-kpi { background: #0d1525; border: 1px solid rgba(122,152,193,0.16); border-radius: 9px; padding: 9px 11px; }
.dro-kt { font-size: 9px; letter-spacing: 0.7px; color: #8294ad; font-weight: 700; }
.dro-kv { font-family: 'JetBrains Mono', monospace; font-size: 24px; font-weight: 800; color: #e7eef8; margin-top: 3px; line-height: 1; }
.dro-kof { font-size: 15px; color: #8294ad; font-weight: 600; } .dro-ku { font-size: 11px; color: #8294ad; font-weight: 600; }
.dro-ks { font-size: 10px; color: #8294ad; margin-top: 5px; }
.dro-grn { color: #46d17f !important; } .dro-blu { color: #5fa8ff !important; } .dro-amb { color: #f0a64e !important; }
.dro-grid { display: grid; grid-template-columns: 226px minmax(0,1fr) 360px; gap: 10px; align-items: start; }
.dro-left, .dro-center, .dro-right { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.dro-panel { background: #0d1525; border: 1px solid rgba(122,152,193,0.16); border-radius: 9px; padding: 9px 11px; }
.dro-ph { font-size: 10px; letter-spacing: 0.9px; font-weight: 700; color: #aebbce; margin-bottom: 7px; text-transform: uppercase; }
.dro-ph-sub { color: #6f7e93; font-weight: 600; letter-spacing: 0.3px; }
.dro-rw { display: flex; justify-content: space-between; align-items: baseline; padding: 3.5px 0; font-size: 12px;
  color: #8a99af; border-top: 1px solid rgba(122,152,193,0.07); }
.dro-rw:first-of-type { border-top: none; }
.dro-rw b { color: #e7eef8; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.dro-rw small { font-size: 10px; color: #8294ad; }
.dro-rq { text-align: center; } .dro-rq-big { font-size: 30px; font-weight: 800; letter-spacing: 2px; margin: 6px 0 2px; }
.dro-rq-sub { font-size: 11px; color: #8294ad; }
.dro-cbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dro-seg { display: inline-flex; border: 1px solid rgba(122,152,193,0.22); border-radius: 7px; overflow: hidden; }
.dro-sg { background: transparent; border: none; color: #8294ad; font-size: 10px; padding: 4px 10px; font-family: 'JetBrains Mono', monospace; cursor: default; }
.dro-sg.on { background: rgba(95,168,255,0.18); color: #cfe0f5; }
.dro-ctime { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #aebbce; }
.dro-mini { background: #0d1525; border: 1px solid rgba(122,152,193,0.22); color: #8294ad; font-size: 10px; padding: 4px 9px; border-radius: 6px; margin-left: 6px; cursor: default; }
.dro-tracks { background: #0a1120; border: 1px solid rgba(122,152,193,0.14); border-radius: 9px; padding: 6px 6px 4px; }
.dro-track { display: grid; grid-template-columns: 90px 1fr; align-items: center; }
.dro-track + .dro-track { border-top: 1px solid rgba(122,152,193,0.06); }
.dro-tk-lbl { font-size: 9px; color: #8294ad; line-height: 1.25; padding-left: 4px; }
.dro-tk-lbl b { display: block; color: #cfe0f5; font-size: 10px; font-weight: 700; }
.dro-tk-svg { width: 100%; height: 44px; display: block; }
.dro-marks { display: grid; grid-template-columns: 90px 1fr; }
.dro-marks-row { display: flex; justify-content: space-between; padding: 2px 8px; font-size: 9px; color: #6f7e93; font-family: 'JetBrains Mono', monospace; }
.dro-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.dro-tbl th { text-align: left; font-size: 8.5px; letter-spacing: 0.3px; color: #6f7e93; font-weight: 700; padding: 3px 6px; border-bottom: 1px solid rgba(122,152,193,0.18); }
.dro-tbl td { padding: 4px 6px; color: #c2cedd; border-bottom: 1px solid rgba(122,152,193,0.06); font-family: 'JetBrains Mono', monospace; }
.dro-tbl tr.dro-amb td { color: #f0a64e; } .dro-tbl tr.dro-grn td { color: #46d17f; }
.dro-evlog td:first-child { color: #8294ad; }
.dro-cur-row td { color: #5fa8ff; } .dro-pend-row td { color: #6f7e93; }
.dro-avg-row td { color: #aebbce; font-weight: 700; border-top: 1px solid rgba(122,152,193,0.18); }
.dro-leg { display: flex; gap: 14px; font-size: 10px; color: #8294ad; margin-bottom: 4px; }
.dro-leg i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.dro-sw-cleared { background: #46d17f; } .dro-sw-cur { background: #5fa8ff; } .dro-sw-pend { background: transparent; border: 1.5px solid #5a6679; }
.dro-schem-art { height: auto; margin-top: 2px; }
.dro-pg-cl2 { fill: #46d17f; } .dro-pg-pd2 { fill: none; stroke: #5a6679; stroke-width: 1.1; }
.dro-pg-num { fill: #8294ad; font-size: 9px; font-family: 'JetBrains Mono', monospace; }
.dro-schem-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; margin-top: 8px; }
.dro-schem-stats div { display: flex; flex-direction: column; }
.dro-schem-stats span { font-size: 9px; color: #6f7e93; } .dro-schem-stats b { font-size: 12px; color: #e7eef8; font-family: 'JetBrains Mono', monospace; }

/* ── MATERIALS view (Live Ops top-level tab — water + sand accounting; dark-only,
   same lo-main overlay idiom as the drillout view; js/live-materials.js) ── */
.lo-nav-tab[data-lonav="materials"] { --acc: #46d17f; }
.lomat-view { position: absolute; inset: 0; z-index: 61; overflow: auto; padding: 12px 16px 18px;
  background: radial-gradient(120% 80% at 50% -10%, #10192b 0%, #0a0f1a 60%, #070b13 100%);
  color: #cfd8e3; font-size: 12px; }
.lomat-view[hidden] { display: none; }
/* Themed scrollbars — the native light bars clash on the dark console
   (Live Ops is dark-only, no light override needed). Sidebar idiom. */
.lomat-view::-webkit-scrollbar { width: 10px; height: 10px; }
.lomat-view::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); }
.lomat-view::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid #0a0f1a; }
.lomat-view::-webkit-scrollbar-thumb:hover { background: #4a5568; }
.lomat-view::-webkit-scrollbar-corner { background: rgba(0,0,0,0.25); }
.lomat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lomat-title { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 800; letter-spacing: 2px; color: #e7eef8; }
.lomat-sub { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; color: #8294ad; }
.lomat-plan-chip { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; color: #9fd9ff;
  border: 1px solid rgba(95,168,255,0.45); border-radius: 999px; padding: 3px 10px; background: rgba(95,168,255,0.10); }
.lomat-savemsg { margin-left: auto; font-size: 10.5px; color: #8294ad; }
.lomat-savemsg.err { color: #ff8f7a; }
.lomat-refresh { font-size: 11px; }
.lomat-summary-card, .lomat-card { background: #0d1525; border: 1px solid rgba(122,152,193,0.16);
  border-radius: 10px; padding: 10px 12px 12px; margin-bottom: 10px; }
.lomat-card-h { font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: #8fa8c8; margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lomat-hint { font-size: 10px; font-weight: 500; letter-spacing: 0.2px; text-transform: none; color: #6f7e93; cursor: help; }
.lomat-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 10px; align-items: start; }
@media (max-width: 1250px) { .lomat-grid { grid-template-columns: 1fr; } }
.lomat-col { min-width: 0; }
.lomat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lomat-table th { font-size: 9.5px; letter-spacing: 0.7px; text-transform: uppercase; color: #6f7e93;
  text-align: left; padding: 3px 8px; border-bottom: 1px solid rgba(122,152,193,0.18); }
.lomat-table th.num, .lomat-table td.num { text-align: right; font-family: 'JetBrains Mono', monospace; }
.lomat-table td { padding: 5px 8px; border-bottom: 1px solid rgba(122,152,193,0.08); color: #cfd8e3; white-space: nowrap; }
.lomat-table td small { color: #6f7e93; font-size: 9.5px; }
.lomat-row-water td { color: #bfe0ff; }
.lomat-row-total td { border-top: 1px solid rgba(122,152,193,0.25); font-weight: 700; }
.lomat-order { color: #ff8f7a !important; font-weight: 700; }
.lomat-surplus { color: #46d17f !important; font-weight: 700; }
.lomat-live { color: #5fd0e6; }
.lomat-note { font-size: 10px; color: #6f7e93; }
.lomat-warn-t { color: #f0a64e; }
.lomat-dim-t { color: #7c8ca3; }
.lomat-var { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.lomat-var.ok { color: #46d17f; border-color: rgba(70,209,127,0.4); }
.lomat-var.warn { color: #f0a64e; border-color: rgba(240,166,78,0.45); }
.lomat-var.bad { color: #ff8f7a; border-color: rgba(255,143,122,0.5); }
.lomat-var.muted { color: #6f7e93; border-color: rgba(122,152,193,0.25); }
.lomat-foot { font-size: 10px; color: #6f7e93; margin-top: 6px; }
.lomat-in { background: #0a1220; border: 1px solid rgba(122,152,193,0.28); border-radius: 6px;
  color: #e7eef8; font-size: 12px; padding: 3px 6px; font-family: 'JetBrains Mono', monospace; }
.lomat-in:focus { outline: none; border-color: #5fa8ff; }
.lomat-in.bad { border-color: #ff8f7a; }
.lomat-pit-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.lomat-pit-controls label { font-size: 11px; color: #8fa8c8; display: inline-flex; align-items: center; gap: 6px; }
.lomat-pit-reads { font-size: 12px; color: #cfd8e3; display: inline-flex; align-items: baseline; gap: 10px; }
.lomat-pit-reads b { font-family: 'JetBrains Mono', monospace; font-size: 17px; color: #9fd9ff; }
.lomat-pit-reads small { color: #6f7e93; font-size: 10px; }
.lomat-pit-svg svg { display: block; background: #0a111e; border: 1px solid rgba(122,152,193,0.14); border-radius: 8px; }
.lomat-svgt { font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.lomat-caption { font-size: 9.5px; color: #6f7e93; margin-top: 5px; font-style: italic; }
.lomat-warn { font-size: 11px; color: #ff8f7a; border: 1px solid rgba(255,143,122,0.4); border-radius: 7px;
  padding: 5px 9px; margin: 4px 0 6px; background: rgba(255,143,122,0.07); }
.lomat-wrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 0;
  border-bottom: 1px solid rgba(122,152,193,0.08); }
.lomat-wrow label { font-size: 11px; color: #8fa8c8; display: inline-flex; align-items: center; gap: 5px; }
.lomat-wlbl { min-width: 110px; font-weight: 700; color: #bfe0ff; font-size: 12px; }
.lomat-wlbl small { display: block; font-weight: 500; color: #6f7e93; font-size: 9.5px; }
.lomat-bar { flex: 1 1 90px; height: 9px; border-radius: 5px; background: #0a1220; border: 1px solid rgba(122,152,193,0.2); overflow: hidden; min-width: 70px; }
.lomat-bar-fill { height: 100%; background: linear-gradient(90deg, #2f80ed, #5fd0e6); }
.lomat-wsum { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #cfd8e3; }
.lomat-wtotal { font-size: 11.5px; color: #8fa8c8; padding-top: 8px; }
.lomat-wtotal b { color: #9fd9ff; font-family: 'JetBrains Mono', monospace; }
/* Water-level change audit trail (attribution + freshness). Small, unobtrusive. */
.lomat-whist { margin-top: 8px; border-top: 1px solid rgba(122,152,193,0.14); padding-top: 5px; }
.lomat-whist-h { font-size: 9.5px; letter-spacing: 0.6px; text-transform: uppercase; color: #6f7e93; margin-bottom: 3px; }
.lomat-whist-h small { text-transform: none; letter-spacing: 0; color: #59677c; font-size: 9px; }
.lomat-whist-row { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 10.5px; color: #8fa8c8; padding: 1.5px 0; }
.lomat-whist-chg { font-family: 'JetBrains Mono', monospace; color: #bfe0ff; }
.lomat-whist-who { color: #cfd8e3; }
.lomat-whist-when { color: #6f7e93; margin-left: auto; }
.lomat-sand-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.lomat-sand-top label { font-size: 11px; color: #8fa8c8; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lomat-mini { font-size: 10.5px; padding: 2px 8px; }
.lomat-tname { width: 110px; }
.lomat-deliv { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
/* Delivery controls stack vertically (deliver row, then Reconcile) so the
   sand table never forces the console to scroll horizontally (Dean). */
.lomat-deliv-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.lomat-sand-table td:last-child { white-space: normal; }
.lomat-evlog { margin-top: 8px; border-top: 1px solid rgba(122,152,193,0.14); padding-top: 5px; }
.lomat-evh { font-size: 9.5px; letter-spacing: 0.6px; text-transform: uppercase; color: #6f7e93; margin-bottom: 3px; }
.lomat-ev { display: grid; grid-template-columns: 150px 110px 1fr; gap: 8px; font-size: 10.5px; color: #8fa8c8; padding: 1.5px 0; }
.lomat-rate-chart { width: 100%; height: 280px; }
.lomat-rate-chart.split { height: 400px; }   /* two stacked panels need the extra rows */
.lomat-seg { display: inline-flex; margin-left: auto; border: 1px solid rgba(122,152,193,0.3); border-radius: 7px; overflow: hidden; }
.lomat-seg button { background: transparent; border: none; color: #8294ad; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; padding: 3px 10px; cursor: pointer; text-transform: uppercase; }
.lomat-seg button + button { border-left: 1px solid rgba(122,152,193,0.3); }
.lomat-seg button.on { background: rgba(95,168,255,0.16); color: #cfe3ff; }
.lomat-rate-empty { font-size: 11px; color: #6f7e93; font-style: italic; padding: 18px 6px 10px; }
.lomat-runway { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 8px; }
.lomat-rw { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; cursor: help; }
.lomat-rw b { font-family: 'JetBrains Mono', monospace; }
.lomat-rw small { color: inherit; opacity: 0.75; font-size: 9.5px; }
.lomat-rw.ok { color: #46d17f; border-color: rgba(70,209,127,0.4); background: rgba(70,209,127,0.06); }
.lomat-rw.warn { color: #f0a64e; border-color: rgba(240,166,78,0.5); background: rgba(240,166,78,0.07); }
.lomat-rw.bad { color: #ff8f7a; border-color: rgba(255,143,122,0.55); background: rgba(255,143,122,0.08); }
.lomat-rw.muted, .lomat-rw.basis { color: #6f7e93; border-color: rgba(122,152,193,0.25); }
.lomat-builder { border: 1px dashed rgba(95,168,255,0.35); border-radius: 8px; padding: 8px 11px 9px; margin: 4px 0 8px; background: rgba(95,168,255,0.05); }
.lomat-builder-h { font-size: 10px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: #9fd9ff; margin-bottom: 6px; }
.lomat-builder-grid { display: flex; gap: 12px 16px; flex-wrap: wrap; }
.lomat-builder-grid label { font-size: 11px; color: #8fa8c8; display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.lomat-builder-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.lomat-builder-foot b { color: #9fd9ff; font-family: 'JetBrains Mono', monospace; }
.lomat-attach { font-size: 10.5px; color: #8fa8c8; margin-top: 5px; }
.lomat-att-link { background: none; border: none; padding: 0; color: #5fa8ff; font-size: 10.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lomat-att-link:hover { color: #9fd9ff; }
.lomat-wellrow { border-bottom: 1px solid rgba(122,152,193,0.1); padding: 6px 0; }
.lomat-wellhead { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.lomat-wellhead b { color: #e7eef8; font-size: 12.5px; }
.lomat-wellnums { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: #8fa8c8; }
.lomat-src { font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px; padding: 1.5px 7px; border-radius: 999px; border: 1px solid rgba(122,152,193,0.3); color: #8294ad; }
.lomat-src.icop { color: #46d17f; border-color: rgba(70,209,127,0.45); }
.lomat-src.bod { color: #5fd0e6; border-color: rgba(95,208,230,0.45); }
.lomat-src.man { color: #f0a64e; border-color: rgba(240,166,78,0.45); }
.lomat-ovr { margin-left: auto; font-size: 10.5px; color: #8fa8c8; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.lomat-manual { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 5px; }
.lomat-manual label { font-size: 11px; color: #8fa8c8; display: inline-flex; align-items: center; gap: 5px; }

/* ── Mobile Materials: Inventory + Runway block ──────────────────────────
   Phone-only. The card is display:none on desktop and revealed in the
   ≤820px media query; these rules just define its look. Numbers come from the
   same accounting the desktop ledger uses — this is presentation only. */
.lomat-mobinv-card { display: none; }
.lomat-mi-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid rgba(122,152,193,0.1); }
.lomat-mi-row:last-of-type { border-bottom: none; }
.lomat-mi-main { flex: 1 1 auto; min-width: 0; }
.lomat-mi-side { flex: 0 0 auto; display: flex; align-items: center; }
.lomat-mi-lbl { font-size: 12px; font-weight: 700; color: #bfe0ff; letter-spacing: 0.3px; }
.lomat-mi-lbl small { color: #6f7e93; font-weight: 600; font-size: 9.5px; margin-left: 3px; }
.lomat-mi-water .lomat-mi-lbl { color: #9fd9ff; }
.lomat-mi-onhand { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: #cfd8e3; margin-top: 2px; }
.lomat-mi-onhand b { font-size: 20px; color: #e7eef8; }
.lomat-mi-sub { font-size: 10px; color: #6f7e93; margin-top: 2px; }
.lomat-mi-fresh { font-size: 10px; color: #6f7e93; margin-top: 3px; }
.lomat-mi-fresh.muted { color: #6f7e93; font-style: italic; }
.lomat-mi-pill { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid;
  white-space: nowrap; text-align: right; cursor: help; }
.lomat-mi-pill b { font-family: 'JetBrains Mono', monospace; }
.lomat-mi-pill small { display: block; opacity: 0.8; font-size: 9px; font-weight: 600; }
.lomat-mi-pill.ok { color: #46d17f; border-color: rgba(70,209,127,0.4); background: rgba(70,209,127,0.06); }
.lomat-mi-pill.warn { color: #f0a64e; border-color: rgba(240,166,78,0.5); background: rgba(240,166,78,0.07); }
.lomat-mi-pill.bad { color: #ff8f7a; border-color: rgba(255,143,122,0.55); background: rgba(255,143,122,0.08); }
.lomat-mi-pill.muted { color: #6f7e93; border-color: rgba(122,152,193,0.25); }
.lomat-mi-basis { font-size: 9.5px; color: #6f7e93; font-style: italic; margin-top: 8px; }
.lomat-mi-detailbtn { margin-top: 10px; width: 100%; padding: 7px; }

/* ── Settings modal ── */
.lo-modal { position: absolute; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; background: rgba(5,9,16,0.62);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.lo-modal.open { display: flex; }
.lo-modal-card { width: 360px; max-width: 90%; border-radius: 12px; overflow: hidden;
  color: var(--lo-ink, #f1f6fd);
  background: linear-gradient(158deg, rgba(26,37,60,0.98) 0%, rgba(14,22,38,0.99) 100%);
  border: 1px solid rgba(122,152,193,0.25); box-shadow: 0 22px 60px rgba(0,0,0,0.6); }
.lo-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid rgba(58,88,130,0.32);
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; }
.lo-modal-x { background: transparent; border: none; color: var(--lo-mut, #8294ad);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.lo-modal-x:hover { color: var(--lo-ink, #f1f6fd); }
.lo-modal-body { padding: 16px; }
.lo-set-group { display: flex; flex-direction: column; gap: 6px; }
.lo-set-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--lo-cyan, #2cc3ec); margin-bottom: 4px; }
.lo-set-radio { display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: Helvetica, Arial, sans-serif; font-size: 13px; color: #dbe6f3;
  padding: 7px 9px; border-radius: 8px; border: 1px solid transparent; }
.lo-set-radio:hover { background: rgba(255,255,255,0.04); border-color: rgba(122,152,193,0.14); }
.lo-set-radio input { accent-color: #3b82f6; width: 15px; height: 15px; }
.lo-set-select { font-family: Helvetica, Arial, sans-serif; font-size: 13px; color: #dbe6f3;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(122,152,193,0.22);
  border-radius: 8px; padding: 8px 9px; cursor: pointer; width: 100%; }
.lo-set-select:focus { outline: none; border-color: #3b82f6; }
.lo-set-hint { font-family: Helvetica, Arial, sans-serif; font-size: 11px; color: var(--text-muted, #8aa0b8);
  margin-top: 2px; line-height: 1.4; }
/* My Reports — per-user subscription rows */
.lo-rep-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 9px; border-radius: 8px; border: 1px solid transparent; }
.lo-rep-row:hover { background: rgba(255,255,255,0.04); border-color: rgba(122,152,193,0.14); }
.lo-set-check { display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: Helvetica, Arial, sans-serif; font-size: 13px; color: #dbe6f3; }
.lo-set-check input { accent-color: #3b82f6; width: 15px; height: 15px; }
.lo-set-check input:disabled + span { opacity: .5; }
.lo-set-time { font-family: Helvetica, Arial, sans-serif; font-size: 13px; color: #dbe6f3;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(122,152,193,0.22);
  border-radius: 6px; padding: 5px 7px; }
.lo-set-time:focus { outline: none; border-color: #3b82f6; }
.lo-set-time:disabled { opacity: .5; }
.lo-modal-foot { padding: 12px 16px; border-top: 1px solid rgba(58,88,130,0.32);
  display: flex; justify-content: flex-end; }

/* ── Ops summary band — full-width row above rail + chart (Pad Progress top-left) ── */
.lo-opsbar { flex: 0 0 auto; display: flex; gap: 12px; padding: 10px 14px 4px; position: relative; }
.lo-opsbar:empty { display: none; }
/* Collapse toggle — small chevron pinned to the band's top-right corner. */
.lo-ops-toggle {
  position: absolute; top: 6px; right: 8px; z-index: 3;
  background: rgba(13,21,37,0.7); border: 1px solid rgba(159,179,209,.3); border-radius: 5px;
  cursor: pointer; color: var(--text-muted, #9fb3d1); font-size: 10px; line-height: 1;
  width: 24px; height: 18px; padding: 0;
}
.lo-ops-toggle:hover { color: var(--text-primary, #e2e8f0); border-color: rgba(159,179,209,.6); }
/* Collapsed: one-line compact strip — pad progress · well statuses · tour. */
.lo-opsbar.lo-ops-min {
  align-items: center; gap: 16px; padding: 4px 40px 4px 14px; min-height: 26px;
  font-size: 11px; color: var(--text-muted, #9fb3d1);
}
.lo-opsbar.lo-ops-min .lo-ops-toggle { top: 50%; transform: translateY(-50%); }
.lo-ops-min-seg b { color: var(--text-primary, #e2e8f0); font-weight: 800; }
/* Compact well chips double as the well switcher (same click handler as the cards). */
.lo-ops-min-well {
  font-weight: 800; font-size: 10px; letter-spacing: .5px; white-space: nowrap;
  cursor: pointer; padding: 2px 7px; border-radius: 5px; border: 1px solid transparent;
}
.lo-ops-min-well:hover { border-color: rgba(159,179,209,.35); }
.lo-ops-min-well.sel { border-color: rgba(90,170,255,.55); background: rgba(59,130,246,.12); }
.lo-ops-min-well.frac { color: #e67e22; }
.lo-ops-min-well.wl { color: #2ecc71; }
.lo-ops-min-well.done { color: #2ecc71; }
.lo-ops-min-well.idle { color: #9fb3d1; opacity: .65; }
.lo-ops-card {
  flex: 1 1 0; min-width: 0; max-width: 360px; display: flex; align-items: center; gap: 14px;
  padding: 11px 16px; border-radius: 12px;
  background: linear-gradient(158deg, rgba(24,34,55,0.60) 0%, rgba(13,21,37,0.50) 100%);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  border: 1px solid rgba(122,152,193,0.18);
  box-shadow: 0 6px 20px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05);
}
.lo-ops-meta { flex: 1 1 auto; min-width: 0; }
/* Classification-color stripe across the top of a well status card (field
   continuity with the crew-painted frac stack). Only the well cards
   (.lo-ops-active) get it — not the progress/tour cards. */
.lo-ops-card.lo-ops-active { position: relative; overflow: hidden; }
.lo-ops-stripe { position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 12px 12px 0 0; pointer-events: none; }
.lo-ops-cdot-wrap { display: inline-flex; align-items: center; margin-right: 6px; vertical-align: middle; }
.lo-ops-cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.lo-sum-wo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; flex: 0 0 auto; vertical-align: middle; }
.lo-ops-card.lo-ops-idle { opacity: 0.66; }   /* inactive well — present but receded */
/* Today's Tour summary card — pinned to the right of the band */
.lo-ops-tour { margin-left: auto; max-width: 320px; }
.lo-tour-meta { width: 100%; }
.lo-tour-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; margin-top: 7px; }
.lo-tour-span { grid-column: 1 / -1; }

/* Pad Progress donut is a tap target → Today's Tour summary. Accent chevron
   badge on the donut is the "there's a panel here, tap me" cue. */
.lo-ops-progress[data-day-summary] { cursor: pointer; position: relative; }
.lo-ds-cue {
  position: absolute; right: 0; bottom: 0;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--lo-cyan, #2cc3ec); color: #06121f;
  box-shadow: 0 0 0 2px var(--lo-bg, #0e1a2d);
  transition: transform 0.12s ease;
}
.lo-ops-progress[data-day-summary]:active .lo-ds-cue { transform: scale(0.88); }

/* Today's Tour summary sheet (tap the donut). Reuses the .lo-modal chrome. */
.lo-ds-day { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--lo-mut, #8294ad); }
.lo-ds-prog { display: flex; align-items: center; gap: 16px; margin: 12px 0 4px;
  padding-bottom: 14px; border-bottom: 1px solid var(--lo-div); }
.lo-ds-pct { font-family: Helvetica, Arial, sans-serif; font-size: 42px; font-weight: 800;
  line-height: 1; color: var(--lo-cyan, #2cc3ec); flex: 0 0 auto; }
.lo-ds-progbig { font-family: Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 800;
  color: #fff; line-height: 1.1; }
.lo-ds-proglab { font-size: 12px; font-weight: 600; color: var(--lo-mut, #8294ad); }
.lo-ds-progsub { font-size: 12px; color: var(--lo-mut, #8294ad); margin-top: 3px; }
.lo-ds-grid { gap: 12px 16px; margin-top: 6px; }
/* Section caption — makes clear the KPI grid is the LIVE tour so far (vs the
   report button below, which is the last completed tour). */
.lo-ds-seclabel { margin-top: 14px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--lo-mut, #8294ad); }
/* Inline report status/link in the day-summary sheet (no pre-opened tab on
   mobile). When ready, the status becomes a big tap-to-open link. */
#lo-daysummary [data-ds-status] { margin-top: 12px; font-size: 13px; color: var(--lo-mut, #8294ad); text-align: center; }
.lo-report-openlink { display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 11px 18px; width: 100%; box-sizing: border-box;
  font-size: 15px; font-weight: 700; letter-spacing: 0.3px; text-decoration: none;
  color: #eaf2fb; background: rgba(46,224,106,0.16); border: 1px solid rgba(46,224,106,0.5);
  border-radius: 10px; }
.lo-report-openlink:active { background: rgba(46,224,106,0.28); }
.lo-tour-stat { display: flex; flex-direction: column; min-width: 0; }
/* The day's headline KPIs (Stages Pumped / WL Runs) — dominant on the left half. */
.lo-tour-big .lo-tour-v { font-size: 34px; font-weight: 800; line-height: 1.05; }
.lo-tour-big .lo-tour-k { font-size: 9px; letter-spacing: 0.7px; }
.lo-tour-v { font-family: Helvetica, Arial, sans-serif; font-size: 17px; font-weight: 800;
  color: #fff; line-height: 1.1; white-space: nowrap; }
.lo-tour-v small { font-size: 10px; font-weight: 600; color: var(--lo-mut, #8294ad); margin-left: 2px; }
.lo-tour-k { font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase; color: var(--lo-mut, #8294ad); margin-top: 1px; }
/* Per-status readouts on the well cards (frac press/rate/conc · wl depth/speed · zipper) */
.lo-ops-kpis { margin-top: 7px; gap: 16px; }
.lo-ops-kpis .lo-card-kpi:first-child .lo-kpi-val { font-size: 14px; }
.lo-ops-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--lo-mut, #8294ad); margin-bottom: 3px; }
.lo-ops-big { font-family: Helvetica, Arial, sans-serif; font-size: 19px; font-weight: 800;
  color: #fff; line-height: 1.12; display: flex; align-items: baseline; gap: 9px; }
.lo-ops-wname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-ops-wshort { display: none; }   /* mobile-only abbreviated name (first word) */
.lo-ops-fwl { display: none; }      /* mobile-only F/WL op segment on the card */
.lo-ops-mstage { display: none; }   /* mobile-only stage number on the card */
.lo-ops-of { font-size: 14px; font-weight: 600; color: var(--lo-mut, #8294ad); }
.lo-ops-stage { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--lo-cyan, #2cc3ec); }
/* Selected (focused) well card — persistent cyan highlight */
.lo-ops-card.lo-ops-selected { border-color: rgba(44,195,236,0.78);
  box-shadow: 0 0 0 1px rgba(44,195,236,0.42), 0 0 22px rgba(44,195,236,0.26); opacity: 1; }
/* Selected-card connector tab (reviewer spec) — a small dark, cyan-outlined pointer
   projecting from the bottom edge into the gap, marking that THIS card drives the
   workspace below. Selected card only. It overlaps the gap (no added row height):
   the selected card goes overflow:visible + a z-index bump so the tab paints over
   the panel beneath, and its top edge tucks under the card's bottom border so the
   outline reads as opening into the point. */
.lo-ops-card.lo-ops-selected { overflow: visible; z-index: 3; }
.lo-ops-tab {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  width: 31px; height: 15px; opacity: 0; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(44,195,236,0.55)); transition: opacity .18s ease;
}
/* Subtle translucent cyan body (reviewer) — more presence than hairline strokes,
   still reads as opening off the card's bottom edge. */
.lo-ops-tab path { fill: rgba(44,195,236,0.15); stroke: var(--lo-cyan, #2cc3ec); stroke-width: 1.7; stroke-linejoin: round; }
.lo-ops-card.lo-ops-selected .lo-ops-tab { opacity: 1; }
.lo-ops-statusline { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.lo-ops-status { font-family: Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 700; }
.lo-ops-label { white-space: nowrap; display: flex; align-items: baseline; }
.lo-ops-statustag { margin-left: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: none; }
/* Activity timer — pinned to the card's top-right corner (desktop has the room),
   a prominent constant reminder since rig time is money. Mobile keeps it in the
   stage block. Absolute so it never crowds the status line or KPI row. */
.lo-ops-timer-hdr { position: absolute; top: 12px; right: 17px;
  display: flex; align-items: baseline; gap: 7px; }
.lo-ops-timer-lab { font: 700 9px/1 'JetBrains Mono', monospace; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--lo-mut, #8294ad); }
.lo-ops-timer-val { font-size: 17px; font-weight: 700; }   /* status-colored inline */
.lo-ops-stagebig { font-family: Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 700; color: var(--lo-cyan, #2cc3ec); }
.lo-ops-since { font-family: Helvetica, Arial, sans-serif; font-size: 11px; color: var(--lo-mut, #8294ad); white-space: nowrap; }
/* Activity timer readout (h:mm) — monospace, tabular so digits don't jitter. */
.lo-ops-timer { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px; color: #b7c6da; }
.lo-ops-click { cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease; }
.lo-ops-click:hover { border-color: rgba(90,170,255,0.45); box-shadow: 0 0 16px rgba(80,120,255,0.18); }
.lo-ops-sub { font-family: Helvetica, Arial, sans-serif; font-size: 11px; color: var(--lo-mut, #8294ad); margin-top: 3px; }
/* Thin stages progress bar (mockup) — remaining count sits beneath it */
.lo-ops-pbar { height: 4px; border-radius: 2px; background: rgba(122,152,193,0.20);
  margin-top: 7px; overflow: hidden; }
.lo-ops-pbar > span { display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #2cc3ec 0%, #3b82f6 100%); transition: width .5s ease; }
/* Progress donut */
.lo-donut { flex: 0 0 auto; width: 54px; height: 54px; }
.lo-donut-track { fill: none; stroke: rgba(122,152,193,0.22); stroke-width: 6; }
.lo-donut-arc { fill: none; stroke: var(--lo-cyan, #2cc3ec); stroke-width: 6; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 32px 32px; transition: stroke-dashoffset .5s ease; }
.lo-donut-pct { fill: #fff; font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 800; text-anchor: middle; }
.lo-donut-frac { fill: var(--lo-cyan, #2cc3ec); font-family: Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-anchor: middle; }
.lo-ops-gold { display: none; }   /* gold pad-summary stripe — shown on the mobile donut card only */
/* Active-well rig badge (ring color = op status) */
.lo-ops-rig { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--rig, #54e08c); color: var(--rig, #54e08c);
  display: flex; align-items: center; justify-content: center; }
.lo-ops-rig svg { width: 24px; height: 24px; }

.lo-active-strip {
  flex: 0 0 auto; display: flex; align-items: stretch; gap: 12px;
  overflow-x: auto; padding: 4px 2px 8px;
}
.lo-active-strip:empty { display: none; }   /* legacy strip retired — collapse the gap */
/* collapse toggle for the top realtime cards (hides the strip; charts grow up) */
.lo-strip-empty {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-muted);
  font-style: italic; padding: 10px 2px;
}
.lo-card {
  flex: 0 0 188px; display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 9px;
}
.lo-card:hover { border-color: var(--accent, #2d6cdf); }
.lo-card.selected { border-color: var(--accent, #2d6cdf); box-shadow: inset 0 0 0 1px var(--accent, #2d6cdf); }
.lo-card-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lo-card-name {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lo-card-mid { height: 30px; display: flex; align-items: center; }
.lo-spark { display: block; width: 100%; height: 30px; }
.lo-card-wait { font-size: 9px; color: var(--text-muted); font-style: italic; }
.lo-card-kpis { display: flex; justify-content: space-between; gap: 6px; }
.lo-card-kpi {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; line-height: 1;
  display: flex; flex-direction: column; gap: 1px;
}
.lo-card-kpi small { font-size: 7.5px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.3px; }

/* ── Pad well cards — premium glass status tiles over the cover backdrop.
   One well name over a WIRELINE + FRAC op sub-tile (kept side-by-side). Visual
   only: accent = Wireline blue / Frac orange / monitor-stale gray; the active
   (focused) well gets the strongest glow. Report Helvetica typography. ── */
.lo-wellcard {
  flex: 1 1 320px; max-width: 520px;
  display: flex; flex-direction: column; gap: 7px; cursor: pointer;
  padding: 11px 13px; border-radius: 12px;
  background: linear-gradient(158deg, rgba(24,34,55,0.60) 0%, rgba(13,21,37,0.50) 100%);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  border: 1px solid rgba(122,152,193,0.18);
  box-shadow: 0 6px 20px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.lo-wellcard:hover {
  transform: translateY(-1px); border-color: rgba(122,152,193,0.34);
  box-shadow: 0 11px 28px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.06);
}
/* Active (focused) well — priority #1: brighter glass, thicker cyan border + glow. */
.lo-wellcard.selected {
  background: linear-gradient(158deg, rgba(34,49,77,0.72) 0%, rgba(19,30,52,0.60) 100%);
  border: 1.5px solid rgba(44,195,236,0.62);
  box-shadow: 0 12px 30px rgba(0,0,0,0.46), 0 0 0 1px rgba(44,195,236,0.22),
              0 0 22px rgba(44,195,236,0.26), inset 0 1px 0 rgba(255,255,255,0.07);
}
.lo-wellcard-name {
  font-family: Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 700;
  color: #eef4fc; letter-spacing: 0.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lo-subcards { display: flex; flex-direction: row; gap: 8px; flex: 1 1 auto; }
.lo-subcard {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 7px 9px;
  background: rgba(10,16,28,0.40); border: 1px solid rgba(122,152,193,0.14); border-radius: 9px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
/* Op accents on the LIVE tiles (chrome only — KPI value colors keep their metric language) */
.lo-subcard[data-sub="frac"]:not(.lo-sub-stale):not(.lo-sub-zipper) {
  background: rgba(42,27,12,0.34); border-color: rgba(230,132,42,0.50);
  box-shadow: inset 0 0 0 1px rgba(230,132,42,0.12), 0 0 14px rgba(230,132,42,0.10);
}
.lo-subcard[data-sub="wireline"]:not(.lo-sub-stale) {
  background: rgba(13,26,49,0.36); border-color: rgba(59,130,246,0.50);
  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.12), 0 0 14px rgba(59,130,246,0.10);
}
/* Monitored zipper (live surface pressure, not pumping) — calm slate, lower priority. */
.lo-subcard.lo-sub-zipper {
  background: rgba(16,24,38,0.34); border-color: rgba(94,131,168,0.40); box-shadow: none;
}
.lo-subcard.lo-sub-idle { opacity: 0.5; }
/* Stale op-slot: data older than the live threshold — dim, gray, show "last seen". */
.lo-subcard.lo-sub-stale {
  opacity: 0.5; background: rgba(12,18,30,0.30); border-color: rgba(122,152,193,0.10); box-shadow: none;
}
.lo-sub-idlemsg {
  height: 32px; display: flex; align-items: center;
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
/* Pulsing dot on a LIVE (currently streaming) op-slot. */
.lo-live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; margin-left: 6px; vertical-align: middle;
  animation: lo-live-pulse 1.6s ease-out infinite;
}
@keyframes lo-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  70%  { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
/* Active wireline (tools downhole, >500 ft) — soft "selected" cue, not an alert. */
.lo-subcard.lo-sub-active-wl {
  background: rgba(18,34,62,0.45); border-color: rgba(90,170,255,0.65);
  box-shadow: 0 0 10px rgba(90,170,255,0.20);
}
.lo-sub-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
/* Sparkline grows to fill spare height and sits at the BOTTOM, glued to the KPIs
   (kills the floating gap); any surplus stacks under the role pill instead. */
.lo-sub-mid { flex: 1 1 auto; min-height: 30px; display: flex; align-items: flex-end; }
.lo-sub-mid .lo-spark { height: 30px; }
/* KPIs: tiny uppercase label over value+unit so a new operator can read them.
   Primary (first) prominent; secondaries muted. Report Helvetica. */
.lo-sub-kpis { display: flex; gap: 14px; align-items: flex-start; margin-top: 1px; }
.lo-sub-kpis .lo-card-kpi { display: flex; flex-direction: column; gap: 0; line-height: 1.05; }
.lo-kpi-lab {
  font-family: Helvetica, Arial, sans-serif; font-size: 8px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--lo-mut, #8294ad);
}
.lo-kpi-val {
  font-family: Helvetica, Arial, sans-serif; font-variant-numeric: tabular-nums;
  font-size: 14px; font-weight: 700; white-space: nowrap; line-height: 1.1;
}
.lo-kpi-val small { font-size: 8.5px; font-weight: 600; color: var(--text-muted);
  margin-left: 2px; letter-spacing: 0.2px; }
.lo-sub-kpis .lo-card-kpi:first-child .lo-kpi-val { font-size: 18px; }
.lo-sub-kpis .lo-card-kpi:not(:first-child) { opacity: 0.82; }
/* Op status pills — Wireline = blue, Frac = orange, Zipper = slate (top cards only;
   the Pad Overview rail role tags are left unchanged). */
.lo-wellcard .lo-role { cursor: default; }
.lo-wellcard .lo-role-frac { background: #e8842a; color: #1c0f02; }
.lo-wellcard .lo-role-wireline { background: #3b82f6; color: #04122e; }
.lo-wellcard .lo-role-zipper { background: #5e83a8; color: #061320; }
@media (prefers-reduced-motion: reduce) {
  .lo-wellcard, .lo-subcard { transition: none; }
  .lo-wellcard:hover { transform: none; }
}

.lo-kpis { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lo-plot-wrap { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.lo-plot-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  /* Dark glass instrument panel over the ICOP backdrop */
  background: linear-gradient(158deg, rgba(16,24,40,0.66) 0%, rgba(10,16,28,0.72) 100%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(122,152,193,0.11); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 6px 8px;
}
.lo-plot-label {
  flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); padding: 2px 2px 4px;
}
.lo-plot { flex: 1; min-height: 0; width: 100%; }

/* Tabbed plot containers (upper: PRD/Tab2/Tab3 — lower: Chem Plot/Numeric/Notes) */
.lo-tabbed { padding: 0; position: relative; }
/* Navy tab bar — matches the PRD plot's .hist-chart-header chrome (both themes). */
.lo-lower-tabs {
  flex: 0 0 auto; display: flex; gap: 2px; border-bottom: 1px solid rgba(58,88,130,0.22);
  position: relative; z-index: 5; background: rgba(11,18,32,0.55); padding: 0 4px;  /* quieter bar, above the canvas */
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;  /* hide the stray tab-bar scrollbar/arrows */
}
.lo-lower-tabs::-webkit-scrollbar { display: none; }
/* collapse/expand the bottom panel (stays anchored at the bottom) */
.lo-lower-collapse {
  flex: 0 0 auto; margin-left: auto; align-self: stretch; background: transparent; border: none;
  cursor: pointer; color: #9fb3d1; font-size: 13px; line-height: 1; padding: 0 14px;
  display: flex; align-items: center; justify-content: center;
}
/* Stage selector (LIVE / historical) rides the upper tab bar, right-aligned just
   left of the collapse chevron. The wrapper carries the auto-margin so alignment
   holds whether a selector is visible or both are hidden; the chevron's own
   auto-margin is zeroed here (it stays for the lower bar, which has no actions). */
.lo-uptab-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; padding-right: 4px; }
#lo-upper .lo-lower-collapse { margin-left: 0; }
.lo-lower-collapse:hover { color: #fff; background: rgba(255,255,255,0.08); }
#lo-lower.lo-lower-collapsed { flex: 0 0 auto; }
#lo-lower.lo-lower-collapsed .lo-lower-body { display: none; }
#lo-upper.lo-upper-collapsed { flex: 0 0 auto; }
#lo-upper.lo-upper-collapsed .lo-lower-body { display: none; }
/* Enlarge the PRD/analysis panel to fill the screen (desktop). Fixed to the
   viewport, above the cards + numeric panel; the tab bar (with the ⤡ exit button)
   and Esc restore it. */
#lo-upper.lo-upper-enlarged {
  position: fixed; inset: 0; z-index: 120;
  width: 100vw; height: 100vh; max-width: none; margin: 0; border-radius: 0;
}
/* Collapsing a full-screen panel is meaningless — hide the caret; ⤡ / Esc exit. */
#lo-upper.lo-upper-enlarged #lo-upper-collapse { display: none; }
.lo-tab {
  padding: 8px 12px 7px; margin: 0 0 -1px; border: none; border-bottom: 2px solid transparent;
  background: transparent; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.4px; text-transform: uppercase; color: rgba(255,255,255,0.55);
  position: relative; z-index: 6; white-space: nowrap; user-select: none;
  transition: color .12s ease, border-color .12s ease;
}
.lo-tab:hover { color: rgba(255,255,255,0.85); }
.lo-tab.active { color: #fff; border-bottom-color: #69a8ff; }
.lo-lower-body { flex: 1; min-height: 0; display: flex; position: relative; z-index: 1; }
.lo-tabpane { display: none; flex: 1; min-height: 0; }
.lo-tabpane.active { display: flex; flex-direction: column; }
.lo-tabpane[data-lopane="plot"], .lo-tabpane[data-uppane="prd"] { padding: 6px 8px; }
/* Chemical Plot "Map Channels" toolbar (opens the shared PRD-prefs modal) */
.lo-chem-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 2px 0 6px; }
/* Chemical Map editor (pump ↔ chemical pairing) */
.chemmap-hint { font-size: 11px; color: var(--text-muted, #9fb3d1); margin: 0 0 10px; }
.chemmap-head, .chemmap-row { display: grid; grid-template-columns: 64px 1fr 168px 150px 24px; gap: 8px; align-items: center; }
.chemmap-head { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted, #9fb3d1); padding: 0 2px 4px; }
.chemmap-row { padding: 2px 0; }
.chemmap-ch { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary, #cbd5e1); }
.chemmap-prev { font-size: 11px; font-weight: 600; color: var(--text-primary, #e2e8f0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chemmap-del { background: none; border: none; color: #e74c3c; font-size: 16px; cursor: pointer; line-height: 1; padding: 0; }
.chemmap-empty { font-size: 11px; color: var(--text-muted, #9fb3d1); font-style: italic; padding: 4px 2px; }
.chemmap-row select, .chemmap-row input { padding: 3px 5px; font-size: 11px; }

/* ── Chemical Channel Assignments editor (time-aware map) — dark-only ─────── */
.ccm-hint { font-size: 11px; color: var(--text-muted, #9fb3d1); margin: 0 0 6px; line-height: 1.4; }
.ccm-current { display: flex; flex-direction: column; gap: 2px; }
.ccm-cur-row {
  display: grid; grid-template-columns: 150px 1fr 120px auto auto; gap: 8px; align-items: center;
  padding: 3px 4px; border-radius: 4px; background: rgba(148,163,184,0.05);
}
.ccm-cur-ch { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary, #cbd5e1); }
.ccm-cur-ch small { display: block; font-size: 9px; color: var(--text-muted, #64748b); }
.ccm-cur-prod { font-size: 12px; font-weight: 600; color: var(--text-primary, #e2e8f0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccm-cur-role { font-size: 11px; color: var(--text-muted, #9fb3d1); }
.ccm-unassigned { color: var(--text-muted, #64748b); font-style: italic; font-weight: 400; }
.ccm-src { font-size: 9px; text-transform: uppercase; letter-spacing: .3px; padding: 2px 6px; border-radius: 8px; white-space: nowrap; }
.ccm-src-base { background: rgba(148,163,184,0.15); color: #94a3b8; }
.ccm-src-op { background: rgba(34,211,238,0.14); color: #22d3ee; }
.ccm-flag { font-size: 9px; padding: 2px 6px; border-radius: 8px; white-space: nowrap; cursor: help; }
.ccm-flag-warn { background: rgba(234,179,8,0.16); color: #eab308; }
.ccm-flag-off { background: rgba(236,72,153,0.16); color: #ec4899; }
.ccm-move { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 4px 0 2px; }
.ccm-move label { display: flex; flex-direction: column; gap: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted, #9fb3d1); }
.ccm-move input[type="text"], .ccm-move select, .ccm-move input[type="datetime-local"] { padding: 4px 6px; font-size: 12px; }
.ccm-move .ccm-when { flex-direction: row; align-items: center; gap: 10px; text-transform: none; }
.ccm-move .ccm-when span { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary, #cbd5e1); }
.ccm-move .ccm-note input { min-width: 200px; }
.ccm-base { margin-top: 12px; }
.ccm-base summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-secondary, #cbd5e1); }
.ccm-base-head { display: grid; grid-template-columns: 110px 1fr 160px; gap: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted, #9fb3d1); padding: 6px 2px 4px; }
.ccm-base-row { display: grid; grid-template-columns: 110px 1fr 160px; gap: 8px; align-items: center; padding: 2px 0; }
.ccm-base-ch { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary, #cbd5e1); }
.ccm-base-ch small { color: var(--text-muted, #64748b); margin-left: 4px; }
.ccm-base-row input, .ccm-base-row select { padding: 3px 5px; font-size: 11px; }
.ccm-base-actions { display: flex; gap: 8px; margin-top: 8px; }
.ccm-savemsg { flex: 1; font-size: 11px; color: var(--text-muted, #9fb3d1); font-family: 'JetBrains Mono', monospace; }
.ccm-savemsg.err { color: #ec4899; }

.lo-tabpane[data-lopane="plot"].active #lo-chem-chart,
.lo-tabpane[data-uppane="prd"].active #lo-prd-chart { flex: 1; min-height: 0; width: 100%; }
/* Wellbore Transit overlay sits over the live PRD chart (pixel-aligned). */
.lo-prd-chartwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
/* Phone "LIVE" snap-back chip — appears (via JS .show) when a pinch/pan has
   paused live-follow; one tap resets zoom and resumes following. */
.lo-prd-live { position: absolute; top: 8px; right: 10px; z-index: 6; display: none;
  align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(20,32,52,0.92); border: 1px solid rgba(122,152,193,0.5);
  color: #dbe7f5; font: 700 11.5px/1 'JetBrains Mono', monospace; letter-spacing: 0.5px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lo-prd-live.show { display: inline-flex; }
.lo-prd-live:active { background: rgba(30,46,72,0.95); }
.lo-wl-body { position: relative; }   /* anchors the WL chart's LIVE reset chip */

/* Compact live readout pinned over the wireline chart for mobile / full-screen,
   where the numeric panel is off-screen. Depth is the large primary; hidden on
   desktop-inline (the numeric panel already shows there). */
.lo-wl-mstrip { position: absolute; top: 8px; left: 10px; z-index: 6; display: none;
  align-items: flex-end; gap: 14px; padding: 7px 12px 6px; border-radius: 10px;
  background: rgba(14,22,38,0.82); border: 1px solid rgba(122,152,193,0.32);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  pointer-events: none; max-width: calc(100% - 20px); flex-wrap: wrap; }
.lo-wlm-cell { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.lo-wlm-lab { font: 600 8.5px/1 'JetBrains Mono', monospace; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-secondary, #8ba0bd); white-space: nowrap; }
.lo-wlm-val { font: 700 15px/1 'JetBrains Mono', monospace; white-space: nowrap; }
.lo-wlm-val small { font-size: 9px; font-weight: 600; opacity: 0.7; margin-left: 2px; }
.lo-wlm-primary .lo-wlm-val { font-size: 22px; }
.lo-wlm-primary .lo-wlm-lab { font-size: 9.5px; }
/* Show when the chart is enlarged (desktop full-screen). */
#lo-upper.lo-upper-enlarged .lo-wl-mstrip { display: flex; }
@media (max-width: 820px), (max-height: 500px) {
  .lo-wl-mstrip { display: flex; }
}

/* Landscape phone: the user rotated to WATCH the job, but a short viewport left
   the chart with almost no height under the chrome. Make the console scrollable
   and give the chart most of the viewport, so a scroll-down fills the screen with
   the live trace (Dean). Portrait keeps the fixed fill layout. */
@media (orientation: landscape) and (max-height: 520px) {
  .live-ops-fullscreen { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* 68vh (not more) so at full scroll the chart is maximized AND the view row +
     LIVE stage dropdown still sit above it, in view (Dean). */
  /* Chart takes ~the full usable screen (Dean) so a scroll-down pushes the cards +
     view row + LIVE dropdown off and the trace fills the phone. dvh tracks the
     ACTUAL dynamic viewport (Safari's toolbar collapse) — vh is the fallback. */
  .lo-main { flex: 0 0 auto; min-height: 100vh; min-height: 100dvh; }
}
/* Mobile PORTRAIT frac numeric = the 3 primary KPIs only (Treating Pressure,
   Slurry Rate, Prop Conc), each full-width and legible. The individual chemicals
   and the "+ Add" tile stay in landscape / desktop where there's width for the
   full grid (Dean). */
@media (max-width: 820px) and (orientation: portrait) {
  /* Numeric adds .lo-compact (a desktop strip-under-chart behavior) which caps the
     panel at 236px — on a phone that hides Prop Conc below the cap. Fill the view. */
  #lo-lower.lo-compact .lo-chem-numeric { max-height: none; }
  .lo-chem-numeric { grid-template-columns: 1fr; }
  .lo-chem-numeric .lo-num-chem,
  .lo-chem-numeric .lo-num-add { display: none; }
}
.lo-prd-transit-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.lo-pane-placeholder {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; font-style: italic;
}
/* PRD tab toolbar — reuses the global .trim-btn / .trim-checkbox / .trim-sep chrome */
.lo-prd-toolbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 4px 2px 8px;
}

/* Step Down Test draft — modeled on the Rate Step-Down Analysis */
.lo-sdt { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.lo-sdt-title {
  flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  color: var(--text-primary); letter-spacing: 0.3px;
}
.lo-sdt-title .lo-sdt-api { color: var(--text-muted); font-weight: 400; }
.lo-sdt-title .lo-sdt-meta { color: var(--text-secondary); font-weight: 400; }
.lo-sdt-fluid {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary);
}
.lo-sdt-fluid label { color: var(--text-muted); text-transform: uppercase; font-size: 10px; letter-spacing: 0.4px; }
.lo-sdt-fluid .lo-bind { max-width: 280px; }
.lo-sdt-hint { color: var(--text-muted); font-style: italic; font-size: 10px; }
/* Middle band: pick-controls RAIL on the left, chart + time slider on the right. */
.lo-sdt-mid { flex: 1; min-height: 0; display: flex; gap: 8px; }
/* Rail matches the dark glassy card language (the old solid #1f3b63 blue stuck out). */
.lo-sdt-prd {
  flex: 0 0 152px; align-self: stretch; overflow-y: auto;
  background: linear-gradient(158deg, rgba(24,34,55,0.60) 0%, rgba(13,21,37,0.50) 100%);
  border: 1px solid rgba(159,179,209,0.18); border-radius: 8px; padding: 9px 11px;
}
.lo-sdt-prd-head {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-primary, #e2e8f0); margin-bottom: 3px;
}
.lo-sdt-prd-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: #9fb3d1; font-size: 10px; line-height: 1.35; margin-bottom: 9px; }
.lo-sdt-rail-note { font-size: 10px; color: #9fb3d1; font-style: italic; line-height: 1.35; min-height: 0; }
.lo-sdt-toolbar { display: flex; flex-direction: column; gap: 6px; }
.lo-sdt-toolbar .trim-btn { width: 100%; }
.lo-sdt-prd .trim-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); color: #dbe6f3; }
.lo-sdt-prd .trim-btn:hover { background: rgba(255,255,255,0.16); color: #fff; border-color: rgba(255,255,255,0.45); }
.lo-sdt-prd .trim-btn.danger:hover { border-color: #e74c3c; color: #ff8a7a; background: rgba(231,76,60,0.18); }
.lo-sdt-mid-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lo-sdt-chart { flex: 1; min-height: 140px; width: 100%; overflow: hidden; }
.lo-sdt-rail-sep { height: 1px; margin: 4px 0; background: rgba(255,255,255,0.18); }
/* Chart ⇄ Results flip: the right side of the band shows ONE of the two —
   there isn't room for both. The rail (with the toggle) stays put. */
.lo-sdt-mid.results-mode .lo-sdt-mid-main { display: none; }
.lo-sdt-mid:not(.results-mode) .lo-sdt-results { display: none; }

/* ── Wireline Pumpdown tab ─────────────────────────────────────────────── */
.lo-tabpane[data-uppane="wlpump"] { padding: 6px 8px; position: relative; }
.lo-wl-body { flex: 1; min-height: 0; display: flex; gap: 8px; width: 100%; }
/* stacked column of circular instruments (unassigned gauges are hidden) */
.lo-wl-gauges { flex: 0 0 300px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.lo-wl-gauge { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
  min-width: 0; min-height: 0; cursor: pointer; }
.lo-wl-gtitle { position: absolute; left: 0; right: 0; bottom: 7%; z-index: 3; text-align: center;
  font-size: 9px; font-weight: 600; color: #9fb6cf; letter-spacing: .04em; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* wrapper centers the circle; JS sizes the circle square to min(wrapW, wrapH) */
.lo-wl-gwrap { flex: 1 1 auto; min-height: 0; min-width: 0; width: 100%;
  display: flex; align-items: center; justify-content: center; }
/* metallic bezel + glossy dark face (instrument look, dark in both themes like the demo) */
.lo-wl-gcircle { position: relative; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #233047 0%, #18212f 52%, #0a0e16 100%);
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.10), inset 0 -6px 16px rgba(0,0,0,0.7),
    0 3px 8px rgba(0,0,0,0.5), 0 0 0 5px #12161d, 0 0 0 7px #2a2f37;
  transition: box-shadow .12s; }
.lo-wl-gauge:hover .lo-wl-gcircle { box-shadow: inset 0 2px 6px rgba(255,255,255,0.10),
    inset 0 -6px 16px rgba(0,0,0,0.7), 0 3px 8px rgba(0,0,0,0.5), 0 0 0 5px #12161d, 0 0 0 7px var(--accent); }
/* nudge the dial up so DevExtreme's auto-centered arc puts the needle pivot on
   the bezel's true center (it otherwise sits ~7% low to reserve label space). */
.lo-wl-gdial { position: absolute; inset: 7%; z-index: 1; pointer-events: none; transform: translateY(-7%); }
.lo-wl-gval { position: absolute; left: 0; right: 0; bottom: 19%; text-align: center; z-index: 3;
  font-size: clamp(12px, 1.5vw, 16px); font-weight: 700; color: #dbeafe; pointer-events: none; white-space: nowrap; }
.lo-wl-gauge::after { content: '⚙'; position: absolute; top: 4px; right: 8px; font-size: 11px;
  color: rgba(200,210,225,0.6); opacity: 0; transition: opacity .12s; pointer-events: none; z-index: 4; }
.lo-wl-gauge:hover::after { opacity: 0.9; }
/* Conveyance metric cards (modern replacement for the circular gauges) */
.lo-wl-gauge.lo-wlc { align-items: stretch; justify-content: flex-start; gap: 6px;
  padding: 12px 14px; cursor: pointer;
  background: rgba(6,12,24,0.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(100,130,255,0.10); border-radius: 10px;
  transition: border-color .14s ease, box-shadow .14s ease; }
.lo-wl-gauge.lo-wlc:hover { border-color: rgba(120,160,255,0.30); box-shadow: 0 0 14px rgba(80,120,255,0.12); }
.lo-wlc-top { display: flex; align-items: center; gap: 8px; }
.lo-wlc-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--lo-mut, #8294ad); }
.lo-wlc-dir { font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; color: #cdd9ea; background: rgba(255,255,255,0.06); border-radius: 4px; padding: 1px 5px; }
.lo-wlc-val { font-family: Helvetica, Arial, sans-serif; font-size: 30px; font-weight: 800; line-height: 1;
  display: flex; align-items: baseline; gap: 4px; }
.lo-wlc-val small { font-size: 13px; font-weight: 600; color: var(--lo-mut, #8294ad); opacity: 0.85; }
.lo-wlc-spark { height: 24px; opacity: 0.6; }
.lo-wlc-spark .lo-spark { width: 100%; height: 24px; }
.lo-wlc-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }
.lo-wlc-status { font-family: Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 700; }
.lo-wlc-target { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--lo-mut, #8294ad); }
.lo-wl-chart { flex: 1; min-height: 0; }

/* ── Wellbore Diagram tab — hosts the gauge column + schematic placeholder ── */
/* ── Pad Timeline (zipper board) — dxScheduler swimlanes ── */
.lo-tabpane[data-uppane="padtl"] { padding: 6px 8px; }
.lo-padtl { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.lo-padtl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.lo-padtl-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.lo-padtl-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--text-secondary); }
.lo-padtl-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lo-ptl-sw { width: 12px; height: 10px; border-radius: 2px; display: inline-block; }
.lo-ptl-sw-npt { background-color: #8a93a1;
  background-image: repeating-linear-gradient(45deg, transparent 0 2px, rgba(0,0,0,0.45) 2px 4px); }
/* Metrics line — pad-wide totals above the zipper. */
.lo-padtl-metrics { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 4px 4px 8px; }
.lo-padtl-metrics:empty { display: none; }
.lo-met { display: inline-flex; align-items: baseline; gap: 5px; }
.lo-met-k { font-size: 9px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.lo-met-v { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--text-primary); }
.lo-met.lo-met-warn .lo-met-v { color: #d98a3a; }
/* Zipper strip — one line per well, colored phase blocks (the overview). */
.lo-padtl-zip { flex: 0 0 auto; width: 100%; overflow: hidden; }
.lo-padtl-zip svg { display: block; }
.lo-padtl-zip text.lo-zip-wname { fill: var(--text-primary); font-size: 11px; font-weight: 600; }
.lo-padtl-zip text.lo-zip-tick { fill: var(--text-muted); font-size: 9px; font-family: 'JetBrains Mono', monospace; }
.lo-padtl-zip text.lo-zip-date { fill: var(--text-secondary); font-size: 10px; font-weight: 600; }
/* Stage-number labels — sit on the colored work cluster, so a white glyph with a
   thin dark outline reads across blue/cyan/orange/green (no white box). */
.lo-padtl-zip text.lo-zip-stage { fill: #fff; font-size: 9px; font-weight: 700;
  paint-order: stroke; stroke: rgba(0,0,0,0.40); stroke-width: 1.6px; stroke-linejoin: round; }
.lo-padtl-zip rect.lo-zip-live { animation: loZipPulse 1.6s ease-in-out infinite; }
@keyframes loZipPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.lo-padtl-sched { flex: 1; min-height: 0; overflow: hidden; }
/* dxGantt fills the pane (height:'100%' option sets the inner size). */
.lo-padtl-sched .dx-gantt { height: 100%; }
.lo-ptl-tip { font-size: 12px; line-height: 1.5; padding: 2px; }
.lo-ptl-tip-npt { color: #c0c8d4; font-style: italic; }

/* ── Wireline Continuous Timeline (Pad Timeline tab, Phase B1) ─────────────
   Timeline mode: the strip viewer owns the console — hide the well KPI cards,
   the lower (numeric) panel and the pad-overview sidebar while the tab is
   active. Toggled by _switchUpperTab via .lo-timeline-mode on the console
   root; leaving the tab restores everything (class removed, no JS unwind). */
.live-ops-fullscreen.lo-timeline-mode .lo-active-strip,
.live-ops-fullscreen.lo-timeline-mode #lo-opsbar,
.live-ops-fullscreen.lo-timeline-mode .lo-side,
.live-ops-fullscreen.lo-timeline-mode #lo-lower { display: none !important; }

.lo-tl { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.lo-tl-bar { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }
.lo-tl-title { font-size: 12px; font-weight: 700; color: var(--text-secondary);
  letter-spacing: .05em; text-transform: uppercase; }
.lo-tl-modechip { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; padding: 2px 8px; border-radius: 9px;
  color: #7ce38b; background: rgba(46,158,91,0.14); border: 1px solid rgba(46,158,91,0.4); }
.lo-tl-modechip.hist { color: #f0b429; background: rgba(240,180,41,0.12); border-color: rgba(240,180,41,0.4); }
.lo-tl-livebtn { color: #0c1420 !important; background: #2cc3ec !important; border-color: #2cc3ec !important;
  font-weight: 700; animation: loTlPulse 1.6s ease-in-out infinite; }
@keyframes loTlPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(44,195,236,0.5); } 50% { box-shadow: 0 0 0 6px rgba(44,195,236,0); } }
.lo-tl-status { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.lo-tl-legend { display: inline-flex; gap: 12px; flex-wrap: wrap; font-size: 10px; color: var(--text-muted); }
.lo-tl-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lo-tl-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lo-tl-sw-hatch { background: repeating-linear-gradient(45deg, #1a2231 0 3px, rgba(148,163,184,0.25) 3px 4px); }
.lo-tl-jumplbl { font-size: 11px; color: var(--text-muted); }
/* ── WELL FILTER — isolate a pad well on the strip viewer ── */
.lo-tl-wellfilter { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.lo-tl-wellfilter[hidden] { display: none; }
.lo-tl-wf-lbl { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); background: none; border: 0; padding: 2px 3px; cursor: pointer;
  border-radius: 4px; font-family: inherit; }
.lo-tl-wf-lbl:hover { color: var(--text-secondary); }
.lo-tl-wellfilter.filtered .lo-tl-wf-lbl { color: #2cc3ec; }
.lo-tl-wf-chip { display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 8px; border-radius: 9px; color: var(--wc, #7a98c1);
  border: 1px solid transparent; background: transparent; }
.lo-tl-wf-chip .lo-tl-wf-dot { width: 7px; height: 7px; border-radius: 50%;
  background: var(--wc, #7a98c1); flex: 0 0 auto; }
.lo-tl-wf-chip:hover { filter: brightness(1.18); }
.lo-tl-wf-chip.off { color: var(--text-muted); opacity: .6; }
.lo-tl-wf-chip.off .lo-tl-wf-dot { background: transparent; box-shadow: inset 0 0 0 1px var(--text-muted); }
/* Strip navigator + detail chart get the full height (Dean); the future frac
   lane keeps only a slim collapsed placeholder bar at the bottom. */
.lo-tl-top { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.lo-tl-lane { flex: 0 0 auto; position: relative; }
.lo-tl-lane canvas { display: block; width: 100%; height: 112px; border-radius: 6px; cursor: crosshair;
  touch-action: none; }
/* EDIT RUNS: taller canvas so the rail can grow to a ~22px touch target
   without stealing strip height (the 8px band was undraggable — Dean). */
.lo-tl-lane.lo-tl-lane-edit canvas { height: 128px; }
.lo-tl-chart { flex: 1; min-height: 130px; }
.lo-tl-bottom { flex: 0 0 22px; min-height: 22px; border: 1px dashed rgba(122,152,193,0.18);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .4; }
/* ── EDIT RUNS (Phase B2) ── */
.lo-tl-editbtn.armed { color: #0c1420 !important; background: #f0b429 !important; border-color: #f0b429 !important; font-weight: 700; }
.lo-tl-editbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 0 0 auto;
  padding: 4px 8px; border: 1px solid rgba(240,180,41,0.35); border-radius: 6px;
  background: rgba(240,180,41,0.06); font-size: 11px; }
.lo-tl-editbar label { display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-muted); font-size: 11px; }
.lo-tl-editbar input[type="number"],
.lo-tl-editbar input[type="text"] { width: 58px; background: #101a2c; color: #dbe6f3;
  border: 1px solid rgba(122,152,193,0.35); border-radius: 4px; padding: 2px 5px; font-size: 11px; }
.lo-tl-editbar .lo-tl-ed-notewrap { flex: 1 1 160px; min-width: 140px; }
.lo-tl-editbar .lo-tl-ed-notewrap input { flex: 1; width: auto; min-width: 100px; }
.lo-tl-ed-title { font-weight: 700; color: var(--text-secondary); font-size: 11px; }
.lo-tl-ed-title i { color: #f0b429; font-style: normal; font-weight: 600; }
.lo-tl-ed-hint { color: var(--text-muted); font-size: 11px; }
.lo-tl-ed-msg { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); }
.lo-tl-ed-msg.ok { color: #7ce38b; }
.lo-tl-ed-msg.warn { color: #f0b429; }
.lo-tl-ed-msg.err { color: #e57368; }

.lo-tabpane[data-uppane="wellbore"] { padding: 6px 8px; position: relative; }
.lo-wb-body { flex: 1; min-height: 0; display: flex; gap: 8px; width: 100%; }
.lo-wb-chart { flex: 1; min-height: 0; display: flex; gap: 8px; }
/* Skinny vertical depth track (TVD) with the live tool-string marker. */
.lo-wb-vsec { flex: 0 0 108px; min-height: 0; position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary); }
.lo-wb-vsec-lbl { position: absolute; top: 6px; left: 6px; right: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary);
  text-align: center; pointer-events: none; }
.lo-wb-vsec-lbl b { display: block; font-size: 12px; color: #8e44ad; white-space: nowrap; }
.lo-wb-vsec-lbl span { display: block; font-size: 9px; color: var(--text-muted); white-space: nowrap; }
/* Wider horizontal window — the lateral section (next piece). */
.lo-wb-hsec { flex: 1; min-height: 0; position: relative;
  border: 1px solid var(--border-color, rgba(127, 140, 160, 0.30)); border-radius: 6px;
  background: var(--bg-secondary); overflow: hidden; }
.lo-wb-lat-chart { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Ghost-runs control (top-right of the lateral panel) */
.lo-wb-ghostbar { position: absolute; top: 4px; right: 10px; z-index: 6; display: flex; gap: 8px; align-items: center; }
.lo-wb-mjt { font-size: 11px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; }
.lo-wb-mjt input { width: 62px; background: transparent; border: none; color: var(--title-strong);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; text-align: right; }
.lo-wb-mjt input:focus { outline: none; }
.lo-wb-ghost-pop { position: absolute; top: 28px; right: 0; width: 210px; max-height: 340px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.lo-wb-ghost-head { display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 12px; margin-bottom: 6px; color: var(--title-strong); }
.lo-wb-ghost-quick { display: flex; gap: 6px; margin-bottom: 8px; }
.lo-wb-ghost-quick .trim-btn { flex: 1; }
.lo-wb-ghost-tree { max-height: 250px; overflow: auto; }
.lo-wb-hsec .lo-wb-lat-note { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: 12px; }

/* gauge config modal */
.lo-wl-gmodal { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,0.45); }
.lo-wl-gmodal[hidden] { display: none; }
.lo-wl-gmodal-card { width: 340px; max-width: 92%; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); color: var(--text-primary); }
.lo-wl-gmodal-head { display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 13px; margin-bottom: 12px; color: var(--title-strong); }
.lo-wl-gmodal-x { background: none; border: none; color: var(--text-muted); font-size: 20px;
  line-height: 1; cursor: pointer; padding: 0 4px; }
.lo-wl-gmodal-card label { display: flex; flex-direction: column; gap: 3px; font-size: 11px;
  color: var(--text-secondary); margin-bottom: 9px; }
.lo-wl-gmodal-card select, .lo-wl-gmodal-card input {
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 5px; padding: 6px 8px; font-size: 12px; width: 100%; }
.lo-wl-gm-row { display: flex; gap: 10px; }
.lo-wl-gm-row label { flex: 1; }
.lo-wl-gmodal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.lo-wl-gmodal-actions .trim-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Controls row under the tab bar — Events/Scales sit right-aligned, directly
   below the stage selector (which lives in the tab bar above). The old chart
   title ("Stage N · timestamp") is gone; the selector carries stage context. */
.lo-wl-head { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; padding: 2px 8px 4px; }
.lo-wl-head:not(:has(> :not([hidden]))) { display: none; }   /* collapse when all controls hidden */
.lo-wl-hint { font-size: 11px; opacity: 0.62; flex: 1 1 220px; min-width: 0; }
.lo-wl-badge { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 10px; border: 1px solid transparent; white-space: nowrap; }
.lo-wl-badge.standby { color: #9fb3c8; background: rgba(159,179,200,0.12); border-color: rgba(159,179,200,0.35); }
.lo-wl-badge.running { color: #2ecc71; background: rgba(46,204,113,0.14); border-color: rgba(46,204,113,0.45); }
.lo-wl-badge.offline { color: #e67e22; background: rgba(230,126,34,0.13); border-color: rgba(230,126,34,0.4); }

.lo-sdt-zoom { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.lo-sdt-zoom-lbl, .lo-sdt-zoom .hz-range {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
  flex: 0 0 auto; white-space: nowrap;
}
.lo-sdt-zoom .hist-zoom-track { flex: 1; }
/* Step-Down results panel */
.lo-sdt-results { flex: 1; min-width: 0; align-self: stretch; overflow: auto; }
.lo-sdt-results::-webkit-scrollbar { width: 10px; }
.lo-sdt-results::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.lo-sdt-results::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid #0d1525; }
.lo-sdt-results::-webkit-scrollbar-thumb:hover { background: #4a5568; }
.lo-sdt-results { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
.lo-sdt-res-empty { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-muted); font-style: italic; line-height: 1.5; padding: 6px 2px; }
.lo-sdt-res-head {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--text-secondary); padding: 4px 2px;
}
.lo-sdt-res-head span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin-left: 8px; }
.lo-sdt-res-table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.lo-sdt-res-table th, .lo-sdt-res-table td { text-align: right; padding: 4px 10px; border-bottom: 1px solid var(--border); }
.lo-sdt-res-table th:first-child, .lo-sdt-res-table td:first-child { text-align: left; }
.lo-sdt-res-table th { color: var(--text-muted); font-weight: 600; font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; }
.lo-sdt-res-table th small { font-weight: 400; }
.lo-sdt-res-table td { color: var(--text-primary); }
.lo-sdt-res-table .lo-sdt-dn { color: #e74c3c; }

.lo-chem-numeric {
  flex: 1; min-height: 0; overflow: auto; padding: 14px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; align-content: start;
  scrollbar-width: thin;                                   /* Firefox */
  scrollbar-color: rgba(110,145,240,0.65) rgba(255,255,255,0.04);
}
/* Custom ICOP scrollbar — trading-desk scrubber feel, replaces the native bar */
.lo-chem-numeric::-webkit-scrollbar { width: 8px; height: 8px; }
.lo-chem-numeric::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(120,140,180,0.15);
  border-radius: 6px;
}
.lo-chem-numeric::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(120,160,255,0.65), rgba(90,120,220,0.65));
  border: 1px solid rgba(180,210,255,0.25); border-radius: 6px;
  background-clip: padding-box;
}
.lo-chem-numeric::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(145,185,255,0.9), rgba(110,145,240,0.9));
  border-color: rgba(200,225,255,0.4); box-shadow: 0 0 6px rgba(120,160,255,0.5);
}
.lo-chem-numeric::-webkit-scrollbar-corner { background: transparent; }
/* Numeric panel selected → lower container shrinks to fit its rows (anchored at
   the bottom of the workspace); the upper PRD container grows to fill the space. */
#lo-lower.lo-compact { flex: 0 0 auto; }
/* Tall enough for the primary KPI cards (value + SP/MAX stats + totals block ≈
   210px) — at 184px they clipped mid-content and read as broken formatting. */
#lo-lower.lo-compact .lo-chem-numeric { max-height: 236px; }
.lo-num {
  background: rgba(6,12,24,0.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(100,130,255,0.10); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 5px;
  min-height: 130px; position: relative; cursor: pointer;
  overflow: hidden;   /* content can never cross the card border */
  transition: border-color .14s ease, box-shadow .14s ease;
}
.lo-num-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-secondary); opacity: 0.7;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Subtle "alarm armed" indicator (replaces the busy ±%/sec badge) */
.lo-num-flagged .lo-num-label::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); margin-left: 6px; vertical-align: middle; opacity: 0.7;
}
.lo-num-val {
  font-family: 'JetBrains Mono', monospace; font-size: 36px; font-weight: 700; line-height: 1;
  display: flex; align-items: baseline; gap: 5px;
}
.lo-num-val small { font-size: 13px; font-weight: 600; color: var(--text-muted); opacity: 0.65; }
/* Stage-peak sub-line on wireline numerics (e.g. Line Speed / Tension max) */
.lo-num-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  color: var(--text-muted); line-height: 1;
}
/* Click-to-edit field-reported pumpdown volume. */
.lo-wlvol { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lo-wlvol:hover { color: var(--text-secondary, #b7c6da); }
.lo-wlvol-pen { opacity: 0.5; font-size: 0.9em; margin-left: 1px; }
.lo-wlvol-empty { color: #5aa9ff; opacity: 0.85; }
.lo-wlvol-empty:hover { opacity: 1; color: #7bbcff; }
/* Multi-total cells (e.g. Prop Conc — blender / inline / screw) */
.lo-num-wide { grid-column: span 2; }
/* Primary KPIs (Treating Pressure / Slurry Rate / Prop Conc) dominate the strip */
.lo-num-primary { grid-column: span 2; }
.lo-num-chem .lo-num-val { font-size: 27px; }   /* chems read compact */
/* Secondary stats — small, muted, stacked, anchored to the card bottom */
.lo-num-stat { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); white-space: nowrap; letter-spacing: 0.3px; }
/* Totals flow as a wrapping ROW (Dean): three sum lines stacked vertically clipped
   the third (Belt) at the card bottom — let them share lines and wrap instead. */
.lo-num-totals { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; margin-top: 3px; padding-top: 3px; border-top: 1px solid var(--border); }
.lo-num-tline { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-secondary); white-space: nowrap; }
.lo-num-tline i { font-style: normal; color: var(--text-muted); margin-right: 5px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; }
.lo-num-tline small { color: var(--text-muted); font-size: 8px; margin-left: 1px; }
/* "+ Add" tile in the numeric grid */
.lo-num-add {
  border: 1px dashed var(--border); border-radius: 6px; background: transparent;
  color: var(--text-muted); cursor: pointer; min-height: 60px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600;
  letter-spacing: 0.4px; display: flex; align-items: center; justify-content: center;
}
.lo-num-add:hover { border-color: var(--accent, #2d6cdf); color: var(--text-secondary); background: var(--bg-hover, rgba(255,255,255,0.03)); }

/* PRD Plot Preferences modal */
.lo-prd-prefs-card { max-width: 640px; width: 95vw; }
.lo-prd-rowhead, .lo-prd-row {
  display: grid; grid-template-columns: 22px 24px 1fr 92px 58px 88px 22px; gap: 6px; align-items: center;
}
.lo-prd-axhead, .lo-prd-axisrow {
  display: grid; grid-template-columns: 1fr 62px 84px 84px; gap: 6px; align-items: center;
}
.lo-prd-rowhead, .lo-prd-axhead {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-muted); padding: 2px 0 4px;
}
.lo-prd-row { padding: 3px 0; }
.lo-prd-row + .lo-prd-row { border-top: 1px solid var(--border); }
.lo-prd-row input[type="text"], .lo-prd-row input[type="number"], .lo-prd-row select,
.lo-prd-axisrow input, .lo-prd-axisrow select {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 10.5px; padding: 3px 5px; min-width: 0;
}
.lo-prd-color { width: 20px; height: 20px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; padding: 0; }
.lo-prd-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; }
.lo-prd-remove:hover { color: var(--danger, #e74c3c); }
.lo-prd-addrow { margin: 8px 0 4px; display: flex; align-items: center; gap: 12px; }
.lo-prd-addrow .lo-bind { flex: 1; max-width: none; }
.lo-prd-incl { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary); cursor: pointer; }
.lo-prd-autolbl { display: inline-flex; align-items: center; gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary); }
.lo-prd-axisrow { padding: 3px 0; }
.lo-prd-axisrow input:disabled { opacity: 0.4; }
.lo-prd-swatch-pop {
  position: fixed; z-index: 10002; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px; display: grid; grid-template-columns: repeat(8, 18px); gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.lo-notes-head {
  flex: 0 0 auto; padding: 8px 12px 4px; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
}
.lo-notes-hint { font-size: 9px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.lo-notes {
  flex: 1; min-height: 0; margin: 0 12px 12px; resize: none; padding: 10px 12px;
  background: var(--bg-primary, rgba(0,0,0,0.15)); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; line-height: 1.6;
}
.lo-notes:focus { outline: none; border-color: var(--accent, #2d6cdf); }

/* Live Ops Note Log — append-only shared pad log (replaced the local textarea) */
.lo-note-addrow { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; margin: 2px 12px 8px; }
.lo-note-scope {
  flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.4px; color: var(--text-primary); background: rgba(45,108,223,0.18);
  border: 1px solid var(--accent, #2d6cdf); border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.lo-note-scope.padwide { background: rgba(148,163,184,0.15); border-color: var(--border); color: var(--text-secondary); }
.lo-note-scope:disabled { opacity: 0.5; cursor: default; }
.lo-note-input {
  flex: 1; min-width: 0; padding: 7px 10px; background: var(--bg-primary, rgba(0,0,0,0.15));
  border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}
.lo-note-input:focus { outline: none; border-color: var(--accent, #2d6cdf); }
.lo-note-addbtn {
  flex: 0 0 auto; padding: 6px 14px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  font-weight: 700; color: #fff; background: var(--accent, #2d6cdf); border: none; border-radius: 6px; cursor: pointer;
}
.lo-note-addbtn:hover { filter: brightness(1.12); }
.lo-notes-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.lo-note-row {
  display: flex; align-items: baseline; gap: 8px; padding: 5px 8px; border-radius: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.5;
}
.lo-note-row:nth-child(odd) { background: rgba(255,255,255,0.03); }
.lo-note-ts { flex: 0 0 auto; color: var(--text-muted); font-size: 10px; }
.lo-note-user { flex: 0 0 auto; color: var(--text-secondary); font-size: 10px; font-weight: 600; }
.lo-note-chip {
  flex: 0 0 auto; font-size: 9px; font-weight: 700; letter-spacing: 0.3px;
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; color: var(--text-primary);
}
.lo-note-chip-pad { color: var(--text-muted); border-style: dashed; }
.lo-note-stg { flex: 0 0 auto; color: #5fd6e6; font-size: 10px; font-weight: 600; }
.lo-note-text { flex: 1; min-width: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.lo-note-del { flex: 0 0 auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 0 2px; }
.lo-note-del:hover { color: #ef6a6a; }
.lo-notes-hint.err { color: #ef6a6a; }

/* Step vs Design Volumes pane */
.lo-volumes { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.lo-vol-stage {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px; color: var(--text-primary); margin-bottom: 14px;
}
.lo-vol { margin-bottom: 16px; max-width: 660px; }
.lo-vol-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 5px; font-family: 'JetBrains Mono', monospace;
}
.lo-vol-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-secondary);
}
.lo-vol-nums { font-size: 12px; color: var(--text-primary); white-space: nowrap; }
.lo-vol-nums small { font-size: 9px; color: var(--text-muted); }
.lo-vol-track { height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; }
.lo-vol-fill { height: 100%; border-radius: 6px; transition: width 0.3s ease; }
.lo-vol-note { font-size: 9.5px; font-style: italic; color: var(--text-muted); margin-top: 8px; }

/* Treatment Schedule pane (read-only, in-tab) */
.lo-tabpane[data-lopane="schedule"] { padding: 10px 12px; }
/* Diagnostics button — subtle tinted control, not a bright filled-blue button
   (overrides the global .trim-btn.armed accent fill while it's active). */
#lo-prd-diag, #lo-prd-diag-settings-btn {
  background: rgba(90,120,255,0.10); border-color: rgba(90,120,255,0.28); color: #aebdd4; box-shadow: none; }
#lo-prd-diag:hover, #lo-prd-diag-settings-btn:hover { border-color: rgba(120,160,255,0.45); color: #fff; }
#lo-prd-diag.armed {
  background: rgba(90,120,255,0.15); border-color: rgba(90,120,255,0.40); color: #fff; box-shadow: none; }
.lo-sched-body-tab { flex: 1; min-height: 0; min-width: 0; overflow: auto; }
/* Treatment schedule table is wide → let it scroll horizontally instead of clipping */
.lo-sched-body-tab .sched-table-wrap { max-width: 100%; overflow-x: auto; }
.lo-tabpane[data-lopane="schedule"] { min-width: 0; }

.lo-sched-card { max-width: 1100px; width: 92vw; }
.lo-sched-toolbar { margin-bottom: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); }

/* Idle (no-live-data) well cards in the strip */
.lo-card-idle { opacity: 0.72; }
.lo-card-idle .lo-card-mid { justify-content: center; }
.lo-card-nodata { font-size: 9.5px; color: var(--text-muted); font-style: italic; }

/* Left panel — Pad Overview summary */
/* ── Pad Overview rail — dark glass control panel, matched to the well cards ── */
/* Pad summary — key/value rows inside a subtle glass card */
.lo-sum {
  margin: 8px 4px; padding: 2px 11px;
  background: rgba(10,16,28,0.42); border: 1px solid rgba(122,152,193,0.14); border-radius: 9px;
}
.lo-sum-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0;
  font-family: 'JetBrains Mono', monospace; border-bottom: 1px solid rgba(122,152,193,0.10);
}
.lo-sum-row:last-child { border-bottom: none; }
.lo-sum-k { color: var(--lo-mut, #8294ad); text-transform: uppercase; font-size: 9px; font-weight: 600;
  letter-spacing: 0.7px; align-self: center; }
.lo-sum-v { color: #e7eef8; font-weight: 600; font-size: 12px; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Emphasis on the live-state values */
.lo-sum-row[data-k="streaming"] .lo-sum-v,
.lo-sum-row[data-k="stage"] .lo-sum-v,
.lo-sum-row[data-k="focused"] .lo-sum-v { color: var(--lo-cyan, #2cc3ec); }
.lo-sum-note {
  margin: 6px 4px 8px; padding: 9px 11px; font-size: 9.5px; font-style: italic;
  color: var(--lo-mut, #8294ad); line-height: 1.55;
  background: rgba(255,255,255,0.025); border-radius: 8px;
}
/* Buttons — scoped to the rail so the global .trim-btn is untouched */
.lo-rail .trim-btn {
  height: 36px; padding: 0 12px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; transition: all .14s ease;
}
.lo-rail .trim-btn.primary {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid rgba(90,170,255,0.55); color: #fff;
  box-shadow: 0 2px 10px rgba(59,130,246,0.25);
}
.lo-rail .trim-btn.primary:hover {
  filter: none; border-color: rgba(120,190,255,0.8); box-shadow: 0 3px 15px rgba(59,130,246,0.42);
}
.lo-rail .trim-btn:not(.primary) {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(122,152,193,0.22); color: #cdd9ea;
}
.lo-rail .trim-btn:not(.primary):hover {
  border-color: rgba(44,195,236,0.6); color: #fff; box-shadow: 0 0 12px rgba(44,195,236,0.18);
}
.lo-sum-launch { width: calc(100% - 8px); margin: 8px 4px 10px; }
.lo-sum-report { padding: 0 4px 10px; border-bottom: 1px solid rgba(58,88,130,0.32); margin-bottom: 8px; }
.lo-sum-genreport { width: 100%; }
/* Cutoff dropdown — dark, no default white select chrome */
.lo-gen-asof {
  width: 100%; height: 34px; margin-top: 7px; padding: 0 28px 0 11px; border-radius: 7px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #dbe6f3; cursor: pointer;
  background-color: rgba(255,255,255,0.05); border: 1px solid rgba(122,152,193,0.22);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238294ad' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.lo-gen-asof:hover { border-color: rgba(44,195,236,0.5); }
.lo-gen-asof:focus { outline: none; border-color: rgba(44,195,236,0.75); box-shadow: 0 0 0 2px rgba(44,195,236,0.15); }
.lo-gen-asof option { background: #0f1d35; color: #dbe6f3; }
.lo-gen-status { display: block; min-height: 13px; margin-top: 6px; font-size: 10px; color: var(--lo-mut, #8294ad); }
/* Well order — compact status rows with accent dot + focused highlight */
.lo-sum-wellorder { padding: 8px 6px 4px; }
.lo-sum-woh { font-size: 9px; text-transform: uppercase; letter-spacing: 0.7px;
  font-family: 'JetBrains Mono', monospace; color: var(--lo-mut, #8294ad); margin-bottom: 6px; }
.lo-sum-wo-row {
  display: block; padding: 6px 7px 7px; border-radius: 7px; border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.lo-sum-wo-row:hover { background: rgba(255,255,255,0.045); }
.lo-sum-wo-row.lo-wo-active {
  background: rgba(59,130,246,0.13); border-color: rgba(90,170,255,0.30);
  box-shadow: inset 2px 0 0 0 rgba(90,170,255,0.85);
}
.lo-wo-head { display: flex; align-items: center; gap: 6px; }
.lo-sum-wo-name { display: flex; align-items: center; min-width: 0; font-size: 11px; color: #cdd9ea;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-sum-wo-name::before {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%;
  background: var(--lo-mut, #8294ad); margin-right: 8px;
}
.lo-sum-wo-row.lo-wo-active .lo-sum-wo-name { color: #fff; }
.lo-sum-wo-row.lo-wo-active .lo-sum-wo-name::before {
  background: var(--lo-cyan, #2cc3ec); box-shadow: 0 0 6px rgba(44,195,236,0.8);
}
.lo-wo-count { margin-left: auto; flex: 0 0 auto; font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 600; color: var(--lo-mut, #8294ad); }
.lo-sum-wo-row.lo-wo-active .lo-wo-count { color: var(--lo-cyan, #2cc3ec); }
.lo-sum-wo-btns { display: inline-flex; gap: 3px; flex: 0 0 auto; }
/* Per-well stage bar: done (green) · current (blue) · remaining (gray) */
.lo-wo-bar { display: flex; gap: 1px; height: 8px; margin-top: 6px; }
.lo-wo-seg { flex: 1 1 0; min-width: 0; height: 100%; border-radius: 1px; }
.lo-wo-done { background: #2e9e5b; }                                          /* green: frac done */
.lo-wo-wl { background: #3b82f6; box-shadow: 0 0 5px rgba(59,130,246,0.55); } /* blue: wireline done */
.lo-wo-rem { background: rgba(122,152,193,0.18); }                           /* gray: to do */
.lo-wo-lead { position: relative; }
/* CURRENT OPS marker on the focused well's leading stage */
.lo-sum-wo-row.lo-wo-active .lo-wo-lead::after {
  content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid #eaf4ff;
}
.lo-wo-btn { border: 1px solid rgba(122,152,193,0.22); background: rgba(255,255,255,0.04); color: #9fb1c6;
  border-radius: 5px; font-size: 9px; line-height: 1; padding: 4px 6px; cursor: pointer; transition: all .12s; }
.lo-wo-btn:disabled { opacity: 0.3; cursor: default; }
.lo-wo-btn:not(:disabled):hover { background: rgba(44,195,236,0.14); border-color: rgba(44,195,236,0.5); color: #fff; }

/* Numeric cells — setpoint line, error-flag badge, out-of-band shading */
.lo-num { cursor: pointer; position: relative; }
.lo-num:hover { border-color: rgba(120,160,255,0.35); box-shadow: 0 0 14px rgba(80,120,255,0.15); }
.lo-num-sp { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); }
.lo-num-flag {
  font-size: 8px; font-weight: 700; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 3px; padding: 0 3px; vertical-align: middle;
}
.lo-num-hi { background: rgba(231, 76, 60, 0.18); border-color: rgba(231, 76, 60, 0.55); }
.lo-num-lo { background: rgba(52, 152, 219, 0.18); border-color: rgba(52, 152, 219, 0.55); }

/* Numeric-cell config modal */
.lo-num-card { max-width: 440px; width: 92vw; }
.lo-cfg-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-primary);
}
.lo-cfg-k { flex: 0 0 70px; color: var(--text-secondary); font-size: 11px; }
.lo-cfg-row select.lo-bind { flex: 1; max-width: none; }
.lo-cfg-check { align-items: flex-start; }
.lo-cfg-check input { margin-top: 2px; }
.lo-cfg-pct { width: 60px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); padding: 4px 6px; font-family: 'JetBrains Mono', monospace; }
.lo-cfg-hint { font-size: 10px; color: var(--text-muted); line-height: 1.5; margin-top: 4px; }
.lo-cfg-text {
  flex: 1; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 12px; padding: 5px 7px;
}
.lo-cfg-text:focus { outline: none; border-color: var(--accent, #2d6cdf); }
.lo-cfg-sec {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-muted); border-top: 1px solid var(--border);
  padding-top: 10px; margin: 4px 0 12px;
}
/* 32-swatch color grid */
.lo-swatches { flex: 1; display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.lo-sw { height: 22px; border: 1px solid rgba(0,0,0,0.25); border-radius: 4px; cursor: pointer; padding: 0; }
.lo-sw.sel { outline: 2px solid var(--text-primary); outline-offset: 1px; }
/* numeric cell sub-line (setpoint + total) + plan label.
   NOTE: margin-top:auto springs this block to the card bottom, but when a card's
   content (label+value+stats+totals) is taller than the card it shoves the label
   off the TOP edge (clipped). Use a fixed gap so content always flows from the top. */
.lo-num-sub { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.lo-num-tot { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary); white-space: nowrap; }
.lo-num-subL { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.lo-num-max { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary); white-space: nowrap; }
.lo-sum-plan {
  margin: 8px 6px 0; padding: 8px; border: 1px dashed var(--border); border-radius: 5px;
  font-size: 9.5px; color: var(--text-muted); line-height: 1.5;
}
.lo-sum-plan b { color: var(--text-secondary); }

@media (max-width: 1100px) {
  .lo-side { flex-basis: 168px; }
  .lo-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ── Job Time Log (ICOP-as-source-of-record) ──────────────────────────────── */
.jtl-wellsel { display: flex; gap: 6px; flex-wrap: wrap; }
.jtl-wbtn {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  padding: 5px 12px; border-radius: 5px; cursor: pointer;
  background: rgba(15,25,50,0.55); color: var(--text-secondary);
  border: 1px solid rgba(120,140,180,0.22); transition: all .14s ease;
}
.jtl-wbtn:hover { border-color: rgba(120,160,255,0.5); color: var(--text-primary); }
.jtl-wbtn.active { background: rgba(59,130,246,0.22); border-color: rgba(120,160,255,0.7); color: #dbe6f3; }
.jtl-legend { display: inline-flex; gap: 12px; margin-left: auto; align-items: center; }
.jtl-leg { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.jtl-leg i, .jtl-chip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.jtl-summary { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.jtl-chip { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.jtl-chip b { color: var(--text-primary); }
.jtl-chip-flag { color: #f8b24a; }
.jtl-scope { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }

.jtl-tablewrap { overflow: auto; max-height: calc(100vh - 230px); }
.jtl-table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.jtl-table thead th {
  position: sticky; top: 0; z-index: 1; text-align: left;
  background: var(--bg-secondary); color: var(--text-muted);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.jtl-table th.num, .jtl-table td.num { text-align: right; }
.jtl-table td { padding: 6px 12px; border-bottom: 1px solid rgba(120,140,180,0.08); vertical-align: top; }
.jtl-row:hover td { background: rgba(120,160,255,0.05); }
.jtl-ts { color: var(--text-secondary); white-space: nowrap; }
.jtl-cum { color: var(--text-muted); }
.jtl-well { color: var(--text-primary); font-weight: 600; }
.jtl-act { color: var(--text-secondary); white-space: nowrap; }
.jtl-com { color: var(--text-secondary); }
.jtl-pill { display: inline-block; min-width: 44px; text-align: center; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.4px; }
.jtl-sub td { background: rgba(255,255,255,0.012); }
/* indent the ACT CODE cell (RIH / SET PLUG / POOH) to show wireline sub-rows nested,
   NOT the first cell — so the Well/Start column stays perfectly left-aligned. */
.jtl-sub .jtl-act { padding-left: 22px; position: relative; }
.jtl-sub .jtl-act::before { content: '└'; position: absolute; left: 8px; color: var(--text-muted); opacity: 0.5; }
.jtl-sub .jtl-pill { opacity: 0.78; }
.jtl-flagged td { background: rgba(248,150,74,0.07); }
.jtl-flag { color: #f8b24a; margin-left: 6px; cursor: help; }

/* ── Job Time Log — edit overlay UI ──────────────────────────────────────── */
.jtl-tag { display: inline-block; margin-right: 5px; font-weight: 700; }
.jtl-tag-add { color: #6fcf97; }
.jtl-tag-edit { color: #f2c94c; }
.jtl-added td { background: rgba(111,207,151,0.07); }
.jtl-edited td { background: rgba(242,201,76,0.06); }
.jtl-chip-edit { color: #f2c94c; }
.jtl-editcell { width: 30px; text-align: center; }
.jtl-rowedit {
  background: rgba(120,140,180,0.12); border: 1px solid rgba(120,140,180,0.25); color: var(--text-secondary);
  border-radius: 4px; width: 22px; height: 22px; cursor: pointer; font-size: 11px; line-height: 1; padding: 0;
}
.jtl-rowedit:hover { border-color: rgba(120,160,255,0.6); color: var(--text-primary); }
#jtl-editmode.active { background: rgba(242,201,76,0.18); border-color: rgba(242,201,76,0.55); color: #f2c94c; }

.jtl-modal-back {
  position: fixed; inset: 0; z-index: 6000; background: rgba(6,10,20,0.62);   /* above the Live Ops full-log modal (5000) */
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.jtl-modal {
  width: 520px; max-width: 94vw; background: var(--bg-secondary);
  border: 1px solid rgba(120,140,180,0.28); border-radius: 10px; box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  font-family: 'JetBrains Mono', monospace; color: var(--text-primary);
}
.jtl-modal-h { padding: 14px 18px; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.jtl-modal-b { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.jtl-modal-b label { display: flex; flex-direction: column; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
.jtl-modal-b input, .jtl-modal-b select, .jtl-modal-b textarea {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-primary);
  background: rgba(10,16,28,0.6); border: 1px solid rgba(120,140,180,0.25); border-radius: 5px; padding: 7px 9px;
}
.jtl-modal-b input:focus, .jtl-modal-b select:focus, .jtl-modal-b textarea:focus { outline: none; border-color: rgba(120,160,255,0.65); }
.jtl-modal-b textarea { resize: vertical; text-transform: none; }
.jtl-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.jtl-chk { flex-direction: row !important; align-items: center; gap: 8px !important; text-transform: none !important; font-weight: 600 !important; color: var(--text-secondary) !important; }
.jtl-chk input { padding: 0 !important; }
.jtl-modal-f { padding: 12px 18px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); }
.jtl-del { color: #e07b6f; border-color: rgba(224,123,111,0.4) !important; }
.jtl-del:hover { background: rgba(224,123,111,0.12); }

/* ── Live Ops — running Job Time Log panel (side rail, off the PRD) ───────── */
.lo-jtl { margin-top: 10px; }
.lo-jtl-empty { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); padding: 6px 2px; }
.lo-jtl-row {
  display: grid; grid-template-columns: 52px 42px 1fr auto auto; gap: 7px; align-items: center;
  padding: 4px 2px; border-bottom: 1px solid rgba(120,140,180,0.06);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
}
.lo-jtl-well { color: var(--text-secondary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-jtl-pill { text-align: center; color: #fff; font-size: 8.5px; font-weight: 700; letter-spacing: 0.3px; padding: 1px 0; border-radius: 3px; }
.lo-jtl-act { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-jtl-time { color: var(--text-secondary); }
.lo-jtl-dur { color: var(--text-muted); min-width: 30px; text-align: right; }
.lo-jtl-live { background: rgba(110,207,151,0.08); }
.lo-jtl-live .lo-jtl-well::before {
  content: '●'; color: #6fcf97; margin-right: 4px; font-size: 8px;
  animation: lo-jtl-pulse 1.8s ease-in-out infinite;
}
@keyframes lo-jtl-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Live Ops — full Job Time Log modal (double-click the running panel) ──── */
.lo-jtl { cursor: pointer; }
.lo-jtl-expand { float: right; color: var(--text-muted); font-size: 11px; }
.lo-jtl-mback {
  position: fixed; inset: 0; z-index: 5000; background: rgba(4,8,16,0.66);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px);
}
.lo-jtl-modal {
  width: 90vw; height: 86vh; display: flex; flex-direction: column;
  background: rgba(10,16,28,0.98); border: 1px solid rgba(120,140,180,0.3);
  border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,0.6); overflow: hidden;
}
.lo-jtl-mh {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg-secondary);
}
.lo-jtl-mtitle { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-primary); }
.lo-jtl-mwell { display: flex; gap: 6px; flex-wrap: wrap; }
.lo-jtl-mhint { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.lo-jtl-mclose {
  background: rgba(120,140,180,0.12); border: 1px solid rgba(120,140,180,0.25); color: var(--text-secondary);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1;
}
.lo-jtl-mclose:hover { border-color: rgba(224,123,111,0.6); color: #e07b6f; }
.lo-jtl-mbody { flex: 1; overflow: auto; }
.lo-jtl-mbody .jtl-table { width: 100%; }
.lo-jtl-mlive td { background: rgba(110,207,151,0.08); }

/* ── Job Time Log scrollbars — match each context ─────────────────────────── */
/* Live Ops full-log modal → ICOP blue-gradient bar (matches .lo-chem-numeric) */
.lo-jtl-mbody::-webkit-scrollbar { width: 10px; height: 10px; }
.lo-jtl-mbody::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(120,140,180,0.15); border-radius: 6px;
}
.lo-jtl-mbody::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(120,160,255,0.65), rgba(90,120,220,0.65));
  border: 1px solid rgba(180,210,255,0.25); border-radius: 6px; background-clip: padding-box;
}
.lo-jtl-mbody::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(145,185,255,0.9), rgba(110,145,240,0.9));
}
.lo-jtl-mbody::-webkit-scrollbar-corner { background: transparent; }
.lo-jtl-mbody { scrollbar-width: thin; scrollbar-color: rgba(120,160,255,0.6) rgba(255,255,255,0.04); }
/* Project-tab table → app canonical bar (matches sidebars/lists) */
.jtl-tablewrap::-webkit-scrollbar { width: 10px; height: 10px; }
.jtl-tablewrap::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.jtl-tablewrap::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-secondary); }
.jtl-tablewrap::-webkit-scrollbar-thumb:hover { background: #4a5568; }

/* ── Job Time Log — collapsible multi-line comment (perforation capture) ──── */
.jtl-com-c { cursor: pointer; }                       /* single click anywhere toggles */
.jtl-com-head { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.jtl-com-head::before { content: '\25B8\00a0'; color: #6a8bd0; }   /* ▸ */
.jtl-com-c.open .jtl-com-head::before { content: '\25BE\00a0'; }   /* ▾ */
.jtl-com-c.open .jtl-com-more { display: none; }
.jtl-com-more { color: #6a8bd0; font-weight: 700; }
.jtl-com-full {
  display: none; white-space: pre-line; margin: 5px 0 3px 14px; padding-left: 8px;
  border-left: 2px solid rgba(120,140,180,0.25); color: var(--text-secondary); line-height: 1.5;
}
.jtl-com-c.open .jtl-com-full { display: block; }

/* ════════════════════════════════════════════════════════════════════════
   FRACFOCUS ANALYSIS — well-based tool (js/fracfocus-analysis.js)
   Additive to the offset FracFocus card; reuses .co-header/.trim-btn/.wr-prod.
   ════════════════════════════════════════════════════════════════════════ */
.fa-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; margin-top: 8px; align-items: start; }
@media (max-width: 1100px) { .fa-layout { grid-template-columns: 1fr; } }

.fa-select, .fa-output { min-width: 0; }
.fa-section-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 6px;
}
.fa-soon {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
  padding: 1px 6px; margin-left: 6px; opacity: 0.8;
}

/* search bar */
.fa-search-bar { display: flex; gap: 6px; align-items: center; }
.fa-search-bar select, .fa-search-bar input {
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 4px; padding: 5px 8px; font-size: 12px; font-family: inherit;
}
.fa-search-bar input#fa-search-input { flex: 1; min-width: 0; }
.fa-search-bar .fa-state { width: 44px; text-transform: uppercase; text-align: center; }
.fa-search-status, .fa-sel-status, .fa-pull-status, .fa-report-status {
  font-size: 11px; color: var(--text-muted); margin-top: 4px; display: inline-block;
}
.fa-report-status a, .fa-search-status a { color: var(--accent); }

.fa-search-results {
  margin-top: 6px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary);
}
.fa-search-loading { padding: 10px; font-size: 11px; color: var(--text-muted); }
.fa-search-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.fa-search-row:last-child { border-bottom: none; }
.fa-search-row:hover { background: var(--bg-tertiary); }
.fa-search-row.added { opacity: 0.6; }
.fa-search-row-main { flex: 1; min-width: 0; }
.fa-search-row-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.fa-search-row-sub { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fa-search-row-act { font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.fa-search-row.added .fa-search-row-act { color: var(--text-muted); }

/* paste box */
.fa-paste {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 4px; padding: 7px 9px; font-size: 12px; font-family: 'JetBrains Mono', monospace;
}
.fa-paste-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }

/* selected chips */
.fa-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; max-height: 150px; overflow-y: auto; }

/* instant tally bar — proppant + fluid-system counts, computed client-side */
.fa-tally { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); padding: 10px 12px; margin-bottom: 12px; }
.fa-tally-head { font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.fa-tally-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-style: italic; }
.fa-tally-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.fa-tally-grp { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); width: 92px; flex-shrink: 0; }
.fa-tally-pill { font-size: 11.5px; color: var(--text-secondary); background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.fa-tally-pill b { color: var(--text-primary); margin-left: 3px; }
.fa-tally-pill.ceramic { border-color: rgba(74,139,213,0.5); }
.fa-tally-pill.resin { border-color: rgba(176,90,208,0.5); }
.fa-tally-pill.gel { border-color: rgba(217,164,65,0.5); }
.fa-tally-pill.slick { border-color: rgba(60,180,120,0.5); }
.fa-chips-empty { font-size: 11px; color: var(--text-muted); font-style: italic; }
.fa-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px;
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px;
  font-size: 11.5px; color: var(--text-primary); max-width: 240px;
}
.fa-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fa-chip-has { border-color: rgba(60,180,120,0.6); }
.fa-chip-none { opacity: 0.65; }
.fa-chip-err { border-color: rgba(220,90,90,0.6); }
.fa-chip-x {
  border: none; background: none; cursor: pointer; color: var(--text-muted);
  font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 50%;
}
.fa-chip-x:hover { color: var(--text-primary); background: rgba(220,90,90,0.2); }

.fa-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* results */
.fa-results { display: flex; flex-direction: column; gap: 12px; }
.fa-results-empty {
  padding: 30px 18px; text-align: center; font-size: 12px; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 8px;
}
.fa-well-card { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); padding: 12px 14px; }
.fa-well-head { display: flex; align-items: center; gap: 10px; }
.fa-well-titles { flex: 1; min-width: 0; }
.fa-well-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.fa-well-api { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.fa-note { font-size: 11px; color: var(--text-muted); font-style: italic; margin-top: 4px; }

/* proppant typing panel */
.fa-prop { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-tertiary); }
.fa-prop-empty { font-size: 11px; color: var(--text-muted); font-style: italic; }
.fa-prop-title { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-secondary); display: flex; justify-content: space-between; }
.fa-prop-total { color: var(--text-muted); font-weight: 600; }
.fa-prop-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; margin: 8px 0; background: var(--bg-secondary); }
.fa-prop-seg { display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 700; color: #fff; min-width: 2px; }
.fa-prop-seg.sand { background: #c9a14a; }
.fa-prop-seg.ceramic { background: #4a8bd5; }
.fa-prop-seg.resin { background: #b05ad0; }
.fa-prop-seg.unknown { background: #6a7585; }
.fa-prop-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.fa-prop-legend-cell { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }
.fa-prop-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.fa-prop-dot.sand { background: #c9a14a; }
.fa-prop-dot.ceramic { background: #4a8bd5; }
.fa-prop-dot.resin { background: #b05ad0; }
.fa-prop-dot.unknown { background: #6a7585; }
.fa-prop-legend-val { color: var(--text-muted); }
.fa-prop-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.fa-prop-badge { font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 999px; }
.fa-prop-badge.ceramic { background: rgba(74,139,213,0.18); color: #6fa8e8; border: 1px solid rgba(74,139,213,0.5); }
.fa-prop-badge.resin { background: rgba(176,90,208,0.18); color: #cf8de0; border: 1px solid rgba(176,90,208,0.5); }
.fa-prop-evlist { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.fa-prop-ev { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 10.5px; }
.fa-prop-ev-type { font-weight: 700; font-size: 8.5px; letter-spacing: 0.4px; padding: 1px 5px; border-radius: 3px; }
.fa-prop-ev-type.ceramic { background: rgba(74,139,213,0.25); color: #6fa8e8; }
.fa-prop-ev-type.resin_coated { background: rgba(176,90,208,0.25); color: #cf8de0; }
.fa-prop-ev-name { font-weight: 600; color: var(--text-primary); }
.fa-prop-ev-basis { color: var(--text-muted); font-style: italic; }
.fa-prop-ev-text { color: var(--text-secondary); flex-basis: 100%; padding-left: 4px; }

/* chemistry-by-purpose table */
.fa-well-chem { margin-top: 4px; }
.fa-disc-head { font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.fa-pp-tbl { width: 100%; font-size: 11.5px; margin-top: 4px; border-collapse: collapse; }
.fa-pp-tbl td { padding: 2px 8px 2px 0; vertical-align: top; }
.fa-pp-name { color: var(--text-primary); }
.fa-pp-val { text-align: right; white-space: nowrap; }
.fa-pp-sub { text-align: right; color: var(--text-muted); white-space: nowrap; }
.fa-purpose-row.clickable { cursor: pointer; }
.fa-purpose-row.clickable:hover .fa-pp-name { color: var(--accent); }
.fa-chev { display: inline-block; width: 12px; color: var(--text-muted); }
.fa-chev-sp { display: inline-block; width: 12px; }
.fa-trade-name { color: var(--text-muted); padding-left: 20px !important; }
.fa-trade-val { color: var(--text-muted); }

/* AI prompt + export */
.fa-ai { margin-top: 14px; }
.fa-ai-prompt {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 4px; padding: 7px 9px; font-size: 12px; font-family: inherit;
}
.fa-ai-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.fa-ai-note { font-size: 10.5px; color: var(--text-muted); font-style: italic; }

/* AI analysis result (CONTRACT §5.3 structured render) */
.fa-ai-result { margin-top: 10px; }
.fa-ai-banner { font-size: 12px; color: var(--text-secondary); padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary); }
.fa-ai-banner.err { color: #e08a8a; border-color: rgba(220,90,90,0.5); }
.fa-ai-elapsed { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: var(--bg-tertiary, rgba(255,255,255,0.06)); color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.fa-ai-q { font-size: 12px; color: var(--text-muted); font-style: italic; margin: 6px 0 4px; }
.fa-ai-q::before { content: "Q: "; font-style: normal; font-weight: 600; }
.fa-ai-answer { font-size: 13px; line-height: 1.5; color: var(--text-primary); white-space: normal; }
.fa-ai-answer.err { color: #e08a8a; }
.fa-ai-answer strong { color: var(--text-primary); font-weight: 600; }
.fa-allchem-head .fa-pp-name { font-weight: 600; }
.fa-chem-name { font-size: 12px; }
.fa-chem-cas { color: var(--text-muted); font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; margin-left: 6px; }
.fa-chem-purpose { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 8px; background: var(--bg-tertiary, rgba(255,255,255,0.06)); color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
/* ── Completion Intelligence workspace ──────────────────────────────────────── */
.ci-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 16px; }
.ci-views { display: flex; gap: 4px; background: var(--bg-tertiary, rgba(255,255,255,0.05)); padding: 3px; border-radius: 8px; }
.ci-view-tab { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 6px; border: none; background: transparent; color: var(--text-secondary); cursor: pointer; }
.ci-view-tab.active { background: var(--bg-secondary); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.ci-plays { display: flex; gap: 6px; }
.ci-play-tab { font-size: 12px; font-weight: 600; padding: 7px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; transition: all .12s; }
.ci-play-tab:hover { color: var(--text-primary); border-color: var(--accent, #4a90d9); }
.ci-play-tab.active { background: var(--accent, #4a90d9); border-color: var(--accent, #4a90d9); color: #fff; }
.ci-banner { font-size: 13px; color: var(--text-secondary); padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); }
.ci-banner.err { color: #e08a8a; border-color: rgba(220,90,90,0.5); }
.ci-spin { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--text-muted); border-top-color: transparent; border-radius: 50%; animation: fa-ai-spin 0.8s linear infinite; }
.ci-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); margin-bottom: 14px; }
.ci-sum-n { font-size: 34px; font-weight: 800; color: var(--text-primary); line-height: 1; display: flex; flex-direction: column; align-items: center; }
.ci-sum-n span { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 3px; }
.ci-sum-meta { flex: 1 1 200px; }
.ci-sum-play { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.ci-sum-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ci-mix { display: flex; flex-wrap: wrap; gap: 6px; }
.ci-chip { font-size: 11px; padding: 3px 9px; border-radius: 12px; background: var(--bg-tertiary, rgba(255,255,255,0.06)); color: var(--text-secondary); border: 1px solid var(--border); }
.ci-chip b { color: var(--text-primary); margin-left: 2px; }
.ci-chip.slick { border-color: rgba(63,185,80,.5); } .ci-chip.gel { border-color: rgba(217,164,65,.5); }
.ci-chip.ceramic { border-color: rgba(74,144,217,.5); } .ci-chip.resin { border-color: rgba(190,120,220,.5); }
.ci-card { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); padding: 12px 14px; margin-bottom: 14px; }
.ci-card-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 10px; }
.ci-card-h span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin-left: 6px; }
.ci-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .ci-two { grid-template-columns: 1fr; } }
.ci-dist-row { display: grid; grid-template-columns: 130px 1fr 200px; align-items: center; gap: 12px; margin: 7px 0; font-size: 12px; }
.ci-dist-label { color: var(--text-secondary); }
.ci-dist-track { position: relative; height: 10px; border-radius: 5px; background: var(--bg-tertiary, rgba(255,255,255,0.06)); }
.ci-dist-range { position: absolute; top: 0; height: 10px; border-radius: 5px; background: rgba(74,144,217,.30); }
.ci-dist-median { position: absolute; top: -2px; width: 3px; height: 14px; border-radius: 2px; background: #c8cdd6; transform: translateX(-1px); }
.ci-dist-val { color: var(--text-primary); text-align: right; font-variant-numeric: tabular-nums; }
.ci-dist-range-txt { color: var(--text-muted); font-size: 11px; }
.ci-bar-row { display: grid; grid-template-columns: 1fr 90px 32px; align-items: center; gap: 8px; margin: 4px 0; font-size: 12px; }
.ci-bar-name { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-bar-row.you .ci-bar-name { color: var(--text-primary); font-weight: 700; }
.ci-you-tag { font-size: 9px; font-weight: 700; letter-spacing: .05em; color: #fff; background: var(--accent, #4a90d9); padding: 1px 5px; border-radius: 8px; margin-left: 4px; }
.ci-bar-track { height: 8px; border-radius: 4px; background: var(--bg-tertiary, rgba(255,255,255,0.06)); }
.ci-bar-fill { height: 8px; border-radius: 4px; background: var(--text-muted); }
.ci-bar-row.you .ci-bar-fill { background: var(--accent, #4a90d9); }
.ci-bar-n { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ci-finds { display: flex; flex-wrap: wrap; gap: 6px; }
.ci-find { font-size: 11px; padding: 3px 9px; border-radius: 12px; border: 1px solid var(--border); color: var(--text-secondary); }
.ci-find b { margin-left: 3px; color: var(--text-primary); }
.ci-find.flag { border-color: rgba(74,144,217,.5); } .ci-find.watch { border-color: rgba(217,164,65,.5); }
.ci-find.positive { border-color: rgba(63,185,80,.5); } .ci-find.negative { border-color: rgba(220,90,90,.5); }
.ci-foot { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
/* AI interpretation card (cohort_intelligence) */
.ci-intel-card { border: 1px solid rgba(74,144,217,0.4); border-radius: 8px; background: linear-gradient(180deg, rgba(74,144,217,0.08), rgba(74,144,217,0.02)); padding: 13px 15px; margin-bottom: 14px; }
.ci-intel-head { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent, #4a90d9); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ci-intel-tag { font-weight: 600; font-size: 9px; letter-spacing: .03em; color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px; padding: 1px 7px; text-transform: none; }
.ci-intel-headline { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.35; margin-bottom: 6px; }
.ci-intel-sum { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.ci-intel-sub { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 9px 0 3px; }
.ci-intel-list { margin: 0; padding-left: 18px; }
.ci-intel-list li { font-size: 12px; color: var(--text-secondary); line-height: 1.45; margin: 2px 0; }
.ci-intel-list.cav li { color: var(--text-muted); }
.ci-intel-disc { font-size: 10px; color: var(--text-muted); margin-top: 9px; font-style: italic; }
/* Well Benchmark */
.ci-bench-grid { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
@media (max-width: 820px) { .ci-bench-grid { grid-template-columns: 1fr; } }
.ci-bench-toggle { float: right; margin-right: 22px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-tertiary, rgba(255,255,255,0.06)); color: var(--text-secondary); cursor: pointer; }
.ci-bench-toggle:hover { color: var(--text-primary); border-color: var(--accent, #4a90d9); }
.ci-welllist { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 8px; scrollbar-gutter: stable; }
.ci-intel-details { margin-top: 8px; }
.ci-intel-details summary { font-size: 11px; font-weight: 600; color: var(--accent, #4a90d9); cursor: pointer; letter-spacing: .02em; list-style-position: inside; }
.ci-intel-details[open] summary { margin-bottom: 4px; }
.ci-well-pick { padding: 7px 9px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; }
.ci-well-pick:hover { background: var(--bg-tertiary, rgba(255,255,255,0.05)); }
.ci-well-pick.sel { border-color: var(--accent, #4a90d9); background: rgba(74,144,217,0.10); }
.ci-wp-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.ci-wp-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.ci-empty, .ci-empty-detail { font-size: 12px; color: var(--text-muted); padding: 16px; }
.ci-bench-head { margin-bottom: 12px; }
.ci-bench-well { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.ci-bench-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ci-bench-row { display: grid; grid-template-columns: 130px 1fr 220px; align-items: center; gap: 12px; margin: 9px 0; font-size: 12px; }
.ci-you-mark { position: absolute; top: -3px; width: 4px; height: 16px; border-radius: 2px; background: #3fb950; box-shadow: 0 0 0 2px var(--bg-secondary); transform: translateX(-2px); }
.ci-op-mark { position: absolute; top: -2px; width: 3px; height: 14px; border-radius: 2px; background: #4a90d9; transform: translateX(-1px); }
.ci-top-mark { position: absolute; top: -2px; width: 3px; height: 14px; border-radius: 2px; background: #d9a441; transform: translateX(-1px); }
.ci-bench-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 12px; font-size: 11px; color: var(--text-muted); }
.ci-lg { display: inline-flex; align-items: center; gap: 5px; }
.ci-lg::before { content: ''; width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ci-lg.play::before { background: #c8cdd6; }
.ci-lg.op::before { background: #4a90d9; }
.ci-lg.top::before { background: #d9a441; }
.ci-lg.you::before { background: #3fb950; }
.ci-bench-note { font-size: 11px; color: #3fb950; margin: -4px 0 12px; }
.ci-bench-note.neutral { color: var(--text-secondary); margin: 0 0 8px; }
.ci-standings { font-size: 12px; color: var(--text-secondary); margin: 0 0 14px; padding: 7px 10px; border-radius: 6px; background: var(--bg-tertiary, rgba(255,255,255,0.05)); }
.ci-standings .ci-st-op { color: #3fb950; }
.ci-standings .ci-st-bench { color: #d9a441; }
/* Map view */
.ci-mapcanvas { height: calc(100vh - 340px); min-height: 480px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-secondary); }
.ci-map-controls { margin-bottom: 10px; }
.ci-map-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ci-map-row + .ci-map-row { margin-top: 6px; }
.ci-map-op { font-size: 11px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-muted); cursor: pointer; opacity: 0.55; }
.ci-map-op.active { opacity: 1; color: var(--text-secondary); }
.ci-map-op.cust.active { border-color: #3fb950; color: var(--text-primary); }
.ci-xlinks .ci-card-h { margin-bottom: 8px; }
.ci-xlink { font-size: 12px; padding: 5px 12px; margin-right: 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; }
.ci-xlink:hover { border-color: var(--accent, #4a90d9); color: var(--text-primary); }
.ci-map-clabel { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-right: 2px; }
.ci-map-metric { font-size: 11px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; }
.ci-map-metric.active { border-color: var(--accent, #4a90d9); color: var(--text-primary); background: var(--bg-tertiary, rgba(255,255,255,0.06)); }
.ci-map-legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.ci-mlg { display: inline-flex; align-items: center; gap: 5px; }
.ci-mlg-key { font-weight: 600; color: var(--text-secondary); }
.ci-lg-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.ci-lg-note { margin-left: auto; }
.ci-map-hl, .ci-map-layer { font-size: 11px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; }
.ci-map-hl.active { border-color: #3fb950; color: var(--text-primary); }
.ci-map-layer.active { border-color: var(--accent, #4a90d9); color: var(--text-primary); background: var(--bg-tertiary, rgba(255,255,255,0.06)); }
.ci-map-sep { display: inline-block; width: 1px; height: 16px; background: var(--border); margin: 0 4px; vertical-align: middle; }
.ci-map-findings { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary); }
.ci-mf-h { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 4px; }
.ci-mf-h span { text-transform: none; letter-spacing: 0; }
.ci-mf-list { margin: 0; padding-left: 16px; }
.ci-mf-list li { font-size: 12px; color: var(--text-secondary); line-height: 1.55; }
.ci-mf-empty { font-size: 12px; color: var(--text-muted); }
.ci-pctl { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: var(--accent, #4a90d9); color: #fff; margin: 0 4px; }
/* Chemistry Health Check */
.fa-health { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); }
.fa-hc-head { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--text-primary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.fa-hc-sub { font-weight: 400; font-size: 11px; color: var(--text-muted); }
.fa-hc-explain { margin-left: auto; font-size: 11px; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-tertiary, rgba(255,255,255,0.06)); color: var(--text-secondary); cursor: pointer; }
.fa-hc-explain:hover { border-color: var(--accent, #4a90d9); color: var(--text-primary); }
.fa-hc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 16px; }
.fa-hc-row { display: grid; grid-template-columns: 120px 1fr auto auto; align-items: baseline; gap: 6px; padding: 4px 8px; border-radius: 5px; font-size: 12px; border-left: 3px solid transparent; }
.fa-hc-row.ok { border-left-color: #3fb950; }
.fa-hc-row.watch { border-left-color: #d9a441; background: rgba(217,164,65,0.06); }
.fa-hc-row.flag { border-left-color: #4a90d9; background: rgba(74,144,217,0.06); }
.fa-hc-row.na { border-left-color: var(--border); opacity: .7; }
.fa-hc-label { color: var(--text-muted); text-transform: uppercase; font-size: 10px; letter-spacing: .03em; }
.fa-hc-val { color: var(--text-primary); font-weight: 600; }
.fa-hc-det { color: var(--text-muted); font-size: 11px; text-align: right; }
.fa-hc-icon { font-weight: 700; }
.fa-hc-row.ok .fa-hc-icon { color: #3fb950; }
.fa-hc-row.watch .fa-hc-icon { color: #d9a441; }
.fa-hc-row.flag .fa-hc-icon { color: #4a90d9; }
.fa-hc-row.na .fa-hc-icon { color: var(--text-muted); }
/* Review chips */
.fa-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fa-chip-btn { font-size: 11px; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; transition: border-color .12s, color .12s; }
.fa-chip-btn:hover:not(:disabled) { border-color: var(--accent, #4a90d9); color: var(--text-primary); }
.fa-chip-btn:disabled { opacity: .5; cursor: default; }
/* Confidence meters (categorical) */
.fa-ai-conf { margin: 10px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary); }
.fa-ai-conf-h { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.fa-confbar-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 12px; }
.fa-confbar-label { flex: 0 0 160px; color: var(--text-secondary); }
.fa-confbar { display: inline-flex; gap: 3px; }
.fa-confbar-seg { width: 22px; height: 8px; border-radius: 2px; background: var(--bg-tertiary, rgba(255,255,255,0.08)); }
.fa-confbar-seg.on.high { background: #3fb950; }
.fa-confbar-seg.on.med { background: #d9a441; }
.fa-confbar-seg.on.low { background: #e08a8a; }
.fa-confbar-lvl { font-weight: 600; font-size: 11px; min-width: 52px; }
.fa-confbar-lvl.high { color: #3fb950; }
.fa-confbar-lvl.med { color: #d9a441; }
.fa-confbar-lvl.low { color: #e08a8a; }
.fa-confbar-det { color: var(--text-muted); font-size: 11px; }
.fa-ai-spin {
  display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid var(--text-muted); border-top-color: transparent; border-radius: 50%;
  animation: fa-ai-spin 0.8s linear infinite;
}
@keyframes fa-ai-spin { to { transform: rotate(360deg); } }
.fa-ai-card { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); padding: 14px 16px; }
.fa-ai-disclaimer {
  font-size: 11px; font-weight: 600; color: #d9a441; background: rgba(217,164,65,0.12);
  border: 1px solid rgba(217,164,65,0.4); border-radius: 5px; padding: 6px 10px; margin-bottom: 10px;
}
.fa-ai-meta { font-size: 10.5px; color: var(--text-muted); margin-bottom: 10px; font-family: 'JetBrains Mono', monospace; }
.fa-ai-overall { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fa-ai-overall-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; padding: 4px 12px; border-radius: 999px; }
.fa-ai-overall-badge.hot { background: rgba(176,90,208,0.18); color: #cf8de0; border: 1px solid rgba(176,90,208,0.5); }
.fa-ai-overall-badge.warm { background: rgba(74,139,213,0.18); color: #6fa8e8; border: 1px solid rgba(74,139,213,0.5); }
.fa-ai-overall-badge.cool { background: rgba(120,135,150,0.18); color: var(--text-secondary); border: 1px solid var(--border); }
.fa-ai-overall-badge.na { background: rgba(120,135,150,0.12); color: var(--text-muted); border: 1px solid var(--border); }
.fa-ai-overall-just { font-size: 11.5px; color: var(--text-secondary); flex: 1; min-width: 200px; }
.fa-ai-sec { margin-top: 8px; border-top: 1px solid var(--border); }
.fa-ai-h { font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
/* Collapsible detail sections */
details.fa-ai-sec { margin-top: 0; }
details.fa-ai-sec > summary.fa-ai-h { cursor: pointer; list-style: none; padding: 8px 2px; margin-bottom: 0; display: flex; align-items: center; gap: 6px; user-select: none; }
details.fa-ai-sec > summary.fa-ai-h::-webkit-details-marker { display: none; }
details.fa-ai-sec > summary.fa-ai-h::before { content: '\25B8'; color: var(--text-muted); font-size: 9px; transition: transform .12s; }
details.fa-ai-sec[open] > summary.fa-ai-h::before { transform: rotate(90deg); }
details.fa-ai-sec > summary.fa-ai-h:hover { color: var(--text-secondary); }
.fa-ai-sec-body { padding: 0 2px 10px; }
/* Key Findings lead */
.fa-ai-kf { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--accent, #4a90d9); border-radius: 8px; background: rgba(74,144,217,0.05); }
.fa-ai-kf-h { font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 7px; }
.fa-kf-list { list-style: none; margin: 0; padding: 0; }
.fa-kf-item { display: flex; align-items: baseline; gap: 7px; padding: 3px 0; font-size: 12.5px; color: var(--text-primary); line-height: 1.45; }
.fa-kf-bullet { color: var(--accent, #4a90d9); font-weight: 700; }
.fa-kf-text { flex: 1; }
.fa-kf-more { font-size: 11px; color: var(--text-muted); margin-top: 5px; padding-left: 14px; }
.fa-ai-narr { font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); font-style: italic; margin: 0 0 6px 0; }
.fa-ai-fluid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fa-ai-fluid-class { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.fa-ai-prop-split { font-size: 11.5px; color: var(--text-muted); }
.fa-ai-ev { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.fa-conf { font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; }
.fa-conf.high { background: rgba(60,180,120,0.18); color: #5fcf9a; border: 1px solid rgba(60,180,120,0.5); }
.fa-conf.med { background: rgba(217,164,65,0.18); color: #d9a441; border: 1px solid rgba(217,164,65,0.45); }
.fa-conf.low { background: rgba(220,90,90,0.15); color: #e08a8a; border: 1px solid rgba(220,90,90,0.4); }
.fa-ai-tbl { width: 100%; font-size: 11.5px; border-collapse: collapse; margin-top: 4px; }
.fa-ai-tbl th { text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); padding: 3px 8px 3px 0; border-bottom: 1px solid var(--border); }
.fa-ai-tbl td { padding: 4px 8px 4px 0; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.fa-ai-tbl td:first-child { color: var(--text-primary); font-weight: 600; }
.fa-ai-basis { color: var(--text-muted); font-size: 10.5px; }
.fa-ai-list { margin: 0; padding-left: 18px; }
.fa-ai-list li { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.45; }
.fa-ai-obs-text { color: var(--text-primary); }
.fa-ai-dq-grp { margin-bottom: 5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; }
.fa-ai-dq-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); margin-right: 4px; }
.fa-ai-dq-item { font-size: 10.5px; color: var(--text-secondary); background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; }
.fa-export-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fa-report-title {
  flex: 1; min-width: 180px; background: var(--bg-tertiary); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: 4px; padding: 6px 9px; font-size: 12px; font-family: inherit;
}

/* ══════════════════════════════════════════════════════════════════════
   WELL INVENTORY (mode-inventory) — customer-scoped master well table
   (docs/well-inventory/CONTRACT.md, Phase 1 UI). Theme-variable driven so
   both dark (default, --icop tokens) and light (legacy overrides) work. */
.mode-inventory { width: 100%; height: 100%; display: none; position: relative; overflow: hidden; }
.mode-inventory.visible { display: flex; }
body:not(.theme-light) .mode-inventory { background: var(--icop-bg-wash); }
.inv-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.inv-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
body:not(.theme-light) .inv-toolbar {
  background: var(--icop-panel); border-bottom-color: var(--icop-border-faint);
}
.inv-search {
  flex: 0 1 260px; min-width: 170px;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: var(--icop-radius-sm, 6px); padding: 6px 10px; font-size: 12px; font-family: inherit;
}
.inv-search:focus { outline: none; border-color: var(--accent); }
.inv-select {
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: var(--icop-radius-sm, 6px); padding: 6px 8px; font-size: 11.5px; max-width: 150px;
}
.inv-chiprow { display: inline-flex; gap: 4px; }
.inv-chipbtn {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 999px; padding: 4px 10px; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.inv-chipbtn:hover { color: var(--text-primary); border-color: var(--icop-border-strong, var(--accent)); }
.inv-chipbtn.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.inv-chipbtn.inv-personal.active { background: #8a6d1f; border-color: #b98f2a; }
.inv-summary {
  margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--text-muted); letter-spacing: 0.5px; white-space: nowrap;
}

.inv-table-scroll { flex: 1; overflow: auto; padding: 0 0 24px; }
.inv-loading { padding: 26px 18px; font-size: 12px; color: var(--text-muted); font-style: italic; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inv-table th {
  position: sticky; top: 0; z-index: 2; text-align: left; cursor: pointer; user-select: none;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted);
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 8px 10px; white-space: nowrap;
}
body:not(.theme-light) .inv-table th { background: #101a2c; border-bottom-color: var(--icop-border-faint); }
.inv-table th:hover { color: var(--text-primary); }
.inv-table th.sorted { color: var(--accent); }
.inv-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border); color: var(--text-secondary);
  vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
body:not(.theme-light) .inv-table td { border-bottom-color: rgba(58,88,130,0.18); }
.inv-table tbody tr { cursor: pointer; }
.inv-table tbody tr:hover td { background: rgba(59,130,246,0.07); }
.inv-table tbody tr.selected td { background: rgba(59,130,246,0.14); }
.inv-table td.inv-name { color: var(--text-primary); font-weight: 600; }
.inv-mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.inv-status { text-transform: capitalize; }
.inv-empty-row { text-align: center; font-style: italic; color: var(--text-muted); padding: 22px !important; }
.inv-alias-dot {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
  color: #d3a53c; border: 1px solid rgba(211,165,60,0.55); border-radius: 3px;
  padding: 0 3px; margin-left: 4px; vertical-align: 1px;
}

/* Relationship badges — distinct color per relationship (contract enum) */
.inv-rel-badge {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; border-radius: 999px; padding: 2px 8px;
  border: 1px solid transparent;
}
.inv-rel-operated  { color: #77b2ff; background: rgba(59,130,246,0.14);  border-color: rgba(59,130,246,0.5); }
.inv-rel-nonop     { color: #6fdca4; background: rgba(46,204,113,0.12);  border-color: rgba(46,204,113,0.45); }
.inv-rel-monitored { color: #9fb1c6; background: rgba(130,148,173,0.13); border-color: rgba(130,148,173,0.42); }
.inv-rel-divested  { color: #c99ad6; background: rgba(155,89,182,0.14);  border-color: rgba(155,89,182,0.45); }
body.theme-light .inv-rel-operated  { color: #1d4ed8; }
body.theme-light .inv-rel-nonop     { color: #047857; }
body.theme-light .inv-rel-monitored { color: #475569; }
body.theme-light .inv-rel-divested  { color: #7e22ce; }

/* Data-presence chips (F/W/S) — derived live, dim = absent */
.inv-pres-cell { font-family: 'JetBrains Mono', monospace; }
.inv-pres {
  display: inline-block; width: 18px; text-align: center; font-size: 9.5px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted);
  margin-right: 3px; padding: 1px 0; opacity: 0.45;
}
.inv-pres.has { opacity: 1; color: #5fd0e6; border-color: rgba(95,208,230,0.55); background: rgba(44,195,236,0.10); }
.inv-pres.pending { opacity: 0.6; border-style: dashed; width: auto; padding: 1px 6px; }
body.theme-light .inv-pres.has { color: #0e7490; }
.inv-pres-drawer .inv-pres { width: auto; padding: 2px 8px; }

.inv-proj-chip {
  display: inline-block; font-size: 10px; color: var(--text-secondary);
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; margin-right: 4px;
}
.inv-dim { color: var(--text-muted); }

.inv-fav-btn {
  background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1;
  color: var(--text-muted); padding: 2px 4px;
}
.inv-fav-btn:hover { color: #e8b64a; }
.inv-fav-btn.active { color: #e8b64a; }

/* Toast */
.inv-toast {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--icop-panel-solid, #101a2c); border: 1px solid var(--icop-border, var(--border));
  color: var(--text-primary); font-size: 12px; border-radius: 8px; padding: 8px 16px;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 40;
  box-shadow: var(--icop-shadow, 0 8px 28px rgba(0,0,0,0.5));
}
.inv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.inv-toast.error { border-color: rgba(231,76,60,0.7); color: #f0a094; }
body.theme-light .inv-toast { background: #fff; }
body.theme-light .inv-toast.error { color: #b91c1c; }

/* Detail / edit drawer */
.inv-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  background: var(--bg-secondary); border-left: 1px solid var(--border);
  transform: translateX(102%); transition: transform .2s ease; z-index: 30;
  display: flex; flex-direction: column;
}
body:not(.theme-light) .inv-drawer {
  background: linear-gradient(158deg, #121d31 0%, #0d1525 100%);
  border-left-color: var(--icop-border);
  box-shadow: -12px 0 34px rgba(0,0,0,0.45);
}
.inv-drawer.open { transform: translateX(0); }
.inv-drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 700; color: var(--title-strong);
}
.inv-drawer-head .inv-rel-badge { vertical-align: 2px; margin-left: 6px; }
.inv-drawer-x {
  margin-left: auto; background: none; border: none; color: var(--text-muted);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.inv-drawer-x:hover { color: var(--text-primary); }
.inv-drawer-body { flex: 1; overflow-y: auto; padding: 12px 14px 24px; }
.inv-drawer-sec {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
  margin: 16px 0 8px; padding-top: 10px; border-top: 1px solid var(--border);
}
.inv-hint-inline { text-transform: none; letter-spacing: 0; font-weight: 400; }
.inv-fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.inv-fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inv-fld label {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted);
}
.inv-lock { cursor: help; font-size: 9px; opacity: 0.8; }
.inv-ro { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-fld input, .inv-fld select {
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: var(--icop-radius-sm, 6px); padding: 6px 8px; font-size: 12px; font-family: inherit; min-width: 0;
}
.inv-fld input:focus, .inv-fld select:focus { outline: none; border-color: var(--accent); }
.inv-hint { font-size: 10px; color: var(--text-muted); line-height: 1.35; }
.inv-drawer-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.inv-trans-list { display: flex; flex-direction: column; gap: 8px; }
.inv-trans-row { font-size: 11.5px; color: var(--text-secondary); }
.inv-trans-row b { color: var(--text-primary); }
.inv-trans-note { font-size: 10.5px; color: var(--text-muted); font-style: italic; margin-top: 1px; }

/* Add Well modal */
.inv-modal-backdrop {
  position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(4,8,16,0.6); backdrop-filter: blur(2px);
}
.inv-modal {
  width: 400px; max-width: 94vw; max-height: 88vh; overflow-y: auto;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--icop-radius, 12px);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
body:not(.theme-light) .inv-modal {
  background: var(--icop-panel-solid, #101a2c);
  border-color: var(--icop-border); box-shadow: var(--icop-shadow, 0 8px 28px rgba(0,0,0,0.5));
}
.inv-modal-title { font-size: 14px; font-weight: 700; color: var(--title-strong); margin-bottom: 2px; }
  .inv-modal-title { display: flex; align-items: center; justify-content: space-between; }
  .inv-modal-x {
    background: none; border: none; cursor: pointer; line-height: 1;
    font-size: 20px; padding: 0 2px; color: var(--text-muted);
  }
  .inv-modal-x:hover { color: var(--text-primary); }

.inv-modal-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inv-add-msg { font-size: 11px; color: var(--danger); min-height: 14px; }
.inv-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Inventory buttons (np-btn is scoped to .np-modal, so the inventory has its own) */
.inv-btn {
  font-size: 11.5px; font-weight: 600; font-family: inherit;
  border-radius: var(--icop-radius-sm, 6px); padding: 6px 12px; cursor: pointer;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-secondary);
  transition: color .12s, border-color .12s, opacity .12s;
}
.inv-btn:hover { color: var(--text-primary); border-color: var(--icop-border-strong, var(--accent)); }
.inv-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.inv-btn.primary:hover { opacity: 0.88; }
.inv-btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }
.inv-btn.ghost { background: transparent; }

/* Well Inventory — State OG Lookup panel (reuses the global .np-op-* result/
   badge components from the project dialog; only scaffolding is new). */
.inv-modal.wide { width: 560px; }
.inv-lk-panel { display: flex; flex-direction: column; gap: 6px; }
.inv-lk-row { display: flex; gap: 6px; align-items: center; }
.inv-lk-row .inv-select { max-width: none; }
.inv-lk-input {
  flex: 1 1 auto; min-width: 0;
  background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: var(--icop-radius-sm, 6px); padding: 6px 8px; font-size: 11.5px; font-family: inherit;
}
.inv-lk-input:focus { outline: none; border-color: var(--accent); }
.inv-lk-panel .np-op-results { max-height: 300px; }
.inv-lk-rel-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--text-muted); margin-left: auto;
}
.inv-lk-rel-label .inv-select { padding: 3px 6px; font-size: 10.5px; }
.np-op-result.inv-lk-dup { opacity: 0.5; cursor: default; }
.np-op-result.inv-lk-dup .np-op-result-content { cursor: default; }
.inv-lk-dupchip {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text-muted); border: 1px solid var(--border); vertical-align: 1px;
}
.inv-lk-hint { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.inv-lk-hint-btn {
  background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.5); color: #77b2ff;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px;
  border-radius: 999px; padding: 3px 10px; cursor: pointer; transition: opacity .12s;
}
.inv-lk-hint-btn:hover:not(:disabled) { opacity: 0.85; }
.inv-lk-hint-btn:disabled { opacity: 0.45; cursor: default; }
body.theme-light .inv-lk-hint-btn { color: #1d4ed8; }
.inv-lk-hint-msg { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* Duplicate-API state of the smart-hint chip: amber "open record" action */
.inv-lk-hint-btn.dup {
  background: rgba(232,182,74,0.12); border-color: rgba(232,182,74,0.6); color: #e8b64a;
}
body.theme-light .inv-lk-hint-btn.dup { color: #92600a; }

/* ── PHASE 2 (Well Inventory): project picker + delete button ─────────── */
/* Picker rows: inventory relationship badge + county + IN PROJECT chip */
.np-well-item .npw-rel { flex-shrink: 0; }
.np-well-item .npw-county {
  font-size: 10px; color: var(--text-muted); flex-shrink: 0; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-well-item--inproj { opacity: 0.72; }
.np-well-item--inproj:hover { background: none; }
.npw-inproj {
  flex-shrink: 0; display: inline-block; padding: 1px 6px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text-muted); border: 1px solid var(--border); cursor: help;
}
/* "Add as" batch override in the picker header */
.npw-addas {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.5px;
  color: var(--text-muted); margin-left: 10px;
}
.npw-addas .np-input { padding: 3px 6px; font-size: 10.5px; width: auto; }
.np-newwell-hint { font-size: 10px; color: var(--text-muted); margin: 2px 0 4px; }
/* Batch relationship select in the registry results bulk bar */
.np-op-rel-label { display: inline-flex; align-items: center; gap: 4px; }
.np-op-rel-label .np-op-rel { padding: 2px 4px; font-size: 10px; width: auto; }
/* Danger variant for inventory buttons (Delete from Inventory) */
.inv-btn.danger {
  margin-left: auto; background: rgba(231,76,60,0.10);
  border-color: rgba(231,76,60,0.55); color: #f0a094;
}
.inv-btn.danger:hover { border-color: #e74c3c; color: #ff9a8c; }
body.theme-light .inv-btn.danger { color: #b91c1c; }

/* ── PHASE 1.5 polish: count strip, health filters, launch actions ────── */
/* Relationship count strip — live counts above the table; segments toggle
   the same relationship chips as the toolbar (one filter state). */
.inv-count-strip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
}
body:not(.theme-light) .inv-count-strip { background: var(--icop-panel); border-bottom-color: var(--icop-border-faint); }
.inv-count-dot { color: var(--text-muted); opacity: 0.6; }
.inv-count-seg {
  background: none; border: 1px solid transparent; border-radius: 999px;
  font: inherit; letter-spacing: 0.4px; color: var(--text-muted);
  padding: 2px 8px; cursor: pointer; transition: color .12s, border-color .12s, background .12s;
}
.inv-count-seg b { font-weight: 700; color: var(--text-secondary); margin-right: 2px; }
.inv-count-seg:hover { color: var(--text-primary); border-color: var(--icop-border-strong, var(--accent)); }
.inv-count-seg:hover b { color: var(--text-primary); }
.inv-count-seg.active.inv-count-operated  { color: #77b2ff; background: rgba(59,130,246,0.14);  border-color: rgba(59,130,246,0.5); }
.inv-count-seg.active.inv-count-nonop     { color: #6fdca4; background: rgba(46,204,113,0.12);  border-color: rgba(46,204,113,0.45); }
.inv-count-seg.active.inv-count-monitored { color: #9fb1c6; background: rgba(130,148,173,0.13); border-color: rgba(130,148,173,0.42); }
.inv-count-seg.active.inv-count-divested  { color: #c99ad6; background: rgba(155,89,182,0.14);  border-color: rgba(155,89,182,0.45); }
.inv-count-seg.active b { color: inherit; }
body.theme-light .inv-count-seg.active.inv-count-operated  { color: #1d4ed8; }
body.theme-light .inv-count-seg.active.inv-count-nonop     { color: #047857; }
body.theme-light .inv-count-seg.active.inv-count-monitored { color: #475569; }
body.theme-light .inv-count-seg.active.inv-count-divested  { color: #7e22ce; }

/* Data-health filter chips — teal accent to read "derived", not relationship */
.inv-chipbtn.inv-health.active { background: #0e6273; border-color: #22a3bd; }

/* Drawer launch-action row (navigation only — see the DESIGN FENCE comment
   in js/well-inventory.js; deliberately NO Live Ops action) */
.inv-actionrow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.inv-btn.inv-launch { font-size: 11px; padding: 5px 10px; }
.inv-btn.inv-launch:disabled { opacity: 0.4; cursor: not-allowed; }
.inv-btn.inv-launch:disabled:hover { color: var(--text-secondary); border-color: var(--border); }

/* Multi-membership project menu (anchored under the launch button) */
.inv-proj-menu {
  position: fixed; z-index: 200; min-width: 160px; padding: 4px;
  background: var(--icop-panel-solid, #101a2c); border: 1px solid var(--icop-border, var(--border));
  border-radius: 8px; box-shadow: var(--icop-shadow, 0 8px 28px rgba(0,0,0,0.5));
  display: flex; flex-direction: column;
}
body.theme-light .inv-proj-menu { background: #fff; }
.inv-proj-menu-item {
  background: none; border: none; text-align: left; cursor: pointer;
  font-size: 12px; color: var(--text-secondary); padding: 6px 10px; border-radius: 6px;
}
.inv-proj-menu-item:hover { background: rgba(59,130,246,0.12); color: var(--text-primary); }

/* Data presence spelled out as rows in the drawer */
.inv-pres-rows { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--text-secondary); }
.inv-pres-row { display: flex; align-items: center; gap: 6px; }
.inv-pres-row .inv-pres { margin-right: 2px; }
.inv-pres-label { font-weight: 600; color: var(--text-primary); }
.inv-pres-avail { color: #5fd0e6; }
body.theme-light .inv-pres-avail { color: #0e7490; }

/* Project Membership chips are buttons now (click = open that project) */
.inv-proj-chip-btn { cursor: pointer; font-family: inherit; transition: color .12s, border-color .12s; }
.inv-proj-chip-btn:hover { color: var(--text-primary); border-color: var(--icop-border-strong, var(--accent)); }

/* "View on Map" temporary highlight ring (Leaflet circleMarker className) */
.inv-map-ping { animation: invMapPing 1.5s ease-in-out infinite; }
@keyframes invMapPing {
  0%   { stroke-opacity: 0.95; stroke-width: 3; }
  50%  { stroke-opacity: 0.25; stroke-width: 6; }
  100% { stroke-opacity: 0.95; stroke-width: 3; }
}

/* Two-category rail (Dean's model): PAD WELLS section (operated + non-op,
   role=subject) caps like the old operated list then scrolls; OFFSETS keeps
   its fill-remaining behavior via the existing .pw-group--offset rules. */
.pw-group--pad { flex: 0 0 auto; }
#proj-well-list-pad {
  max-height: calc(var(--pw-well-row) * 8);
  overflow-y: auto;
}
/* Well-attribute badge (inventory relationship) on rail rows — rides inline
   with the api line, scaled down from the inventory table badge. */
.well-row .wr-rel { font-size: 7.5px; padding: 1px 6px; vertical-align: 1px; margin-left: 4px; }

  .wr-api-line { display: flex; align-items: center; gap: 6px; }

  /* formations dropdown type-to-filter */
  .fm-search-row { padding: 4px 8px 6px; position: sticky; top: 0; }
  .fm-search {
    width: 100%; box-sizing: border-box; padding: 4px 8px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 4px;
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 11px;
  }
  .fm-search:focus { outline: none; border-color: var(--accent); }

  .land-card .lc-rel-wrap { display: inline-flex; align-items: center; gap: 5px; }
  .land-card .lc-rel-lbl {
    font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.4px;
    text-transform: uppercase; color: #8899aa; white-space: nowrap;
  }

  /* In-app transition-note prompt (replaces native prompt()) */
  .inv-note-back {
    position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center;
    background: rgba(4, 8, 18, 0.62);
  }
  .inv-note-modal {
    width: 440px; max-width: 92vw; padding: 18px 20px 16px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  }
  .inv-note-title { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
  .inv-note-rel { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 6px 0 12px; }
  .inv-note-lbl { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
  .inv-note-input {
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-primary); font-family: inherit; font-size: 13px;
  }
  .inv-note-input:focus { outline: none; border-color: var(--accent); }
  .inv-note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
  .inv-note-cancel, .inv-note-ok {
    padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  }
  .inv-note-cancel { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
  .inv-note-ok { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
  .inv-note-ok:hover { opacity: 0.92; }

  .inv-confirm-body { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin: 8px 0 2px; }
  .inv-confirm-body div:empty { height: 6px; }
  .inv-note-ok.inv-note-danger { background: var(--danger, #e74c3c); border-color: var(--danger, #e74c3c); }

/* ── EDIT-FIRST current-wells section (Dean): the project's wells at the TOP
   of the Edit Project Wells dialog. Appended tightly-scoped to avoid colliding
   with concurrent index.html/styles.css edits. All selectors are .np-cur* or
   #np-current-wrap-scoped so they touch nothing else. */
#np-current-wrap {
  border: 1px solid var(--border); border-radius: 6px;
  background: rgba(58,123,213,0.05); padding: 8px 10px 10px; margin-bottom: 4px;
}
.np-cur-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.np-cur-title .np-count {
  color: #fff; background: var(--accent); font-weight: 700;
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  padding: 1px 7px; border-radius: 8px;
}
.np-cur-sub { margin-top: 6px; }
.np-cur-sub-label {
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted);
  padding: 2px 2px 4px;
}
.np-cur-sub-label .np-count { color: var(--accent); font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.np-cur-list { max-height: 200px; overflow-y: auto; padding-right: 2px; }
.np-cur-list::-webkit-scrollbar { width: 8px; }
.np-cur-list::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 4px; }
.np-cur-item {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px; margin-bottom: 2px; border-radius: 4px;
  background: var(--bg-secondary);
}
.np-cur-item:hover { background: rgba(58,123,213,0.10); }
.np-cur-item .npw-name { font-size: 11.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.np-cur-item .npw-api { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; color: var(--accent); flex-shrink: 0; }
.np-cur-item .npw-rel { flex-shrink: 0; }
.np-cur-item .npw-county { font-size: 9.5px; color: var(--text-muted); flex-shrink: 0; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npw-cur-role {
  flex-shrink: 0;
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 3px 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  cursor: pointer; outline: none;
}
.npw-cur-role:focus { border-color: var(--accent); }
.np-cur-remove {
  flex-shrink: 0; width: 20px; height: 20px; line-height: 1;
  background: none; border: 1px solid transparent; border-radius: 4px;
  color: var(--text-muted); font-size: 15px; cursor: pointer; padding: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.np-cur-remove:hover { color: var(--danger, #e74c3c); border-color: var(--danger, #e74c3c); background: rgba(231,76,60,0.10); }

/* ── PAD GEOMETRY workspace (js/pad-geometry.js). Appended tightly-scoped to
   avoid colliding with concurrent index.html/styles.css edits — every selector
   is .pg-* or #pg-* and touches nothing else. Dark-theme tokens only. */
#pg-workspace { height: 100%; overflow-y: auto; }
.pg-controls {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.pg-tabs { display: flex; gap: 4px; }
.pg-tab {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 5px 14px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
}
.pg-tab.active { background: var(--bg-tertiary); color: var(--text-primary); }
.pg-offtoggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-secondary); cursor: pointer; user-select: none;
}
.pg-status { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.pg-layout { display: flex; gap: 14px; align-items: flex-start; }
.pg-rail { flex: 0 0 300px; min-width: 240px; display: flex; flex-direction: column; gap: 12px; }
.pg-rail-sec { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; background: var(--bg-secondary); }
.pg-rail-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted);
}
.pg-rail-title .pg-count { color: var(--accent); }
.pg-rail-hint { font-size: 9px; letter-spacing: 0.4px; text-transform: none; color: var(--text-muted); font-weight: 400; margin-left: auto; }
.pg-rail-empty, .pg-rail-note { font-size: 10.5px; color: var(--text-muted); padding: 2px 0; }
.pg-rail-note { margin-top: 6px; font-style: italic; }
.pg-well-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.pg-well-row.pg-dim { opacity: 0.45; }
.pg-well-row .pg-well-chk { margin: 0; flex-shrink: 0; cursor: pointer; }
.pg-chip {
  flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid transparent; box-sizing: border-box;
}
.pg-chip-empty { border-color: var(--border); background: transparent; }
.pg-well-name {
  flex: 1; min-width: 0; font-size: 11.5px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pg-muted, .pg-well-row.pg-muted .pg-well-name { color: var(--text-muted); font-weight: 400; }
.pg-survey-sel {
  flex-shrink: 0; max-width: 130px;
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 4px; font-size: 10px; outline: none; cursor: pointer;
}
.pg-survey-sel:focus { border-color: var(--accent); }
.pg-main { flex: 1 1 auto; min-width: 0; }
.pg-caution {
  border: 1px solid var(--warning, #f39c12); border-radius: 6px;
  background: rgba(243,156,18,0.08); color: var(--warning, #f39c12);
  font-size: 11.5px; padding: 8px 12px; margin-bottom: 10px;
}
.pg-empty { font-size: 12px; color: var(--text-muted); padding: 24px 8px; }
.pg-slider-row { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; }
.pg-slider-label {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap;
}
.pg-slider-row input[type="range"] { flex: 1 1 auto; min-width: 120px; accent-color: var(--accent); }
.pg-slider-readout { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.pg-svg-wrap { border: 1px solid var(--border); border-radius: 6px; background: var(--bg-primary); }
.pg-svg-wrap svg { display: block; width: 100%; height: auto; }
.pg-table-wrap { margin-top: 12px; overflow-x: auto; }
/* Thin themed horizontal bar when the spacing table overflows (same canonical
   treatment as the app's other scrollers; light override mirrors the
   .project-sidebar precedent). */
.pg-table-wrap::-webkit-scrollbar { height: 8px; }
.pg-table-wrap::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.pg-table-wrap::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 4px; }
.pg-table-wrap::-webkit-scrollbar-thumb:hover { background: #4a5568; }
.pg-table-wrap { scrollbar-width: thin; scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
body.theme-light .pg-table-wrap::-webkit-scrollbar-track { background: rgba(15,23,42,0.06); }
body.theme-light .pg-table-wrap::-webkit-scrollbar-thumb { background: #8FA5C2; }
body.theme-light .pg-table-wrap { scrollbar-color: #8FA5C2 rgba(15,23,42,0.06); }
.pg-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pg-table th {
  text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted);
}
.pg-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.pg-table td:first-child { color: var(--text-primary); font-weight: 600; }
.pg-table tfoot td { border-bottom: none; font-size: 10.5px; font-style: italic; }
.pg-plan-wrap { position: relative; height: 640px; border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: var(--bg-primary); }
/* Orientation affordances (Dean: 3D opened mirrored vs the plan view) */
.pg-north-glyph {
  position: absolute; top: 10px; right: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
  color: var(--text-muted); background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px; cursor: help;
}
.pg3d-compass {
  position: absolute; top: 10px; right: 10px; width: 110px; height: 110px;
  pointer-events: none; z-index: 5;
  background: color-mix(in srgb, var(--bg-primary) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 50%;
}
/* 3D view fills the available workspace height (gun/plan keep their fixed
   640px .pg-plan-wrap — this rule is scoped to the 3D container only). The
   subtracted chrome ≈ workspace padding + co-header + tabs + 3D control bar +
   honesty note; min-height guards short viewports. pgInit3D reads
   clientHeight and the ResizeObserver re-fits when it grows. */
#pg-3d-container {
  width: 100%; height: calc(100vh - 250px); min-height: 560px; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden; position: relative;
}

/* ── PAD GEOMETRY additions (Dean feedback round 1): gun-barrel caption +
   Direct-column emphasis (the on-chart "N ft direct" labels are the table's
   Direct column, same left→right order). Scoped .pg-* only. */
.pg-gun-caption { font-size: 10.5px; color: var(--text-muted); padding: 6px 4px 0; line-height: 1.4; }
.pg-gun-caption b { color: var(--text-secondary); }
.pg-table tbody td:nth-child(4) { color: var(--text-primary); font-weight: 600; }

/* ── PAD GEOMETRY additions (Dean rounds 3+4): section-azimuth mode control,
   WSM provenance note, heel/toe slider end labels. Scoped .pg-* only. */
.pg-azmode-row { display: flex; align-items: center; gap: 12px; padding: 8px 0 2px; flex-wrap: wrap; }
.pg-azmode { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.pg-azbtn {
  background: transparent; color: var(--text-muted); border: none;
  border-right: 1px solid var(--border); padding: 4px 12px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.pg-azbtn:last-child { border-right: none; }
.pg-azbtn.active { background: var(--bg-tertiary); color: var(--text-primary); }
.pg-azbtn:disabled { opacity: 0.4; cursor: not-allowed; }
#pg-az-manual {
  width: 72px; padding: 3px 6px; background: var(--bg-tertiary);
  border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 3px; font-size: 11px;
}
/* WSM search-radius control ("within [15] mi") beside the SHmax mode button */
.pg-wsm-range-wrap { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
#pg-wsm-range {
  width: 52px; padding: 3px 6px; background: var(--bg-tertiary);
  border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 3px; font-size: 11px; margin: 0 2px;
}
.pg-az-info { font-size: 11px; color: var(--text-secondary); }
.pg-wsm-note {
  display: none; font-size: 11px; color: var(--text-muted);
  padding: 6px 0 0; line-height: 1.45;
}
.pg-wsm-note b { color: var(--text-secondary); }
.pg-slider-end {
  font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
  letter-spacing: 1.2px; color: var(--text-muted); white-space: nowrap; user-select: none;
}

  /* WSM contributing-records popover (Pad Geometry SHmax provenance) */
  .pg-wsm-details { color: var(--accent); cursor: pointer; text-decoration: underline dotted; margin-left: 4px; }
  .pg-wsm-pop {
    position: fixed; z-index: 4500; padding: 10px 12px; max-width: 460px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.45);
  }
  .pg-wsm-pop-title { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
  .pg-wsm-pop table { border-collapse: collapse; font-size: 11px; color: var(--text-primary); }
  .pg-wsm-pop th { text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.5px; color: var(--text-muted); padding: 2px 10px 4px 0; }
  .pg-wsm-pop td { padding: 2px 10px 2px 0; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
  .pg-wsm-pop-foot { margin-top: 6px; font-size: 9px; color: var(--text-muted); }

  .inv-formation { font-size: 10.5px; color: var(--text-secondary); letter-spacing: 0.2px; white-space: nowrap; }
  .inv-fm-analyst { color: var(--accent); font-weight: 700; margin-left: 2px; cursor: help; }

  /* Project chips colored by role: PAD WELL (subject) = solid accent fill so it
     reads at a glance; offset = plain ghost outline. Bumped specificity/contrast
     after the subtle first pass was invisible. */
  .inv-proj-chip.pad {
    background: var(--accent) !important; border-color: var(--accent) !important;
    color: #fff !important; font-weight: 700;
  }
  .inv-proj-chip.offset {
    background: transparent !important; border-color: var(--border) !important;
    color: var(--text-muted); font-weight: 400;
  }

/* ── Stage Layout & Stress Alignment (step-3 capstone) ─────────────────── */
.sl-note { font-size: 11.5px; color: var(--text-muted); font-style: italic; padding: 6px 0; }
.sl-head { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.sl-subhead { font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 6px; }
.sl-summary { margin-bottom: 10px; }
.sl-prov { font-size: 8.5px; color: var(--text-muted); font-weight: 400; }
.sl-warn { color: var(--warning); }
.sl-flag-likely { color: var(--danger); font-weight: 700; }
.sl-flag-none { color: var(--icop-green, #2ecc71); }
.sl-block { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; background: color-mix(in srgb, var(--bg-tertiary) 45%, transparent); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.sl-block-soft { background: none; border: none; padding: 6px 0; }
.sl-blocklist { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.sl-blockchip { font-size: 10.5px; color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 8%, transparent); border-radius: 10px; padding: 2px 9px; }
.sl-layout { display: block; width: 100%; height: auto; margin: 6px 0 4px; }
.sl-layout .sl-ax { font-family: 'JetBrains Mono', monospace; font-size: 9px; fill: var(--text-muted); }
.sl-layout .sl-wlbl { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700; fill: var(--text-secondary); }
.sl-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 2px; }
.sl-table th { text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); padding: 3px 8px; border-bottom: 1px solid var(--border); }
.sl-table td { padding: 4px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent); color: var(--text-primary); }
.sl-prior { font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin: 10px 0 2px; padding: 8px 10px; border-left: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sl-prior b { color: var(--text-primary); }
.sl-foot { font-size: 10px; color: var(--text-muted); line-height: 1.5; margin-top: 8px; }
.sl-next { font-size: 10.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.sl-next b { color: var(--accent); }

/* ── Wellbore Diagram (Construction tab right pane) ─────────────────────── */
.wbd-wrap { width: 100%; padding: 10px 12px; }
.wbd-head { margin-bottom: 6px; }
.wbd-title { font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 700; color: var(--title-strong); }
.wbd-api { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.wbd-sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-secondary); margin-top: 2px; }
.wbd-svg { display: block; width: 100%; height: auto; }
.wbd-svg .wbd-tick { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; fill: var(--text-muted); }
.wbd-svg .wbd-lbl { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; fill: var(--text-muted); }
.wbd-svg .wbd-shoe-lbl { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700; fill: var(--text-secondary); }
.wbd-svg .wbd-hole { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; fill: var(--text-muted); opacity: 0.8; }
.wbd-svg .wbd-perf { font-family: 'JetBrains Mono', monospace; font-size: 9px; fill: var(--accent); }
.wbd-foot { font-size: 9.5px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* ── Pad Requirements rollup (Treatment Schedule page, #design-padreq-panel) ──
   Read-only pad-wide procurement panel. Dark theme rides the shared
   .materials-* classes; the light-theme block below mirrors the
   #design-materials-panel treatment (alias, never rename). */
#design-padreq-body { padding: 10px 12px 14px; }
/* Laptop widths: the shared 260px grid minimum crams four cards and clips
   their tables — raise the floor so the panel wraps to 2 columns instead. */
#design-padreq-panel .materials-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
/* A section's table scrolls inside its own card rather than clipping, with
   the dark-console scrollbar (native light bar clashed at 4K). */
#design-padreq-panel .materials-section { overflow-x: auto; }
#design-padreq-panel .materials-section::-webkit-scrollbar { height: 9px; }
#design-padreq-panel .materials-section::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
#design-padreq-panel .materials-section::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-tertiary); }
#design-padreq-panel .materials-section::-webkit-scrollbar-thumb:hover { background: #4a5568; }
body.theme-light #design-padreq-panel .materials-section::-webkit-scrollbar-track { background: rgba(15,23,42,0.06); }
body.theme-light #design-padreq-panel .materials-section::-webkit-scrollbar-thumb { background: #8FA5C2; border-color: #F8FBFF; }
/* Long text cells (plug-type rosters, water item labels) wrap in this panel
   instead of forcing width — numbers stay nowrap. */
#design-padreq-panel .materials-section td.txt { white-space: normal; }
.padreq-cover {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary, #b8c4d6);
  background: rgba(74, 123, 213, 0.08);
  border: 1px solid var(--border-color, #2a3a52);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  line-height: 1.55;
}
.padreq-warn { color: var(--warning, #f39c12); font-weight: 600; }
.padreq-note {
  font-size: 10px;
  color: var(--text-muted, #8294ad);
  margin-top: 6px;
  line-height: 1.45;
}
.padreq-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
  font-size: 11px;
  color: var(--text-muted, #8294ad);
}
.padreq-controls label { display: flex; align-items: center; gap: 5px; }
.padreq-controls input {
  width: 56px;
  background: var(--bg-tertiary, #0b1220);
  border: 1px solid var(--border-color, #2a3a52);
  color: var(--text-primary, #e2e8f0);
  border-radius: 4px;
  padding: 3px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.padreq-sub td { font-size: 10px; color: var(--text-muted, #8294ad); }

/* light theme — mirrors the #design-materials-panel light rules */
body.theme-light #design-padreq-panel #design-padreq-body { background: #E7EEF7; }
body.theme-light #design-padreq-panel .materials-grid {
  background: #E7EEF7;
  padding: 10px;
  border-radius: 0;
  gap: 10px;
}
body.theme-light #design-padreq-panel .materials-section {
  background: #F8FBFF;
  border-color: #B8C7D9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 10px 12px 12px;
}
body.theme-light #design-padreq-panel .materials-section h4 {
  color: #ffffff;
  background: #1F3B63;
  margin: -10px -12px 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #12274A;
  border-radius: 4px 4px 0 0;
}
body.theme-light #design-padreq-panel .materials-section h4 .hdr-control,
body.theme-light #design-padreq-panel .materials-section h4 .hdr-control span {
  color: #D7E2F0 !important;
  font-weight: 400;
}
body.theme-light #design-padreq-panel .materials-section table thead th {
  background: #243f66;
  color: #ffffff;
  border-bottom: 1px solid #12274A;
  padding: 6px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}
body.theme-light #design-padreq-panel .materials-section tbody td {
  border-bottom-color: #D6DEE8;
  color: #0f172a;
}
body.theme-light #design-padreq-panel .materials-section tbody tr:nth-child(even) td {
  background: #EEF4FA;
}
body.theme-light #design-padreq-panel .materials-section tbody tr:hover td {
  background: #D7E2F0;
}
body.theme-light #design-padreq-panel .materials-section tr.totals-row td {
  background: #D7E2F0;
  color: #1F3B63;
  border-top: 2px solid #B8C7D9;
  font-weight: 700;
}
body.theme-light .padreq-cover { background: #F8FBFF; border-color: #B8C7D9; color: #1F3B63; }
body.theme-light .padreq-warn { color: #b45309; }
body.theme-light .padreq-note { color: #64748b; }
body.theme-light .padreq-controls { color: #64748b; }
body.theme-light .padreq-controls input { background: #ffffff; border-color: #B8C7D9; color: #0f172a; }
body.theme-light .padreq-sub td { color: #64748b; }
.padreq-ok { color: var(--success, #2ecc71); font-weight: 600; }
body.theme-light .padreq-ok { color: #15803d; }

/* ══════════════════════════════════════════════════════════════════════════
   FORMATION WATER CHEMISTRY (pw-profile-workspace) — USGS produced-waters
   statistical baselines. Contract: docs/usgs-pw-profile/CONTRACT.md.
   Theme-aware via the shared tokens (--bg-, --text-, --border, --accent).
   ══════════════════════════════════════════════════════════════════════════ */
.pwp-selectors { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.pwp-sel { flex: 1; min-width: 260px; max-width: 460px; }
.pwp-sel-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 4px;
}
.pwp-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.pwp-combo { position: relative; }
.pwp-combo input {
  width: 100%; box-sizing: border-box; padding: 6px 26px 6px 9px;
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-primary); font-size: 12px;
}
.pwp-combo input:focus { outline: none; border-color: var(--accent); }
.pwp-combo-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); font-size: 15px;
  cursor: pointer; padding: 2px 6px; line-height: 1;
}
.pwp-combo-clear:hover { color: var(--text-primary); }
.pwp-combo-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 3px);
  max-height: 300px; overflow-y: auto;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.pwp-combo-row { padding: 6px 10px; font-size: 12px; color: var(--text-primary); cursor: pointer; }
.pwp-combo-row:hover { background: var(--bg-tertiary); }
.pwp-combo-more { padding: 6px 10px; font-size: 10.5px; color: var(--text-muted); font-style: italic; }
.pwp-loading, .pwp-hint {
  font-size: 12px; color: var(--text-muted); padding: 14px 2px;
}
.pwp-error {
  font-size: 12px; color: var(--text-secondary); padding: 12px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary);
  display: flex; align-items: center; gap: 10px;
}
.pwp-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.pwp-card {
  flex: 1; min-width: 280px; max-width: 520px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary);
  padding: 10px 14px;
}
.pwp-card-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.pwp-card-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.pwp-stat { font-size: 11.5px; color: var(--text-secondary); }
.pwp-stat b { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.pwp-stat-label { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-muted); }
.pwp-card-states { font-size: 10.5px; color: var(--text-muted); margin-top: 5px; }
.pwp-source { font-size: 10.5px; color: var(--text-muted); margin: 8px 2px 0; }
.pwp-table-wrap { margin-top: 10px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.pwp-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--bg-secondary); }
.pwp-table th, .pwp-table td { padding: 6px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.pwp-table tbody tr:last-child td { border-bottom: none; }
.pwp-th-groups th {
  font-size: 11px; font-weight: 700; color: var(--text-primary);
  background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
}
.pwp-th-groups th + th { border-left: 1px solid var(--border); }
.pwp-th-cols th {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-tertiary);
}
.pwp-table .pwp-num, .pwp-th-cols th.pwp-num { text-align: right; font-family: 'JetBrains Mono', monospace; }
.pwp-table td.pwp-num { color: var(--text-primary); }
.pwp-table td.pwp-range { color: var(--text-secondary); }
.pwp-table td.pwp-n { color: var(--text-muted); font-size: 11px; }
.pwp-analyte { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.pwp-unit { color: var(--text-muted); font-weight: 400; font-size: 10.5px; margin-left: 4px; }
.pwp-insuf { color: var(--text-muted); font-style: italic; text-align: right; }
.pwp-footer { font-size: 10.5px; color: var(--text-muted); margin-top: 10px; }

/* ══════════════════════════════════════════════════════════════════
   RESERVOIR ENGINEER (mode-reservoir) — decline + type-curve workbench
   Phase 1: well selector rail + production display (js/reservoir-engineer.js)
   ══════════════════════════════════════════════════════════════════ */
/* ── Land's workflow axis: POSITION - ACTIVITY - OPPORTUNITY ─────────────
   Replaces the completions 1-2-3 strip in the header while body[data-mode]
   is "land". Same silhouette as .wf-cat (full-height flex item, 2px accent
   bottom-border when active) so the header does not visibly re-layout when the
   mode changes; no numbers, because land does not loop. */
.land-lenses { display: none; align-items: stretch; gap: 2px; height: 100%; margin-left: 18px; }
body[data-mode="land"] #wf-bar { display: none; }
body[data-mode="land"] .land-lenses { display: flex; }
.lens { position: relative; display: flex; align-items: center; padding: 0 10px;
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--text-secondary); font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .12em; cursor: pointer; }
.lens:hover { color: var(--title-strong); }
.lens.active { color: var(--title-strong); border-bottom-color: var(--accent); }
/* Unwired lenses look unwired. A pill that responds to a hover it cannot
   honour is a lie about what works. */
.lens.soon { opacity: .38; cursor: not-allowed; }
.lens.soon:hover { color: var(--text-secondary); }
.lens-dot { align-self: center; color: var(--text-muted); opacity: .6; }

/* Dedicated NORRIS /norris view; the full ICOP shell stays available at /. */
.land-test-link { display: flex; align-items: center; padding: 0 10px;
  border-bottom: 2px solid transparent; color: var(--text-secondary);
  font: 11px 'JetBrains Mono', monospace; letter-spacing: .12em; text-decoration: none; }
.land-test-link:hover { color: var(--title-strong); border-bottom-color: var(--accent); }
.land-test-link:focus-visible, .land-return-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-brand, .land-return-link { display: none; }
.land-page .app-header { grid-template-columns: auto 1fr auto auto auto; gap: 18px; height: 56px; }
.land-page .app-header .app-title, .land-page .app-header .mode-tabs,
.land-page .app-header #wf-bar, .land-page .app-header #scope-ctl,
.land-page .land-test-link, .land-page .land-test-dot { display: none; }
.land-page .land-brand { display: block; grid-row: 1; grid-column: 1; white-space: nowrap; }
.land-brand .title-main { color: var(--title-strong); font: 800 20px Helvetica, Arial, sans-serif; letter-spacing: 2px; }
.land-brand .title-sub { color: var(--text-secondary); font-size: 10px; margin-top: 3px;
  line-height: 1.25; white-space: normal; max-width: 320px; }
/* The dedicated header owns the name; retain Position's source context
   without a second branded strip above the workspace. */
.land-page .land-top { display: contents; }
.land-page .land-who { display: none; }
.land-page .land-feed { display: none; }
.land-page .land-demo-aoi, .land-page .land-top, .land-page .land-ask,
.land-page #land-stream > .land-card2 { display: none; }
.land-page #mode-land[data-lens="position"] #land-stream { display: none; }
.land-position, .land-map-selection, .land-map-find { display: none; }
.land-page .land-position { display: flex; flex: 1; flex-direction: column; min-height: 0;
  min-width: 0; margin: 12px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.land-map-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-secondary); color: var(--text-primary); flex-wrap: wrap; }
.land-map-toolbar > div { flex: 1; min-width: 200px; }
.land-map-toolbar strong { display: block; font-size: 13px; }
.land-map-toolbar span { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.land-map-details { line-height: 1.45; }
.land-map-details b { color: var(--text-primary); font-size: 13px; }
.land-map-details small { display: block; color: var(--text-secondary); font-size: 10px; margin-top: 3px; }
.land-map-toolbar button, .land-map-toolbar select, .land-page .land-map-find,
.land-map-status button { color: var(--text-primary); border: 1px solid var(--border);
  background: var(--bg-tertiary); padding: 7px 10px; border-radius: 5px; font-size: 11px; cursor: pointer; }
.land-map-toolbar label { display: flex; gap: 6px; align-items: center; font-size: 11px; }
#land-position-map { flex: 1; min-height: 260px; width: 100%; background: #dfe5e8; isolation: isolate; }
.land-map-status { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 10px;
  color: var(--text-secondary); background: var(--bg-secondary); line-height: 1.5; }
.land-map-status i { width: 9px; height: 9px; flex: 0 0 9px; border: 1px solid #0f766e; background: #8fd9cf; }
.land-map-status button { margin-left: auto; }
.land-page .land-map-selection { display: block; font-size: 11px; line-height: 1.6;
  color: var(--text-secondary); margin-bottom: 12px; }
.land-map-selection strong { color: var(--text-primary); display: block; font-size: 13px; }
.land-map-selection small { display: block; margin-top: 5px; font-size: 10px; }
.land-page .land-map-find { display: block; width: 100%; margin: 8px 0 12px; }
/* /norris: Run Lease Check (with the demo credit popup) and the Lease Checks run this month sit in the rail;
   the map's Lease Check | Workbook switch opens the one shown. */
.land-rs-credits { margin-top: 6px; font-size: 10px; line-height: 1.4; color: var(--text-secondary); }
.land-rs-credits b { color: var(--text-primary); }
.land-rs-credits:empty { display: none; }
/* Your townships replaces the flat list of Lease Checks on /norris. */
.land-page .land-rs-outh, .land-page #land-rs-out { display: none; }
/* State > County > Township, each a <details>; the caret turns when open. */
.land-own details > summary { display: flex; align-items: baseline; gap: 6px; cursor: pointer; list-style: none;
  padding: 4px 0; user-select: none; }
.land-own details > summary::-webkit-details-marker { display: none; }
.land-own details > summary::before { content: ''; flex: 0 0 auto; align-self: center; width: 0; height: 0;
  margin-right: 3px; border-left: 5px solid var(--text-muted); border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent; transition: transform .15s; }
.land-own details[open] > summary::before { transform: rotate(90deg); }
.land-own details > summary b { color: var(--text-primary); }
.land-own details > summary span { margin-left: auto; font-size: 9.5px; color: var(--text-muted); white-space: nowrap; }
.land-own details > summary:hover b { color: var(--accent-ink, var(--accent)); }
.land-own-state > summary b { font-size: 12px; }
.land-own-county { margin-left: 10px; }
.land-own-county > summary b { font-size: 11px; }
.land-own-twp { margin-left: 10px; border-top: 1px solid var(--border); }
.land-own-twp > summary b { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
/* A township's name opens its plat; the rest of the row folds it. */
.land-own-go { text-decoration: none; }
.land-own details.land-own-twp > summary:hover b { color: var(--text-primary); }
.land-own details.land-own-twp > summary .land-own-go:hover b, .land-own-go:focus-visible b { color: var(--accent-ink, var(--accent)); text-decoration: underline; }
.land-own-body { padding: 0 0 6px 16px; }
.land-own-k { margin: 4px 0 2px; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.land-own-item { display: flex; align-items: baseline; gap: 8px; font-size: 10.5px; line-height: 1.5; color: var(--text-secondary); }
.land-own-item a, .land-own-plat { margin-left: auto; color: var(--accent-ink, var(--accent)); text-decoration: none; white-space: nowrap; }
.land-own-item a:hover, .land-own-plat:hover { text-decoration: underline; }
.land-own-docs { margin-left: auto; display: inline-flex; gap: 6px; white-space: nowrap; }
.land-own-docs a { margin-left: 0; }
.land-own-docs > span { color: var(--text-muted); }
.land-own-plat { display: inline-block; margin-top: 5px; font-size: 10px; }
.land-own-item small { color: var(--text-muted); font-size: 9.5px; }
.land-own-item > span:first-child { white-space: nowrap; }
.land-own-none { font-size: 10px; color: var(--text-muted); }
.land-own-top { display: flex; align-items: center; gap: 8px; }
.land-own-top .land-rail-h { flex: 1 1 auto; padding-right: 0; }
.land-own-addbtn { flex: 0 0 auto; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 4px;
  background: none; color: var(--accent-ink, var(--accent)); font-size: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.land-own-addbtn:hover { background: var(--accent); color: #fff; }
.land-map-tooltip { font: 12px/1.5 Helvetica, Arial, sans-serif; white-space: normal;
  width: 260px; max-width: calc(100vw - 80px); box-sizing: border-box; overflow-wrap: break-word; }
/* Map | Run sheet PDF. The PDF replaces the map inside the same panel; the
   map, its view and its selection stay intact underneath. */
.land-page .land-position { position: relative; }
.land-map-toolbar > .land-view-switch { flex: 0 0 auto; min-width: 0; display: flex;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.land-map-toolbar .land-view-switch button { border: 0; border-radius: 0; background: transparent;
  color: var(--text-secondary); padding: 7px 12px; }
.land-map-toolbar .land-view-switch button + button { border-left: 1px solid var(--border); }
.land-map-toolbar .land-view-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.land-map-toolbar .land-view-switch button:not([aria-pressed="true"]):not(:disabled):hover { color: var(--text-primary);
  background: var(--bg-tertiary); }
.land-map-toolbar .land-view-switch button:disabled { opacity: .45; cursor: not-allowed; }
.land-map-toolbar button:focus-visible, .land-map-toolbar a:focus-visible,
.land-pdf-card button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-pdf { display: none; flex: 1; flex-direction: column; min-height: 260px; background: var(--bg-primary); }
.land-position.is-pdf .land-pdf { display: flex; }
.land-position.is-doc #land-position-map, .land-position.is-doc .land-map-status,
.land-position.is-doc #land-map-reset, .land-position.is-doc .land-map-toolbar > label { display: none; }
/* PDF mode collapses the toolbar to one row: the run sheet's name replaces the
   section details, and its actions sit beside the switch. */
.land-map-toolbar > .land-pdf-name, .land-map-toolbar > .land-pdf-actions,
.land-map-toolbar > .land-pdf-close { display: none; }
.land-position.is-doc .land-map-toolbar { padding: 8px 12px; gap: 10px; }
.land-position.is-doc .land-map-toolbar > .land-map-details { display: none; }
.land-position.is-doc .land-map-toolbar > .land-pdf-name { display: block; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The plat's title (township, plat, county) centred over the plat itself: across the bar's width less the side column
   (.land-plat .land-pages-body's second column), clear of Map | Plat on both sides so the centre holds. */
.land-position.is-plat:not(.is-chain) .land-map-toolbar { flex-wrap: nowrap; }
/* The title stays in the row, after the switch, so the two never share space. A spacer on the right the width of the
   switch plus the side column holds the centre over the plat on a wide window; on a narrow one the spacer gives way
   first, the title slides right, and only then does its text shorten. */
.land-position.is-plat:not(.is-chain) .land-map-toolbar > .land-pdf-name { flex: 1 1 auto; min-width: 0; text-align: center; }
.land-position.is-plat:not(.is-chain) .land-map-toolbar::after { content: ""; flex: 0 1000000 calc(300px + max(220px, 26%)); min-width: 0; }
@media (max-width: 900px) { .land-position.is-plat:not(.is-chain) .land-map-toolbar::after { flex-basis: 300px; } }
.land-position.is-doc .land-map-toolbar > .land-pdf-actions { display: flex; flex: 0 0 auto; min-width: 0; gap: 8px; }
.land-position.is-doc .land-map-toolbar > .land-pdf-close { display: block; }
/* The close button belongs to the Lease Check's PDF and workbook only; the plat and its chain return with Map (or Esc),
   and the documents opened over the plat carry their own close. */
.land-position.is-doc:not(.is-pdf):not(.is-xlsx) .land-map-toolbar > .land-pdf-close { display: none; }
/* Map | Plat at the left of the bar; the Lease Check and Workbook switches are not shown (a Lease Check opens from the
   rail's list and Run Lease Check). Ask NORRIS stays, last. */
.land-map-toolbar > .land-view-switch { order: -1; }
.land-map-toolbar .land-view-switch #land-view-pdf, .land-map-toolbar .land-view-switch #land-view-xlsx { display: none; }
.land-map-toolbar .land-pdf-name strong { display: inline; margin-right: 6px;
  font: 600 12px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-map-toolbar .land-pdf-name span { display: inline; margin: 0; font-size: 11px; color: var(--text-secondary); }
.land-pdf-actions button { white-space: nowrap; }
.land-pdf-actions button:hover, .land-map-toolbar .land-pdf-close:hover { border-color: var(--accent); }
/* Workbook view: sheet tabs, filter, and the sheet as a sortable table with
   a pinned header row. */
.land-xlsx { display: none; flex: 1; flex-direction: column; min-height: 260px; min-width: 0;
  background: var(--bg-primary); border-top: 1px solid var(--border); }
.land-position.is-xlsx .land-xlsx { display: flex; }
.land-xlsx-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.land-xlsx-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.land-xlsx-tabs button { flex: 0 0 auto; padding: 5px 10px; border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--text-secondary); font-size: 11px; cursor: pointer; white-space: nowrap; }
.land-xlsx-tabs button:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.land-xlsx-tabs button[aria-selected="true"] { color: var(--text-primary); background: var(--bg-tertiary);
  border-color: var(--accent); }
.land-xlsx-bar input { width: 180px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-primary); color: var(--text-primary); font-size: 11px; }
.land-xlsx-bar input:focus { outline: none; border-color: var(--accent); }
.land-xlsx-count { flex: 0 0 auto; min-width: 84px; text-align: right; font-size: 10.5px; color: var(--text-muted); }
.land-xlsx-scroll { flex: 1; min-height: 0; overflow: auto; }
.land-xlsx-titles { padding: 10px 12px 8px; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }
.land-xlsx-titles div:first-child { font-weight: 600; color: var(--text-primary); }
.land-xlsx-titles:empty { display: none; }
#land-xlsx-table { table-layout: fixed; border-collapse: separate; border-spacing: 0;
  font-size: 11px; line-height: 1.4; color: var(--text-primary); }
#land-xlsx-table th, #land-xlsx-table td { padding: 5px 8px; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: top; overflow-wrap: anywhere; }
#land-xlsx-table thead th { position: sticky; top: 0; z-index: 1; padding: 0;
  background: var(--bg-secondary); border-bottom: 1px solid var(--accent); }
#land-xlsx-table thead button { display: flex; align-items: flex-start; gap: 4px; width: 100%; padding: 7px 8px;
  border: 0; background: transparent; color: var(--text-primary); font: 600 10.5px Helvetica, Arial, sans-serif;
  text-align: left; cursor: pointer; }
#land-xlsx-table thead button:hover { color: var(--accent-ink, var(--accent)); }
#land-xlsx-table thead button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#land-xlsx-table thead i { font-style: normal; font-size: 8px; color: var(--accent-ink, var(--accent)); margin-top: 2px; }
#land-xlsx-table tbody td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
#land-xlsx-table tbody tr.is-open td { white-space: normal; overflow-wrap: anywhere; background: var(--bg-secondary); }
#land-xlsx-table tbody tr:hover td { background: var(--bg-secondary); }
#land-xlsx-table.is-list tbody td { white-space: normal; }
#land-xlsx-table.is-list td:first-child { color: var(--text-secondary); font-weight: 600; }
#land-xlsx-table tr.is-heading th { padding-top: 14px; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-ink, var(--accent)); }
.land-xlsx-notes { padding: 10px 12px 14px; font-size: 10.5px; line-height: 1.5; color: var(--text-muted); }
.land-xlsx-notes:empty { display: none; }
/* Ask NORRIS view: the section's answer thread over a fixed question bar. */
.land-askview { display: none; flex: 1; flex-direction: column; min-height: 260px; min-width: 0;
  background: var(--bg-primary); border-top: 1px solid var(--border); }
.land-position.is-ask .land-askview { display: flex; }
.land-position.is-ask .land-map-toolbar > .land-pdf-actions { display: none; }
.land-ask-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 4px; }
.land-askthread[hidden] { display: none; }
.land-askthread .land-card2 { margin: 0 0 14px; max-width: 920px; }
.land-ask-intro { max-width: 720px; margin: 0 0 14px; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.land-ask-intro strong { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.land-ask-foot { padding: 8px 12px 10px; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.land-ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.land-ask-chips button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--text-secondary); font-size: 11px; cursor: pointer; }
.land-ask-chips button:hover, .land-ask-chips button:focus-visible { color: var(--text-primary);
  border-color: var(--accent); outline: none; }
.land-ask-row { display: flex; gap: 8px; }
.land-ask-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-primary); color: var(--text-primary); font-size: 12px; }
.land-ask-row input:focus { outline: none; border-color: var(--accent); }
.land-ask-row button { padding: 0 16px; border: 1px solid var(--accent); border-radius: 6px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.land-ask-row button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.land-map-toolbar .land-pdf-close { padding: 4px 10px; font-size: 17px; line-height: 1; }
#land-pdf-frame { flex: 1; width: 100%; border: 0; background: #525659; }
/* Recorded-pages viewer over the workbook: page image left, abstract right. */
.land-xlsx-inst { border: 0; padding: 0; background: transparent; cursor: pointer; color: var(--accent-ink, var(--accent));
  font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.land-xlsx-inst:hover { text-decoration-style: solid; }
.land-xlsx-inst:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-pages { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg-primary); }
.land-pages[hidden] { display: none; }
.land-pages-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary); }
.land-pages-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; color: var(--text-secondary); }
.land-pages-name strong { margin-right: 6px; font: 600 12.5px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-pages-nav { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-secondary); }
.land-pages-bar button { color: var(--text-primary); border: 1px solid var(--border); background: var(--bg-tertiary);
  padding: 5px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.land-pages-bar button:disabled { opacity: .4; cursor: default; }
.land-pages-bar button:hover:not(:disabled) { border-color: var(--accent); }
.land-pages-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-pages-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 34%); }
.land-pages-img { min-height: 0; overflow: auto; background: #525659; padding: 12px; text-align: center; }
/* The frame is what zoom sizes. A county viewer capture (1333 x 1291) is cropped to the page area: the
   viewer's toolbar (top 62 px), thumbnail rail (left 40 px) and scrollbar (right 12 px) sit outside the frame
   and cannot be scrolled into view. Margins in % are of the frame's width, so the crop holds at any zoom. */
.land-pages-frame { position: relative; margin: 0 auto; width: 100%; overflow: hidden; background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.land-pages-frame img { display: block; width: 100%; height: auto; max-width: none;
  user-select: none; -webkit-user-drag: none; }
.land-pages-frame.is-cropped { aspect-ratio: 1281 / 1229; }
.land-pages-frame.is-cropped img { width: calc(100% * 1333 / 1281); margin-left: calc(-100% * 40 / 1281);
  margin-top: calc(-100% * 62 / 1281); }
.land-pages-img { cursor: grab; }
.land-pages-img.is-dragging { cursor: grabbing; }
.land-pages-zoom { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.land-pages-zoom span { min-width: 40px; text-align: center; font-family: 'JetBrains Mono', monospace; }
.land-pages-abs { min-height: 0; overflow: auto; padding: 12px 16px; border-left: 1px solid var(--border);
  font-size: 12px; line-height: 1.55; color: var(--text-secondary); }
.land-pages-abs h4 { margin: 0 0 4px; font-size: 14px; color: var(--text-primary); }
.land-pages-abs h5 { margin: 12px 0 4px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); }
.land-pages-abs ul { margin: 0; padding-left: 16px; }
.land-pages-abs li span { color: var(--text-muted); font-size: 11px; }
.land-pages-flags { font-size: 10.5px; color: var(--warning); margin-bottom: 6px; }
.land-pages-kv span { color: var(--text-muted); font-size: 11px; margin-right: 4px; }
.land-pages-open li { margin-bottom: 4px; }
.land-pages-none { color: var(--text-muted); }
.land-pages-foot { padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted);
  background: var(--bg-secondary); }
@media (max-width: 900px) { .land-pages-body { grid-template-columns: minmax(0, 1fr); } .land-pages-abs { border-left: 0; } }
/* Township plat view: the recorded-pages viewer's layout as a view of its own (plat left, reading right). */
.land-plat { position: relative; display: none; flex: 1; flex-direction: column; min-height: 260px; min-width: 0;
  background: var(--bg-primary); }
.land-position.is-plat .land-plat { display: flex; }
.land-position.is-plat .land-map-toolbar > .land-pdf-actions { display: none; }
.land-position.is-report #land-doc-xlsx { display: none; }
/* Mineral chain view: members from the patent down, beside a date rail drawn to scale. */
.land-chain { position: relative; display: none; flex: 1; flex-direction: column; min-height: 260px; min-width: 0;
  background: var(--bg-primary); }
.land-position.is-chain .land-chain { display: flex; }
/* Inventory (land-position-map.js invRender): tabs, township, search, View as and CSV in a bar; filter chips and the
   tab's coverage under it; the table, rows tinted by standing. */
.land-inv { position: relative; display: none; flex: 1; flex-direction: column; min-height: 260px; min-width: 0; background: var(--bg-primary); }
.land-position.is-inv .land-inv { display: flex; }
.land-position.is-inv .land-map-toolbar > .land-pdf-actions { display: none; }
.land-inv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.land-inv-tabs { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.land-inv-tabs button { padding: 6px 14px; border: 0; background: transparent; color: var(--text-secondary); font-size: 12.5px; cursor: pointer; }
.land-inv-tabs button + button { border-left: 1px solid var(--border); }
.land-inv-tabs button small { margin-left: 4px; font-size: 10.5px; opacity: .75; }
.land-inv-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.land-inv-bar select, .land-inv-bar input { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary);
  color: var(--text-primary); font-size: 12.5px; }
.land-inv-bar input[type="search"] { flex: 1 1 200px; max-width: 320px; }
.land-inv-as { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.land-inv-as input { width: 210px; }
.land-inv-csv { margin-left: auto; height: 30px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-tertiary);
  color: var(--text-primary); font-size: 12px; cursor: pointer; }
.land-inv-csv:disabled { opacity: .45; cursor: default; }
.land-inv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px 0; }
.land-inv-chips button { height: 26px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--text-secondary); font-size: 11.5px; cursor: pointer; }
.land-inv-chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.land-inv-count { margin-left: auto; font-size: 12px; color: var(--text-secondary); }
.land-inv-cov { margin: 6px 14px 8px; font-size: 11px; color: var(--text-muted); }
.land-inv-scroll { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--border); }
.land-inv-scroll table { width: 100%; border-collapse: collapse; font-size: 12px; }
.land-inv-scroll th { position: sticky; top: 0; z-index: 1; padding: 0; border-bottom: 1px solid var(--border); background: var(--bg-secondary); text-align: left; }
.land-inv-scroll th button { width: 100%; padding: 7px 10px; border: 0; background: none; text-align: left; cursor: pointer; white-space: nowrap;
  font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.land-inv-scroll td { padding: 6px 10px; border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: top; }
.land-inv-scroll td:first-child { font-weight: 600; }
.land-inv-scroll tr[data-inv-row] { cursor: pointer; }
.land-inv-scroll tr[data-inv-row]:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.land-inv-scroll tr[data-inv-row]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-inv-scroll tr.is-past td, .land-inv-scroll tr.is-expired td, .land-inv-scroll tr.is-lapsed td { color: var(--text-muted); }
.land-inv-scroll tr.is-soon td:nth-child(9) { color: #ea580c; font-weight: 600; }
.land-inv-none { padding: 18px 14px; color: var(--text-muted); }
.land-inv-scope button[aria-pressed="true"] { background: var(--bg-tertiary); color: var(--text-primary); font-weight: 600; }
.land-inv-bar [hidden] { display: none; }
.land-inv-sub[hidden] { display: none; }
.land-inv-main { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; }
.land-inv-sched { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 14px 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-secondary); font-size: 12px; color: var(--text-secondary); }
.land-inv-sched span { flex: 1 1 320px; }
.land-inv-sched b { margin-right: 6px; color: var(--text-primary); }
.land-inv-sched em { color: #dc2626; font-style: normal; }
.land-inv-sched button { height: 26px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 12px; cursor: pointer; }
.land-inv-sched button:disabled { opacity: .5; cursor: default; }
.land-inv-scroll th span { display: block; padding: 7px 10px; font-size: 11px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.land-inv-scroll tr[data-inv-co] { cursor: pointer; }
.land-inv-scroll tr[data-inv-co]:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.land-inv-mine { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 10px; font-weight: 500; }
.land-inv-scroll tr.is-schedonly td { font-style: italic; }
/* A well's production and decline (js/land-well-production.js): one panel over the page. */
.land-wprod { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(2, 6, 23, .55); }
.land-wprod[hidden] { display: none; }
.land-wprod-box { display: flex; flex-direction: column; gap: 12px; width: min(1180px, 100%); max-height: 100%; overflow: auto; padding: 18px 20px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg-primary); color: var(--text-primary); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.land-wprod-box header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.land-wprod-box h3 { margin: 0; font-size: 18px; }
.land-wprod-box header p { margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); }
.land-wprod-acts { display: flex; gap: 8px; }
.land-wprod-acts button, .land-wprod-seg button { height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 12px; cursor: pointer; }
.land-wprod-wait { margin: 40px 0; text-align: center; color: var(--text-secondary); }
.land-wprod-wait.is-error { color: #dc2626; }
.land-wprod-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.land-wprod-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.land-wprod-tile span { font-size: 11px; color: var(--text-secondary); }
.land-wprod-tile b { font-size: 18px; font-variant-numeric: tabular-nums; }
.land-wprod-tile small { font-size: 11px; color: var(--text-muted); }
.land-wprod-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.land-wprod-seg { display: flex; border: 1px solid var(--border); border-radius: 8px; }
.land-wprod-seg button { position: relative; border: 0; border-radius: 0; background: transparent; color: var(--text-secondary); }
.land-wprod-seg button:first-child { border-radius: 7px 0 0 7px; }
.land-wprod-seg button:last-child { border-radius: 0 7px 7px 0; }
.land-wprod-seg button[data-tip]:hover::after, .land-wprod-seg button[data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 0; z-index: 5;
  width: max-content; max-width: min(340px, 78vw); padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); color: var(--text-primary);
  font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; box-shadow: 0 10px 28px rgba(0, 0, 0, .28); pointer-events: none; }
.land-wprod-seg button + button { border-left: 1px solid var(--border); }
.land-wprod-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.land-wprod-bar { align-items: center; }
.land-wprod-adjbtn { height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.land-wprod-adjbtn[aria-expanded="true"] { border-color: var(--accent); color: var(--text-primary); }
.land-wprod-params { margin: 0; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.land-wprod-adj { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.land-wprod-adj label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-secondary); }
.land-wprod-adj input { width: 124px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); font-size: 12px; }
.land-wprod-adj input[type="month"] { width: 150px; }
.land-wprod-adj button { height: 30px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 12px; cursor: pointer; }
.land-wprod-adj button[type="submit"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.land-wprod-adj button[disabled] { opacity: .6; cursor: default; }
.land-wprod-adj small { flex-basis: 100%; font-size: 11px; color: var(--text-muted); }
.land-wprod-adj small.is-error { color: #dc2626; }
.land-wprod-adjnote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: 4px; background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 12px; color: var(--text-primary); }
.land-wprod-chart { height: 380px; min-height: 280px; }
.land-wprod-own { padding: 12px 14px; border: 1px solid #f59e0b; border-radius: 10px; background: color-mix(in srgb, #f59e0b 7%, transparent); }
.land-wprod-own h4 { margin: 0; font-size: 14px; }
.land-wprod-own h4 small { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--text-secondary); }
.land-wprod-own p { margin: 4px 0 8px; font-size: 12px; color: var(--text-secondary); }
.land-wprod-own table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.land-wprod-own th, .land-wprod-own td { padding: 5px 8px; border-top: 1px solid var(--border); text-align: right; }
.land-wprod-own th { border-top: 0; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.land-wprod-own th:first-child, .land-wprod-own td:first-child { text-align: left; }
.land-wprod-own tr.is-before td { color: var(--text-muted); }
.land-wprod-foot { margin: 0; font-size: 11px; color: var(--text-muted); }
.land-inv-scroll tr.is-diff td:nth-last-child(-n+4) { color: #ea580c; }
.land-position.is-chain .land-map-toolbar > .land-pdf-actions { display: none; }
.land-chain-scroll { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 28px; }
/* Lanes: one column per holding beside the date rail; the body scrolls sideways when the lanes outgrow the panel. */
.land-chain-body { --rail-w: 92px; --lane-w: 310px; position: relative;
  min-width: calc(var(--rail-w) + var(--lanes, 1) * var(--lane-w)); }
.land-chain-row { position: relative; display: grid; grid-template-columns: var(--rail-w) repeat(var(--lanes, 1), var(--lane-w)); }
.land-chain-row > * { grid-row: 1; }
.land-chain-row > .land-chain-rail { grid-column: 1; }
.land-chain-lane { position: relative; min-height: 1px; }
/* One colour per holding (lane): set as --lc on the lane cells, slots, badges and branches (land-position-map.js laneTone). */
.land-chain-body { --chain-c0: #7f77dd; --chain-c1: #7f77dd; --chain-c2: #7f77dd; --chain-c3: #7f77dd; --chain-c4: #7f77dd;
  --chain-c5: #7f77dd; }
.land-chain-line { position: absolute; left: var(--line-x, 20px); top: 0; bottom: 0; border-left: 2px solid var(--lc, var(--accent)); opacity: .75; }
.land-chain-line.is-start { top: 19px; }
.land-chain-line.is-end { bottom: auto; height: 30px; }
.land-chain-line.is-dashed { border-left-style: dashed; border-left-color: var(--text-muted); }
.land-chain-slot { position: relative; z-index: 1; padding: 0 12px 0 36px; min-width: 0; }
/* A card over empty lanes to its right (land-position-map.js renderChain is-wide): as wide as reads well, no wider. */
.land-chain-slot.is-wide > .land-chain-card, .land-chain-slot.is-wide > .land-chain-oneline { max-width: 560px; }
.land-chain-slot::before { content: ''; position: absolute; left: 15px; top: 14px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--lc, var(--accent)); box-shadow: 0 0 0 3px var(--bg-primary); }
.land-chain-row.is-gap .land-chain-slot::before { background: var(--text-muted); }
.land-chain-row > .land-chain-slot[style*="2 / -1"]::before { display: none; }
/* A share leaving one lane for another: an elbow from the grantor's lane line across and down into the new lane. */
.land-chain-branch { position: absolute; z-index: 0; top: 19px; height: 18px; box-sizing: border-box;
  left: calc(var(--rail-w) + var(--from) * var(--lane-w) + var(--line-x, 20px)); width: calc(var(--span) * var(--lane-w) + 2px);
  border-top: 2px solid var(--lc, var(--accent)); border-right: 2px solid var(--lc, var(--accent)); opacity: .75; }
.land-chain-branch.is-left { border-right: 0; border-left: 2px solid var(--lc, var(--accent)); }
.land-chain-rail.is-node.is-same b { font-size: 12px; color: var(--text-secondary); }
.land-chain-rail.is-now b { color: var(--accent-ink, var(--accent)); }
/* A member that changes no holding (a death of record before its decree, say) reads like any other card: solid, at
   full strength, so it never looks inactive or missing. Its text says the holdings do not change here. */
.land-chain-card.is-holding { padding: 8px 10px; border-left: 3px solid var(--lc, var(--accent)); }
.land-chain-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.land-chain-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 8px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 11px; color: var(--text-primary); background: var(--bg-tertiary); }
.land-chain-chip b { font-weight: 600; }
.land-chain-chip small { color: var(--text-muted); font-size: 10px; }
.land-chain-chip.is-new, .land-chain-chip.is-grows { border-color: #2e8b57; }
.land-chain-chip.is-now { border-color: var(--accent); }
.land-chain-chip[style*="--lc"] { border-color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, transparent); }
.land-chain-row > .land-chain-sum { grid-row: 2; margin: 6px 12px 18px 36px; font-size: 11px; color: var(--text-muted); }
.land-chain-rail { position: relative; border-right: 2px solid var(--border); margin-right: -1px; }
/* The date rail stays in view while a wide chain scrolls sideways. */
.land-chain-row > .land-chain-rail { position: sticky; left: 0; z-index: 4; background: var(--chain-bg, var(--bg-primary)); }
.land-chain-rail.is-gap { border-right-style: dashed; border-right-color: var(--text-muted); }
.land-chain-rail.is-node { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 14px 0 0;
  font-family: 'JetBrains Mono', monospace; }
.land-chain-rail.is-node::after { content: ''; position: absolute; right: -7px; top: 12px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--lc, var(--accent)); box-shadow: 0 0 0 3px var(--bg-primary); }
.land-chain-rail.is-node b { font-size: 15px; color: var(--text-primary); }
.land-chain-rail.is-node span { font-size: 10.5px; color: var(--text-muted); }
.land-chain-tick { position: absolute; right: 10px; transform: translateY(-50%); font: 10px 'JetBrains Mono', monospace;
  color: var(--text-muted); }
.land-chain-tick::after { content: ''; position: absolute; right: -10px; top: 50%; width: 7px; border-top: 1px solid var(--text-muted); }
.land-chain-span { position: absolute; right: 10px; bottom: 6px; font-size: 10px; color: var(--text-muted); font-style: italic; }
.land-chain-card { margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-secondary); font-size: 12px; line-height: 1.55; color: var(--text-secondary); }
.land-chain-row.is-gap .land-chain-card, .land-chain-card.is-gap { align-self: center; border-style: dashed; background: transparent; }
.land-chain-row.is-gap .land-chain-slot { align-self: center; }
.land-chain-card h4 { margin: 2px 0 6px; font-size: 13px; color: var(--text-primary); }
.land-chain-card p { margin: 4px 0 0; }
.land-chain-kind { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.land-chain-when { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.land-chain-parties { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-primary); }
.land-chain-parties i { font-style: normal; color: var(--accent-ink, var(--accent)); }
.land-chain-note, .land-chain-src, .land-chain-reading { font-size: 11px; color: var(--text-muted); }
.land-chain-reading::before { content: '✓ '; color: #2e8b57; }
.land-chain-land { color: var(--text-secondary); }
.land-chain-effect { color: var(--text-primary); font-weight: 600; }
.land-chain-needs { font-size: 11.5px; }
.land-chain-abs { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.land-chain-abs[hidden] { display: none; }
.land-chain-abs h5 { margin: 10px 0 4px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); }
.land-chain-abs blockquote { margin: 0; padding: 4px 10px; border-left: 2px solid var(--border); font-style: italic; }
.land-chain-abs ul { margin: 0; padding-left: 16px; }
.land-chain-facts { border-collapse: collapse; font-size: 11.5px; }
.land-chain-facts th { padding: 2px 12px 2px 0; text-align: left; vertical-align: top; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.land-chain-facts td { padding: 2px 0; color: var(--text-primary); }
.land-chain-names { font-size: 11.5px; }
.land-plat-acts button.is-chain { background: transparent; color: var(--accent-ink, var(--accent)); }
.land-chain-pdf-tabs { display: flex; gap: 2px; }
.land-chain-pdf-tabs button[aria-selected="true"] { border-color: var(--accent); }
#land-chain-pdf-frame { flex: 1; width: 100%; border: 0; background: #525659; }
/* The unit well: a track down the left of the date rail, its rows across every lane (land-position-map.js wellTrack). */
.land-chain-well { position: absolute; left: 8px; width: 5px; }
.land-chain-well.is-drilling { background: #ba7517; }
.land-chain-well.is-well { background: #639922; }
.land-chain-well-mark { position: absolute; left: 5px; width: 11px; height: 2px; margin-top: -1px; background: var(--text-primary); opacity: .7; }
.land-chain-rail.is-well::after { background: #639922; }
.land-chain-rail.is-well[class*="_order"]::after { border-radius: 2px; background: var(--bg-primary);
  border: 2px solid #639922; width: 8px; height: 8px; }
.land-chain-rail.is-plugged::after { background: var(--bg-primary); border: 2px solid var(--text-muted); width: 8px; height: 8px; }
.land-chain-card.is-well { max-width: 720px; margin: 4px 12px 14px 0; padding: 8px 12px; border-left: 3px solid #639922;
  background: linear-gradient(color-mix(in srgb, #639922 8%, transparent), color-mix(in srgb, #639922 8%, transparent)),
    linear-gradient(var(--bg-secondary), var(--bg-secondary)) var(--bg-primary); }
.land-chain-card.is-well.is-plugged { border-left-color: var(--text-muted);
  background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) var(--bg-primary); }
.land-chain-card.is-well p { font-size: 12px; color: var(--text-secondary); }
/* The unit well and lease keys (land-position-map.js wellKey, leaseKey): as wide as the Title now card at most, each
   folding to its title line. */
.land-chain-wellkey { display: flex; align-items: flex-start; gap: 10px; max-width: 1100px; box-sizing: border-box; margin: 0 0 16px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text-secondary); }
.land-chain-key-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.land-chain-key-fold { flex: none; padding: 1px 8px; border: 1px solid var(--border); border-radius: 4px; background: transparent;
  color: var(--text-secondary); font-size: 10.5px; cursor: pointer; }
.land-chain-key-fold:hover { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.land-chain-wellkey.is-folded { padding-top: 6px; padding-bottom: 6px; }
.land-chain-wellkey.is-folded .land-chain-key-body { flex-wrap: nowrap; }
.land-chain-wellkey.is-folded .land-chain-wellkey-items, .land-chain-wellkey.is-folded small { display: none; }
.land-chain-wellkey.is-folded .land-chain-key-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.land-chain-wellkey.is-folded .land-chain-key-body > b { flex: none; white-space: nowrap; }
.land-chain-wellkey b { color: var(--text-primary); }
.land-chain-wellkey small { flex-basis: 100%; color: var(--text-muted); font-size: 11px; }
.land-chain-wellkey-items { display: inline-flex; align-items: center; gap: 6px; }
.land-chain-wellkey-items i { position: relative; left: 0; display: inline-block; height: 12px; margin-left: 6px; }
.land-chain-wellkey-items .land-chain-well-mark { height: 2px; margin: 0 0 0 6px; }
/* Leases: a starting box at the lease date and a sleeve beside each lane it covers (land-position-map.js leaseSleeves). */
.land-chain-body { --lease-c0: #b07d2a; --lease-c1: #d9b77e; --lease-c2: #efdcb2; --lease-c3: #8f5f35; }
.land-chain-body.has-leases .land-chain-slot { padding-left: calc(32px + var(--sleeves, 3) * 9px); }
.land-chain-sleeve { position: absolute; left: calc(26px + var(--slot, 0) * 9px); width: max(3px, calc(7px * var(--share, 1)));
  box-sizing: border-box; background: var(--lsc); }
.land-chain-sleeve.is-held { background: repeating-linear-gradient(45deg, var(--lsc) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px var(--lsc); }
.land-chain-sleeve.is-extended { background: color-mix(in srgb, var(--lsc) 35%, transparent); border: 1.5px dashed var(--lsc); }
.land-chain-sleeve.is-ended, .land-chain-sleeve.is-matured { background: transparent; border: 1.5px dotted var(--lsc); }
.land-chain-sleeve-mark { position: absolute; left: calc(23px + var(--slot, 0) * 9px); width: 13px; height: 2px; margin-top: -1px;
  background: var(--text-primary); opacity: .8; }
.land-chain-rail.is-lease::after { background: var(--lsc); border-radius: 2px; transform: rotate(45deg); width: 9px; height: 9px; }
.land-chain-card.is-lease, .land-chain-card.is-lien { border-left: 3px solid var(--lsc); max-width: 640px;
  background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) var(--bg-primary); }
.land-chain-lmarks { margin: 8px 0 0; padding-left: 16px; font-size: 11.5px; }
.land-chain-lmarks li { margin: 2px 0; }
.land-chain-lmarks span { color: var(--text-muted); }
/* Leasehold burdens on a lease box (and the burden on the well): status chip, then the instrument and what ended it. */
.land-chain-burdens { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 11.5px; }
.land-chain-burdens > b { display: block; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); }
.land-chain-burdens.has-standing > b { color: #e06a78; }
.land-chain-burdens p { margin: 2px 0 0; color: var(--text-secondary); }
.land-chain-burdens ul { margin: 4px 0 0; padding: 0; list-style: none; }
.land-chain-burdens li { margin: 5px 0; color: var(--text-primary); }
.land-chain-burdens li span { color: var(--text-muted); }
.land-chain-burdens li > i { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 3px; font-style: normal;
  font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px;
  color: var(--text-muted); border: 1px solid var(--border); }
.land-chain-burdens li.is-standing > i { color: #fff; background: var(--lien-c); border-color: var(--lien-c); }
.land-chain-burdens li:not(.is-standing) { color: var(--text-secondary); }
.land-chain-burdens li.land-chain-bfold { margin: 6px 0 2px; }
.land-chain-burdens small { display: block; margin-left: 2px; color: var(--text-muted); font-size: 10.5px; }
.land-chain-mini { padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; background: transparent;
  color: var(--accent-ink, var(--accent)); font: inherit; font-size: 10.5px; line-height: 18px; cursor: pointer; }
.land-chain-mini:hover { border-color: var(--accent); }
.land-chain-holdlease { margin: 6px 0 0; padding: 0; list-style: none; font-size: 11px; color: var(--text-secondary); }
.land-chain-holdlease li { position: relative; padding-left: 14px; margin: 2px 0; }
.land-chain-holdlease li::before { content: ''; position: absolute; left: 0; top: 3px; width: 7px; height: 10px; background: var(--lsc); }
.land-chain-holdlease li.is-ended::before { background: transparent; border: 1.5px dotted var(--lsc); box-sizing: border-box; }
.land-chain-holdlease li.is-open::before { background: transparent; border: 1px solid var(--text-muted); box-sizing: border-box; }
.land-chain-holdlease li.is-open { color: var(--text-primary); font-weight: 600; }
.land-chain-holdlease li.is-unresolved { font-style: italic; }
.land-chain-holdlease li.is-unresolved::before { background: repeating-linear-gradient(45deg, var(--lsc) 0 2px, transparent 2px 4px); }
.land-chain-wellkey-items .land-chain-sleeve { position: relative; left: 0; display: inline-block; height: 12px; margin-left: 6px; }
/* Record-class banners: a filled band across the top of each card naming the kind of record, in a fixed colour per
   class (land-position-map.js banner). Holding colours stay on the lanes. */
.land-chain-body { --banner-patent: #1f4e79; --banner-mineral: #4b3f8f; --banner-lease: #8a5a00; --banner-well: #3b6d11;
  --banner-lien: #7a2430; --lien-c: #b03a48; }
.land-chain-card.is-patent, .land-chain-card.is-instrument, .land-chain-card.is-death, .land-chain-card.is-gap,
.land-chain-card.is-well, .land-chain-card.is-lease, .land-chain-card.is-lien { padding-top: 0; overflow: hidden; border-left-width: 1px;
  border-left-color: var(--border); }
.land-chain-card.is-gap { border-left-style: dashed; border-left-color: var(--border-strong, var(--border)); }
.land-chain-banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 30px;
  box-sizing: border-box; margin: 0 -14px 10px; padding: 6px 14px; color: #fff; font-size: 12px; line-height: 1.3; }
.land-chain-card.is-well .land-chain-banner { margin: 0 -12px 8px; padding: 6px 12px; }
.land-chain-banner b { font: 600 11px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
.land-chain-banner > span:last-child { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  font: 11px 'JetBrains Mono', monospace; opacity: .85; white-space: nowrap; }
.land-chain-banner.is-patent { background: var(--banner-patent); }
.land-chain-banner.is-mineral { background: var(--banner-mineral); }
.land-chain-banner.is-lease { background: var(--banner-lease); }
.land-chain-banner.is-well { background: var(--banner-well); }
.land-chain-banner.is-lien { background: var(--banner-lien); }
.land-chain-banner.is-gap { color: var(--text-secondary); border-bottom: 1px dashed var(--border-strong, var(--border)); }
.land-chain-banner-swatch { display: inline-block; width: 6px; height: 14px; background: var(--lsc); box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
/* Layer toggles above the chain (land-position-map.js layerBar); sticky while the chain scrolls, both ways. It sits
   above the sticky date rail (z-index 4), so the dates and nodes pass under it, and it stays pinned at the left on a
   chain wider than the view (offsets cancel the scroll box's 18px / 20px padding). */
.land-chain-layers { position: sticky; top: -18px; left: -20px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: -18px -20px 14px; padding: 10px 20px; background: var(--bg-primary); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); box-sizing: border-box; width: var(--view-w, auto); }
.land-chain-layers > span:first-child { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; margin-right: 4px; }
.land-chain-layer { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--text-secondary); font: inherit; cursor: pointer; }
.land-chain-layer small { margin-left: 3px; color: var(--text-muted); }
.land-chain-layer.is-fixed { border-color: var(--banner-mineral); color: var(--text-primary); cursor: default; }
/* Chain | Abstracts (land-position-map.js chainModeBar / absHtml): the chain as a timeline or as an index of its
   instruments, a reader beside the list. */
.land-chain-mode { display: inline-flex; margin-right: 10px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
#land-chain-body.is-abstracts { min-width: 0; }   /* the index has no lanes: never wider than the view */
.land-chain-mode button { padding: 5px 16px; border: 0; background: transparent; color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.land-chain-mode button + button { border-left: 1px solid var(--border); }
.land-chain-mode button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.land-chain-layer.is-mineral { cursor: pointer; }
.land-chain-layer.is-mineral[aria-pressed="true"] { background: var(--banner-mineral); border-color: var(--banner-mineral); color: #fff; }
.land-chain-layers.land-abs-tools { gap: 8px 14px; }
.land-abs-tools input[type="search"] { flex: 1 1 280px; max-width: 460px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-primary); color: var(--text-primary); font-size: 12.5px; }
.land-abs-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.land-abs-years { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-secondary); }
.land-abs-years input { width: 68px; height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-primary); color: var(--text-primary); }
.land-abs-list { min-width: 0; }
.land-abs-sum { margin: 0 0 6px; font-size: 12px; color: var(--text-secondary); }
.land-abs-chip { margin-left: 8px; padding: 1px 8px; border: 1px solid var(--accent); border-radius: 999px; background: transparent;
  color: var(--accent-ink, var(--accent)); font-size: 11px; cursor: pointer; }
.land-abs-list table { width: 100%; border-collapse: collapse; font-size: 12px; }
.land-abs-list th { position: sticky; top: 0; z-index: 1; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--bg-primary);
  text-align: left; font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.land-abs-list th button { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.land-abs-list td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-primary); }
.land-abs-list tr[data-abs-row] > td:first-child { white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text-secondary); }
.land-abs-list td small { display: block; color: var(--text-muted); font-size: 11px; }
.land-abs-list td:nth-child(4) { color: var(--text-secondary); }
.land-abs-list tr[data-abs-row] { cursor: pointer; }
.land-abs-list tr[data-abs-row]:hover td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.land-abs-list tr.is-sel td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-abs-list tr[data-abs-row]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-abs-mark { display: inline-block; width: 4px; height: 12px; margin-right: 8px; border-radius: 2px; vertical-align: -1px; background: var(--banner-mineral); }
tr.is-lease .land-abs-mark { background: var(--banner-lease); }
tr.is-lien .land-abs-mark { background: var(--banner-lien); }
tr.is-well .land-abs-mark { background: var(--banner-well); }
.land-abs-st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink, var(--accent)); }
.land-abs-st.is-reading { background: color-mix(in srgb, #16a34a 16%, transparent); color: #15803d; }
.land-abs-st.is-none { background: transparent; color: var(--text-muted); font-weight: 400; }
.land-page body:not(.theme-light) .land-abs-st.is-reading { color: #6ee7a0; }
/* An open row: the reading and abstract at the left, the facts at the right; the row's two buttons at its end. */
.land-abs-list tr.is-open td { background: color-mix(in srgb, var(--accent) 10%, transparent); border-bottom-color: transparent; }
.land-abs-caret { display: inline-block; width: 12px; font-style: normal; color: var(--text-muted); }
.land-abs-acts { white-space: nowrap; text-align: right; }
.land-abs-acts .land-chain-mini + .land-chain-mini { margin-left: 6px; }
.land-abs-detail > td { white-space: normal; font-family: inherit; padding: 4px 8px 14px 28px; background: color-mix(in srgb, var(--accent) 5%, transparent); cursor: default; }
.land-abs-open { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 8px 24px; font-size: 12.5px; color: var(--text-secondary); }
.land-abs-open h5 { margin: 8px 0 3px; font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.land-abs-open p { margin: 3px 0; color: var(--text-primary); }
.land-abs-open small { display: block; color: var(--text-muted); font-size: 11px; }
.land-abs-facts { padding-left: 14px; border-left: 2px solid var(--border); }
@media (max-width: 900px) { .land-abs-open { grid-template-columns: minmax(0, 1fr); } .land-abs-facts { padding-left: 0; border-left: 0; } }
.land-abs-party { padding: 0; border: 0; background: none; color: var(--accent-ink, var(--accent)); font: inherit; cursor: pointer; text-align: left; }
.land-abs-party:hover { text-decoration: underline; }
.land-abs-none { color: var(--text-muted); }
.land-chain-layer.is-empty { border-style: dashed; color: var(--text-muted); opacity: .75; cursor: default; }
.land-chain-layer[aria-pressed="true"] { color: #fff; }
.land-chain-layer.is-lease[aria-pressed="true"] { background: var(--banner-lease); border-color: var(--banner-lease); }
.land-chain-layer.is-lien[aria-pressed="true"] { background: var(--banner-lien); border-color: var(--banner-lien); }
.land-chain-layer.is-well[aria-pressed="true"] { background: var(--banner-well); border-color: var(--banner-well); }
.land-chain-layer[aria-pressed="true"] small { color: rgba(255,255,255,.75); }
.land-chain-layer[aria-pressed="false"] { text-decoration: line-through; opacity: .7; }
/* Tags: the unit well's track is named where it begins; a lease sleeve is tagged HBP where production starts holding it. */
.land-chain-rail.is-node span.land-chain-well-tag { position: absolute; left: 16px; top: 46px; z-index: 2; display: flex; flex-direction: column;
  font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: #8cc152; line-height: 1.3; }
.land-chain-rail.is-node span.land-chain-well-tag small { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-muted); font-size: 10px; }
.land-chain-sleeve-tag { position: absolute; z-index: 2; left: calc(26px + var(--slot, 0) * 9px + 9px); margin-top: -7px;
  padding: 0 4px; border: 1px solid var(--lsc); border-radius: 3px; background: var(--bg-primary); color: var(--lsc);
  font: 600 9px/13px 'JetBrains Mono', monospace; letter-spacing: .06em; white-space: nowrap; }
/* Lane tints (default) and focus mode (land-position-map.js laneTint, chainFocus). */
.land-chain-tint { position: absolute; left: 24px; width: calc(100% - 30px); z-index: 0; pointer-events: none; }
.land-chain-tint.is-leased { background: color-mix(in srgb, #b07d2a 14%, transparent); }
.land-chain-tint.is-leased.is-part { background: color-mix(in srgb, #b07d2a 6%, transparent); }
.land-chain-tint.is-held.is-part { opacity: .5; }
.land-chain-tint-tag.is-part { border-style: dashed; }
.land-chain-wellkey-items .land-chain-tint-tag.is-key { position: relative; left: 0; margin: 0 6px 0 4px; }
.land-chain-tint.is-held { background: repeating-linear-gradient(45deg, color-mix(in srgb, #b07d2a 26%, transparent) 0 3px,
  color-mix(in srgb, #b07d2a 7%, transparent) 3px 9px); }
.land-chain-tint.is-cloud { width: 0; border-left: 2px dotted color-mix(in srgb, #b07d2a 85%, transparent); left: 27px; }
/* Dark theme: the held hatch as a quiet texture (reviewer, 2026-10-28): fine muted-gold lines at about 10%, 10 px apart,
   on the panel itself rather than a brown wash, so the cards read first, the lanes second and the hatch third. The
   light theme keeps the hatch above. */
body:not(.theme-light) .land-chain-tint.is-held { background: repeating-linear-gradient(45deg, rgba(199, 161, 106, .10) 0 1px,
  transparent 1px 10px); }
.land-chain-tint-lien { position: absolute; left: 23px; width: 3px; background: var(--lien-c); opacity: .85; z-index: 0; pointer-events: none; }
.land-chain-tint-tag { position: absolute; z-index: 2; left: 30px; margin-top: -7px; padding: 0 4px; border: 1px solid #b07d2a;
  border-radius: 3px; background: var(--bg-primary); color: #d9a65a; font: 600 9px/13px 'JetBrains Mono', monospace; letter-spacing: .06em; }
.land-chain-wellkey-items .land-chain-tint, .land-chain-wellkey-items .land-chain-tint-lien { position: relative; left: 0; display: inline-block;
  width: 22px; height: 12px; margin-left: 6px; vertical-align: middle; }
.land-chain-wellkey-items .land-chain-tint.is-part { width: 22px; }
.land-chain-wellkey-items .land-chain-tint.is-cloud { width: 0; height: 12px; margin-right: 18px; }
.land-chain-wellkey-items .land-chain-tint-lien { width: 3px; margin-right: 8px; }
[data-focus] { cursor: pointer; }
.land-chain-card[data-focus]:hover { border-color: var(--lsc); }
.land-chain-body.is-focus .land-chain-card:not(.is-focused), .land-chain-body.is-focus .land-chain-sum { opacity: .38; transition: opacity .15s; }
.land-chain-body.is-focus .land-chain-card.is-focused { box-shadow: 0 0 0 2px var(--lsc); }
.land-chain-layer.is-focus { background: var(--lsc); border-color: var(--lsc); color: #1b1408; font-weight: 600; }
/* Address of record, last in each holding's Now box. */
.land-chain-addr { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-primary); }
.land-chain-addr b { display: block; margin-bottom: 2px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); }
.land-chain-addr p { margin: 3px 0 0; line-height: 1.4; }
.land-chain-addr span { display: block; color: var(--text-secondary); font-size: 11px; }
.land-chain-addr small { display: block; color: var(--text-muted); font-size: 10.5px; }
/* Title now: the summary at the top of the chain (land-position-map.js summaryCard). */
.land-chain-summary { max-width: 1100px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) var(--bg-primary); font-size: 12.5px; }
.land-chain-summary > .land-chain-banner { margin: 0; padding: 7px 14px; }
.land-chain-fold { margin-left: 10px; padding: 1px 8px; border: 1px solid rgba(255,255,255,.5); border-radius: 4px; background: transparent;
  color: #fff; font: inherit; font-size: 10.5px; cursor: pointer; }
.land-chain-sumline { margin: 0; padding: 8px 14px; color: var(--text-primary); }
.land-chain-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 12px 14px 4px; }
.land-chain-tile { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary); }
.land-chain-tile span { color: var(--text-muted); font-size: 11px; }
.land-chain-tile b { margin: 2px 0; font-size: 19px; font-weight: 600; color: var(--text-primary); }
.land-chain-tile small { color: var(--text-secondary); font-size: 11px; line-height: 1.35; }
.land-chain-tile.is-lease b { color: #d9a65a; }
.land-chain-tile.is-cloud b { color: #e06a78; }
.land-chain-holders { width: calc(100% - 28px); margin: 10px 14px 4px; border-collapse: collapse; }
.land-chain-holders th { padding: 4px 6px; text-align: left; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.land-chain-holders td { padding: 5px 6px; border-top: 1px solid var(--border); color: var(--text-primary); vertical-align: top; }
.land-chain-holders td:last-child { color: var(--text-secondary); }
.land-chain-holders tr[data-goto-lane] { cursor: pointer; }
.land-chain-holders tr[data-goto-lane]:hover td { background: color-mix(in srgb, var(--banner-mineral) 12%, transparent); }
.land-chain-attn { margin: 10px 14px 4px; padding: 8px 10px; border-left: 3px solid var(--lien-c); background: var(--bg-primary); }
.land-chain-attn b { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-chain-attn ul { margin: 4px 0 0; padding-left: 16px; }
.land-chain-attn li { margin: 4px 0; color: var(--text-primary); }
.land-chain-attn li[data-focus], .land-chain-attn li[data-goto-lane], .land-chain-attn li[data-goto] { cursor: pointer; }
.land-chain-attn li:hover > span { text-decoration: underline; }
.land-chain-attn small { display: block; color: var(--text-muted); font-size: 11px; }
/* Encumbrances block in Title now: one row per estate, standing first. */
.land-chain-enc { margin: 10px 14px 4px; padding: 8px 10px; border-left: 3px solid var(--banner-lien); background: var(--bg-primary); }
.land-chain-enc > b { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-chain-enc > ul { margin: 4px 0 0; padding: 0; list-style: none; }
.land-chain-enc-row { margin: 7px 0; }
.land-chain-enc-row > span { font-weight: 600; color: var(--text-primary); }
.land-chain-enc-row > small { margin-left: 8px; color: var(--text-muted); font-size: 11px; }
.land-chain-enc-row.has-standing > small { color: #e06a78; }
.land-chain-enc-row > ul { margin: 2px 0 0; padding-left: 16px; }
.land-chain-enc-row li { margin: 2px 0; color: var(--text-secondary); }
.land-chain-enc-row li.is-standing { color: var(--text-primary); }
.land-chain-enc-row li.is-unknown { color: var(--text-primary); font-style: italic; }
.land-chain-enc-row li.is-of_record { color: var(--text-primary); }
.land-chain-enc-row li small { display: block; color: var(--text-muted); font-size: 10.5px; font-style: normal; }
.land-chain-enc-row > em { display: block; color: var(--text-muted); font-size: 11px; }
.land-chain-enc-row li[data-focus], .land-chain-enc-row li[data-goto] { cursor: pointer; }
.land-chain-enc-row li[data-focus]:hover, .land-chain-enc-row li[data-goto]:hover { text-decoration: underline; }
.land-chain-enc > p { margin: 6px 0 0; color: var(--text-muted); font-size: 10.5px; }
.land-chain-holders td.is-enc { color: #e06a78; }
.land-chain-prov { margin: 8px 14px 10px; color: var(--text-muted); font-size: 10.5px; line-height: 1.5; }
.land-chain-slot.is-flash .land-chain-card { box-shadow: 0 0 0 2px var(--banner-mineral); transition: box-shadow .3s; }
/* Grouped 'Needs attention' and the dated owner check. */
.land-chain-attn li.land-chain-attn-group { list-style: none; margin: 10px 0 2px -16px; color: var(--text-muted);
  font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.land-chain-attn li.land-chain-attn-group:first-child { margin-top: 2px; }
.land-chain-attn li.is-owner_check > span { color: #8cc152; }
.land-chain-ocheck { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-primary); }
.land-chain-ocheck b { display: block; margin-bottom: 2px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); }
.land-chain-ocheck p { margin: 2px 0 0; }
.land-chain-ocheck small { display: block; color: var(--text-muted); font-size: 10.5px; }
.land-chain-ocheck.is-found p { color: #e06a78; }
/* One-line rows: mergers and renamings, re-recordings, surface-only deeds. */
.land-chain-row.is-oneline .land-chain-rail.is-node { padding-top: 8px; }
.land-chain-row.is-oneline .land-chain-rail.is-node::after { top: 13px; width: 8px; height: 8px; right: -5px; }
.land-chain-row.is-oneline .land-chain-rail.is-node b { font-size: 12px; }
.land-chain-oneline { margin: 4px 0 10px; padding: 7px 10px; border-left: 2px solid var(--lc, var(--border));
  font-size: 11.5px; color: var(--text-secondary); background: var(--bg-secondary); border-radius: 0 6px 6px 0; }
/* A one-line row over every lane (it changes no holding, so it has none): as wide as the cards, no wider. */
.land-chain-row > .land-chain-slot[style*="2 / -1"] > .land-chain-oneline { max-width: 560px; }
.land-chain-oneline small { display: block; color: var(--text-muted); font-size: 10.5px; }
.land-chain-oneline small.is-outside { font-style: italic; }
/* A ruling on its card. */
.land-chain-ruling { margin-top: 8px; border: 1px solid color-mix(in srgb, var(--banner-mineral) 55%, var(--border));
  border-radius: 6px; background: color-mix(in srgb, var(--banner-mineral) 10%, transparent); font-size: 11.5px; }
.land-chain-ruling summary { padding: 5px 8px; cursor: pointer; color: var(--text-primary); }
.land-chain-ruling summary b { margin-right: 6px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .08em;
  text-transform: uppercase; color: #a99ff0; }
.land-chain-ruling > p, .land-chain-ruling > ul { margin: 4px 8px; color: var(--text-secondary); }
.land-chain-ruling > ul { padding-left: 16px; }
.land-chain-ruling > p b { color: var(--text-primary); }
.land-chain-ruling-q { font-style: italic; }
.land-chain-attn li[data-goto^="ruling:"] { cursor: pointer; }
/* Compact lanes when a quarter has many holdings. */
.land-chain-body.is-compact .land-chain-card { padding: 9px 10px; font-size: 11.5px; }
.land-chain-body.is-compact { --line-x: 10px; }
.land-chain-body.is-compact .land-chain-slot { padding: 0 6px 0 22px; }
.land-chain-body.is-compact .land-chain-slot::before { left: 5px; }
.land-chain-body.is-compact .land-chain-card h4 { font-size: 12.5px; }
.land-chain-body.is-compact .land-chain-chip { font-size: 10.5px; }
.land-chain-body.is-compact .land-chain-banner { flex-wrap: wrap; gap: 2px 8px; margin: 0 -10px 8px; padding: 5px 10px; font-size: 9px; }
.land-chain-body.is-compact .land-chain-banner > span:last-child { white-space: normal; }
.land-chain-body.is-compact .land-chain-banner > span { white-space: normal; min-width: 0; }
.land-chain-body.is-compact .land-chain-banner b { font-size: 9.5px; letter-spacing: .08em; }
.land-chain-body.is-compact .land-chain-chip { display: flex; flex-wrap: wrap; border-radius: 6px; width: 100%; }
@media (max-width: 700px) { .land-chain-body { --rail-w: 64px; --lane-w: 260px; } }
/* Dense chains (past 26 lanes): lanes are lines a few px apart; a card keeps its width over the lanes beside it. */
.land-chain-body.is-dense { min-width: calc(var(--rail-w) + var(--lanes, 1) * var(--lane-w) + var(--card-w, 240px)); }
.land-chain-body.is-dense .land-chain-slot { min-width: var(--card-w, 240px); }
.land-chain-body.is-dense .land-chain-slot.is-nowgrid { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.land-chain-nowcell { width: var(--card-w, 240px); }
.land-chain-nowcell.is-flash .land-chain-card { box-shadow: 0 0 0 2px var(--banner-mineral); transition: box-shadow .3s; }
.land-plat .land-pages-body { grid-template-columns: minmax(0, 1fr) 10px var(--plat-side, minmax(220px, 26%)); }
.land-plat-side-grip { position: relative; cursor: col-resize; background: transparent; border-left: 1px solid var(--border); touch-action: none; user-select: none; }
.land-plat-side-grip:hover, .land-plat-side-grip.is-dragging { background: rgba(59, 130, 246, .25); }
.land-plat-side-grip button { position: absolute; top: 10px; left: -9px; width: 18px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--plat-box-bg, #131a2a); color: var(--text-secondary); font-size: 11px; line-height: 1; cursor: pointer; z-index: 6; }
.land-plat-side-grip button:hover { color: var(--text-primary); border-color: var(--accent); }
.land-plat .land-pages-body > .land-plat-side { border-left: 0; }
.land-plat .land-pages-body.is-side-folded { --plat-side: 0px; }
.land-plat .land-pages-body.is-side-folded > .land-plat-side { display: none; }
@media (max-width: 900px) { .land-plat .land-pages-body { grid-template-columns: minmax(0, 1fr); } .land-plat-side-grip { display: none; } }
.land-plat-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.land-plat-tabs .land-plat-tab { flex: 0 0 auto; padding: 5px 10px; border: 1px solid transparent; background: transparent;
  color: var(--text-secondary); font-size: 11px; white-space: nowrap; }
.land-plat-tabs .land-plat-tab:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-tertiary); border-color: transparent; }
.land-plat-tabs .land-plat-tab[aria-selected="true"] { color: var(--text-primary); background: var(--bg-tertiary); border-color: var(--accent); }
.land-plat-tabs .land-plat-one { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.land-plat table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.land-plat td { padding: 3px 0; border-bottom: 1px solid var(--border); }
.land-plat td:last-child { text-align: right; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-plat tr.is-total td { border-bottom: 0; font-weight: 600; color: var(--text-primary); }
.land-plat-side a { color: var(--accent-ink, var(--accent)); }
.land-plat-side p { margin: 6px 0 0; }
.land-plat-side tr.is-picked td { background: rgba(77, 208, 225, .13); }
.land-plat-side tr.is-picked td:first-child { box-shadow: inset 3px 0 0 #4dd0e1; padding-left: 9px; }
.land-plat-side p.land-plat-pickline { color: #4dd0e1; }
.land-plat .land-pages-bar button[aria-pressed="false"] { opacity: .6; }
/* The frame shows the township (or the sheet); the sheet layer is the whole image with the patent overlay on it. */
.land-plat-sheet { position: relative; }
#land-plat-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.land-plat-pt { fill-opacity: .13; stroke-opacity: .85; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
/* Patent kinds: cash sale green, homestead blue with a dark blue outline (the outline's lightness as well as its hue
   tells it from green, for the colour-blind; the brighter fill keeps the wash blue on the paper, clear of the pooling
   violet), Indian allotment orange, other light grey. */
.land-plat-pt.is-homestead { fill: #2f6fd1; stroke: #1e3fa8; }
.land-plat-pt.is-cash { fill: #2e8b57; stroke: #2e8b57; }
.land-plat-pt.is-indian { fill: #d9822b; stroke: #d9822b; }
.land-plat-pt.is-dawes { fill: #c0396b; stroke: #9b2453; }
/* The Nations' patents sit exactly on their Dawes allotments: dark ink and a heavier line read over the rose and the paper. */
.land-plat-pt.is-nation { fill: #1b2a4a; stroke: #0b1530; fill-opacity: .18; stroke-width: 2.25; }
/* The 1842 Indian Grant lies under the whole township: it answers a click but is never drawn, selected or not.
   Ground the Dawes map leaves unallotted (no sale deed found yet) is a grey wash with a dashed edge: not established. */
.land-plat-pt.is-grant, .land-plat-pt.is-grant.is-sel, .land-plat-pt.is-grant.is-hover, .land-plat-pt.is-grant.is-also { fill-opacity: 0; stroke-opacity: 0; }
.land-plat-pt.is-unallotted { fill: #6b7280; stroke: #4b5563; fill-opacity: .16; stroke-dasharray: 5 4; }
.land-plat-pt.is-state { fill: #8e44ad; stroke: #6c2a8a; }
.land-plat-pt.is-reserve { fill: #0f8b8d; stroke: #0b6466; }
.land-plat-pt.is-federal { fill: #b7791f; stroke: #8a5a12; }
.land-plat-pt.is-other { fill: #a3a3a3; stroke: #a3a3a3; }
/* Texas cells (the Webb cell plats): two grant kinds Oklahoma has no counterpart for, the lease outlines traced from RRC
   permit plats and P-16s (earlier filings dashed orange, open traces unfilled), allocation wells, provisional units. */
.land-plat-pt.is-scrip { fill: #0e7490; stroke: #0e7490; }
.land-plat-pt.is-headright { fill: #b45309; stroke: #92400e; }
.land-plat-txlease { fill: #a16207; fill-opacity: .07; stroke: #92400e; stroke-width: 2; stroke-dasharray: 9 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-txlease.is-hist { fill: none; stroke: #f97316; stroke-dasharray: 3 4; }
.land-plat-txlease.is-open { fill: none; }
.land-plat-txalloc { fill: none; stroke: #9333ea; stroke-width: 2.5; stroke-dasharray: 7 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-unit.is-prov { stroke-dasharray: 8 5; }
.land-plat-txgrant { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--border); }
/* Leasehold (land-position-map.js leasesSvg): a tract with its mineral chain takes the colour of how most of its
   minerals stand under lease; the patent's own fill steps aside there and its outline stays. */
.land-plat-pt.has-lease { fill-opacity: 0; }
.land-plat-lease { fill: var(--lc); fill-opacity: .32; stroke: var(--lc); stroke-opacity: .9; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-lease-cloud { stroke: none; pointer-events: none; }
.land-plat-lease-exp { fill: none; stroke: #f97316; stroke-width: 3.5; stroke-opacity: .95; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-lease-barbg { fill: #fff; stroke: #1f2937; stroke-width: .8; }
.land-plat-lease-label { font: 600 9px Arial, sans-serif; fill: #111827; stroke: #fff; stroke-width: 3; paint-order: stroke; stroke-linejoin: round; }
.land-plat-lease-label.is-exp { fill: #c2410c; }
#land-plat-svg:not(.lease-tags) .land-plat-lease-tag { display: none; }
.land-plat-lyr-key .sw.is-lease, .land-plat-readout .sw.is-lease, .land-plat-lyr .sw.is-lease { background: var(--lc); opacity: .75; }
.land-plat-lyr-key .sw.is-lease-exp, .land-plat-readout .sw.is-lease-exp { background: transparent; border: 2.5px solid #f97316; }
.land-plat-lyr-key .sw.is-lease-cloud, .land-plat-readout .sw.is-lease-cloud { background: repeating-linear-gradient(-45deg, rgba(127, 29, 29, .55) 0 1.5px, transparent 1.5px 5px); }
.land-plat-leaseblk { margin: 0 0 10px; }
.land-plat-leaseblk > p small { display: block; opacity: .75; margin-top: 2px; }
.land-plat-leaseblk .is-exp { color: #f97316; font-weight: 600; }
.land-plat-leasesub { margin: 6px 0 2px; font-size: 11px; opacity: .8; }
/* A pooling cause's docket and filings, expanded under its entry. */
.land-plat-cdocs { margin-top: 6px; }
.land-plat-cdocs > b { display: block; margin: 8px 0 3px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.land-plat-cdocs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.land-plat-cdocs li { font-size: 12px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.land-plat-cdocs li > span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.land-plat-cdocs-msg { margin: 2px 0; font-size: 11.5px; color: var(--text-muted); }
/* A lease in the plat's list (land-position-map.js leaseRow): the title in the text colour, its status as the bar and a
   chip in the map's lease colours (lifted toward white on the dark theme so the held slate reads), its depths on the
   line under the title. */
.land-plat-poolitem.land-plat-leaseitem { --pcl: color-mix(in srgb, var(--pc) 55%, #fff); border-left: 4px solid var(--pcl);
  background: color-mix(in srgb, var(--pc) 9%, var(--bg-secondary)); }
body.theme-light .land-plat-poolitem.land-plat-leaseitem { --pcl: var(--pc); }
.land-plat-leaseitem .land-plat-leasehead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.land-plat-leaseitem .land-plat-leasehead b { flex: 1 1 140px; min-width: 0; }
.land-plat-leaseitem .land-plat-leasehead b { color: var(--text-primary); font-size: 12px; }
.land-plat-leasechip { flex: none; padding: 1px 7px; border: 1px solid var(--pcl); border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 1.5;
  font-style: normal; white-space: nowrap; color: var(--text-primary); background: color-mix(in srgb, var(--pc) 28%, transparent); }
.land-plat-leaseitem .land-plat-depth { color: var(--text-primary); font-weight: 600; font-size: 11.5px; }
.land-plat-leaseitem .land-plat-depth.is-unread { color: var(--text-muted); font-weight: 400; font-style: italic; }
.land-plat-leaseitem .land-plat-depth.is-split { font-weight: 400; font-size: 11.5px; padding-left: 10px; text-indent: -10px; }
.land-plat-leaseitem .land-plat-depth.is-split::before { content: "↳ "; color: var(--text-muted); }
/* The same depth line at the top of a lease card on the mineral chain. */
.land-chain-depths { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 2px; }
.land-chain-depths .land-plat-depth { color: var(--text-primary); font-weight: 600; font-size: 11.5px; }
.land-chain-depths .land-plat-depth.is-unread { color: var(--text-muted); font-weight: 400; font-style: italic; }
.land-chain-depths .land-plat-depth.is-split { font-weight: 400; padding-left: 10px; text-indent: -10px; }
.land-chain-depths .land-plat-depth.is-split::before { content: "↳ "; color: var(--text-muted); }
.land-plat-leaseitem .land-plat-depth.is-pugh, .land-chain-depths .land-plat-depth.is-pugh { font-weight: 400; color: var(--text-secondary); }
.land-plat-leaseitem .land-plat-depth.is-now, .land-chain-depths .land-plat-depth.is-now { font-weight: 600; color: var(--text-primary); }
.land-plat-leaseacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.land-plat-labs { padding-top: 6px; border-top: 1px solid var(--border); }
.land-plat-labs > p { margin: 2px 0 4px; font-size: 12px; color: var(--text-secondary); }
.land-plat-labs .land-plat-labs-parties { color: var(--text-primary); }
.land-plat-labs .land-chain-facts { margin: 4px 0; font-size: 11.5px; }
.land-plat .land-plat-labs .land-chain-facts td { text-align: left; font-family: inherit; }
.land-plat-labs li small { color: var(--text-muted); }
#land-plat-pdf-tabs[hidden] { display: none; }
/* A well's dated record on its card: the event, its date, what the OCC document says, and the document. */
.land-plat-wrec { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.land-plat-wrec li { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: baseline; }
.land-plat-wrec li > span { grid-column: 1; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.land-plat-wrec li > b { grid-column: 1; font-weight: 600; }
.land-plat-wrec li > small { grid-column: 1; color: var(--text-secondary); line-height: 1.35; }
.land-plat-wrec li > button { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.land-plat-pt.is-hover { fill-opacity: .3; stroke-width: 2; }
.land-plat-pt.is-also { fill-opacity: .3; stroke-width: 2; stroke-dasharray: 6 4; }
/* Selection is magenta: no patent kind uses it, so it never reads as an allotment (orange). */
.land-plat-pt.is-sel { fill-opacity: .42; stroke: #c2185b; stroke-opacity: 1; stroke-width: 3; }
/* The selected section: the township outside it under a veil, the cell in solid magenta on a white halo. Pooling
   sought is a dashed purple line and units a brown one on a halo, so the section's line is solid, heavier and magenta. */
.land-plat-secveil { fill: #0f172a; fill-opacity: .16; fill-rule: evenodd; stroke: none; }
.land-plat-sechalo { fill: none; stroke: #fff; stroke-width: 8; stroke-opacity: .9; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.land-plat-secsel { fill: none; stroke: #c2185b; stroke-width: 3.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* the section grid over the patents (every cell's edge, white on dark) and the section under the pointer, lit and named,
   so a section reads apart from the patent tracts before it is clicked (Dean, 2026-11-03) */
.land-plat-secgrid-dark { fill: none; stroke: #0f172a; stroke-width: 3; stroke-opacity: .32; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.land-plat-secgrid { fill: none; stroke: #fff; stroke-width: 1.4; stroke-opacity: .85; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.land-plat-sechover { fill: #fff; fill-opacity: .14; stroke: #fff; stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-sechover-label { fill: #fff; font-weight: 700; font-family: inherit; text-anchor: middle; dominant-baseline: middle;
  paint-order: stroke; stroke: #0f172a; stroke-width: .35em; stroke-linejoin: round; pointer-events: none; }
#land-plat-img.is-over-sec { cursor: pointer; }
.land-plat .land-pages-img.is-over:not(.is-dragging) { cursor: pointer; }
.land-plat-side i.is-homestead, .land-plat-pat.is-homestead i { background: #1e3fa8; }
.land-plat-side i.is-scrip, .land-plat-pat.is-scrip i { background: #0e7490; }
.land-plat-side i.is-headright, .land-plat-pat.is-headright i { background: #92400e; }
.land-plat-side i.is-cash, .land-plat-pat.is-cash i { background: #2e8b57; }
.land-plat-side i.is-indian, .land-plat-pat.is-indian i { background: #d9822b; }
.land-plat-side i.is-dawes, .land-plat-pat.is-dawes i { background: #c0396b; }
.land-plat-side i.is-nation, .land-plat-pat.is-nation i { background: #1b2a4a; }
.land-plat-side i.is-grant, .land-plat-pat.is-grant i { background: #8a6d2f; }
.land-plat-side i.is-unallotted, .land-plat-pat.is-unallotted i { background: #6b7280; }
.land-plat-side i.is-state, .land-plat-pat.is-state i { background: #8e44ad; }
.land-plat-side i.is-reserve, .land-plat-pat.is-reserve i { background: #0f8b8d; }
.land-plat-side i.is-federal, .land-plat-pat.is-federal i { background: #b7791f; }
.land-plat-side i.is-other, .land-plat-pat.is-other i { background: #a3a3a3; }
.land-plat-side li > i, .land-plat-side button > i, .land-plat-kind i { display: inline-block; width: 9px; height: 9px;
  margin-right: 6px; border-radius: 2px; vertical-align: 0; }
.land-plat-pat { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid #c2185b;
  border-radius: 6px; background: var(--bg-secondary); }
.land-plat-kind { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.land-plat-acts { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.land-plat-acts button { padding: 5px 10px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent);
  color: #fff; font-size: 11.5px; cursor: pointer; }
.land-plat-acts button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Abstract, Document and the plat's patent buttons are supporting actions: light fill, blue text and edge (solid blue is
   kept for the main actions: Run Lease Check, Add task, the selected view). */
.land-plat-acts button { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-ink, var(--accent)); }
.land-plat-acts button:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); border-color: var(--accent); }
body.theme-light .land-plat-acts button { background: #EEF2FA; border-color: #C5D2EC; color: var(--accent); }
body.theme-light .land-plat-acts button:hover { background: #E1E9F8; border-color: var(--accent); }
.land-plat-chain { font-size: 11px; color: var(--text-muted); }
.land-plat-list { list-style: none; margin: 0; padding: 0; }
.land-plat-list button { display: block; width: 100%; padding: 4px 6px; border: 0; border-radius: 4px; background: transparent;
  color: var(--text-primary); font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; }
.land-plat-list button span { color: var(--text-muted); }
.land-plat-list button:hover, .land-plat-list button:focus-visible { background: var(--bg-tertiary); outline: none; }
.land-plat-list button[aria-current="true"] { background: var(--bg-tertiary); box-shadow: inset 2px 0 #c2185b; }
/* Key under the plat bar: what each colour and line on the plat means. */
/* The plat's stage: the image, with the layers button and panel at its top left and the legend floating at its top
   right (the ICOP map's pattern). */
/* The Land view's --bg-secondary is 80% opaque; the boxes over the plat need a solid ground so the plat never shows
   through them. */
.land-plat-stage { position: relative; min-height: 0; min-width: 0; display: flex; --plat-box-bg: #0f1626; }
body.theme-light .land-plat-stage { --plat-box-bg: #f1f5f9; }
.land-plat-stage > .land-pages-img { flex: 1; min-width: 0; }
.land-plat-stage > .land-pages-img.is-fit { overflow: hidden; }
.land-plat-layers-btn { position: absolute; top: 10px; left: 10px; z-index: 6; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--plat-box-bg); color: var(--text-primary); cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.land-plat-layers-btn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.land-plat-layers-btn[hidden] { display: none; }
/* M | L | U | W beside the layers button: one segmented strip, a lit segment is a layer shown. */
.land-plat-quick { position: absolute; top: 10px; left: 52px; z-index: 6; display: flex; height: 36px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--plat-box-bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); overflow: hidden; }
.land-plat-quick[hidden] { display: none; }
.land-plat-quick button { width: 30px; padding: 0; border: 0; border-left: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); font: 600 12px 'JetBrains Mono', monospace; cursor: pointer; }
.land-plat-quick button:first-child { border-left: 0; }
.land-plat-quick button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.land-plat-quick button:disabled { opacity: .35; cursor: default; }
.land-plat-quick button:not(:disabled):hover { color: var(--text-primary); }
.land-plat-quick button[aria-pressed="true"]:hover { color: #fff; filter: brightness(1.1); }
.land-plat-quick button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 640px) { .land-plat-quick { display: none; } }
.land-plat-layers { position: absolute; top: 52px; left: 10px; z-index: 6; width: 270px; max-height: calc(100% - 64px); overflow: auto;
  padding: 8px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--plat-box-bg); box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  font-size: 12.5px; color: var(--text-primary); }
.land-plat-layers[hidden] { display: none; }
.land-plat-ctrls { position: absolute; top: 54px; left: 10px; z-index: 5; display: flex; flex-direction: column; gap: 6px; width: 36px; }
.land-plat-ctrls button, .land-plat-zoom { border: 1px solid var(--border); border-radius: 6px; background: var(--plat-box-bg);
  color: var(--text-primary); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.land-plat-ctrls button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 18px; line-height: 1; }
.land-plat-ctrls button[hidden] { display: none; }
.land-plat-topo-view { position: absolute; inset: 0; z-index: 3; background: #0c111c; }      /* the ground view lies over the plat, under its tools */
.land-plat-topo-view[hidden] { display: none; }
/* The Subterranean view over the plat: clear of the plat's tools (left) and quick switches (top), the block filling the rest. */
.land-plat-sub-view { position: absolute; inset: 0; z-index: 3; box-sizing: border-box; padding: 54px 0 0 56px; display: flex; align-items: stretch; background: #0c111c; }
.land-plat-sub-view[hidden] { display: none; }
.land-plat-sub-view > .lt3-panel { display: flex; flex-direction: column; text-transform: none; letter-spacing: 0; }
.land-plat-sub-view > .land-act2-3d { aspect-ratio: auto; max-height: none; height: 100%; }
.land-plat-ctrls button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.land-plat-ctrls button:hover:not(:disabled) { border-color: var(--accent); }
.land-plat-ctrls button:disabled { opacity: .4; cursor: default; }
.land-plat-ctrls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Adjoining townships: a compass of eight arrows at the plat's top right, the township open at its centre. An arrow
   opens that township's plat; a greyed arrow has no plat held. Clear of the plat's scrollbar when it is zoomed. */
.land-plat-nav { position: absolute; top: 10px; right: 22px; z-index: 6; display: grid; grid-template-columns: repeat(3, 28px);
  grid-auto-rows: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--plat-box-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); overflow: hidden; }
.land-plat-nav[hidden] { display: none; }
.land-plat-nav button { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--text-primary); cursor: pointer; }
.land-plat-nav button svg { width: 15px; height: 15px; transform: rotate(var(--turn, 0deg)); }
.land-plat-nav button:disabled { opacity: .25; cursor: default; }
.land-plat-nav button:not(:disabled):hover { background: var(--accent); color: #fff; }
.land-plat-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-plat-nav i { place-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
/* OCC hearings ahead (land-position-map.js calRender): over the plat as a document opened from it (.land-opp-pdf), its
   bar with the Month / Day switch and the arrows, the area and operator under it, then the Month grid or the Day list. */
.land-plat-cal { font-size: 12.5px; color: var(--text-primary);
  --cal-canvas: var(--bg-primary); --cal-cell: #222d41; --cal-has: #273859; --cal-line: var(--border); }
body.theme-light .land-plat-cal { --cal-canvas: #F8FAFC; --cal-cell: #ffffff; --cal-has: #F0F5FF; --cal-line: #E2E8F0; }
/* The calendar's own bar is a toolbar, not a band: the title, the month (or day) between its arrows, the Month / Day
   switch at the right. */
.land-opp-pdf-bar.land-plat-cal-bar { flex-wrap: wrap; gap: 12px; background: var(--bg-primary); }
.land-plat-cal-title { font: 600 12.5px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
body.theme-light .land-plat-cal-title { color: #1F3B63; }
.land-plat-cal-views { display: flex; margin-left: auto; }
.land-plat-cal-views button { border-radius: 0; padding: 5px 14px; font-size: 12px; }
.land-plat-cal-views button:first-child { border-radius: 6px 0 0 6px; }
.land-plat-cal-views button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.land-opp-pdf-bar .land-plat-cal-views button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.land-plat-cal-nav { display: flex; align-items: center; gap: 6px; }
.land-plat-cal-nav b { padding: 0 6px; text-align: center; font-size: 17px; font-weight: 700; color: var(--title-strong); white-space: nowrap; }
.land-opp-pdf-bar .land-plat-cal-nav button { width: 30px; height: 30px; padding: 0; border-radius: 6px; font-size: 17px; line-height: 1; }
.land-opp-pdf-bar .land-plat-cal-nav button:disabled { opacity: .35; cursor: default; border-color: var(--border); }
.land-plat-cal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; border-bottom: 1px solid var(--cal-line); }
.land-plat-cal-tools .land-plat-cal-scope, .land-plat-cal-tools .land-plat-cal-op { padding: 0; }
.land-plat-cal-tools .land-plat-cal-scope { gap: 6px; }
.land-plat-cal-tools .land-plat-cal-scope button { flex: none; height: 30px; padding: 0 14px; border-radius: 8px; font-size: 12px; }
.land-plat-cal-tools .land-plat-cal-op { width: 260px; max-width: 100%; }
.land-plat-cal-tools .land-plat-cal-op input { height: 30px; border-radius: 8px; }
.land-plat-cal-tools .land-plat-cal-sum { margin: 0; font-size: 12.5px; }
.land-plat-cal-sum b { color: var(--text-primary); font-weight: 600; }
.land-plat-cal-sum small { display: block; margin-top: 1px; font-size: 11px; color: var(--text-muted); }
.land-plat-cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--cal-canvas); }
/* Month: Monday to Friday, the weeks sharing the height. Each day white (a panel tone in dark), tinted where it has
   hearings, today outlined; its date, a count badge, and its hearings by applicant with a mark per kind of relief. */
.land-plat-calm { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 14px 8px; }
.land-plat-calm-head { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.land-plat-calm-head em { font: normal 600 10.5px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); text-align: left; padding-left: 8px; }
.land-plat-calm-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(92px, 1fr);
  gap: 6px; overflow: auto; }
.land-plat-calm-cell { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 6px 7px; border: 1px solid var(--cal-line);
  border-radius: 8px; background: var(--cal-cell); overflow: hidden; }
.land-plat-calm-cell.is-pad { border-color: transparent; background: transparent; }
.land-plat-calm-cell.is-past { opacity: .5; }
.land-plat-calm-cell.has { background: var(--cal-has); }
.land-plat-calm-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.land-plat-calm-day { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 1px 2px; border: 0; background: none;
  color: var(--text-primary); text-align: left; cursor: pointer; }
.land-plat-calm-day b { font: 600 14.5px 'JetBrains Mono', monospace; }
.land-plat-calm-day:disabled { cursor: default; }
.land-plat-calm-day:disabled b { color: var(--text-muted); font-weight: 500; }
.land-plat-calm-day:not(:disabled):hover b { color: var(--accent-ink, var(--accent)); }
.land-plat-calm-n { padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.land-plat-calm-chip, .land-plat-calm-more { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding: 2px 6px; border: 1px solid var(--cal-line);
  border-radius: 5px; background: var(--cal-cell); color: var(--text-primary); font-size: 11.5px; text-align: left; cursor: pointer; }
.land-plat-calm-chip:hover { border-color: var(--accent); }
.land-plat-calm-marks { display: inline-flex; gap: 2px; flex: none; }
.land-plat-calm-mark { display: inline-block; width: 4px; height: 13px; border-radius: 2px; background: var(--rk); }
.land-plat-calm-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.land-plat-calm-chip em { flex: none; margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--text-secondary); }
.land-plat-calm-more { border-color: transparent; background: none; padding: 0 6px; color: var(--accent-ink, var(--accent)); font-size: 11px; }
.land-plat-calm-key { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 2px 0; font-size: 11px; color: var(--text-secondary); }
.land-plat-calm-key span { display: inline-flex; align-items: center; gap: 6px; }
.land-plat-calm-key .is-warn { color: #b45309; }
/* Day: the small month beside the day's hearings, each card edged in its relief's colour. */
.land-plat-cald { flex: 1; min-height: 0; display: flex; }
.land-plat-cald-side { flex: none; width: 250px; padding: 4px 0; border-right: 1px solid var(--cal-line); background: var(--bg-primary); }
.land-plat-cald .land-plat-cal-list { border-top: 0; padding: 8px 16px 10px; }
.land-plat-cald .land-plat-cal-list ul { max-width: 860px; }
@media (max-width: 760px) {
  .land-plat-cald { flex-direction: column; }
  .land-plat-cald-side { width: auto; border-right: 0; border-bottom: 1px solid var(--cal-line); }
  .land-plat-calm-chip, .land-plat-calm-more { display: none; }
  .land-plat-calm-grid { grid-auto-rows: minmax(48px, 1fr); }
}
.land-plat-cal-scope { display: flex; gap: 4px; padding: 8px 12px 0; }
.land-plat-cal-scope button { flex: 1; padding: 4px 0; border: 1px solid var(--border); border-radius: 5px; background: transparent;
  color: var(--text-secondary); font-size: 11.5px; cursor: pointer; }
.land-plat-cal-scope button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
body.theme-light .land-plat-cal-scope button:not([aria-pressed="true"]) { background: #fff; border-color: #CBD5E1; color: #334155; }
.land-plat-cal-scope button:not([aria-pressed="true"]):not(:disabled):hover { border-color: var(--accent); }
.land-plat-cal-scope button:disabled { opacity: .4; cursor: default; }
.land-plat-cal-op { padding: 8px 12px 0; }
.land-plat-cal-op input { width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-secondary); color: var(--text-primary); font-size: 12px; }
.land-plat-cal-month { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 2px; }
.land-plat-cal-month button { width: 26px; height: 22px; border: 1px solid var(--border); border-radius: 5px; background: transparent;
  color: var(--text-primary); cursor: pointer; font-size: 15px; line-height: 1; }
.land-plat-cal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 4px 12px; }
.land-plat-cal-grid em { font: normal 600 9.5px 'JetBrains Mono', monospace; color: var(--text-muted); text-align: center; }
.land-plat-cal-grid button { position: relative; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--text-muted); font-size: 11.5px; cursor: default; }
.land-plat-cal-grid button.has { color: var(--text-primary); background: var(--bg-secondary); cursor: pointer; }
.land-plat-cal-grid button.has:hover { border-color: var(--accent); }
.land-plat-cal-grid button.is-today { border-color: var(--text-muted); }
.land-plat-cal-grid button.is-on { background: var(--accent); color: #fff; }
.land-plat-cal-grid button i { position: absolute; right: 2px; bottom: 1px; font: normal 600 8.5px 'JetBrains Mono', monospace; color: var(--accent-ink, var(--accent)); }
.land-plat-cal-grid button.is-on i { color: #fff; }
.land-plat-cal-sum { margin: 4px 12px 6px; font-size: 11.5px; color: var(--text-secondary); }
.land-plat-cal-list { flex: 1; min-height: 60px; overflow: auto; padding: 0 12px 6px; border-top: 1px solid var(--border); }
.land-plat-cal-list h6 { margin: 10px 0 4px; font: 600 10.5px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.land-plat-cal-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.land-plat-cal-list li { padding: 8px 10px; border: 1px solid var(--cal-line); border-left: 4px solid var(--rk, var(--accent)); border-radius: 6px; background: var(--cal-cell);
  display: flex; flex-direction: column; gap: 2px; }
.land-plat-cal-list li[data-calcause] { cursor: pointer; }
.land-plat-cal-list li[data-calcause]:hover { border-color: var(--accent); border-left-color: var(--rk, var(--accent)); }
.land-plat-cal-list li.is-open { cursor: default; background: var(--cal-has); }
.land-plat-cal-caret { font-style: normal; color: var(--text-muted); width: 10px; text-align: center; }
.land-plat-cal-docs { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); cursor: default; }
.land-plat-cal-docs ul { gap: 3px; }
.land-plat-cal-docs li { padding: 0; border: 0; background: none; flex-direction: row; gap: 6px; border-radius: 0; }
.land-plat-cal-row { display: flex; gap: 8px; align-items: baseline; }
.land-plat-cal-row span { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.land-plat-cal-row small { margin-left: auto; color: var(--text-muted); }
.land-plat-cal-what { color: var(--text-primary); }
.land-plat-cal-who { color: var(--text-secondary); }
.land-plat-cal-where { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 11.5px; color: var(--text-secondary); }
.land-plat-cal-list li > small { color: var(--text-muted); font-size: 11px; }
.land-plat-cal-none { color: var(--text-muted); }
.land-plat-cal-note { margin: 0; padding: 6px 14px 8px; border-top: 1px solid var(--cal-line); font-size: 10.5px; color: var(--text-muted); background: var(--cal-canvas); }
.land-plat-zoom { display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.land-plat-zoom button { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.land-plat-zoom span { width: 100%; padding: 2px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font: 9.5px 'JetBrains Mono', monospace; color: var(--text-secondary); text-align: center; }
.land-pages-bar[hidden] { display: none; }
.land-plat-lyr-h { padding: 2px 14px 8px; border-bottom: 1px solid var(--border); font: 600 11px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.land-plat-lyr-g { padding: 10px 14px 4px; font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-plat-lyr { display: flex; align-items: center; gap: 8px; padding: 4px 14px; cursor: pointer; }
.land-plat-lyr:hover { background: var(--bg-tertiary); }
.land-plat-lyr.is-sub { padding-left: 34px; font-size: 12px; color: var(--text-secondary); }
.land-plat-lyr.is-off { opacity: .45; }
.land-plat-lyr small { margin-left: auto; color: var(--text-muted); }
.land-plat-lyr .sw { width: 14px; height: 10px; border: 1.5px solid; border-radius: 2px; box-sizing: border-box; flex: none; }
.land-plat-lyr input { accent-color: var(--accent); }
/* Each layer's key in the layers panel, under its options (land-position-map.js layerKey); the footer readout shows the
   same marks beside what is under the pointer. */
.land-plat-lyr-key { display: flex; flex-direction: column; gap: 3px; padding: 2px 14px 6px 34px; font-size: 11.5px;
  color: var(--text-secondary); }
.land-plat-lyr-key.is-off { opacity: .45; }
.land-plat-lyr-key span { display: inline-flex; align-items: center; gap: 8px; }
.land-plat-lyr-key span.is-past { opacity: .6; }
.land-plat-readout .sw { display: inline-block; vertical-align: -1px; margin-right: 5px; }
.land-plat-readout .land-plat-wicon { vertical-align: -2px; margin-right: 4px; }
.land-plat-readout { min-height: 1.5em; font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.land-plat-lyr-key .sw, .land-plat-readout .sw { width: 16px; height: 10px; border: 1.5px solid; border-radius: 2px; box-sizing: border-box; }
/* OCC wells on the plat, in the Texas RRC map symbology (land-position-map.js wellsSvg): a symbol keeps one size on
   screen (--ws, image pixels per screen pixel); the lateral is a dark line from surface to where the hole ends. */
#land-plat-svg .land-plat-wsym { transform: scale(var(--ws, 1)); }
.land-plat-well.is-past, .land-plat-lat.is-past { opacity: .55; }
#land-plat-svg.is-busy .land-plat-pt:not(.is-sel):not(.is-hover):not(.is-also) { stroke-width: .75; stroke-opacity: .45; }
/* The plat's operator view (land-position-map.js opSvg): each unit's sections washed in its operator's colour, striped
   where units of different operators overlap; the patents and leases step back under it. */
.land-plat-op { fill-opacity: .42; stroke-width: 2; stroke-opacity: .9; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-op.is-dim { fill-opacity: .08; stroke-opacity: .2; }
#land-plat-svg.is-opview .land-plat-pt:not(.is-sel) { fill-opacity: .03; }
#land-plat-svg.is-opview .land-plat-lease { fill-opacity: .06; stroke-opacity: .25; }
#land-plat-svg.is-opview .land-plat-lease-cloud { opacity: .25; }
.land-plat-lyr-key .sw.is-op, .land-plat-readout .sw.is-op, .land-plat-opline .sw.is-op, .land-plat-oplist .sw.is-op {
  display: inline-block; width: 16px; height: 10px; border: 1.5px solid var(--oc); border-radius: 2px; box-sizing: border-box;
  background: color-mix(in srgb, var(--oc) 60%, transparent); }
.land-plat-lyr-key .sw.is-op.is-mixed { border-color: #64748b; background: repeating-linear-gradient(45deg, #ea580c 0 4px, #16a34a 4px 8px, #9333ea 8px 12px); }
.land-plat-opline .sw.is-op { vertical-align: -1px; margin-right: 6px; }
.land-plat-oplist { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 2px; }
.land-plat-oplist button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: var(--text-primary); font-size: 12px; text-align: left; cursor: pointer; }
.land-plat-oplist button:hover { background: var(--bg-secondary); }
.land-plat-oplist button[aria-current="true"] { border-color: var(--accent); background: var(--bg-secondary); }
.land-plat-oplist button span { margin-left: auto; color: var(--text-muted); font-size: 11px; }
.land-plat-lat { fill: none; stroke: #1b1b1b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* A lateral drawn from its drilling permit (the well not yet completed): dashed, so it never reads as a drilled path. */
.land-plat-lat.is-proposed { stroke-dasharray: 7 5; stroke-linecap: butt; }
.land-plat-lyr-key .sw.is-lat, .land-plat-readout .sw.is-lat { height: 0; border: 0; border-top: 2px solid #1b1b1b; border-radius: 0; }
.land-plat-lyr-key .sw.is-lat.is-proposed, .land-plat-readout .sw.is-lat.is-proposed { border-top-style: dashed; }
/* The plat draws laterals near-black on the parchment; on the dark panel the key shows the line light enough to see. */
.land-plat-lyr-key .sw.is-lat, .land-plat-readout .sw.is-lat { border-top-color: #cbd5e1; }
body.theme-light .land-plat-lyr-key .sw.is-lat, body.theme-light .land-plat-readout .sw.is-lat { border-top-color: #1b1b1b; }
.land-plat-wicon { flex: none; vertical-align: -3px; margin-right: 5px; }
.land-plat-wcard { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid #c2185b; border-radius: 6px; background: var(--bg-secondary); }
.land-plat-wcard h4 { display: flex; align-items: center; margin: 0 0 6px; }
.land-plat-wcount { margin: 0 0 6px; font-size: 12px; }
.land-plat-wcount small { display: block; color: var(--text-muted); }
/* OCC pooling on the plat (land-position-map.js poolSvg): each pooled section hatched in its most pressing status. */
.land-plat-pool { stroke-width: 3; stroke-opacity: .9; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-pool.is-lapsed { stroke-dasharray: 4 4; stroke-opacity: .6; }
.land-plat-pool.is-sought { stroke-dasharray: 10 5; }
/* Drilling and spacing units (land-position-map.js unitsSvg): one brown outline per unit over a white halo, a label at
   its centre that keeps one size on screen. */
.land-plat-unit-halo { fill: none; stroke: #fff; stroke-width: 5; stroke-opacity: .75; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.land-plat-unit { fill: none; stroke: #7c2d12; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.land-plat-unit-label { font: 600 9px Arial, sans-serif; fill: #7c2d12; stroke: #fff; stroke-width: 3; paint-order: stroke; stroke-linejoin: round; }
/* Company layers (land-position-map.js companySvg / companyHtml / companyControl): a section shaded by its value with
   the value at its centre on the plat; on the map, a panel at the top right. One layer shows at a time. */
.land-plat-co { stroke: #334155; stroke-width: .8; stroke-opacity: .5; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-co.is-weak { stroke-dasharray: 5 4; stroke-width: 1.4; stroke-opacity: .8; }
.land-plat-co-label { font: 700 10px Arial, sans-serif; fill: #0f172a; stroke: #fff; stroke-width: 3; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
#land-plat-svg.is-company .land-plat-pt:not(.is-sel) { fill-opacity: .03; }
/* Activity (land-position-map.js actSvg): sections with recorded instruments tinted, a count pill with a mark per kind,
   and an orange diamond with the count of OCC events; held at one size on screen. */
.land-plat-act { fill: #0ea5e9; fill-opacity: .16; stroke: #0284c7; stroke-opacity: .55; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.land-plat-act-pill { fill: #0f172a; fill-opacity: .88; stroke: #fff; stroke-width: 1.5; }
.land-plat-act-n { font: 700 12px Arial, sans-serif; fill: #fff; pointer-events: none; }
.land-plat-act-occ { fill: #ea580c; stroke: #fff; stroke-width: 1.5; }
.land-plat-act-on { font: 700 9px Arial, sans-serif; fill: #fff; pointer-events: none; }
#land-plat-svg .land-plat-actmark { pointer-events: auto; cursor: help; }
/* The activity key (land-position-map.js actKeyRender): bottom left of the plat, folding to its title line. */
.land-plat-actkey { position: absolute; left: 10px; bottom: 10px; z-index: 6; width: 290px; max-width: calc(100% - 20px); padding: 0 0 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--plat-box-bg); box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  font-size: 12px; color: var(--text-secondary); }
.land-plat-actkey[hidden] { display: none; }
.land-plat-actkey-h { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 12px 6px; border: 0; background: none;
  color: var(--text-secondary); font-size: 12px; text-align: left; cursor: pointer; }
.land-plat-actkey-h b { color: var(--text-primary); }
.land-plat-actkey-h i { margin-left: auto; font-style: normal; color: var(--text-muted); }
.land-plat-actkey:has(.land-plat-actkey-h[aria-expanded="false"]) { padding-bottom: 0; }
.land-plat-actkey-win { display: flex; margin: 2px 12px 6px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.land-plat-actkey-win button { flex: 1; padding: 4px 0; border: 0; background: transparent; color: var(--text-secondary); font-size: 11.5px; cursor: pointer; }
.land-plat-actkey-win button + button { border-left: 1px solid var(--border); }
.land-plat-actkey-win button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.land-plat-actkey-dates { margin: 0 12px 6px; font-size: 11px; color: var(--text-muted); }
.land-plat-actkey-legend { list-style: none; margin: 0 12px; padding: 0; display: grid; gap: 5px; }
.land-plat-actkey-legend li { display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.land-plat-actkey-legend li.is-kinds { flex-wrap: wrap; gap: 3px 10px; padding-left: 4px; font-size: 11px; }
.land-plat-actkey-legend li.is-kinds span { display: inline-flex; align-items: center; gap: 5px; }
.land-plat-actkey-pill { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 17px; border: 1.5px solid #fff; border-radius: 9px;
  background: #0f172a; color: #fff; font: normal 700 11px Arial, sans-serif; box-shadow: 0 0 0 1px rgba(15, 23, 42, .3); }
.land-plat-actkey-occ { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0 5px; background: #ea580c;
  border: 1.5px solid #fff; transform: rotate(45deg); }
.land-plat-actkey-occ b { transform: rotate(-45deg); color: #fff; font: normal 700 9px Arial, sans-serif; }
.land-plat-actkey-hint { margin: 6px 12px 0; font-size: 11px; color: var(--text-muted); }
#land-plat-svg.is-activity .land-plat-pt:not(.is-sel) { fill-opacity: .04; }
#land-plat-svg.is-activity .land-plat-lease { fill-opacity: .08; stroke-opacity: .3; }
.sw.is-act { background: rgba(14, 165, 233, .35); border-color: #0284c7 !important; }
.sw.is-actk { width: 10px !important; height: 10px !important; background: var(--ak); border-color: var(--ak) !important; }
.sw.is-actocc { width: 11px !important; height: 11px !important; background: #ea580c; border-color: #ea580c !important; transform: rotate(45deg) scale(.8); }
#land-plat-svg.is-company .land-plat-lease { fill-opacity: .06; stroke-opacity: .3; }
#land-plat-svg.is-company .land-plat-lease-cloud { opacity: .25; }
.sw.is-co { display: inline-block; width: 16px; height: 10px; border: 1px solid rgba(15, 23, 42, .5); border-radius: 2px; box-sizing: border-box;
  background: var(--cc); vertical-align: -1px; margin-right: 6px; }
.land-plat-lyr.is-co { align-items: flex-start; }
.land-plat-lyr.is-co span { display: flex; flex-direction: column; }
.land-plat-lyr.is-co span small { margin-left: 0; font-size: 10.5px; }
.land-co-key { padding: 4px 14px 6px 36px; display: grid; gap: 4px; font-size: 11px; color: var(--text-secondary); }
.land-co-key > i { display: block; height: 10px; border-radius: 2px; border: 1px solid var(--border); }
.land-co-key > span { display: flex; justify-content: space-between; color: var(--text-muted); }
.land-co-op { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.land-co-op input { flex: 1; accent-color: var(--accent); }
.land-co-add { margin: 6px 14px 10px; padding: 5px 10px; border: 1px dashed var(--border); border-radius: 5px; background: transparent;
  color: var(--text-primary); font-size: 12px; cursor: pointer; }
.land-co-add:hover { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.land-co-ctl { position: relative; --plat-box-bg: #0f1626; color: var(--text-primary); font-size: 12.5px; }
body.theme-light .land-co-ctl { --plat-box-bg: #f1f5f9; }
.land-co-ctl.is-open { z-index: 1001; }      /* over the zoom control below it while open */
.land-co-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: var(--plat-box-bg); color: var(--text-primary); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.land-co-btn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.land-co-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-co-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b;
  box-shadow: 0 0 0 1.5px var(--plat-box-bg); }
.land-co-body { position: absolute; top: 42px; left: 0; z-index: 1000; width: 270px; max-height: 60vh; overflow: auto; padding: 8px 0 2px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--plat-box-bg); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.land-co-body .land-plat-lyr { padding: 5px 14px; }
.land-co-body .land-co-key { padding-left: 36px; padding-right: 14px; }
.land-co-body .land-co-add { margin: 6px 14px 8px; }
.land-co-sel { margin: 0; padding: 6px 10px 8px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-secondary); }
.land-plat-lyr-key .sw.is-unit, .land-plat-readout .sw.is-unit, .land-plat-lyr .sw.is-unit { height: 0; border: 0; border-top: 2.5px solid #7c2d12; border-radius: 0; }
.land-plat-poolitem.is-dim { opacity: .6; }
#land-plat-svg.is-far .land-plat-unit-label { display: none; }
.land-plat-lyr-key .sw.is-pool, .land-plat-readout .sw.is-pool, .land-plat-lyr .sw.is-pool { border-color: var(--pc); background: repeating-linear-gradient(45deg, var(--pc) 0 2px, transparent 2px 5px); opacity: .85; }
/* Lapsed or dismissed pooling is hatched the other way on the plat, so it never reads as a live order. */
.land-plat-lyr-key .sw.is-pool.is-lapsed, .land-plat-readout .sw.is-pool.is-lapsed, .land-plat-lyr .sw.is-pool.is-lapsed { background: repeating-linear-gradient(-45deg, var(--pc) 0 2px, transparent 2px 5px); }
.land-plat-pools-list { list-style: none; margin: 0 0 8px; padding: 0; }
.land-plat-poolitem { display: flex; flex-direction: column; gap: 1px; margin: 0 0 8px; padding: 6px 8px; border-left: 3px solid var(--pc);
  background: var(--bg-secondary); border-radius: 4px; font-size: 12px; }
.land-plat-poolitem b { color: var(--pc); font-size: 11.5px; }
.land-plat-poolitem span { color: var(--text-secondary); }
.land-plat-poolitem small { color: var(--text-muted); }
.land-plat-lyr-key .sw.is-homestead, .land-plat-readout .sw.is-homestead, .land-plat-lyr .sw.is-homestead { border-color: #1e3fa8; background: rgba(47, 111, 209, .3); }
.land-plat-lyr-key .sw.is-cash, .land-plat-readout .sw.is-cash, .land-plat-lyr .sw.is-cash { border-color: #2e8b57; background: rgba(46, 139, 87, .3); }
.land-plat-lyr-key .sw.is-indian, .land-plat-readout .sw.is-indian, .land-plat-lyr .sw.is-indian { border-color: #d9822b; background: rgba(217, 130, 43, .3); }
.land-plat-lyr-key .sw.is-dawes, .land-plat-readout .sw.is-dawes, .land-plat-lyr .sw.is-dawes { border-color: #c0396b; background: rgba(192, 57, 107, .3); }
.land-plat-lyr-key .sw.is-nation, .land-plat-readout .sw.is-nation, .land-plat-lyr .sw.is-nation { border-color: #0b1530; background: rgba(27, 42, 74, .35); }
.land-plat-lyr-key .sw.is-grant, .land-plat-readout .sw.is-grant, .land-plat-lyr .sw.is-grant { border-color: #8a6d2f; background: transparent; }
.land-plat-lyr-key .sw.is-unallotted, .land-plat-readout .sw.is-unallotted, .land-plat-lyr .sw.is-unallotted { border-color: #4b5563; border-style: dashed; background: rgba(107, 114, 128, .15); }
.land-plat-lyr-key .sw.is-state, .land-plat-readout .sw.is-state, .land-plat-lyr .sw.is-state { border-color: #8e44ad; background: rgba(142, 68, 173, .3); }
.land-plat-lyr-key .sw.is-reserve, .land-plat-readout .sw.is-reserve, .land-plat-lyr .sw.is-reserve { border-color: #0f8b8d; background: rgba(15, 139, 141, .3); }
.land-plat-lyr-key .sw.is-federal, .land-plat-readout .sw.is-federal, .land-plat-lyr .sw.is-federal { border-color: #b7791f; background: rgba(183, 121, 31, .3); }
.land-plat-lyr-key .sw.is-other, .land-plat-readout .sw.is-other, .land-plat-lyr .sw.is-other { border-color: #a3a3a3; background: rgba(163, 163, 163, .3); }
.land-plat-lyr-key .sw.is-scrip, .land-plat-readout .sw.is-scrip, .land-plat-lyr .sw.is-scrip { border-color: #0e7490; background: rgba(14, 116, 144, .3); }
.land-plat-lyr-key .sw.is-headright, .land-plat-readout .sw.is-headright, .land-plat-lyr .sw.is-headright { border-color: #92400e; background: rgba(180, 83, 9, .3); }
.land-plat-lyr-key .sw.is-txlease, .land-plat-readout .sw.is-txlease { border: 2px dashed #92400e; background: rgba(161, 98, 7, .15); }
.land-plat-lyr-key .sw.is-txlease.is-hist, .land-plat-readout .sw.is-txlease.is-hist { border-color: #f97316; background: transparent; }
.land-plat-lyr-key .sw.is-txalloc, .land-plat-readout .sw.is-txalloc { height: 0; border: 0; border-top: 2.5px dashed #9333ea; border-radius: 0; }
.land-plat-lyr-key .sw.is-sel, .land-plat-readout .sw.is-sel { border: 2.5px solid #c2185b; background: rgba(194, 24, 91, .15); }
.land-plat-lyr-key .sw.is-also, .land-plat-readout .sw.is-also { border: 1.5px dashed var(--text-secondary); }
.land-plat-lyr-key .sw.is-secsel, .land-plat-readout .sw.is-secsel { border: 3px solid #c2185b; box-shadow: 0 0 0 2px #fff; }
.land-plat-legend { list-style: none; margin: 0; padding: 0; font-size: 11.5px; }
.land-plat-side table th { padding: 0 0 2px; text-align: right; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); }
.land-plat-legend span { float: right; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-pdf-busy { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center;
  justify-content: center; background: rgba(8, 13, 24, .45); }
.land-pdf-busy[hidden] { display: none; }
.land-pdf-card { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 340px;
  padding: 22px 26px; border: 1px solid var(--border); border-radius: 10px; text-align: center;
  background: var(--bg-secondary); color: var(--text-primary); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.land-pdf-card strong { font-size: 14px; }
.land-pdf-card span { font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }
.land-pdf-card button { margin-top: 6px; color: var(--text-primary); border: 1px solid var(--border);
  background: var(--bg-tertiary); padding: 6px 12px; border-radius: 5px; font-size: 11px; cursor: pointer; }
.land-pdf-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--accent); animation: land-pdf-spin .8s linear infinite; }
.land-pdf-busy.is-err .land-pdf-spin { display: none; }
.land-pdf-busy.is-err strong { color: var(--danger); }
@keyframes land-pdf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .land-pdf-spin { animation-duration: 2.4s; } }
@media (max-width: 820px) {
  .land-position.is-doc .land-map-toolbar > .land-pdf-name { flex-basis: 100%; }
}
@media (max-width: 820px) {
  .land-page .land-rail { flex-basis: 210px; }
  .land-page .land-position { margin: 6px; }
  .land-map-toolbar { gap: 6px; padding: 9px; }
}
.land-page .land-top .land-aoi { align-self: flex-end; margin: 12px 18px 0; }
.land-page .app-header .land-lenses { grid-row: 1; grid-column: 2; justify-self: center; margin: 0; }
/* Return to ICOP is kept in place and clickable but drawn in the header's own colour (transparent text), so it does not
   show during a presentation, in either theme or on hover. */
.land-page .app-header .land-return-link { display: block; grid-row: 1; grid-column: 3;
  color: transparent; font-size: 11px; text-decoration: none; padding: 8px; }
.land-page .land-return-link:hover { color: transparent; }
.land-page .app-header .theme-toggle { grid-column: 4; }
.land-page .app-header .app-customer { grid-column: 5; }
/* NORRIS is a demo for no one company: the account chip and its menu show who is signed in, not the account's company. */
.land-page .app-org { display: none !important; }
/* Presentation, 2026-10-28 (Dean): the NORRIS map's attribution line is hidden. Esri's basemap terms require it shown,
   so remove this rule after the presentation. */
.land-page .land-position .leaflet-control-attribution { display: none !important; }
.land-rail-scroll { display: contents; }
.land-side-foot { display: none; }
/* /norris: the rail collapses to a strip holding its toggle; the map and plat refit to the space it frees. */
.land-rail-toggle { display: none; }
.land-page .land-rail { position: relative; transition: flex-basis .18s ease; }
.land-page .land-rail-h { padding-right: 30px; }
.land-page .land-rail-toggle { display: flex; align-items: center; justify-content: center; position: absolute; z-index: 2;
  top: 7px; right: 7px; width: 24px; height: 24px; padding: 0 0 2px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-tertiary); color: var(--text-secondary); font-size: 16px; line-height: 1; cursor: pointer; }
.land-page .land-rail-toggle:hover { color: var(--text-primary); border-color: var(--accent); }
.land-page .land-rail-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-page .land-rail.is-collapsed { flex-basis: 38px; overflow: hidden; }
.land-page .land-rail.is-collapsed .land-rail-scroll,
.land-page .land-rail.is-collapsed .land-side-foot { display: none; }
@media (prefers-reduced-motion: reduce) { .land-page .land-rail { transition: none; } }
.land-page .land-rail-scroll { display: block; flex: 1 1 0; min-height: 0; overflow: auto; }
.land-page .land-side-foot {
  display: flex; flex-direction: column; flex: 0 0 auto; gap: 1px;
  padding: 10px 12px 12px; border-top: 1px solid var(--border);
}
.land-foot-gen { font: 600 10px Helvetica, Arial, sans-serif;
  letter-spacing: .5px; color: var(--text-muted); }
.land-foot-brand { font: 700 17px Helvetica, Arial, sans-serif;
  letter-spacing: .2px; color: var(--text-primary); }
@media (max-width: 820px) {
  .land-page .app-header { gap: 10px; }
  .land-page .land-brand .title-sub { max-width: 240px; }
}

/* ── LAND workbench ─────────────────────────────────────────────────────
   Same container contract as .mode-reservoir / .mode-inventory: hidden until
   switchMode() adds .visible. Empty shell for now. */
.mode-land { width: 100%; height: 100%; display: none; position: relative; overflow: hidden; }
.mode-land.visible { display: flex; }
/* Themed scrollbars on every Land scroller (the stream, the fed list, verbatim
   authority, the rail) -- the native light scrollbar clashes on the dark
   surface. Same canonical idiom as .analysis-main / .sidebar. scrollbar-color
   inherits; scrollbar-width does not, hence the descendant rule. */
.mode-land { scrollbar-color: #3a4558 rgba(0,0,0,0.2); }
.mode-land * { scrollbar-width: thin; }
.mode-land ::-webkit-scrollbar { width: 10px; height: 10px; }
.mode-land ::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.mode-land ::-webkit-scrollbar-thumb { background: #3a4558; border-radius: 5px; border: 2px solid var(--bg-secondary); }
.mode-land ::-webkit-scrollbar-thumb:hover { background: #4a5568; }
.mode-land ::-webkit-scrollbar-corner { background: rgba(0,0,0,0.2); }
body.theme-light .mode-land { scrollbar-color: #8FA5C2 rgba(15,23,42,0.06); }
body.theme-light .mode-land ::-webkit-scrollbar-track { background: rgba(15,23,42,0.06); }
body.theme-light .mode-land ::-webkit-scrollbar-thumb { background: #8FA5C2; border-color: #D6DEE8; }
/* Lens scoping. #mode-land carries data-lens (activity | position); anything
   tagged data-lens-only shows on that lens alone, untagged content on both.
   [hidden] is forced because several land classes set their own display. */
.mode-land [hidden] { display: none !important; }
#mode-land:not([data-lens="activity"]) [data-lens-only="activity"],
#mode-land:not([data-lens="position"]) [data-lens-only="position"],
#mode-land:not([data-lens="opportunity"]) [data-lens-only="opportunity"],
#mode-land:not([data-lens="notice"]) [data-lens-only="notice"] { display: none !important; }
/* The ICOP environment, same as Live Ops (Dean, 2026-09-02): cover photo on
   its own ::before layer at z-index:-1 so the contrast filter touches only the
   image, dark gradient over it, fixed attachment. Dark theme only -- the asset
   is a dark image and the light theme keeps its flat panels. */
body:not(.theme-light) .mode-land { background-color: var(--icop-bg, #0a0f1a); }
body:not(.theme-light) .mode-land::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(8,13,24,0.45) 0%, rgba(8,13,24,0.58) 100%),
    url('/assets/ICOP_Background_2560x1440_2.webp');
  background-size: cover; background-position: center 90%;
  background-repeat: no-repeat; background-attachment: fixed;
  filter: contrast(1.05);
}
/* Settings -> Appearance -> Background image OFF: the navy wash instead. */
body:not(.theme-light) .mode-land.nobg::before {
  background-image: linear-gradient(180deg, #0e1626 0%, #0a101d 55%, #080c16 100%);
  background-attachment: scroll; filter: none;
}
/* Glass, via the tokens: every element in the workbench that paints
   --bg-secondary / --bg-tertiary becomes translucent without touching each
   rule. Blur only on the two big surfaces -- backdrop-filter on every nested
   chip would cost real frames for no visible difference. */
body:not(.theme-light) .mode-land {
  --bg-secondary: rgba(15,22,38,0.80);
  --bg-tertiary: rgba(22,35,58,0.80);
}
body:not(.theme-light) .mode-land .land-rail,
body:not(.theme-light) .mode-land .land-mod,
body:not(.theme-light) .mode-land .land-detail,
body:not(.theme-light) .mode-land .land-card2 {
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
body:not(.theme-light) .mode-land .land-stream,
body:not(.theme-light) .mode-land .land-main { background: transparent; }
/* The dedicated Land page uses the welcome-screen landscape. Contain the
   negative background layer so it paints above the workbench's solid fill.
   This route keeps its backdrop even when Live Ops' image preference is off. */
.land-page .mode-land { isolation: isolate; }
.land-page .mode-land::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-size: cover; background-position: center 90%;
  background-repeat: no-repeat; background-attachment: fixed;
}
.land-page body:not(.theme-light) .mode-land::before {
  background-image:
    linear-gradient(180deg, rgba(8,13,24,0.52) 0%, rgba(8,13,24,0.68) 100%),
    url('/assets/ICOP_Background_2560x1440_2.webp');
  background-attachment: scroll; filter: contrast(1.05);
}
.land-page body.theme-light .mode-land::before {
  background-image:
    linear-gradient(180deg, rgba(246,249,253,0.84) 0%, rgba(240,246,252,0.90) 100%),
    url('/assets/ICOP_Background_2560x1440_2.webp');
  background-attachment: scroll; filter: saturate(0.45) contrast(0.98);
}
/* NORRIS's dark theme, lighter than ICOP's (Dean, 2026-10-28: long sessions on the near-black were straining; the
   second step was a little too light, so it sits between): a slate-navy base, panels and borders lifted, secondary and
   muted text brighter (7:1 and 5:1 on a panel), headline white eased. NORRIS only (html.land-page, set by js/land-page.js); ICOP keeps its own. The plat
   sheet, its grey surround and the map are unchanged. */
.land-page body:not(.theme-light) {
  --accent-ink: #86b0fa;           /* accent as text (links, counts): 6:1 on a panel; fills keep --accent */
  --bg-primary: #1a2333; --border: #405271;
  --text-primary: #e3e8f0; --text-secondary: #a8b7cb; --text-muted: #8999b3; --title-strong: #eff3fa;
}
.land-page body:not(.theme-light) .mode-land {
  background-color: #1a2333;
  --bg-secondary: rgba(32,43,64,0.87);
  --bg-tertiary: rgba(42,57,84,0.87);
}
.land-page body:not(.theme-light) .mode-land::before {
  background-image:
    linear-gradient(180deg, rgba(26,35,51,0.53) 0%, rgba(26,35,51,0.65) 100%),
    url('/assets/ICOP_Background_2560x1440_2.webp');
}
.land-page body:not(.theme-light) .app-header {
  background:
    radial-gradient(130% 200% at 11% -10%, rgba(44,195,236,0.12) 0%, rgba(44,195,236,0) 42%),
    linear-gradient(115deg, #18253e 0%, #1e304d 48%, #273c61 100%);
  border-bottom-color: #304465;
}
.land-page body:not(.theme-light) .land-plat-stage, .land-page body:not(.theme-light) .land-co-ctl { --plat-box-bg: #222d41; }
/* NORRIS light: the bars over the map, the plat, the hearings and the documents in ICOP's executive navy (#1F3B63, its
   light-theme card headers), white type and pale-blue secondary; the controls in them white on translucent, the
   pressed one a white pill (Dean, 2026-10-28: the light bars read bland). */
.land-page body.theme-light .land-map-toolbar, .land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar),
.land-page body.theme-light .land-pages-bar { background: #1F3B63; color: #fff; border-bottom-color: #12274A; }
.land-page body.theme-light .land-map-toolbar strong, .land-page body.theme-light .land-map-toolbar b,
.land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) strong, .land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) b,
.land-page body.theme-light .land-pages-bar strong, .land-page body.theme-light .land-pages-bar b { color: #fff; }
.land-page body.theme-light .land-map-toolbar span, .land-page body.theme-light .land-map-toolbar small,
.land-page body.theme-light .land-map-toolbar label, .land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) span,
.land-page body.theme-light .land-pages-bar span, .land-page body.theme-light .land-pages-name { color: #D7E2F0; }
.land-page body.theme-light .land-map-toolbar button, .land-page body.theme-light .land-map-toolbar select,
.land-page body.theme-light .land-map-toolbar a, .land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) button,
.land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) a, .land-page body.theme-light .land-pages-bar button {
  color: #fff; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.32); }
.land-page body.theme-light .land-map-toolbar select option { color: #0f172a; background: #fff; }
.land-page body.theme-light .land-map-toolbar button:hover:not(:disabled), .land-page body.theme-light .land-map-toolbar select:hover,
.land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) button:hover:not(:disabled),
.land-page body.theme-light .land-pages-bar button:hover:not(:disabled) { border-color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.14); }
.land-page body.theme-light .land-map-toolbar > .land-view-switch { border-color: rgba(255,255,255,0.32); }
.land-page body.theme-light .land-map-toolbar .land-view-switch button { background: transparent; color: #D7E2F0; border-color: rgba(255,255,255,0.32); }
.land-page body.theme-light .land-map-toolbar .land-view-switch button[aria-pressed="true"],
.land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) .land-plat-cal-views button[aria-pressed="true"],
.land-page body.theme-light .land-pages-bar .land-plat-tab[aria-selected="true"] { background: #fff; color: #1F3B63; border-color: #fff; }
.land-page body.theme-light .land-map-toolbar .land-view-switch button:not([aria-pressed="true"]):not(:disabled):hover { color: #fff; background: rgba(255,255,255,0.12); }
.land-page body.theme-light .land-map-toolbar button:focus-visible, .land-page body.theme-light .land-opp-pdf-bar:not(.land-plat-cal-bar) button:focus-visible,
.land-page body.theme-light .land-pages-bar button:focus-visible { outline-color: #fff; }
/* NORRIS light, a contrast and polish pass (Dean and reviewer, 2026-10-28): the same light theme, three clear levels
   (navy bars and selection; white working surfaces; light-grey supporting surfaces), stronger text, borders and
   geography. One set of colours for the map, the plat, the side column and the hearings. ICOP keeps its own. */
.land-page body.theme-light {
  --accent: #3659B8;               /* a deeper blue with the navy bars (reviewer, 2026-10-28; was #2563eb): white on it 6.4:1 */
  --bg-primary: #ffffff; --bg-secondary: #F1F4F9; --bg-tertiary: #E3EAF3;
  --border: #CBD5E1; --border-subtle: #DEE5EE; --input-border: #BCC8D8; --hover-bg: #E8EEFB;
  --text-primary: #1E293B; --text-secondary: #526179; --text-muted: #56657c; --title-strong: #1E293B;
}
.land-page body.theme-light .app-header { box-shadow: 0 1px 0 #CBD5E1, 0 2px 8px rgba(15, 23, 42, .06); }
/* Sidebar: firmer dividers between its sections, white inputs with a visible edge, the small counts readable. */
.land-page body.theme-light .land-rail { border-right-color: #CBD5E1; }
.land-page body.theme-light .land-rail-sec { border-bottom-color: #CBD5E1; }
.land-page body.theme-light .land-rs-form input, .land-page body.theme-light .land-rail input[type="search"],
.land-page body.theme-light .land-rail textarea { background: #fff; border-color: var(--input-border); }
.land-page body.theme-light .land-rs-dir { border-color: var(--input-border); background: #E8EEF6; }
.land-page body.theme-light .land-rs-form label, .land-page body.theme-light .land-rs-field { color: var(--text-secondary); }
.land-page body.theme-light .land-own details > summary span { color: var(--text-secondary); font-size: 10px; }
.land-page body.theme-light .land-own-twp { border-top-color: #DEE5EE; }
.land-page body.theme-light .land-own-item { color: #3b4a61; }
.land-page body.theme-light .land-own-k { color: var(--text-secondary); }
/* Map: the basemap's geography and the county lines and names firmer; controls with an edge, a shadow, dark icons. */
.land-page body.theme-light #land-position-map .leaflet-tile-pane { filter: contrast(1.22) brightness(.97); }
.land-page body.theme-light #land-position-map .leaflet-counties-pane { filter: contrast(1.35) brightness(.9); }
.land-page body.theme-light #land-position-map .leaflet-bar { border: 1px solid var(--input-border); box-shadow: 0 2px 6px rgba(15, 23, 42, .12); }
.land-page body.theme-light #land-position-map .leaflet-bar a { color: #1E293B; border-bottom-color: #DEE5EE; }
.land-page body.theme-light #land-position-map .leaflet-bar a:hover { background: var(--hover-bg); color: #1F3B63; }
.land-page body.theme-light .land-co-btn { border-color: var(--input-border); color: #1E293B; box-shadow: 0 2px 6px rgba(15, 23, 42, .12); }
.land-page body.theme-light .land-co-btn:not([aria-expanded="true"]):hover { background: var(--hover-bg); }
/* Plat: the controls the same; the document surround a touch bluer; the side column off-white with stronger headings,
   a separator between sections, and the patent counts as tight rows. */
.land-page body.theme-light .land-plat-ctrls button, .land-page body.theme-light .land-plat-zoom,
.land-page body.theme-light .land-plat-layers-btn, .land-page body.theme-light .land-plat-quick,
.land-page body.theme-light .land-plat-nav {
  border-color: var(--input-border); color: #1E293B; box-shadow: 0 2px 6px rgba(15, 23, 42, .14); }
.land-page body.theme-light .land-plat-ctrls button:hover:not(:disabled):not([aria-pressed="true"]),
.land-page body.theme-light .land-plat-layers-btn:not([aria-expanded="true"]):hover { background: var(--hover-bg); }
.land-page body.theme-light .land-plat .land-pages-img { background: #4f5866; }
.land-page body.theme-light .land-plat-side { background: #F8FAFC; border-left-color: #CBD5E1; color: var(--text-secondary); }
.land-page body.theme-light .land-plat-side h4 { color: #1E293B; }
.land-page body.theme-light .land-plat-side h5 { margin-top: 14px; padding-top: 10px; border-top: 1px solid #DEE5EE; color: #344766; font-size: 10px; }
.land-page body.theme-light .land-plat-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid #EDF1F6; color: #1E293B; }
.land-page body.theme-light .land-plat-legend li:last-child { border-bottom: 0; }
.land-page body.theme-light .land-plat-legend span { float: none; margin-left: auto; font-weight: 600; }
.land-page body.theme-light .land-plat-wcount { color: #3b4a61; }
/* The hearings use the same lines. */
body.theme-light .land-plat-cal { --cal-line: #DEE5EE; }
/* The rail's section headings in the same navy, as type. */
.land-page body.theme-light .land-rail-h, .land-page body.theme-light .land-asst-h { color: #1F3B63; font-weight: 600; }
.land-empty { margin: auto; text-align: center; padding: 40px 24px; }
.land-empty-title { font-size: 44px; letter-spacing: 0.22em; font-weight: 600;
  margin: 0 0 10px; color: var(--text-primary); }
.land-empty-sub { margin: 0; font-size: 13px; letter-spacing: 0.06em;
  color: var(--text-secondary); }

/* ── GRANT workbench (LAYOUT SKETCH — nothing here is wired) ─────────────
   Left rail is the COVERAGE TREE, not a well list: the first question on this
   page is always "do we hold this ground", so the answer to it is the
   navigation. Answers stack as cards in the centre; provenance lives in a
   collapsed footer ON each card rather than a global panel, because a global
   panel goes stale the moment you scroll to a different answer. */
.land-wb { display: flex; width: 100%; height: 100%; min-height: 0; }

.land-rail { flex: 0 0 250px; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border); background: var(--bg-secondary); }
.land-rail-sec { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.land-rail-h { font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: 0.14em; color: var(--text-muted); margin: 0 0 8px;
  text-transform: uppercase; }
.land-county { font-size: 10px; letter-spacing: .08em; color: var(--text-secondary);
  margin: 8px 0 4px; font-weight: 600; }
.land-county:first-of-type { margin-top: 0; }
.land-twp { display: flex; align-items: center; gap: 7px; padding: 4px 6px;
  border-radius: 4px; cursor: default; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-primary); }
.land-twp.is-active { background: var(--bg-tertiary); }
.land-twp .n { margin-left: auto; font-size: 9.5px; color: var(--text-muted); }
/* The four coverage states are the whole point — they must not look alike. */
.cov { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.cov-ready    { background: var(--accent); }
.cov-partial  { background: var(--warning); }
.cov-none     { background: transparent; border: 1px solid var(--text-muted); }
.cov-unavail  { background: var(--text-muted); opacity: .45; }

/* Run sheet test panel (js/land-runsheet.js): township / range / section -> outputs list. */
.land-rs-tag { margin-left: 4px; padding: 0 4px; border: 1px solid var(--border); border-radius: 3px;
  font-size: 8px; letter-spacing: .1em; color: var(--warning); }
.land-rs-form { display: flex; gap: 6px; }
.land-rs-form label { flex: 1 1 0; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  font-size: 9.5px; color: var(--text-muted); }
.land-rs-form input { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg-primary); color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; }
.land-rs-form input:focus { outline: none; border-color: var(--accent); }
/* Twp / Rng: number box joined to an N/S or E/W toggle (land-runsheet.js). */
.land-rs-field { flex: 1.2 1 0; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  font-size: 9.5px; color: var(--text-muted); }
.land-rs-form .land-rs-field > label { flex: none; }
.land-rs-pair { display: flex; min-width: 0; }
.land-rs-pair input { flex: 1 1 auto; min-width: 0; border-radius: 4px 0 0 4px; }
.land-rs-dir { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 0 6px;
  border: 1px solid var(--border); border-left: 0; border-radius: 0 4px 4px 0;
  background: var(--bg-tertiary); color: var(--text-primary);
  font: 600 11px 'JetBrains Mono', monospace; cursor: pointer; }
.land-rs-dir i { display: flex; flex-direction: column; gap: 1px; font-style: normal;
  font-size: 6px; line-height: 1; color: var(--text-muted); }
.land-rs-dir:hover i, .land-rs-dir:focus-visible i { color: var(--accent-ink, var(--accent)); }
.land-rs-dir:focus-visible { outline: none; border-color: var(--accent); border-left: 1px solid var(--accent); }
.land-rs-opt { display: flex; align-items: center; gap: 5px; margin: 7px 0 0; font-size: 10px;
  color: var(--text-secondary); cursor: pointer; }
/* NORRIS demo: the respondent-address option is not offered; Lease Checks open in the version without addresses. */
.land-page .land-rs-opt { display: none; }
.land-rs-btn { width: 100%; margin-top: 8px; padding: 6px 8px; border: 1px solid var(--accent);
  border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; }
.land-rs-btn:disabled { opacity: .55; cursor: progress; }
.land-rs-status { margin-top: 6px; font-size: 10px; line-height: 1.4; color: var(--text-secondary); }
/* NORRIS Assistant (preview): /norris rail only. */
.land-asst { display: none; }
.land-page .land-asst { display: block; }
.land-asst-ctx { margin: -2px 0 6px; font: 600 10.5px 'JetBrains Mono', monospace; color: var(--text-primary);
  transition: color .2s; }
.land-asst-ctx.is-none { color: var(--text-muted); font-weight: 400; }
.land-asst-ctx.is-warn { color: var(--warning); }
.land-asst-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }
.land-asst-quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 5px; background: var(--bg-secondary); color: var(--text-primary);
  font-size: 11px; font-weight: 600; text-align: left; cursor: pointer; }
.land-asst-quick button span { font-size: 9.5px; font-weight: 400; color: var(--text-muted); }
.land-asst-quick button:hover { border-color: var(--accent); }
.land-asst-h { margin: 12px 0 5px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-secondary); }
.land-asst-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.land-asst-list li { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border: 1px solid var(--border);
  border-radius: 5px; background: var(--bg-secondary); }
.land-asst-list li.land-asst-empty { display: block; border-style: dashed; background: transparent;
  font-size: 10.5px; color: var(--text-muted); }
.land-asst-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.land-asst-t b { font-size: 11px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.land-asst-t span { font-size: 9.5px; color: var(--text-muted); }
.land-asst-done li { border-left: 3px solid var(--success, #3fb950); }
.land-asst-open { flex: 0 0 auto; padding: 3px 8px; border: 1px solid var(--accent); border-radius: 4px; background: transparent;
  color: var(--accent-ink, var(--accent)); font-size: 10px; cursor: pointer; white-space: nowrap; }
.land-asst-open:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-asst button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-rs-status:empty { display: none; }
.land-rs-status.is-err { color: var(--danger); }
.land-rs-status.is-ok { color: var(--text-primary); }
.land-rs-outh { margin-top: 12px; }
.land-rs-out { max-height: 210px; overflow: auto; }
.land-rs-empty { font-size: 10.5px; color: var(--text-muted); }
.land-rs-row { padding: 6px 0; border-top: 1px solid var(--border); }
.land-rs-row:first-child { border-top: none; padding-top: 0; }
.land-rs-name { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-primary); }
.land-rs-cty { margin-left: 6px; font-family: inherit; font-size: 9.5px; color: var(--text-muted); }
.land-rs-meta { margin-top: 2px; font-size: 9.5px; color: var(--text-muted); }
.land-rs-links { display: flex; gap: 12px; margin-top: 3px; }
.land-rs-links a { font-size: 10.5px; color: var(--accent-ink, var(--accent)); text-decoration: none; }
.land-rs-links a:hover { text-decoration: underline; }

.land-thread { display: block; padding: 5px 6px; border-radius: 4px; font-size: 11px;
  color: var(--text-secondary); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.land-thread:hover { background: var(--bg-tertiary); }
.land-thread .t { display: block; font-size: 9px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; }

.land-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.land-top { display: flex; align-items: center; gap: 12px; padding: 9px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.land-who { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
  letter-spacing: .16em; color: var(--text-primary); }
.land-who span { font-size: 9px; letter-spacing: .06em; color: var(--text-muted);
  font-weight: 400; margin-left: 8px; }
.land-aoi { margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); }
.land-chip { border: 1px solid var(--border); border-radius: 10px; padding: 2px 9px;
  font-size: 9.5px; letter-spacing: .08em; color: var(--text-muted); }

.land-stream { flex: 1; overflow-y: auto; padding: 16px 18px 6px; min-height: 0; }
.land-card2 { border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-secondary); margin-bottom: 14px; overflow: hidden; }
.land-q { padding: 9px 14px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-primary); background: var(--bg-tertiary); }
.land-q b { font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: .12em; color: var(--text-muted); display: block; margin-bottom: 3px;
  font-weight: 400; }
.land-a { padding: 12px 14px; font-size: 12.5px; line-height: 1.62;
  color: var(--text-secondary); }
.land-a p { margin: 0 0 9px; }
.land-a p:last-child { margin-bottom: 0; }
.land-a strong { color: var(--text-primary); font-weight: 600; }
.land-view { padding: 4px 14px 12px; }
.land-viewhead { font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: .12em; color: var(--text-muted); margin-bottom: 7px; }

/* Provenance: present on every answer, folded away until wanted. */
.land-prov { border-top: 1px solid var(--border); background: var(--bg-tertiary); }
.land-prov summary { padding: 7px 14px; font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: .1em; color: var(--text-muted); cursor: pointer; }
.land-prov[open] summary { color: var(--text-secondary); }
.land-prov-body { padding: 2px 14px 11px; font-size: 11px; line-height: 1.6;
  color: var(--text-muted); }
.land-prov-body dt { font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: .1em; color: var(--text-secondary); margin-top: 7px; }
.land-prov-body dd { margin: 1px 0 0; }

.land-refused { border-color: var(--warning); }
.land-refused .land-q { background: color-mix(in srgb, var(--warning) 12%, transparent); }

.land-ask { border-top: 1px solid var(--border); background: var(--bg-secondary);
  padding: 11px 18px 14px; }
.land-askbox { display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg-tertiary);
  padding: 9px 12px; }
.land-askbox input { flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif; font-size: 12.5px; }
.land-askbox input::placeholder { color: var(--text-muted); }
.land-send { border: 1px solid var(--border); border-radius: 5px; background: var(--bg-secondary);
  color: var(--text-secondary); font-size: 12px; padding: 3px 10px; }
.land-hints { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.land-hint { border: 1px solid var(--border); border-radius: 11px; padding: 3px 10px;
  font-size: 10.5px; color: var(--text-muted); }

/* KPI — depth of holdings. The delta is deliberately "since last sync" and
   not "this week": the store only changes when we pull, so a week-framed
   number would report 0 for a quiet week and 0 for a week nobody looked, and
   those are not the same fact. Staleness is shown next to it for that reason. */
.land-kpi { padding: 12px 12px 11px; border-bottom: 1px solid var(--border); }
.land-kpi-n { font-family: 'JetBrains Mono', monospace; font-size: 25px; font-weight: 700;
  color: var(--text-primary); line-height: 1; letter-spacing: -0.01em; }
.land-kpi-l { font-size: 9.5px; letter-spacing: .13em; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; margin-top: 4px; text-transform: uppercase; }
.land-kpi-d { font-size: 10.5px; color: var(--accent-ink, var(--accent)); margin-top: 6px; }
.land-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; margin-top: 10px;
  padding-top: 9px; border-top: 1px solid var(--border); }
.land-kpi-grid div { font-size: 10px; color: var(--text-muted); }
.land-kpi-grid b { display: block; font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }

/* AOI — a NAMED set of PLSS blocks that may include ground we do not hold.
   That is the point: AOI x coverage is a gap, and the gap has a price. */
.land-aoisel { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: 5px; background: var(--bg-tertiary); padding: 6px 9px; font-size: 11.5px;
  color: var(--text-primary); }
.land-aoisel .car { margin-left: auto; color: var(--text-muted); font-size: 9px; }
.land-gap { margin-top: 7px; font-size: 10.5px; color: var(--text-muted); line-height: 1.55; }
.land-gap b { color: var(--text-secondary); }
.land-gapbar { display: flex; height: 5px; border-radius: 3px; overflow: hidden;
  margin: 7px 0 6px; background: var(--bg-tertiary); }
.land-gapbar i { display: block; height: 100%; }

/* The AOI grid IS the coverage display. A township list cannot show that the
   held half is the EAST half; a grid laid out in real PLSS orientation can, at
   a fraction of the height. Ranges increase westward, so 22W is drawn left. */
.land-grid { margin: 9px 0 7px; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; }
.land-grid table { border-collapse: separate; border-spacing: 3px; margin: 0 auto; }
.land-grid th { font-weight: 400; color: var(--text-muted); font-size: 8px;
  letter-spacing: .06em; padding: 0 0 1px; }
.land-grid td.rh { color: var(--text-muted); font-size: 8px; padding-right: 2px; }
.land-cell { width: 30px; height: 21px; border-radius: 3px; border: 1px solid var(--border);
  text-align: center; line-height: 21px; color: var(--text-muted); font-size: 7.5px; }
.land-cell.held { background: color-mix(in srgb, var(--accent) 34%, transparent);
  border-color: var(--accent); color: var(--text-primary); }
.land-cell.part { background: color-mix(in srgb, var(--warning) 26%, transparent);
  border-color: var(--warning); color: var(--text-primary); }
.land-cell.none { background: transparent; border-style: dashed; }
.land-def { font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  color: var(--text-secondary); display: flex; align-items: center; gap: 6px;
  margin-top: 7px; }
.land-def .ed { margin-left: auto; color: var(--accent-ink, var(--accent)); font-size: 9px; }
.land-legend { display: flex; gap: 9px; justify-content: center; margin-top: 5px;
  font-size: 8.5px; color: var(--text-muted); }
.land-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px;
  margin-right: 3px; vertical-align: -1px; border: 1px solid var(--border); }

/* Calendar — the forward view. Real dates exist, but not where you would look:
   docket_date has lapsed 13 days behind with no future rows, while continuance
   dates inside `result` run to 2027. */
.land-cal { display: flex; gap: 8px; padding: 6px 0; align-items: flex-start; }
.land-cal + .land-cal { border-top: 1px dashed var(--border); }
.land-cal-d { flex: 0 0 34px; text-align: center; font-family: 'JetBrains Mono', monospace; }
.land-cal-d b { display: block; font-size: 14px; color: var(--text-primary); line-height: 1.05; }
.land-cal-d span { font-size: 8.5px; letter-spacing: .1em; color: var(--text-muted); }
.land-cal-b { min-width: 0; }
.land-cal-t { font-size: 11px; color: var(--text-primary); }
.land-cal-s { font-size: 9.5px; color: var(--text-muted); margin-top: 1px; }
.land-pill { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 8px;
  letter-spacing: .08em; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 6px; color: var(--text-muted); margin-left: 4px; }

/* FEED — the drop target. Output is a PROPOSED extraction, never a committed
   fact: the ontology already requires engineer review and records conflicts
   rather than overwriting them, and a drag-and-drop that writes straight into
   a shared brain would route around exactly that. */
/* The brain sits BEHIND the copy, dimmed, with a gradient scrim over its lower
   half so the instructions stay readable at every theme. The art is the point
   of the target -- it says "feed the expert" faster than the label does -- but
   a reader must never have to squint past it to learn what is accepted. */
.land-drop { position: relative; overflow: hidden;
  border: 1px dashed var(--border); border-radius: 6px; padding: 66px 11px 13px;
  text-align: center; font-size: 10.5px; line-height: 1.52;
  /* text-secondary, not text-muted: muted reads fine on a flat panel and goes
     thin over artwork, and this copy is the part that says which documents are
     accepted. The scrim carries the rest of the legibility. */
  color: var(--text-secondary);
  background: var(--bg-tertiary); transition: border-color .15s, box-shadow .15s; }
.land-drop::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: url("assets/norris-brain.png") center 22% / 128% auto no-repeat, #000;
  opacity: .62; transition: opacity .15s, transform .25s; }
/* Scrim: transparent over the brain, opaque under the text. */
.land-drop::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%, rgba(0,0,0,.15) 38%,
    color-mix(in srgb, var(--bg-tertiary) 88%, transparent) 62%,
    var(--bg-tertiary) 84%); }
.land-drop > * { position: relative; z-index: 2; }
/* Dragging a file over it: the brain brightens and leans in. */
.land-drop.is-over { border-color: var(--accent); border-style: solid;
  box-shadow: 0 0 0 1px var(--accent) inset; }
.land-drop.is-over::before { opacity: .95; transform: scale(1.04); }
.land-drop b { display: block; color: var(--text-primary); font-size: 11.5px;
  margin-bottom: 3px; font-weight: 600;
  text-shadow: 0 1px 6px rgba(0,0,0,.85); }
.land-drop .fmt { font-family: 'JetBrains Mono', monospace; font-size: 8.5px;
  letter-spacing: .08em; margin-top: 6px; display: block;
  color: var(--text-muted); }
.land-fed { display: flex; align-items: center; gap: 7px; padding: 5px 4px;
  font-size: 10.5px; color: var(--text-secondary); }
.land-fed .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.land-fed .st { margin-left: auto; font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: .08em; padding: 1px 6px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-muted); flex: 0 0 auto; }
.land-fed .st.rev { color: var(--warning); border-color: var(--warning); }
.land-fed .st.ok  { color: var(--accent-ink, var(--accent)); border-color: var(--accent); }
/* knowledge answers: section chips in the prose, verbatim authority under the card */
.land-sec { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent-ink, var(--accent));
  border-bottom: 1px dotted var(--accent); cursor: pointer; white-space: nowrap; }
.land-verbatim { white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  line-height: 1.5; color: var(--text-secondary); margin: 4px 0 10px; max-height: 260px; overflow: auto;
  padding: 8px 10px; background: var(--bg-tertiary); border-radius: 4px; }
.land-authsec .land-viewhead a { color: var(--accent-ink, var(--accent)); text-decoration: none; }


/* Proposed-extraction card. Deliberately shares the answer card's shell so
   provenance and refusal behave identically -- an extraction is an answer
   about a document. */
.land-card2.land-propose { border-color: var(--accent); }
.land-card2.land-propose .land-q { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.land-item { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0;
  border-top: 1px dashed var(--border); font-size: 11.5px; }
.land-item:first-of-type { border-top: none; }
.land-item .k { flex: 0 0 128px; font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: .08em; color: var(--text-muted); padding-top: 2px; }
.land-item .v { flex: 1; min-width: 0; color: var(--text-primary); }
.land-item .v small { display: block; color: var(--text-muted); font-size: 10px;
  margin-top: 1px; }
.land-tag { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: .08em;
  border: 1px solid var(--border); border-radius: 8px; padding: 1px 6px;
  color: var(--text-muted); flex: 0 0 auto; }
.land-tag.new { color: var(--accent-ink, var(--accent)); border-color: var(--accent); }
.land-tag.reinf { color: var(--text-secondary); }
.land-tag.conf { color: var(--danger); border-color: var(--danger); }
.land-conflict { margin-top: 9px; border: 1px solid var(--danger); border-radius: 5px;
  padding: 8px 10px; font-size: 11px; line-height: 1.55;
  background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--text-secondary); }
.land-conflict b { color: var(--text-primary); }
.land-actions { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--border); background: var(--bg-tertiary); }
.land-scope { font-size: 10.5px; color: var(--text-muted); }
.land-scope select { background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 4px; font-size: 10.5px; padding: 2px 5px;
  font-family: 'IBM Plex Sans', sans-serif; }
.land-btn { border: 1px solid var(--border); border-radius: 5px; background: var(--bg-secondary);
  color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: .09em; padding: 5px 12px; }
.land-btn.primary { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.land-unsaved { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: .09em; color: var(--warning); }

/* ── OPPORTUNITY on /norris: the township board ───────────────────────── */
.land-opp { display: none; }
/* An OCC document over the Opportunity panel, as the Lease Check PDF sits over the Position map. */
.land-page .land-opp { position: relative; }
.land-opp-pdf { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: var(--bg-primary); }
.land-opp-pdf[hidden] { display: none; }
.land-opp-pdf-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary); }
.land-opp-pdf-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; color: var(--text-muted); }
.land-opp-pdf-name strong { margin-right: 8px; font: 600 12.5px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-opp-pdf-bar a, .land-opp-pdf-bar button { color: var(--text-primary); border: 1px solid var(--border);
  background: var(--bg-tertiary); padding: 6px 10px; border-radius: 5px; font-size: 11px; cursor: pointer; text-decoration: none; }
.land-opp-pdf-bar .land-pdf-close { font-size: 16px; line-height: 1; padding: 4px 10px; }
.land-opp-pdf-bar a:hover, .land-opp-pdf-bar button:hover { border-color: var(--accent); }
.land-opp-pdf-bar a:focus-visible, .land-opp-pdf-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-opp-pdf-msg { padding: 24px; font-size: 12px; color: var(--text-secondary); }
.land-opp-pdf-msg[hidden] { display: none; }
#land-opp-pdf-frame, #land-plat-pdf-frame { flex: 1; width: 100%; border: 0; background: #525659; }
/* The original survey's field notes: one page at a time, fitted, a click zooms to the page's full width. */
.land-plat-notes-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; font: 11px 'JetBrains Mono', monospace; color: var(--text-secondary); }
.land-plat-notes-nav button:disabled { opacity: .4; cursor: default; }
.land-plat-notes-box { flex: 1; min-height: 0; overflow: auto; background: #525659; padding: 12px; text-align: center; }
#land-plat-notes-pic { max-width: 100%; max-height: 100%; cursor: zoom-in; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); background: #fff; }
#land-plat-notes-pic.is-zoomed { max-width: none; max-height: none; width: 100%; cursor: zoom-out; }
.land-page .land-opp { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; margin: 12px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
/* Finders bar: same toolbar as POSITION; each finder is a placeholder marked "soon". */
.land-map-toolbar > .land-opp-finders { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.land-map-toolbar .land-opp-finders button { display: inline-flex; align-items: center; gap: 6px;
  border-style: dashed; color: var(--text-secondary); background: transparent; }
.land-map-toolbar .land-opp-finders button:hover { color: var(--text-primary); border-color: var(--accent); }
.land-map-toolbar .land-opp-finders button[aria-pressed="true"] { color: var(--text-primary); border-style: solid;
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-opp-finders i { font: 600 8px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .1em;
  text-transform: uppercase; color: var(--warning); }
.land-opp-about { padding: 8px 14px; border-top: 1px solid var(--border); background: var(--bg-tertiary);
  font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }
.land-opp-about b { color: var(--text-primary); margin-right: 6px; }
.land-opp-about em { font-style: normal; font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .12em;
  text-transform: uppercase; color: var(--warning); margin-right: 8px; }
/* Pooling elections SAMPLE: docket list + example order card, above the map. */
.land-opp-sample { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  border-top: 1px solid var(--border); background: var(--bg-primary); }
.land-opp-sample-head { padding: 7px 14px; font-size: 10.5px; line-height: 1.5; color: var(--text-muted);
  border-bottom: 1px solid var(--border); }
.land-opp-sample-head em { font: 600 9px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .12em;
  text-transform: uppercase; color: var(--bg-primary); background: var(--warning); padding: 1px 6px; border-radius: 3px;
  margin-right: 8px; }
.land-opp-sample-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.land-opp-sample-cols > section { min-height: 0; display: flex; flex-direction: column; padding: 8px 14px 10px; }
.land-opp-sample-cols > section + section { border-left: 1px solid var(--border); overflow: auto; }
.land-opp-sample h4 { margin: 0 0 6px; font: 700 10.5px 'JetBrains Mono', monospace; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-primary); }
.land-opp-sample h4 span { margin-left: 8px; font: 400 10px Helvetica, Arial, sans-serif; letter-spacing: 0;
  text-transform: none; color: var(--text-muted); }
.land-opp-sample h5 { margin: 10px 0 4px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-secondary); }
.land-opp-sample-scroll { flex: 1; min-height: 0; overflow: auto; }
.land-opp-sample table { width: 100%; border-collapse: collapse; font-size: 11px; color: var(--text-primary); }
.land-opp-sample th { position: sticky; top: 0; text-align: left; padding: 4px 6px; font-weight: 600; font-size: 10px;
  color: var(--text-secondary); background: var(--bg-primary); border-bottom: 1px solid var(--accent); }
.land-opp-sample td { padding: 4px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.land-opp-sample td code { font-size: 10.5px; color: var(--text-secondary); }
.land-opp-sample p { margin: 6px 0 0; font-size: 10.5px; color: var(--text-muted); }
.land-opp-order { font-size: 11.5px; line-height: 1.55; color: var(--text-secondary); }
.land-opp-order-n { font: 700 15px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-opp-order-n span { margin-left: 8px; font: 400 11px Helvetica, Arial, sans-serif; color: var(--text-muted); }
.land-opp-order-m { margin-top: 4px; font-size: 10.5px; color: var(--text-muted); }
.land-opp-order-m b { color: var(--text-primary); }
.land-opp-opts { max-width: 320px; }
.land-opp-order button { margin-top: 10px; align-self: flex-start; padding: 6px 12px; border: 1px solid var(--accent);
  border-radius: 5px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; }
.land-opp-code { border-bottom: 1px dotted var(--text-muted); cursor: help; }
.land-opp-code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.land-opp-tip { position: fixed; z-index: 10000; max-width: 340px; padding: 6px 9px; border: 1px solid var(--border);
  border-radius: 5px; background: var(--bg-secondary); color: var(--text-primary); font-size: 11px; line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: none; }
.land-opp-tip[hidden] { display: none; }
.land-opp-collapse { float: right; margin: -2px 0 0 12px; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 11px; cursor: pointer; }
.land-opp-collapse:hover { border-color: var(--accent); }
.land-opp-collapse:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.land-opp-cause { border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--accent-ink, var(--accent));
  font: 600 10.5px 'JetBrains Mono', monospace; text-decoration: underline dotted; text-underline-offset: 3px; }
.land-opp-cause i { font: 400 9.5px Helvetica, Arial, sans-serif; font-style: normal; color: var(--text-muted);
  text-decoration: none; margin-left: 4px; }
.land-opp-cause[aria-expanded="true"] { color: var(--text-primary); }
.land-opp-cause:focus-visible, .land-opp-docs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.land-opp-sample tr.land-opp-docrow td { white-space: normal; background: var(--bg-secondary); padding: 6px 8px 8px; }
.land-opp-docs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.land-opp-docs button { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid var(--border); border-radius: 5px; background: var(--bg-primary); color: var(--text-primary);
  padding: 4px 8px; font-size: 10.5px; cursor: pointer; text-align: left; }
.land-opp-docs button span { font-size: 9.5px; color: var(--text-muted); }
.land-opp-docs button.is-key { border-color: var(--accent); }
.land-opp-docs button:hover { background: color-mix(in srgb, var(--accent) 12%, var(--bg-primary)); }
.land-opp-docs-empty { font-size: 10.5px; color: var(--text-muted); }
/* The recorded leases behind a Coming loose row and the section card (js/land-opportunity.js leaseListHtml): the lessee,
   the dates, the recording reference, and the document where ICOP holds its recorded pages; where it does not, the
   reference stands and the row says so. */
.land-opp-leases { padding: 0 12px 8px 74px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.land-opp-leases.is-card { padding: 0; border: 0; background: transparent; }
.land-opp-lease { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who doc" "when doc" "ref doc";
  gap: 1px 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--border); font-size: 11px; color: var(--text-primary); }
.land-opp-leases > .land-opp-lease:first-child { border-top: 0; }
.land-opp-lease-who { grid-area: who; min-width: 0; }
.land-opp-lease-who b { font-weight: 600; }
.land-opp-lease-who span { color: var(--text-secondary); }
.land-opp-lease-when { grid-area: when; font-size: 10.5px; color: var(--text-secondary); }
.land-opp-lease-ref { grid-area: ref; font: 10px 'JetBrains Mono', monospace; color: var(--text-muted); }
.land-opp-lease-doc { grid-area: doc; padding: 4px 10px; border: 1px solid var(--accent); border-radius: 5px; background: transparent;
  color: var(--accent-ink, var(--accent)); font-size: 10.5px; cursor: pointer; white-space: nowrap; }
.land-opp-lease-doc:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.land-opp-lease-doc:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-opp-lease-none { grid-area: doc; padding: 4px 8px; border: 1px dashed var(--border); border-radius: 5px; font-size: 10px;
  color: var(--text-muted); white-space: nowrap; }
.land-opp-leases-more { margin: 4px 0 0; font-size: 10.5px; color: var(--text-muted); }
.land-opp-held { margin: 2px 0 6px; padding: 6px 8px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 11px; color: var(--text-primary); }
/* The lessees-of-record table: a lessee's row unfolds its instruments. */
.land-opp-tbl-toggle { padding: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; cursor: pointer; text-align: left; }
.land-opp-tbl-toggle::before { content: '\25B8'; display: inline-block; width: 12px; color: var(--text-muted); font-size: 9px; }
.land-opp-tbl-toggle[aria-expanded="true"]::before { content: '\25BE'; }
.land-opp-tbl-toggle:hover { color: var(--accent-ink, var(--accent)); }
.land-opp-tbl-detail td { padding: 0 0 6px 12px; }
.land-opp-tbl-detail[hidden] { display: none; }
/* The viewer's page tabs (a recorded instrument is one PDF per recorded page). */
#land-opp-pdf-tabs { flex-wrap: wrap; justify-content: flex-end; max-width: 48%; }
#land-opp-pdf-tabs button { padding: 4px 8px; font-size: 10.5px; }
@media (max-width: 1100px) { .land-opp-sample-cols { grid-template-columns: minmax(0, 1fr); overflow: auto; } }
.land-page #mode-land[data-lens="opportunity"] #land-stream, .land-page #mode-land[data-lens="notice"] #land-stream { display: none; }

/* ── ACTIVITY on /norris: Land | Regulatory (js/land-activity.js) ───────
   Replaces the hard-coded summary cards on /norris; the full ICOP view keeps
   them. The two columns fill the workbench and scroll on their own. */
.land-act2 { display: none; }
.land-page .land-act { display: none; }
.land-page #mode-land[data-lens="activity"] #land-stream { display: flex; flex-direction: column; overflow: hidden; }
.land-page .land-act2 { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.land-act2-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; }
.land-act2-head .land-act-h { margin: 0; }
.land-act2-scope { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
/* The scope toggle is land-act2-seg, never land-act2-chips: that name is the satellite strip's, whose gap and margin
   opened an unfilled strip between the toggle's buttons while the two shared it (Dean, 2026-11-10). */
.land-act2-seg, .land-act2-win { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.land-act2-seg button, .land-act2-win button { border: 0; background: transparent; color: var(--text-secondary);
  padding: 5px 10px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.land-act2-seg button + button, .land-act2-win button + button { border-left: 1px solid var(--border); }
.land-act2-seg button[aria-pressed="true"], .land-act2-win button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.land-act2-seg button:focus-visible, .land-act2-win button:focus-visible,
.land-act2-count:focus-visible, .land-act2-more:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-act2-note { font-size: 10.5px; color: var(--text-muted); }
.land-act2-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; flex: 1; min-height: 0; }
.land-act2-col { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); border-radius: 8px;
  background: color-mix(in srgb, var(--bg-secondary) 92%, transparent); overflow: hidden; }
.land-act2-colhead { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px 6px; }
.land-act2-colhead h3 { margin: 0; font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-primary); }
.land-act2-src { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.land-act2-counts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.land-act2-count { border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--text-secondary); padding: 3px 10px; font-size: 10.5px; cursor: pointer; }
.land-act2-count b { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
.land-act2-count i { font-style: normal; color: var(--text-muted); }
.land-act2-count[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-act2-count:disabled { opacity: .45; cursor: default; }
.land-act2-top { padding: 0 14px 4px; font-size: 10.5px; color: var(--text-secondary); line-height: 1.5; }
.land-act2-top span { color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 9.5px; }
.land-act2-top b { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
.land-act2-up { margin: 4px 14px 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 10.5px; line-height: 1.6; color: var(--text-secondary); }
.land-act2-up b { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; margin-right: 4px; }
.land-act2-up span { color: var(--text-muted); }
.land-act2-uph { font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink, var(--accent)); margin-bottom: 3px; }
.land-act2-feed { flex: 1; min-height: 0; overflow: auto; padding: 0 14px 10px; border-top: 1px solid var(--border); }
.land-act2-day { position: sticky; top: 0; z-index: 1; padding: 8px 0 4px; font: 600 9.5px 'JetBrains Mono', monospace;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-secondary) 96%, transparent); }
.land-act2-item { padding: 6px 0 8px; border-bottom: 1px dashed var(--border); }
.land-act2-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 11.5px; }
.land-act2-line b { color: var(--text-primary); }
.land-act2-line span { color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
.land-act2-line span span { color: var(--text-muted); font-family: inherit; }
.land-act2-line .k-filed, .land-act2-line .k-hearing, .land-act2-line .k-order, .land-act2-line .k-permit,
.land-act2-line .k-frac { font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.land-act2-line .k-filed { color: var(--accent-ink, var(--accent)); }
.land-act2-line .k-hearing { color: var(--text-secondary); }
.land-act2-line .k-order { color: var(--success, #3fb950); }
.land-act2-line .k-permit, .land-act2-line .k-frac { color: var(--warning); }
.land-act2-parties { margin-top: 2px; font-size: 11px; color: var(--text-primary); line-height: 1.45; }
.land-act2-parties i { font-style: normal; color: var(--text-muted); margin: 0 3px; }
.land-act2-parties span { color: var(--text-muted); }
.land-act2-meta { margin-top: 2px; font-size: 10px; color: var(--text-muted); }
.land-act2-more { display: block; margin: 10px auto 4px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-tertiary); color: var(--text-primary); padding: 5px 12px; font-size: 11px; cursor: pointer; }
.land-act2-empty { padding: 16px 14px; font-size: 11.5px; line-height: 1.6; color: var(--text-secondary); }
.land-act2-empty.is-err { color: var(--danger); }
.land-act2-sources { padding: 7px 14px 9px; border-top: 1px solid var(--border); font-size: 9.5px; line-height: 1.5;
  color: var(--text-muted); }
@media (max-width: 1100px) {
  .land-page #mode-land[data-lens="activity"] #land-stream { overflow: auto; }
  .land-act2-cols { grid-template-columns: minmax(0, 1fr); }
  .land-act2-col { max-height: 70vh; }
}

/* ── ACTIVITY lens: heading, three summary modules, attention section ──── */
.land-act-head { margin: 0 0 12px; }
.land-act-h { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700;
  letter-spacing: .16em; color: var(--text-primary); margin: 0 0 5px; text-transform: uppercase; }
.land-act-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.land-act-aoi { font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: .04em; color: var(--text-secondary); }
.land-act-mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-bottom: 18px; }
@media (max-width: 1100px) { .land-act-mods { grid-template-columns: minmax(0, 1fr); } }
.land-mod { border: 1px solid var(--border); border-radius: 7px; background: var(--bg-secondary);
  padding: 8px 12px 7px; min-width: 0; }
.land-mod-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .14em;
  color: var(--text-secondary); text-transform: uppercase; margin-bottom: 5px; }
/* Source freshness / sample-data note: present, but quiet -- it must not
   out-shout the module it annotates. */
.land-mod-meta { margin-left: auto; font-size: 8.5px; letter-spacing: .06em;
  text-transform: none; color: var(--text-muted); opacity: .75; }
.land-mod-n { font-family: 'JetBrains Mono', monospace; font-size: 19px; font-weight: 700;
  color: var(--text-primary); line-height: 1.1; }
.land-mod-l { font-size: 10.5px; color: var(--text-secondary); margin: 1px 0 2px; }
.land-mod-s { font-size: 10px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
/* Upcoming entries sit tighter inside a module than they did in the rail; the
   detail line holds to one row (full text on hover). */
.land-mod .land-cal { padding: 3px 0; gap: 7px; }
.land-mod .land-cal-d { flex-basis: 30px; line-height: 1; }
.land-mod .land-cal-d b { font-size: 12.5px; }
.land-mod .land-cal-d span { display: block; margin-top: 1px; }
.land-mod .land-cal-t,
.land-mod .land-cal-s { line-height: 1.35; }
.land-mod .land-cal-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A card with a detail view is selectable; the others stay inert, so nothing
   invites a click it cannot honour. */
.land-mod[data-detail] { cursor: pointer; transition: border-color .15s, background-color .15s; }
.land-mod[data-detail]:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.land-mod[data-detail]:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.land-mod[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset;
  background-color: color-mix(in srgb, var(--accent) 8%, var(--bg-secondary)); }

/* Detail workspace under the cards. OCC DOCKET: grouped by hearing date. */
.land-detail { border: 1px solid var(--border); border-radius: 7px; background: var(--bg-secondary);
  margin-bottom: 14px; overflow: hidden; }
.land-detail-h { display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-tertiary); }
.land-detail-t { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-primary); }
.land-dk-day + .land-dk-day { border-top: 1px solid var(--border); }
.land-dk-date { padding: 9px 14px 2px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-secondary); }
.land-dk-date span { color: var(--text-muted); }
.land-dk-item { padding: 6px 14px 10px; }
.land-dk-item + .land-dk-item { border-top: 1px dashed var(--border); }
.land-dk-row { display: flex; gap: 12px; align-items: flex-start; }
.land-dk-main { flex: 1; min-width: 0; }
.land-dk-who { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.land-dk-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.land-dk-sub.rel { color: var(--text-muted); }
.land-dk-act { flex: 0 0 auto; border: none; background: none; padding: 2px 0; cursor: pointer;
  color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .08em; }
.land-dk-act:hover { text-decoration: underline; }
.land-dk-n { font-weight: 400; color: var(--text-muted); }
/* UPCOMING / RECENT group headings inside the docket. */
.land-dk-grp { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 2px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-primary); }
.land-dk-grp span { font-weight: 400; font-size: 9px; letter-spacing: .06em; text-transform: none;
  color: var(--text-muted); }
.land-dk-grp + .land-dk-day { border-top: none; }
.land-dk-day + .land-dk-grp { margin-top: 4px; border-top: 1px solid var(--border); }
.land-dk-none { padding: 6px 14px 10px; font-size: 11px; color: var(--text-muted); }
/* A past hearing with no outcome held: a state worth monitoring, not an error. */
.land-dk-flag { display: inline-block; margin-top: 5px; font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: .06em; color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 55%, transparent); border-radius: 8px; padding: 1px 7px; }
.land-mod-recent { margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--border);
  font-size: 9.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.land-mod-recent b { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--warning); margin-right: 3px; }
.land-cov dd { color: var(--text-secondary); }
.land-cause-note { margin: 6px 0 0; font-size: 10.5px; color: var(--text-muted); }
.land-dk-causes { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); }
.land-dk-ch { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
/* A cause is a row that opens its record in ICOP -- not a link out. */
.land-dk-c { display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 4px 0; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif; font-size: 11px;
  color: var(--text-secondary); }
.land-dk-c .cn { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-primary); }
.land-dk-c .go { color: var(--text-muted); margin-left: 2px; }
.land-dk-c:hover { color: var(--text-primary); }
.land-dk-c:hover .cn, .land-dk-c:hover .go { color: var(--accent); }

/* Cause record: one level below the docket, same workspace, breadcrumb back. */
.land-crumb { display: flex; align-items: center; gap: 6px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-tertiary);
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); }
.land-crumb button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--accent);
  font: inherit; letter-spacing: inherit; text-transform: inherit; }
.land-crumb button:hover { text-decoration: underline; }
.land-crumb .cur { color: var(--text-primary); }
.land-crumb .land-back { margin-left: auto; text-transform: none; letter-spacing: .04em; }
.land-cause-body { padding: 12px 14px 14px; }
.land-cause-no { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700;
  color: var(--text-primary); }
.land-cause-t { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-secondary); margin: 2px 0 10px; }
.land-cause-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 12px;
  margin: 0; font-size: 11.5px; }
.land-cause-kv dt { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
.land-cause-kv dd { margin: 0; color: var(--text-primary); }
.land-cause-sec { margin-top: 14px; }
.land-cause-sh { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-secondary); padding-bottom: 4px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border); }
.land-cause-p { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--text-secondary); }
.land-hist { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 12px; font-size: 11.5px; }
.land-hist .d { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-muted); }
.land-hist .e { color: var(--text-primary); }
.land-hist small { color: var(--text-muted); font-size: 10.5px; margin-left: 6px; }

/* The document feed, compact on ACTIVITY: same drop element, no artwork, one
   line; the fed list folds behind the header toggle. POSITION is unchanged. */
.land-feed-h { display: flex; align-items: center; gap: 6px; }
.land-feed-tog { margin-left: auto; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px; letter-spacing: .08em; padding: 1px 7px; cursor: pointer; text-transform: uppercase; }
.land-feed-tog:hover { color: var(--text-primary); }
#mode-land[data-lens="activity"] .land-drop { padding: 7px 10px; text-align: left; }
#mode-land[data-lens="activity"] .land-drop::before,
#mode-land[data-lens="activity"] .land-drop::after { display: none; }
.land-drop-add { font-size: 11px; color: var(--accent); font-weight: 600; }
#mode-land[data-lens="activity"] .land-feed:not(.open) #land-fed-list { display: none; }

/* The subtitle is allowed to disappear before it collides with the badge --
   it is a label, and the badge saying what is real is not optional. */
.land-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; }
@media (max-width: 1180px) { .land-sub { display: none; } }

/* In the flow, not floating over the header. Absolutely positioned it sat on
   top of the subtitle at ordinary widths -- a banner announcing what is real,
   obscuring the label next to it. */
.land-sketch { flex: 0 0 auto; font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: .14em; color: var(--warning);
  border: 1px solid var(--warning); border-radius: 10px; padding: 2px 11px;
  background: var(--bg-primary); white-space: nowrap; }

.mode-reservoir { width: 100%; height: 100%; display: none; position: relative; overflow: hidden; }
.mode-reservoir.visible { display: flex; }
/* Same ICOP environment as Land and Live Ops -- see .mode-land::before. */
body:not(.theme-light) .mode-reservoir { background-color: var(--icop-bg, #0a0f1a); }
body:not(.theme-light) .mode-reservoir::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(8,13,24,0.45) 0%, rgba(8,13,24,0.58) 100%),
    url('/assets/ICOP_Background_2560x1440_2.webp');
  background-size: cover; background-position: center 90%;
  background-repeat: no-repeat; background-attachment: fixed;
  filter: contrast(1.05);
}
body:not(.theme-light) .mode-reservoir.nobg::before {
  background-image: linear-gradient(180deg, #0e1626 0%, #0a101d 55%, #080c16 100%);
  background-attachment: scroll; filter: none;
}
body:not(.theme-light) .mode-reservoir {
  --bg-secondary: rgba(15,22,38,0.80);
  --bg-tertiary: rgba(22,35,58,0.80);
}
body:not(.theme-light) .mode-reservoir .re-rail,
body:not(.theme-light) .mode-reservoir .re-chart-wrap,
body:not(.theme-light) .mode-reservoir .re-fit-card,
body:not(.theme-light) .mode-reservoir .re-ready,
body:not(.theme-light) .mode-reservoir .re-kpi {
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
body:not(.theme-light) .mode-reservoir .re-main,
body:not(.theme-light) .mode-reservoir .re-body { background: transparent; }

/* left rail — well selector */
.re-rail { flex: 0 0 280px; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border); background: var(--bg-secondary); }
.re-rail-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; }
.re-search, .re-api-input { width: 100%; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; padding: 6px 8px; }
.re-search:focus, .re-api-input:focus { outline: none; border-color: var(--accent, #00d9ff); }
.re-api-row { display: flex; gap: 6px; }
.re-api-row .re-api-input { flex: 1; min-width: 0; }
.re-btn { background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; cursor: pointer; }
.re-btn:hover { border-color: var(--accent, #00d9ff); }
.re-btn.ghost { color: var(--text-muted); }
.re-status { font-size: 10.5px; color: var(--text-muted); min-height: 14px; }
.re-well-list { flex: 1; overflow-y: auto; min-height: 0; padding: 4px; }
.re-list-empty { padding: 18px 12px; color: var(--text-muted); font-size: 12px; }
.re-well-row { display: block; width: 100%; text-align: left; background: transparent;
  border: 1px solid transparent; border-radius: 4px; padding: 6px 8px; cursor: pointer; }
.re-well-row:hover { background: var(--bg-tertiary); }
.re-well-row.sel { background: var(--bg-tertiary); border-color: var(--accent, #00d9ff); }
.re-well-row.unsup { opacity: 0.45; }
.re-wr-name { display: block; color: var(--text-primary); font-size: 12px; font-weight: 600; }
.re-wr-sub { display: block; color: var(--text-muted); font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace; }

/* main pane */
.re-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  padding: 12px 16px; gap: 10px; }
.re-ws-tabs { display: flex; gap: 6px; }
.re-ws-tab { background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 5px 14px; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.re-ws-tab.on { background: var(--bg-tertiary); color: var(--text-primary); }
.re-ws-tab:disabled { cursor: not-allowed; opacity: 0.55; }
.re-soon { font-size: 8.5px; color: var(--accent, #00d9ff); margin-left: 4px; letter-spacing: 0.5px; }
.re-well-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.re-well-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.re-well-sub { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.re-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.re-seg { display: flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.re-seg button { background: transparent; color: var(--text-muted); border: none;
  padding: 5px 10px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  font-weight: 700; letter-spacing: 0.5px; cursor: pointer; }
.re-seg button + button { border-left: 1px solid var(--border); }
.re-seg button.on { background: var(--bg-tertiary); color: var(--text-primary); }
.re-seg button.oil.on { color: #22c55e; }
.re-seg button.gas.on { color: #f59e0b; }
.re-seg button.water.on { color: #06b6d4; }
.re-seg-solo { background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 5px 10px; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; cursor: pointer; }
.re-seg-solo.on { background: var(--bg-tertiary); color: var(--text-primary);
  border-color: var(--accent, #00d9ff); }
.re-empty { flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 13px; text-align: center; padding: 24px;
  border: 1px dashed var(--border); border-radius: 6px; }
.re-body { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.re-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.re-kpi { background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 5px; padding: 8px 10px; }
.re-kpi-label { font-size: 9.5px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px; font-family: 'JetBrains Mono', monospace; }
.re-kpi-val { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-top: 2px; }
.re-kpi-sub { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.re-chart-wrap { flex: 1; min-height: 220px; position: relative;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px; }
.re-chart-wrap canvas { position: absolute; inset: 10px; width: calc(100% - 20px) !important;
  height: calc(100% - 20px) !important; }

/* RE evidence-layer additions (reviewer round, 2026-08-30) */
.re-ext-badge { display: inline-flex; align-items: center; margin-left: 8px;
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace; vertical-align: 3px; }
.re-provenance { font-size: 10px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; padding: 0 2px; }
.re-kpi.warn .re-kpi-val { color: #d9a441; }
.re-kpi.bad .re-kpi-val { color: #e74c3c; }

/* Fit Readiness gate (Phase 2 step 3) */
.re-ready { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.re-ready-status { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--border);
  border-left-width: 4px; border-radius: 6px; padding: 10px 14px; background: var(--bg-secondary); }
.re-ready-status.ok { border-left-color: #3fb950; }
.re-ready-status.warn { border-left-color: #d9a441; }
.re-ready-status.bad { border-left-color: #e74c3c; }
.re-rs-badge { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px;
  letter-spacing: 1.5px; padding-top: 1px; }
.re-ready-status.ok .re-rs-badge { color: #3fb950; }
.re-ready-status.warn .re-rs-badge { color: #d9a441; }
.re-ready-status.bad .re-rs-badge { color: #e74c3c; }
.re-rs-reasons { font-size: 11.5px; color: var(--text-primary); line-height: 1.5; }
.re-ready-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.re-ready-col { background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; }
.re-rc-title { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; }
.re-win-row { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.re-win-row label { font-size: 11px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.re-win-row input { background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
  font-size: 11px; padding: 4px 6px; }
.re-ev-list, .re-ex-list { display: flex; flex-direction: column; gap: 3px; max-height: 160px; overflow-y: auto; }
.re-ev-row, .re-ex-row { display: flex; gap: 10px; align-items: baseline; font-size: 11.5px;
  color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
.re-ev-kind { font-size: 10px; font-weight: 700; }
.re-ev-kind.imp { color: #e74c3c; }
.re-ev-kind.upl { color: #3fb950; }
.re-ev-sub { color: var(--text-muted); font-size: 10.5px; }
.re-notes { width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-primary); font-size: 11.5px; padding: 6px 8px;
  font-family: 'IBM Plex Sans', sans-serif; resize: vertical; }
.re-ready-actions { display: flex; gap: 10px; align-items: center; }
.re-btn.primary { border-color: var(--accent, #00d9ff); color: var(--accent, #00d9ff); }

/* Step 4 fitting workspace */
.re-fit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.re-fit-card { background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; }
.re-fit-model { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.re-fit-model input { vertical-align: -2px; margin-right: 6px; }
.re-fit-params { font-size: 10.5px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px; }
.re-fit-row { display: flex; justify-content: space-between; font-size: 11px;
  color: var(--text-primary); padding: 2px 0; border-top: 1px dashed var(--border); }
.re-fit-row span:first-child { color: var(--text-muted); }

/* Step 5 — REMI interpretation pane */
.re-int-item { font-size: 11.5px; color: var(--text-primary); padding: 3px 0; line-height: 1.45; }
.re-int-refs { margin: 2px 0 2px 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.re-int-ref { font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px;
  padding: 1px 6px; cursor: default; }

/* ── DSU labels ─────────────────────────────────────────────────────────
   Shown only at zoom >= 12 (js/map-layers.js). Non-interactive so they never
   steal a hover from the unit polygon underneath, and text-shadowed rather
   than boxed so a label over a filled unit stays readable without adding
   another rectangle to a map that is already made of rectangles. */
.dsu-label { background: none; border: none; pointer-events: none; }
.dsu-label-in {
  text-align: center; line-height: 1.15; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  color: #f2f5f8;
  text-shadow: 0 0 3px rgba(0,0,0,.95), 0 0 6px rgba(0,0,0,.8);
}
body.theme-light .dsu-label-in {
  color: #1b2430;
  text-shadow: 0 0 3px rgba(255,255,255,.95), 0 0 6px rgba(255,255,255,.85);
}
.dsu-label-op { font-size: 9px; font-weight: 500; opacity: .85; }

/* NORRIS ground card (knowledge type 2): lane tags, index-only order marks, the orders fold */
.land-lane { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 2px; font-size: 9px; letter-spacing: .08em; vertical-align: 1px; border: 1px solid currentColor; opacity: .75; }
.land-lane.authority { color: #7fb3dd; }
.land-lane.record { color: #d9b26a; }
.land-lane.facts { color: #7cc29e; }
.land-item .v small.land-idx, .land-idx { display: inline; font-size: 9px; letter-spacing: .06em; margin: 0 0 0 3px; opacity: .7; text-transform: uppercase; }
.land-ord { cursor: pointer; text-decoration: underline dotted; }

/* ── OPPORTUNITY: the township board, two lenses ──────────────────────────
   One grid of the 36 sections coloured by the active lens (LEASEHOLD: how open control is; MINERALS: the flip
   ladder stage), a ranked list or the active finder's results, and the section card. The map stays below. */
/* The lens switch, one choice across OPPORTUNITY and ACTIVITY: the active lens is filled and marked, the other plain,
   in both themes (the NORRIS light theme restyles every toolbar button, so it gets its own rule below). */
.land-opp-lens { display: flex; flex: 0 0 auto !important; min-width: 0 !important; gap: 0; border: 1px solid var(--border);
  border-radius: 7px; overflow: hidden; }
.land-map-toolbar .land-opp-lens button, .land-act2-lens button { border: 0; border-radius: 0; padding: 8px 14px 8px 12px; font: 600 12px Helvetica, Arial, sans-serif;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); background: transparent; cursor: pointer; }
.land-map-toolbar .land-opp-lens button + button, .land-act2-lens button + button { border-left: 1px solid var(--border); }
.land-map-toolbar .land-opp-lens button::before, .land-act2-lens button::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px;
  border-radius: 50%; border: 1.5px solid currentColor; vertical-align: 1px; opacity: .55; }
.land-map-toolbar .land-opp-lens button[aria-pressed="true"], .land-act2-lens button[aria-pressed="true"] { color: #fff; background: var(--accent); }
.land-map-toolbar .land-opp-lens button[aria-pressed="true"]::before, .land-act2-lens button[aria-pressed="true"]::before { background: #fff; border-color: #fff; opacity: 1; }
/* Light theme: only the OPPORTUNITY toolbar is a navy bar, so only there is the active lens a white pill (like the plat's
   view switch). ACTIVITY's switch sits on the light page and keeps the default accent fill, the same as the window
   chips beside it (Dean, 2026-11-01: white-on-white in light). */
.land-page body.theme-light .land-map-toolbar .land-opp-lens { border-color: rgba(255,255,255,0.32); }
.land-page body.theme-light .land-map-toolbar .land-opp-lens button { background: transparent; color: #D7E2F0; }
.land-page body.theme-light .land-map-toolbar .land-opp-lens button + button { border-left-color: rgba(255,255,255,0.32); }
.land-page body.theme-light .land-map-toolbar .land-opp-lens button[aria-pressed="true"] { background: #fff; color: #1F3B63; }
.land-page body.theme-light .land-map-toolbar .land-opp-lens button[aria-pressed="true"]::before { background: #1F3B63; border-color: #1F3B63; }
.land-opp-lens-tag { display: inline-block; margin: 0 8px 0 2px; padding: 1px 8px; border-radius: 9px; font: 600 9.5px 'JetBrains Mono', monospace; font-style: normal;
  letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--accent); vertical-align: 1px; }
.land-map-toolbar .land-opp-twp-label { flex: 0 0 auto !important; min-width: 0 !important; display: flex; flex-direction: column; gap: 2px;
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-map-toolbar .land-opp-twp-label select { font-size: 11px; padding: 5px 8px; }
.land-map-toolbar > .land-opp-finders { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.land-map-toolbar .land-opp-finders button { display: inline-flex; align-items: center; gap: 6px; border-style: solid;
  color: var(--text-secondary); background: transparent; }
.land-map-toolbar .land-opp-finders button:hover { color: var(--text-primary); border-color: var(--accent); }
.land-map-toolbar .land-opp-finders button[aria-pressed="true"] { color: var(--text-primary); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-opp-finders i { font: 600 9px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .04em; padding: 1px 5px;
  border-radius: 8px; color: var(--text-primary); background: color-mix(in srgb, var(--text-muted) 22%, transparent); }
.land-map-toolbar .land-opp-tools { flex: 0 0 auto !important; min-width: 0 !important; display: flex; gap: 6px; }
.land-map-toolbar .land-opp-tools button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-map-toolbar .land-opp-tools button:disabled { opacity: .45; cursor: default; }
.land-opp-about b { margin-right: 6px; }

.land-opp-board { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(260px, 30%) minmax(0, 1fr) minmax(0, 1.15fr);
  border-top: 1px solid var(--border); background: var(--bg-primary); overflow: hidden; }
.land-opp-board[hidden] { display: none; }
.land-opp-board > div { min-height: 0; min-width: 0; }
.land-opp-grid-col { display: flex; flex-direction: column; padding: 10px 12px; border-right: 1px solid var(--border); overflow: hidden; }
#land-opp-grid { flex: 1; min-height: 0; width: 100%; height: auto; max-height: 100%; }
#land-opp-grid .cell rect { fill: var(--bg-tertiary); stroke: var(--border); stroke-width: 1; cursor: pointer; transition: opacity .15s; }
#land-opp-grid .cell rect.ring { fill: none; stroke: var(--text-primary); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; opacity: .75; }
#land-opp-grid .cell text { pointer-events: none; fill: var(--text-primary); }
#land-opp-grid .cell .n { font: 700 20px 'JetBrains Mono', monospace; }
#land-opp-grid .cell .tag { font: 600 11px Helvetica, Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; opacity: .9; }
#land-opp-grid .cell .date { font: 10.5px Helvetica, Arial, sans-serif; opacity: .75; }
#land-opp-grid .cell .hbp { font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .08em; opacity: .7; }
#land-opp-grid .cell:hover rect:not(.ring), #land-opp-grid .cell:focus-visible rect:not(.ring) { stroke: var(--accent); stroke-width: 2; }
#land-opp-grid .cell:focus-visible { outline: none; }
#land-opp-grid .cell.is-selected rect:not(.ring) { stroke: var(--accent); stroke-width: 3.5; }
#land-opp-grid .cell.is-dim { opacity: .3; }
#land-opp-grid .cell.is-hit rect:not(.ring) { stroke-width: 2.5; stroke: var(--text-primary); }
/* Minerals lens: the flip ladder, faint at quiet, warm where the step is ahead, slate once it is behind. */
#land-opp-grid .st-0 rect:not(.ring), .land-opp-legend i.st-0, .land-opp-row-sec i.st-0, .land-opp-stage i.st-0 { fill: #e6e9ec; background: #e6e9ec; }
#land-opp-grid .st-1 rect:not(.ring), .land-opp-legend i.st-1, .land-opp-row-sec i.st-1, .land-opp-stage i.st-1 { fill: #fbe7bd; background: #fbe7bd; }
#land-opp-grid .st-2 rect:not(.ring), .land-opp-legend i.st-2, .land-opp-row-sec i.st-2, .land-opp-stage i.st-2 { fill: #f7cf7f; background: #f7cf7f; }
#land-opp-grid .st-3 rect:not(.ring), .land-opp-legend i.st-3, .land-opp-row-sec i.st-3, .land-opp-stage i.st-3 { fill: #f2a35a; background: #f2a35a; }
#land-opp-grid .st-4 rect:not(.ring), .land-opp-legend i.st-4, .land-opp-row-sec i.st-4, .land-opp-stage i.st-4 { fill: #e4733b; background: #e4733b; }
#land-opp-grid .st-5 rect:not(.ring), .land-opp-legend i.st-5, .land-opp-row-sec i.st-5, .land-opp-stage i.st-5 { fill: #b9452c; background: #b9452c; }
#land-opp-grid .st-6 rect:not(.ring), .land-opp-legend i.st-6, .land-opp-row-sec i.st-6, .land-opp-stage i.st-6 { fill: #8f2f3f; background: #8f2f3f; }
#land-opp-grid .st-7 rect:not(.ring), .land-opp-legend i.st-7, .land-opp-row-sec i.st-7, .land-opp-stage i.st-7 { fill: #5c6771; background: #5c6771; }
#land-opp-grid .st-5 text, #land-opp-grid .st-6 text, #land-opp-grid .st-7 text, #land-opp-grid .st-4 text { fill: #fff; }
#land-opp-grid .st-0 text, #land-opp-grid .st-1 text, #land-opp-grid .st-2 text, #land-opp-grid .st-3 text { fill: #1d2429; }
/* Leasehold lens: how open control still is. */
#land-opp-grid .ct-open rect:not(.ring), .land-opp-legend i.ct-open, .land-opp-row-sec i.ct-open { fill: #9fd9b4; background: #9fd9b4; }
#land-opp-grid .ct-contested rect:not(.ring), .land-opp-legend i.ct-contested, .land-opp-row-sec i.ct-contested { fill: #f7cf7f; background: #f7cf7f; }
#land-opp-grid .ct-active rect:not(.ring), .land-opp-legend i.ct-active, .land-opp-row-sec i.ct-active { fill: #fbe7bd; background: #fbe7bd; }
#land-opp-grid .ct-led rect:not(.ring), .land-opp-legend i.ct-led, .land-opp-row-sec i.ct-led { fill: #8fb8e8; background: #8fb8e8; }
#land-opp-grid .ct-dominant rect:not(.ring), .land-opp-legend i.ct-dominant, .land-opp-row-sec i.ct-dominant { fill: #3f74b8; background: #3f74b8; }
#land-opp-grid .ct-deciding rect:not(.ring), .land-opp-legend i.ct-deciding, .land-opp-row-sec i.ct-deciding { fill: #b48ad6; background: #b48ad6; }
#land-opp-grid .ct-locked rect:not(.ring), .land-opp-legend i.ct-locked, .land-opp-row-sec i.ct-locked { fill: #8d969e; background: #8d969e; }
#land-opp-grid .ct-dominant text, #land-opp-grid .ct-locked text { fill: #fff; }
#land-opp-grid .ct-open text, #land-opp-grid .ct-contested text, #land-opp-grid .ct-active text, #land-opp-grid .ct-led text, #land-opp-grid .ct-deciding text { fill: #1d2429; }
#land-opp-grid .st-none rect { fill: var(--bg-tertiary); }
.land-opp-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 10px; color: var(--text-secondary); }
.land-opp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.land-opp-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid rgba(0, 0, 0, .15); }
.land-opp-legend i.ring { background: transparent; border: 1.5px dashed var(--text-primary); }

.land-opp-list-col { display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.land-opp-list-head { padding: 9px 12px 6px; font-size: 11px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.land-opp-list-head b { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .08em; color: var(--text-primary); margin-right: 6px; }
.land-opp-list { flex: 1; min-height: 0; overflow: auto; }
.land-opp-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; width: 100%; padding: 8px 12px; border: 0;
  border-bottom: 1px solid var(--border); background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; font: inherit; }
.land-opp-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.land-opp-row.is-selected { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.land-opp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-opp-row-sec { display: flex; align-items: center; gap: 6px; font: 700 11px 'JetBrains Mono', monospace; }
.land-opp-row-sec i { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 10px; border: 1px solid rgba(0, 0, 0, .15); }
.land-opp-row-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.land-opp-row-body strong { font-size: 11.5px; font-weight: 600; }
.land-opp-row-body span { font-size: 10.5px; color: var(--text-secondary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.land-opp-row-when { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.land-opp-wait { padding: 16px 14px; font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }
.land-opp-wait.is-error { color: var(--warning); }
.land-opp-sources { border-top: 1px solid var(--border); font-size: 10.5px; color: var(--text-secondary); }
.land-opp-sources summary { padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--text-primary); }
.land-opp-sources > div { max-height: 180px; overflow: auto; padding: 0 12px 10px; }
.land-opp-sources ul { margin: 4px 0; padding-left: 16px; line-height: 1.55; }
.land-opp-sources .land-opp-limits { border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 6px; }
.land-opp-sources p { margin: 6px 0 0; }

.land-opp-card-col { overflow: auto; padding: 10px 14px 14px; font-size: 11.5px; line-height: 1.55; color: var(--text-secondary); }
.land-opp-card-head { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.land-opp-card-title { display: flex; align-items: center; gap: 10px; }
.land-opp-card-title b { font: 700 15px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-opp-conf { font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .12em; padding: 2px 7px; border-radius: 9px; cursor: help;
  color: var(--text-secondary); border: 1px solid var(--border); }
.land-opp-conf.is-resolved { color: var(--text-primary); border-color: var(--text-primary); }
.land-opp-stage { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-primary); }
.land-opp-stage i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0, 0, 0, .15); }
.land-opp-stage span { color: var(--text-secondary); font-size: 11px; }
.land-opp-stage em { font: 600 9px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .1em; padding: 1px 6px; border-radius: 8px;
  color: var(--text-secondary); border: 1px solid var(--border); cursor: help; }
.land-opp-next { margin-top: 6px; font-size: 11.5px; color: var(--text-primary); }
.land-opp-next strong { color: var(--accent-ink, var(--accent)); }
.land-opp-next small { display: block; font-size: 10px; color: var(--text-muted); }
.land-opp-ev { margin: 8px 0 0; padding-left: 16px; color: var(--text-primary); }
.land-opp-ev li { margin: 2px 0; }
.land-opp-ctx { margin-top: 6px; font-size: 10.5px; }
.land-opp-ctx b { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-opp-ctx ul { margin: 2px 0 0; padding-left: 16px; }
.land-opp-meta { margin-top: 8px; display: grid; gap: 4px; font-size: 10.5px; }
.land-opp-meta b { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-opp-sec { padding: 10px 0 6px; border-bottom: 1px solid var(--border); }
.land-opp-sec h4 { margin: 0 0 6px; font: 700 10.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-primary); }
.land-opp-sec h4 span { margin-left: 8px; font: 600 11px Helvetica, Arial, sans-serif; letter-spacing: 0; text-transform: none; color: var(--accent-ink, var(--accent)); }
.land-opp-sec h5 { margin: 10px 0 4px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-opp-sec h5 span { margin-left: 6px; font: 10px Helvetica, Arial, sans-serif; letter-spacing: 0; text-transform: none; }
.land-opp-sec p { margin: 4px 0; }
.land-opp-caveat { font-size: 10.5px; color: var(--text-muted); }
.land-opp-nmabar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 6px 0; background: var(--bg-tertiary); }
.land-opp-nmabar i { display: block; min-width: 2px; }
.nm-held { background: #3f74b8; } .nm-extended { background: #8fb8e8; } .nm-primary { background: #b9d6f2; }
.nm-open { background: #9fd9b4; } .nm-pooled { background: #b48ad6; } .nm-unresolved { background: #d9d9d9; }
.land-opp-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 14px; font-size: 10.5px; }
.land-opp-kv b { display: inline-block; min-width: 54px; margin-right: 4px; font: 700 12px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-opp-tbl { width: 100%; border-collapse: collapse; font-size: 11px; color: var(--text-primary); }
.land-opp-tbl th { text-align: left; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 2px 6px 2px 0; font-weight: 600; }
.land-opp-tbl td { padding: 3px 6px 3px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.land-opp-tbl td.r, .land-opp-tbl th.r { text-align: right; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
.land-opp-tbl td.w { width: 90px; }
.land-opp-tbl td.w i { display: block; height: 7px; border-radius: 3px; background: var(--accent); min-width: 2px; }
.land-opp-notes { margin: 2px 0; padding-left: 16px; }
.land-opp-notes li { margin: 2px 0; }
.land-opp-notes.land-opp-inline { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 0; list-style: none; }
.land-opp-score { height: 8px; border-radius: 4px; background: var(--bg-tertiary); overflow: hidden; margin: 4px 0 6px; }
.land-opp-score i { display: block; height: 100%; background: linear-gradient(90deg, #f7cf7f, #e4733b); }
.land-opp-pool { padding: 6px 0; border-top: 1px dashed var(--border); font-size: 11px; color: var(--text-primary); }
.land-opp-pool:first-of-type { border-top: 0; }
.land-opp-pool b { font-family: 'JetBrains Mono', monospace; margin-right: 6px; }
.land-opp-pool > span { display: block; font-size: 10.5px; color: var(--text-secondary); }
.land-opp-pool button, .land-opp-card-tools button { margin-top: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-tertiary); color: var(--text-primary); font-size: 10.5px; cursor: pointer; }
.land-opp-pool button:hover, .land-opp-card-tools button:hover { border-color: var(--accent); }
.land-opp-docs-host { margin-top: 6px; }
.land-opp-docket { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; font-size: 10.5px; color: var(--text-secondary); }
.land-opp-card-tools { display: flex; gap: 8px; padding-top: 10px; }

/* The N.O.R.R.I.S. brief takes the list and card columns; the grid stays for reference and follows the findings. */
.land-opp-brief { display: none; grid-column: 2 / 4; min-height: 0; overflow: auto; padding: 10px 16px 16px; font-size: 12px; line-height: 1.6;
  color: var(--text-secondary); background: var(--bg-primary); }
.land-opp-board.is-brief .land-opp-brief { display: block; }
.land-opp-board.is-brief .land-opp-list-col, .land-opp-board.is-brief .land-opp-card-col { display: none; }
.land-opp-brief-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.land-opp-brief-head b { font: 700 13px 'JetBrains Mono', monospace; letter-spacing: .06em; color: var(--text-primary); }
.land-opp-brief-head span { font: 700 12px 'JetBrains Mono', monospace; color: var(--text-secondary); }
.land-opp-brief-head em { font-style: normal; font-size: 10.5px; color: var(--text-muted); }
.land-opp-brief-head em.is-busy { color: var(--accent-ink, var(--accent)); }
.land-opp-brief-head button { margin-left: auto; padding: 5px 11px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-tertiary);
  color: var(--text-primary); font-size: 11px; cursor: pointer; }
.land-opp-brief-head button:hover { border-color: var(--accent); }
.land-opp-brief-head .land-opp-brief-close { margin-left: 0; font-size: 16px; line-height: 1; padding: 3px 9px; }
.land-opp-oneline { margin: 10px 0 4px; font-size: 13px; color: var(--text-primary); }
.land-opp-chapters { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 8px; }
.land-opp-chapter h4 { margin: 0 0 8px; font: 700 10.5px 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--text-primary); }
.land-opp-chapter.is-lens h4 { color: var(--accent-ink, var(--accent)); }
.land-opp-finding { padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.land-opp-finding:hover, .land-opp-finding:focus-visible { border-color: var(--accent); outline: none; }
.land-opp-finding.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.land-opp-finding b { display: block; font-size: 12px; color: var(--text-primary); }
.land-opp-finding p { margin: 3px 0 0; }
.land-opp-finding span { display: block; margin-top: 4px; font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); }
.land-opp-brief-limits { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11px; }
.land-opp-brief-limits b { display: block; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-opp-brief-limits ul { margin: 4px 0 0; padding-left: 16px; }
.land-opp-brief-foot { margin-top: 10px; font-size: 10px; color: var(--text-muted); }

/* ── TRADES: the third Opportunity lens (js/land-trades.js) ─────────────────────────────────────────────────────
   The Trade Opportunity Engine's candidates for one anchor: a bar with the anchor pick and the filters, a note with
   the counts, then the board's three columns (the anchor's standing of record in each section; the candidate list;
   the card with both legs). Kinds, tiers and the give / get legs carry their own marks; no operator has a colour. */
.land-opp-trades { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; border-top: 1px solid var(--border); background: var(--bg-primary); }
.land-opp-trades[hidden] { display: none; }
.land-trd-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.land-trd-anchor-label { display: flex; flex-direction: column; gap: 2px; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); min-width: 240px; }
.land-trd-anchor-label select { font-size: 11.5px; padding: 5px 8px; max-width: 440px; }
.land-trd-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.land-trd-fgroup { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.land-trd-fgroup + .land-trd-fgroup { padding-left: 10px; border-left: 1px solid var(--border); }
.land-trd-filters button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 12px;
  background: transparent; color: var(--text-secondary); font: 600 10.5px Helvetica, Arial, sans-serif; cursor: pointer; }
.land-trd-filters button:hover { color: var(--text-primary); border-color: var(--accent); }
.land-trd-filters button[aria-pressed="true"] { color: var(--text-primary); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-trd-filters button i { font: 600 9px 'JetBrains Mono', monospace; font-style: normal; padding: 1px 5px; border-radius: 8px; color: var(--text-primary);
  background: color-mix(in srgb, var(--text-muted) 22%, transparent); }
.land-trd-filters select { font-size: 10.5px; padding: 4px 6px; }
.land-trd-note { padding: 6px 12px; font-size: 10.5px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.land-trd-note b { font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-trd-note em { color: var(--text-muted); font-style: normal; }
.land-trd-sub { margin: 0; padding: 4px 12px 6px; font-size: 11px; color: var(--text-secondary); }
.land-trd-board { border-top: 0; }
.land-trd-grid-cap { margin: 4px 0 0; font-size: 10px; color: var(--text-muted); line-height: 1.4; }
/* The mosaic: the anchor's standing of record (grey to blue), the selected candidate's give and get sections outlined. */
#land-trd-grid .cell rect { fill: var(--bg-tertiary); stroke: var(--border); stroke-width: 1; cursor: pointer; transition: opacity .15s; }
#land-trd-grid .cell rect.ring { fill: none; stroke: var(--text-primary); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; opacity: .75; }
#land-trd-grid .cell text { pointer-events: none; fill: var(--text-primary); }
#land-trd-grid .cell .n { font: 700 20px 'JetBrains Mono', monospace; }
#land-trd-grid .cell .tag { font: 600 11px Helvetica, Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; opacity: .9; }
#land-trd-grid .cell .date { font: 10.5px Helvetica, Arial, sans-serif; opacity: .75; }
#land-trd-grid .cell .hbp { font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .08em; opacity: .7; }
#land-trd-grid .cell:hover rect:not(.ring), #land-trd-grid .cell:focus-visible rect:not(.ring) { stroke: var(--accent); stroke-width: 2; }
#land-trd-grid .cell:focus-visible { outline: none; }
#land-trd-grid .cell.is-selected rect:not(.ring) { stroke: var(--accent); stroke-width: 3.5; }
#land-trd-grid .cell.is-dim { opacity: .3; }
#land-trd-grid .cell.is-hit rect:not(.ring) { stroke-width: 2.5; stroke: var(--text-primary); }
#land-trd-grid .pt-none rect:not(.ring), .land-trd-legend i.pt-none { fill: #e6e9ec; background: #e6e9ec; }
#land-trd-grid .pt-minor rect:not(.ring), .land-trd-legend i.pt-minor { fill: #d6e2f0; background: #d6e2f0; }
#land-trd-grid .pt-major rect:not(.ring), .land-trd-legend i.pt-major { fill: #b9d6f2; background: #b9d6f2; }
#land-trd-grid .pt-led rect:not(.ring), .land-trd-legend i.pt-led { fill: #8fb8e8; background: #8fb8e8; }
#land-trd-grid .pt-dominant rect:not(.ring), .land-trd-legend i.pt-dominant { fill: #3f74b8; background: #3f74b8; }
#land-trd-grid .pt-dominant text { fill: #fff; }
#land-trd-grid .pt-none text, #land-trd-grid .pt-minor text, #land-trd-grid .pt-major text, #land-trd-grid .pt-led text { fill: #1d2429; }
#land-trd-grid .cell.is-give rect:not(.ring) { stroke: #e4733b; stroke-width: 4; }
#land-trd-grid .cell.is-get rect:not(.ring) { stroke: #2f9e63; stroke-width: 4; }
#land-trd-grid .cell.is-give.is-get rect:not(.ring) { stroke: #8d6b2f; }
.land-trd-legend i.mk-give { background: transparent; border: 2.5px solid #e4733b; }
.land-trd-legend i.mk-get { background: transparent; border: 2.5px solid #2f9e63; }
/* The list: kind and tier marks, the decision status. */
.land-trd-row { grid-template-columns: 82px minmax(0, 1fr) auto; }
.land-trd-row-tags { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.land-trd-row-tags i, .land-trd-tier, .land-trd-mutual { font: 600 8.5px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }
.kd-trade { color: #fff !important; background: var(--accent); border-color: var(--accent) !important; }
.kd-lead { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.kd-acquire { border-style: dashed !important; }
.kd-offer { border-style: dotted !important; }
.tr-verified { color: var(--text-primary) !important; border-color: var(--text-primary) !important; }
.tr-inferred { opacity: .6; }
.land-trd-row-tags i.mu, .land-trd-mutual { color: #2f9e63; border-color: #2f9e63; }
.land-trd-row-status b { font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 8px; color: #fff; background: var(--text-muted); }
.land-trd-row-status b.st-pursuing { background: #2f9e63; }
.land-trd-row-status b.st-parked { background: #8d969e; }
.land-trd-row-status b.st-declined { background: #b9452c; }
.land-trd-row.st-declined .land-opp-row-body { opacity: .6; }
/* The card: both legs, the filing, the records, the effect, the open questions, the decision. */
.land-trd-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 4px 14px; margin-top: 6px; font-size: 11.5px; color: var(--text-primary); }
.land-trd-parties b { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-trd-parties code { font: 10.5px 'JetBrains Mono', monospace; }
.land-trd-parties small { color: var(--text-muted); }
.land-trd-leg-give h4 { border-left: 3px solid #e4733b; padding-left: 8px; }
.land-trd-leg-get h4 { border-left: 3px solid #2f9e63; padding-left: 8px; }
.land-trd-rests { display: flex; flex-wrap: wrap; gap: 4px; }
.land-trd-rests span { font: 10px 'JetBrains Mono', monospace; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); }
.land-trd-rests span.is-chain { border-style: dashed; }
.land-trd-rests span small { font-size: 8.5px; color: var(--text-muted); }
.land-trd-why p b { font-weight: 600; color: var(--text-primary); }
.land-trd-status { font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--border);
  color: var(--text-secondary); margin-left: 6px; }
.land-trd-clock { color: var(--accent-ink, var(--accent)); }
.land-trd-why button, .land-trd-decide button { margin-top: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-tertiary);
  color: var(--text-primary); font-size: 10.5px; cursor: pointer; }
.land-trd-why button:hover, .land-trd-decide button:hover { border-color: var(--accent); }
.land-trd-unres { padding-left: 0; }
.land-trd-unres li { list-style: none; }
.land-trd-unres i { display: inline-block; min-width: 34px; margin-right: 6px; font: 600 8.5px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); }
.land-trd-unres i.lg-give { color: #e4733b; }
.land-trd-unres i.lg-get { color: #2f9e63; }
.land-trd-decide { border-bottom: 0; }
.land-trd-form, .land-trd-notes-in { display: grid; gap: 6px; margin-top: 6px; font-size: 10.5px; color: var(--text-muted); }
.land-trd-form label, .land-trd-notes-in { display: flex; flex-direction: column; gap: 2px; }
.land-trd-form select, .land-trd-form input, .land-trd-notes-in input { font-size: 11px; padding: 5px 8px; }
.land-trd-notes { white-space: pre-wrap; color: var(--text-primary); }
@media (max-width: 1280px) { .land-opp-board { grid-template-columns: minmax(220px, 28%) minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 1000px) { .land-opp-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .land-opp-grid-col { grid-row: 1 / 3; }
  .land-opp-card-col { grid-column: 2; } .land-opp-brief { grid-column: 2; } }

/* ── NOTICE on /norris: the notice list for an OCC application ────────────
   The request form and the tenant's drafts at the side; one draft under review in the main area: its header (unit,
   applicant, dates, counts, the stale banner, acceptance and exports), the row table with filters and decisions,
   and the tabs beside it (unresolved, excluded, stale, leads, completeness, memo). Confidence and status colours
   are the section's own tokens, darker in the light theme. */
.land-notice { display: none; }
.land-page .land-notice { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; margin: 12px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  --nt-a: #3fae72; --nt-b: #5b95f5; --nt-c: #d99a34; --nt-u: #e2655f; --nt-l: #a97ce0; }
.land-page body.theme-light .land-notice { --nt-a: #1f7a46; --nt-b: #2f5fb3; --nt-c: #9a5f0a; --nt-u: #b23b36; --nt-l: #6d3fb5; }
.land-map-toolbar .land-notice-tools { flex: 0 0 auto !important; min-width: 0 !important; display: flex; gap: 6px; }
.land-notice-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  border-top: 1px solid var(--border); background: var(--bg-primary); }
.land-notice-side { min-height: 0; overflow: auto; border-right: 1px solid var(--border); padding: 10px 12px 14px;
  font-size: 11px; color: var(--text-secondary); }
.land-notice-main { min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
/* The request form. */
.land-notice-req { display: flex; flex-direction: column; gap: 7px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.land-notice-req-h { margin: 0 0 2px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-notice-req label { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); }
.land-notice input, .land-notice select, .land-notice textarea { width: 100%; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg-primary); color: var(--text-primary); font: 11px Helvetica, Arial, sans-serif; letter-spacing: 0; text-transform: none; }
.land-notice input:focus, .land-notice select:focus, .land-notice textarea:focus { outline: none; border-color: var(--accent); }
.land-notice input[type="checkbox"] { width: auto; }
.land-notice select option:disabled { color: var(--text-muted); }
.land-page body.theme-light .land-notice input, .land-page body.theme-light .land-notice select,
.land-page body.theme-light .land-notice textarea { background: #fff; border-color: var(--input-border); }
/* a placeholder is a hint, not a value: muted and italic in both themes */
.land-notice input::placeholder, .land-notice textarea::placeholder { color: var(--text-muted); opacity: .72; font-style: italic; }
.land-page body.theme-light .land-notice input::placeholder, .land-page body.theme-light .land-notice textarea::placeholder { color: #8a94a3; opacity: 1; }
.land-notice-req-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.land-notice-policy-help { margin: -3px 0 0; font-size: 10px; line-height: 1.45; color: var(--text-muted); }
/* the ? beside Policy and the guide it opens: every policy in plain words, the current one marked, click to pick */
.land-notice-lab { display: inline-flex; align-items: center; gap: 6px; }
.land-notice-req .land-notice-help { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 16px; height: 16px;
  min-width: 0; padding: 0 0 1px; margin: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted);
  font-family: inherit; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: 0; text-indent: 0; text-transform: none;
  vertical-align: middle; cursor: pointer; filter: none; }
.land-notice-req .land-notice-help:hover, .land-notice-req .land-notice-help:focus-visible, .land-notice-req .land-notice-help[aria-expanded="true"] {
  color: #fff; background: var(--accent); border-color: var(--accent); filter: none; }
.land-notice-guide { margin: 2px 0 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-secondary);
  color: var(--text-primary); font-size: 11px; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.land-notice-guide-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.land-notice-guide-head b { font-size: 11.5px; }
.land-notice-guide-x { background: none; border: 0; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.land-notice-guide-x:hover { color: var(--text-primary); }
.land-notice-guide p { margin: 0 0 6px; color: var(--text-muted); font-size: 10.5px; }
.land-notice-guide dl { margin: 0 0 6px; display: grid; gap: 4px; }
.land-notice-guide dl > div { padding: 5px 7px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; }
.land-notice-guide dl > div:hover, .land-notice-guide dl > div:focus-visible { border-color: var(--border); outline: none; }
.land-notice-guide dl > div.is-current { border-color: var(--accent); background: var(--bg-tertiary); }
.land-notice-guide dt { font-weight: 700; font-size: 11px; color: var(--text-primary); }
.land-notice-guide dd { margin: 1px 0 0; color: var(--text-muted); }
.land-notice-req .land-notice-check { flex-direction: row; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--text-primary); }
.land-notice-check span { color: var(--text-muted); font-size: 10px; }
.land-notice-req-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.land-notice-req button { padding: 7px 12px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: #fff;
  font: 600 11px Helvetica, Arial, sans-serif; cursor: pointer; }
.land-notice-req button:hover:not(:disabled) { filter: brightness(1.1); }
.land-notice-req button:disabled { opacity: .5; cursor: default; }
#land-notice-req-msg { font-size: 10.5px; line-height: 1.4; color: var(--warning); }
/* Your drafts. */
.land-notice-drafts-h { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 6px; }
.land-notice-drafts-h b { font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-notice-drafts-h span { font-size: 10px; color: var(--text-muted); }
.land-notice-drafts { display: flex; flex-direction: column; gap: 5px; }
.land-notice-draft { display: block; width: 100%; text-align: left; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-secondary); color: var(--text-secondary); font: 10.5px Helvetica, Arial, sans-serif; line-height: 1.4; cursor: pointer; }
.land-notice-draft:hover { border-color: var(--accent); }
.land-notice-draft:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-notice-draft.is-open { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.land-notice-draft > b { display: block; font: 700 11.5px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-notice-draft > span { display: block; margin-top: 2px; }
.land-notice-draft-c { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font: 10px 'JetBrains Mono', monospace; color: var(--text-muted); }
.land-notice-draft-c b { color: var(--text-primary); margin-right: 3px; }
.land-notice-badge { display: inline-block; padding: 0 6px; border-radius: 8px; font: 600 9px 'JetBrains Mono', monospace; font-style: normal;
  letter-spacing: .08em; text-transform: uppercase; border: 1px solid currentColor; margin-right: 4px; vertical-align: 1px; }
.land-notice-badge.is-accepted { color: var(--nt-a); }
.land-notice-badge.is-stale { color: var(--warning); }
.land-notice-wait { padding: 16px 14px; font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }
.land-notice-wait.is-error { color: var(--warning); }
.land-notice-side .land-notice-wait { padding: 8px 0; }
.land-notice-empty { margin: auto; max-width: 520px; padding: 24px; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.land-notice-empty b { display: block; margin-bottom: 6px; font: 700 13px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-notice-empty p { margin: 0 0 8px; }
.land-notice-working { margin: auto; max-width: 520px; padding: 24px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.land-notice-working b { display: block; font: 700 13px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-notice-working .land-notice-secs { display: block; margin: 8px 0; font: 700 26px 'JetBrains Mono', monospace; color: var(--accent-ink, var(--accent)); }
.land-notice-working p { margin: 0; }
/* The review head. */
.land-notice-head { padding: 10px 14px 9px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); font-size: 11px; color: var(--text-secondary); }
.land-notice-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.land-notice-title b { font: 700 15px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-notice-title em { font-style: normal; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: #fff;
  background: var(--accent); padding: 1px 8px; border-radius: 9px; }
.land-notice-title .land-notice-badge { margin: 0; }
.land-notice-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 5px; font-size: 10.5px; }
.land-notice-meta b { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-right: 4px; font-weight: 600; }
.land-notice-meta span { color: var(--text-primary); }
.land-notice-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; align-items: center; }
.land-notice-counts .g { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.land-notice-counts .g i { font: 600 9.5px 'JetBrains Mono', monospace; font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-right: 2px; }
.land-notice-cnt { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--border);
  font: 600 10px 'JetBrains Mono', monospace; color: var(--text-primary); cursor: pointer; background: transparent; }
.land-notice-cnt:hover { border-color: var(--accent); }
.land-notice-cnt[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-notice-cnt .land-notice-conf { cursor: inherit; }
.land-notice-conf { display: inline-block; min-width: 10px; text-align: center; padding: 0 6px; border-radius: 8px; font: 700 10px 'JetBrains Mono', monospace;
  letter-spacing: .04em; line-height: 16px; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 14%, transparent); cursor: help; }
.land-notice-conf.c-A { color: var(--nt-a); } .land-notice-conf.c-B { color: var(--nt-b); } .land-notice-conf.c-C { color: var(--nt-c); }
.land-notice-conf.c-U { color: var(--nt-u); } .land-notice-conf.c-L { color: var(--nt-l); }
.land-notice-stale { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; padding: 7px 10px; border: 1px solid var(--warning);
  border-radius: 6px; background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--text-primary); font-size: 11px; line-height: 1.45; }
.land-notice-stale b { color: var(--warning); font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.land-notice-stale small { flex-basis: 100%; font-size: 10px; color: var(--text-secondary); }
.land-notice-stale button { margin-left: auto; }
.land-notice-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.land-notice-acts .sep { width: 1px; height: 18px; background: var(--border); }
.land-notice-acts .land-notice-ok { font-size: 11px; color: var(--nt-a); font-weight: 600; }
.land-notice-acts .land-notice-note { font-size: 10.5px; color: var(--text-muted); }
.land-notice-acts .land-notice-note.is-warn { color: var(--warning); }
.land-notice-btn { padding: 6px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary);
  font: 11px Helvetica, Arial, sans-serif; cursor: pointer; white-space: nowrap; }
.land-notice-btn:hover:not(:disabled) { border-color: var(--accent); }
.land-notice-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.land-notice-btn:disabled { opacity: .45; cursor: default; }
.land-notice-btn.is-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.land-notice-btn.is-primary:hover:not(:disabled) { filter: brightness(1.1); }
.land-notice-btn.is-link { border: 0; background: none; color: var(--accent-ink, var(--accent)); padding: 0 2px; font-weight: 600; }
.land-notice-btn.is-link:hover:not(:disabled) { text-decoration: underline; }
.land-notice-btn.is-sm { padding: 3px 7px; font-size: 10px; }
/* Tabs beside the rows. */
.land-notice-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--border); background: var(--bg-primary); padding: 0 8px; }
.land-notice-tabs button { padding: 8px 11px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--text-secondary);
  font: 600 11px Helvetica, Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.land-notice-tabs button i { font-style: normal; margin-left: 5px; font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); }
.land-notice-tabs button[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--accent); }
.land-notice-tabs button:hover { color: var(--text-primary); }
.land-notice-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.land-notice-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* Filters, bulk decisions and helpers over the rows. */
.land-notice-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 7px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary); font-size: 10.5px; color: var(--text-secondary); }
.land-notice-filters select, .land-notice-filters input[type="search"] { width: auto; padding: 4px 7px; }
.land-notice-filters input[type="search"] { width: 190px; }
.land-notice-filters label { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-secondary); }
.land-notice-filters .grow { flex: 1 1 auto; }
.land-notice-filters .n { font: 600 10.5px 'JetBrains Mono', monospace; color: var(--text-primary); white-space: nowrap; }
.land-notice-filters .land-notice-btn[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.land-notice-add { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(170px, 1.2fr) minmax(170px, 1fr) minmax(120px, auto) auto; gap: 8px; align-items: end;
  padding: 8px 12px 10px; border-bottom: 1px solid var(--border); background: var(--bg-tertiary); }
.land-notice-add[hidden] { display: none; }
.land-notice-add label { display: flex; flex-direction: column; gap: 3px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.land-notice-add textarea { resize: vertical; min-height: 44px; font-family: Helvetica, Arial, sans-serif; }
.land-notice-add .land-notice-add-btns { display: flex; gap: 6px; }
.land-notice-add .land-notice-add-note { grid-column: 1 / -1; margin: 0; font-size: 10px; color: var(--text-muted); }
/* The row table. */
.land-notice-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.land-notice-tbl { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 11px; color: var(--text-primary); }
.land-notice-tbl th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 6px 8px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600; background: var(--bg-primary); border-bottom: 1px solid var(--accent); white-space: nowrap; }
.land-notice-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.4; }
.land-notice-tbl tr.is-accepted > td { background: color-mix(in srgb, var(--nt-a) 7%, transparent); }
.land-notice-tbl tr.is-removed > td { color: var(--text-muted); }
.land-notice-tbl tr.is-removed td.nm b { text-decoration: line-through; color: var(--text-secondary); }
.land-notice-tbl tr.is-selected > td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.land-notice-tbl td.ck, .land-notice-tbl th.ck { width: 22px; padding-right: 2px; }
.land-notice-tbl td.ck input, .land-notice-tbl th.ck input { width: auto; margin: 2px 0 0; }
.land-notice-tbl td.n { font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); white-space: nowrap; }
.land-notice-tbl td.nm { min-width: 170px; }
.land-notice-tbl td.nm b { display: block; font-weight: 600; }
.land-notice-tbl td.nm small { display: block; font-size: 10px; color: var(--text-muted); }
.land-notice-tbl td.nm small.rec { font-family: 'JetBrains Mono', monospace; }
.land-notice-tbl td.nm em { font-style: normal; font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--nt-u); margin-left: 5px; }
.land-notice-rec-btn { margin-top: 3px; padding: 0; border: 0; background: none; color: var(--accent-ink, var(--accent)); font: 600 10px Helvetica, Arial, sans-serif; cursor: pointer; }
.land-notice-rec-btn:hover { text-decoration: underline; }
.land-notice-tbl td.ro { white-space: nowrap; font-size: 10.5px; color: var(--text-secondary); }
.land-notice-tbl td.li { white-space: nowrap; font-size: 10.5px; color: var(--text-secondary); }
.land-notice-tbl td.li span { cursor: help; text-decoration: underline dotted; text-underline-offset: 2px; }
.land-notice-tbl td.ad { min-width: 180px; max-width: 260px; }
.land-notice-tbl td.ad div { white-space: pre-line; }
.land-notice-tbl td.ad small { display: block; font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.land-notice-tbl td.ad .u { color: var(--nt-u); font-weight: 600; }
.land-notice-tbl td.ad .u small { color: var(--text-secondary); font-weight: 400; }
.land-notice-tbl td.wh { max-width: 330px; font-size: 10.5px; color: var(--text-secondary); }
.land-notice-tbl td.fl { max-width: 150px; }
.land-notice-flag { display: inline-block; padding: 0 6px; margin: 1px 2px 1px 0; border-radius: 7px; font: 600 9.5px 'JetBrains Mono', monospace;
  color: var(--nt-c); border: 1px solid currentColor; cursor: help; }
.land-notice-tbl td.st { white-space: nowrap; }
.land-notice-tbl td.st b { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.land-notice-tbl td.st b.s-accepted { color: var(--nt-a); }
.land-notice-tbl td.st b.s-removed { color: var(--nt-u); }
.land-notice-tbl td.st small { display: block; max-width: 170px; font-size: 10px; color: var(--text-muted); white-space: normal; }
.land-notice-tbl td.ac { white-space: nowrap; }
.land-notice-tbl td.ac button { margin-right: 3px; }
.land-notice-tbl tr.land-notice-rec > td { background: var(--bg-secondary); padding: 8px 14px 10px 38px; font-size: 10.5px; color: var(--text-secondary); }
.land-notice-rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 22px; }
.land-notice-rec h5 { margin: 4px 0 2px; font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-notice-rec ul { margin: 0; padding-left: 14px; line-height: 1.5; }
.land-notice-rec code { font: 10.5px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-notice-none { padding: 18px 14px; font-size: 11.5px; color: var(--text-muted); }
/* The reason picker, over the row that asked for it. */
.land-notice-pick { position: fixed; z-index: 100000; width: 280px; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-secondary); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); font-size: 11px; color: var(--text-secondary); }
body.theme-light .land-notice-pick { box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.land-notice-pick > b { display: block; margin-bottom: 8px; font-size: 11.5px; color: var(--text-primary); }
.land-notice-pick label { display: flex; flex-direction: column; gap: 3px; margin-bottom: 7px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.land-notice-pick input, .land-notice-pick select { width: 100%; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-primary); color: var(--text-primary); font: 11px Helvetica, Arial, sans-serif; letter-spacing: 0; text-transform: none; }
.land-notice-pick input:focus, .land-notice-pick select:focus { outline: none; border-color: var(--accent); }
body.theme-light .land-notice-pick input, body.theme-light .land-notice-pick select { background: #fff; border-color: var(--input-border, var(--border)); }
.land-notice-pick-btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
/* The tabs' lists. */
.land-notice-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 14px 16px; font-size: 11px; line-height: 1.5; color: var(--text-secondary); }
.land-notice-list h4 { margin: 12px 0 4px; font: 700 10.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-primary); }
.land-notice-list h4:first-child { margin-top: 2px; }
.land-notice-list h4 span { margin-left: 8px; font: 400 10px Helvetica, Arial, sans-serif; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.land-notice-list .land-notice-note { margin: 0 0 8px; font-size: 10.5px; line-height: 1.5; color: var(--text-muted); max-width: 820px; }
.land-notice-list table { width: 100%; border-collapse: collapse; font-size: 11px; color: var(--text-primary); }
.land-notice-list th { text-align: left; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 2px 8px 3px 0; font-weight: 600; }
.land-notice-list td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.land-notice-list td small { display: block; font-size: 10px; color: var(--text-muted); }
.land-notice-list td code { font: 10.5px 'JetBrains Mono', monospace; color: var(--text-primary); }
.land-notice-list td.r { text-align: right; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
.land-notice-list .land-notice-tabq { width: 240px; margin-bottom: 8px; }
.land-notice-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 14px; margin: 0; max-width: 900px; }
.land-notice-dl dt { font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); }
.land-notice-dl dd { margin: 0; color: var(--text-primary); }
.land-notice-dl dd ul { margin: 0; padding-left: 14px; }
.land-notice-dl dd .land-notice-dl { margin: 1px 0 4px; }
.land-notice-dl dd i { font-style: normal; color: var(--text-muted); }
.land-notice-prose { max-width: 780px; margin-bottom: 20px; }
.land-notice-prov { display: inline-block; margin: 0 0 6px; padding: 2px 8px; border: 1px dashed var(--warning); border-radius: 6px; font-size: 10px; line-height: 1.4; color: var(--warning); }
.land-notice-prose p { margin: 0 0 8px; white-space: pre-line; color: var(--text-primary); font-size: 12px; line-height: 1.6; }
.land-notice-lint { margin: 0 0 8px; padding-left: 16px; color: var(--nt-u); font-size: 10.5px; }
.land-notice-list .land-notice-basis { margin: 0 0 14px; max-width: 780px; font-size: 10.5px; color: var(--text-muted); }
/* An export open over the lens (land-notice.js openExport, in the .land-opp-pdf box): a PDF framed; the workbook and the
   mail-merge file as tables, the sheet bar as the Lease Check workbook's. A click on a row shows its long cells in full. */
#land-notice-doc-frame { flex: 1; width: 100%; border: 0; background: #525659; }
.land-notice-sheet { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--bg-primary); }
.land-notice-sheet[hidden] { display: none; }
.land-notice-sheet .land-xlsx-bar input { width: 180px; flex: 0 0 auto; }
.land-notice-sheet-tbl { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 11px; line-height: 1.4; color: var(--text-primary); }
.land-notice-sheet-tbl th, .land-notice-sheet-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.land-notice-sheet-tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-secondary); border-bottom: 1px solid var(--accent);
  font: 600 10.5px Helvetica, Arial, sans-serif; overflow-wrap: anywhere; }
.land-notice-sheet-tbl tbody td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.land-notice-sheet-tbl tbody tr:hover td { background: var(--bg-secondary); }
.land-notice-sheet-tbl tbody tr.is-open td { white-space: normal; overflow-wrap: anywhere; background: var(--bg-secondary); }
.land-notice-sheet-tbl.is-list tbody td { white-space: normal; overflow-wrap: anywhere; }
.land-notice-sheet-tbl.is-list td:first-child { color: var(--text-secondary); font-weight: 600; }
.land-notice-sheet-tbl.is-list tr.is-title td { font: 700 13px 'JetBrains Mono', monospace; color: var(--text-primary); }
@media (max-width: 1000px) {
  .land-notice-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 42%) minmax(0, 1fr); }
  .land-notice-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .land-notice-add { grid-template-columns: 1fr 1fr; }
  .land-notice-tbl td.wh { max-width: 220px; }
}

/* ── ACTIVITY: what moved (the board's time derivative) ───────────────────
   Head with scope, lens and window; a mosaic of the townships (cells lit by how much moved under the lens); the
   tiers in lens order with routine folded; the clocks and sources at the side. */
.land-page .land-act2 { overflow: auto; padding-right: 2px; }
.land-act2-head { align-items: flex-end; }
.land-act2-title { display: flex; flex-direction: column; gap: 2px; margin-right: 6px; }
.land-act2-title #land-act2-sub { font-size: 11px; color: var(--text-secondary); }
.land-act2-lens { align-self: center; }
.land-act2-mosaic { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 2px 0 12px; }
.land-act2-twp { width: 188px; flex: 0 0 auto; padding: 8px; border: 2px solid transparent; border-radius: 8px;   /* 168 px grid + padding + border */
  transition: opacity .15s ease, background-color .15s ease, border-color .15s ease; }
.land-act2-twp.is-off { opacity: .55; }
/* the picked township is a card in the accent; the others step back until hovered */
.land-act2-twp.is-pick { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-secondary));
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 28%, transparent); }
.land-act2-twp.is-pick .land-act2-twp-name { color: var(--accent); font-size: 12.5px; }
.land-act2-twp.is-pick .land-act2-twp-c b { color: var(--accent-ink, var(--accent)); }
.land-act2-mosaic.has-pick .land-act2-twp:not(.is-pick) { opacity: .45; }
.land-act2-mosaic.has-pick .land-act2-twp:not(.is-pick):hover, .land-act2-mosaic.has-pick .land-act2-twp:not(.is-pick):focus-within { opacity: .9; }
.land-act2-twp-h { display: flex; flex-direction: column; margin-bottom: 4px; }
.land-act2-twp-h b { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .06em; color: var(--text-primary); }
.land-act2-twp-h span { font-size: 9.5px; color: var(--text-muted); }
.land-act2-grid { width: 168px; height: 168px; display: block; }
.land-act2-grid .cell rect { fill: var(--bg-tertiary); stroke: var(--border); stroke-width: 2; cursor: pointer; }
.land-act2-grid .cell text { font: 700 30px 'JetBrains Mono', monospace; fill: var(--text-muted); pointer-events: none; }
.land-act2-grid .cell:hover rect, .land-act2-grid .cell:focus-visible rect { stroke: var(--accent); stroke-width: 5; }
.land-act2-grid .cell:focus-visible { outline: none; }
.land-act2-grid .cell.is-pick rect { stroke: var(--text-primary); stroke-width: 6; }
.land-act2-grid .cell.lv-1 rect, .land-act2-legend i.lv-1 { fill: color-mix(in srgb, var(--accent) 14%, var(--bg-tertiary)); background: color-mix(in srgb, var(--accent) 14%, var(--bg-tertiary)); }
.land-act2-grid .cell.lv-2 rect, .land-act2-legend i.lv-2 { fill: color-mix(in srgb, var(--accent) 34%, var(--bg-tertiary)); background: color-mix(in srgb, var(--accent) 34%, var(--bg-tertiary)); }
.land-act2-grid .cell.lv-3 rect, .land-act2-legend i.lv-3 { fill: color-mix(in srgb, var(--accent) 62%, var(--bg-tertiary)); background: color-mix(in srgb, var(--accent) 62%, var(--bg-tertiary)); }
.land-act2-grid .cell.lv-4 rect, .land-act2-legend i.lv-4 { fill: var(--accent); background: var(--accent); }
.land-act2-grid .cell.lv-2 text, .land-act2-grid .cell.lv-3 text, .land-act2-grid .cell.lv-4 text { fill: #fff; }
#mode-land[data-act-lens="minerals"] .land-act2-grid .cell.lv-1 rect { fill: #fbe7bd; }
.land-act2-twp-c { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font-size: 9.5px; color: var(--text-secondary); }
.land-act2-twp-c b { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
.land-act2-legend { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10px; color: var(--text-muted); }
.land-act2-legend span { display: inline-flex; align-items: center; gap: 5px; }
.land-act2-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--border); }
/* the place: a township name or a section picked in the mosaic narrows the tiers; the scope row clears it or opens it on the board */
.land-act2-twp-name { border: 0; background: transparent; padding: 0; margin: 0; cursor: pointer; text-align: left;
  font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .06em; color: var(--text-primary); }
.land-act2-twp-name:hover, .land-act2-twp-name:focus-visible { color: var(--accent); text-decoration: underline; outline: none; }
.land-act2-twp-name[aria-pressed="true"] { color: var(--accent); }
.land-act2-twp.is-pick .land-act2-grid { border-radius: 3px; }
.land-act2-seg button.land-act2-clear { padding: 4px 8px; font-size: 13px; line-height: 1; }
.land-act2-open { border: 1px solid var(--accent); border-radius: 6px; background: transparent; color: var(--accent-ink, var(--accent));
  padding: 4px 10px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.land-act2-open:hover, .land-act2-open:focus-visible { background: var(--accent); color: #fff; outline: none; }
/* The Activity Briefing reads as one column: the board, then the tiers in reading order, then sources and limits. */
.land-act2-body { display: block; }
.land-act2-tiers, .land-act2-side { min-width: 0; }
.land-act2-side { margin-top: 14px; }
.land-act2-side .land-act2-sources { max-width: 980px; }
.land-act2-later { padding: 8px 10px 4px; font-size: 11px; color: var(--text-muted); }
.land-act2-actions { display: flex; gap: 8px; margin-left: auto; }
.land-act2-actions button { font-size: 11px; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; }
.land-act2-actions button:disabled { opacity: .55; cursor: default; }
.land-act2-actions button[aria-pressed="true"] { border-color: var(--accent); color: var(--text-primary); }
/* The Commission calendar: the hearings and deadlines in the days ahead, at the top of a township's briefing. */
.land-act2-strip { margin: 0 0 12px; padding: 8px 12px 6px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-left-width: 4px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 7%, var(--bg-secondary)); }
.land-act2-strip[hidden] { display: none; }
.land-act2-strip-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.land-act2-strip-h b { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--text-primary); }
.land-act2-strip-h i { font-style: normal; font: 700 11px 'JetBrains Mono', monospace; color: var(--accent-ink, var(--accent)); }
.land-act2-strip-h span { font-size: 11px; color: var(--text-muted); }
.land-act2-strip-it { display: grid; grid-template-columns: 78px minmax(160px, 1fr) minmax(200px, 2fr) auto; gap: 4px 12px; align-items: baseline; padding: 4px 0; border-top: 1px dashed var(--border); font-size: 11.5px; }
.land-act2-strip-it i { font: 700 11px 'JetBrains Mono', monospace; font-style: normal; color: var(--accent-ink, var(--accent)); }
.land-act2-strip-it b { color: var(--text-primary); font-weight: 600; }
.land-act2-strip-it span { color: var(--text-secondary); }
.land-act2-strip-it em { font-style: normal; }
/* The counts a section opens with. */
.land-act2-sum { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 12px 2px; }
.land-act2-sum span { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.land-act2-sum span b { font: 700 13px 'JetBrains Mono', monospace; color: var(--text-primary); margin-right: 5px; }
/* The grip that reorders a section, and the drop marks. */
.land-act2-grip { display: inline-block; margin-right: 8px; color: var(--text-muted); cursor: grab; font-size: 13px; letter-spacing: -2px; user-select: none; }
.land-act2-grip:active { cursor: grabbing; }
.land-act2-tier.is-dragging { opacity: .5; }
.land-act2-tier.is-over-before { box-shadow: 0 -3px 0 0 var(--accent); }
.land-act2-tier.is-over-after { box-shadow: 0 3px 0 0 var(--accent); }
/* Companies in the township. */
.land-act2-co { width: 100%; border-collapse: collapse; font-size: 11px; }
.land-act2-co th { text-align: left; font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .04em; color: var(--text-muted); padding: 4px 8px; border-bottom: 1px solid var(--border); }
.land-act2-co td { padding: 4px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); color: var(--text-secondary); vertical-align: top; }
.land-act2-co td.is-name { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.land-act2-co td.is-zero { color: var(--text-muted); opacity: .5; }
.land-act2-co td.is-secs { max-width: 220px; }
/* The briefing PDF chooser and viewer. */
.land-act2-pdf { margin: 0 0 12px; }
.land-act2-pdf[hidden] { display: none; }
.land-act2-pdf-box { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); }
.land-act2-pdf-box b { font-size: 12px; color: var(--text-primary); }
.land-act2-pdf-box p { margin: 4px 0 8px; font-size: 11px; color: var(--text-secondary); max-width: 900px; }
.land-act2-pdf-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.land-act2-pdf-opts label { font-size: 11.5px; color: var(--text-primary); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.land-act2-pdf-act { display: flex; align-items: center; gap: 10px; }
.land-act2-pdf-act button { font-size: 11px; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.land-act2-pdf-act button:disabled { opacity: .6; cursor: default; }
.land-act2-pdf-act button.land-act2-pdf-x { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.land-act2-pdf-act .is-err { font-size: 11px; color: #e06060; }
.land-act2-pdf .land-act2-docview { margin-top: 10px; }
.land-act2-pdf .land-act2-docview iframe { height: 760px; }
.land-act2-tier { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); overflow: hidden; }
.land-act2-tier summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 9px 14px; cursor: pointer; list-style: none; }
.land-act2-tier summary::-webkit-details-marker { display: none; }
.land-act2-tier summary::before { content: ''; width: 0; height: 0; border: 4px solid transparent; border-left: 6px solid var(--text-muted);
  align-self: center; margin-right: -2px; transition: transform .15s ease; }
.land-act2-tier details[open] > summary::before { transform: rotate(90deg); }
.land-act2-tier summary .land-act2-of { font: 600 10px 'JetBrains Mono', monospace; font-style: normal; color: var(--text-muted); margin-left: -4px; }
.land-act2-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 6px 14px; border-top: 1px solid var(--border); }
.land-act2-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 2px 0; }
.land-act2-search { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 2px 0; }
.land-act2-search span { font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.land-act2-search input { width: 190px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text-primary);
  padding: 3px 9px; font-size: 11px; font-family: inherit; }
.land-act2-search input::placeholder { color: var(--text-muted); }
.land-act2-search input:focus { outline: none; border-color: var(--accent); }
.land-act2-kinds-h { font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-right: 4px; }
.land-act2-kinds button { border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text-secondary); padding: 2px 9px;
  font-size: 10.5px; cursor: pointer; display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.land-act2-kinds button i { font: 700 10px 'JetBrains Mono', monospace; font-style: normal; color: var(--text-muted); }
.land-act2-kinds button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.land-act2-kinds button[aria-pressed="true"] i { color: #fff; }
.land-act2-kinds button:not(:disabled):hover, .land-act2-kinds button:focus-visible { border-color: var(--accent); outline: none; }
.land-act2-kinds button:disabled { opacity: .45; cursor: default; }
.land-act2-filters + .land-act2-items { border-top: 1px dashed var(--border); }
/* the observed column (Phase C): the Evidence button, the record's card under an item, the Ground toggle and palette */
.land-act2-evidence { border: 1px solid var(--accent); border-radius: 10px; background: transparent; color: var(--accent-ink, var(--accent)); padding: 1px 9px;
  font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .04em; cursor: pointer; }
.land-act2-evidence:hover, .land-act2-evidence[aria-expanded="true"] { background: var(--accent); color: #fff; }
.land-act2-card { margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: color-mix(in srgb, var(--accent) 5%, var(--bg-secondary)); }
.land-act2-card-wait { font-size: 11px; color: var(--text-muted); }
.land-act2-card-wait.is-err { color: var(--warning); }
.land-act2-card-well + .land-act2-card-well { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.land-act2-card-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.land-act2-card-h b { font-size: 12px; color: var(--text-primary); }
.land-act2-card-h span { font-size: 10.5px; color: var(--text-muted); }
.land-act2-card-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 16px; }
.land-act2-card-cols h5 { margin: 0 0 3px; font: 700 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-act2-card-row { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; padding: 2px 0; font-size: 11px; color: var(--text-secondary); line-height: 1.45; }
.land-act2-card-row i { font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); padding-top: 1px; }
.land-act2-card-row small { display: block; font-size: 10px; color: var(--text-muted); }
.land-act2-card-read { margin-top: 8px; font-size: 11.5px; color: var(--text-primary); }
.land-act2-card-read b { font: 700 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-right: 6px; }
.land-act2-card-read i { font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); font-style: normal; margin-left: 6px; }
.land-act2-card-foot { margin-top: 8px; font-size: 10px; color: var(--text-muted); }
.land-act2-ground { border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text-secondary); padding: 1px 9px;
  font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; margin-right: 4px; }
.land-act2-ground[aria-pressed="true"] { background: var(--warning); border-color: var(--warning); color: #fff; }
.land-act2-twp-c .is-ground b { color: var(--warning); }
.land-act2-grid.is-ground .cell.lv-1 rect, .land-act2-legend.is-ground i.lv-1 { fill: color-mix(in srgb, var(--warning) 16%, var(--bg-tertiary)); background: color-mix(in srgb, var(--warning) 16%, var(--bg-tertiary)); }
.land-act2-grid.is-ground .cell.lv-2 rect, .land-act2-legend.is-ground i.lv-2 { fill: color-mix(in srgb, var(--warning) 36%, var(--bg-tertiary)); background: color-mix(in srgb, var(--warning) 36%, var(--bg-tertiary)); }
.land-act2-grid.is-ground .cell.lv-3 rect, .land-act2-legend.is-ground i.lv-3 { fill: color-mix(in srgb, var(--warning) 64%, var(--bg-tertiary)); background: color-mix(in srgb, var(--warning) 64%, var(--bg-tertiary)); }
.land-act2-grid.is-ground .cell.lv-4 rect, .land-act2-legend.is-ground i.lv-4 { fill: var(--warning); background: var(--warning); }
.land-act2-legend i.lv-0 { background: var(--bg-tertiary); }
.land-opp-reads em.obs { font-style: normal; font-size: 10px; color: var(--accent-ink, var(--accent)); white-space: nowrap; }
/* the pad timeline in the evidence card: nights, radar scenes and each well's filings on one axis */
.land-act2-tl { margin-top: 10px; overflow-x: auto; }
.land-act2-tl h5 { margin: 0 0 4px; font: 700 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-act2-tl-grid { display: flex; align-items: flex-start; gap: 8px; }
.land-act2-tl-labels { flex: 0 0 auto; width: 196px; }
.land-act2-tl-label { height: 20px; line-height: 14px; font: 600 9.5px 'JetBrains Mono', monospace; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.land-act2-tl svg { display: block; overflow: visible; }
.land-act2-tl rect.n-lit, .land-act2-nights-key i.n-lit { fill: var(--warning); background: var(--warning); }
.land-act2-tl rect.n-dark, .land-act2-nights-key i.n-dark { fill: #0a0d14; background: #0a0d14; stroke: color-mix(in srgb, var(--text-muted) 40%, transparent); stroke-width: 1; }   /* dark reads as black */
.land-act2-tl rect.n-cloud, .land-act2-nights-key i.n-cloud { fill: color-mix(in srgb, var(--text-muted) 55%, var(--bg-tertiary)); background: color-mix(in srgb, var(--text-muted) 55%, var(--bg-tertiary)); }   /* cloud reads as grey */
.land-act2-tl rect.n-none, .land-act2-nights-key i.n-none { fill: none; background: transparent; stroke: var(--border); stroke-width: 1; }   /* hollow: no pass reached the cache */
.land-act2-tl rect.r-quiet, .land-act2-nights-key i.r-quiet { fill: color-mix(in srgb, var(--text-muted) 55%, var(--bg-tertiary)); background: color-mix(in srgb, var(--text-muted) 55%, var(--bg-tertiary)); }
.land-act2-tl rect.r-change, .land-act2-nights-key i.r-change { fill: var(--accent); background: var(--accent); }
.land-act2-tl rect.r-fell, .land-act2-nights-key i.r-fell { fill: none; background: transparent; stroke: var(--accent); stroke-width: 1.5; border-color: var(--accent); }
.land-act2-tl rect.s-drill, .land-act2-nights-key i.s-drill { fill: color-mix(in srgb, var(--text-primary) 40%, var(--bg-tertiary)); background: color-mix(in srgb, var(--text-primary) 40%, var(--bg-tertiary)); }
.land-act2-tl rect.s-drill.is-open { opacity: .55; }
.land-act2-tl rect.s-job, .land-act2-nights-key i.s-job { fill: var(--accent); background: var(--accent); }
.land-act2-tl rect.s-plan, .land-act2-nights-key i.s-plan { fill: none; background: transparent; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2; border: 1px dashed var(--accent); }
.land-act2-tl line.t { stroke: var(--text-muted); stroke-width: 1; }
.land-act2-tl text.t { font: 600 9px 'JetBrains Mono', monospace; fill: var(--text-muted); }
.land-act2-tl line.m { stroke: var(--accent); stroke-width: 1.5; }
.land-act2-tl path.arrow { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .9; }
.land-act2-tl polygon.arrowhead { fill: var(--accent); }
.land-act2-nights-key b.k-spud { color: var(--accent-ink, var(--accent)); font-size: 13px; line-height: 10px; }
.land-act2-tl text.m { font: 600 9px 'JetBrains Mono', monospace; fill: var(--accent-ink, var(--accent)); }
.land-act2-card-wells { width: 100%; border-collapse: collapse; margin: 2px 0 8px; font-size: 11px; }
.land-act2-card-wells th { text-align: left; font: 700 9.5px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: 2px 10px 3px 0; border-bottom: 1px solid var(--border); }
.land-act2-card-wells td { padding: 3px 10px 3px 0; color: var(--text-secondary); border-bottom: 1px dashed var(--border); vertical-align: top; }
.land-act2-card-wells td:first-child { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.land-act2-card-wells td i { font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); font-style: normal; margin-left: 4px; }
.land-act2-card-wells td em { color: var(--text-muted); }
.land-act2-doc { margin-left: 6px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--accent-ink, var(--accent)); padding: 0 8px;
  font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .04em; cursor: pointer; vertical-align: baseline; }
.land-act2-doc:hover, .land-act2-doc:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); outline: none; }
.land-act2-doc[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
/* the occupancy overlay in the card: the latest radar returns above the pad's baseline on the optical chip */
.land-act2-overlay { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; margin-top: 10px; }
.land-act2-overlay figure { margin: 0; width: 256px; }
.land-act2-overlay img { display: block; width: 256px; height: 256px; image-rendering: pixelated; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-secondary, #eee); }
.land-act2-overlay figcaption { margin-top: 3px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .04em; color: var(--text-muted); line-height: 1.4; }
.land-act2-overlay figcaption b { display: block; color: var(--text-primary); }
.land-act2-overlay p { flex: 1 1 240px; margin: 0; font-size: 11px; color: var(--text-secondary); line-height: 1.5; max-width: 420px; }
/* the form shown inside the card */
/* The township board under the picked township (land-activity.js renderBoard): the picture fits the column; a click
   shows it at its own size in a scrolling frame. */
.land-act2-board { margin: 0 0 14px; }
.land-act2-board[hidden] { display: none; }
.land-act2-board figure { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-secondary); }   /* the Township Perspective sits on the page's own light or dark */
.land-act2-board figure.is-picture { background: #0c111c; }                       /* the composed picture carries its own dark page */
.land-act2-board-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 6px; }
.land-act2-board-h b { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--text-primary); }
.land-act2-board-h span { font-size: 10.5px; color: var(--text-muted); }
.land-act2-board figure > img { display: block; width: 100%; height: auto; }      /* the composed picture, when a board has no live marks */
.land-act2-board.is-large figure { overflow: auto; max-height: 82vh; }
.land-act2-board.is-large figure > img { width: auto; max-width: none; }
.land-act2-board figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--bg-secondary); font-size: 11px; color: var(--text-muted); }
.land-act2-board figcaption b { font: 700 12px 'JetBrains Mono', monospace; letter-spacing: .06em; color: var(--text-primary); }
.land-act2-board figcaption a { margin-left: auto; color: var(--accent-ink, var(--accent)); text-decoration: none; }
.land-act2-board figcaption a:hover { text-decoration: underline; }
.land-act2-board-note { margin: 6px 2px 0; font-size: 11px; line-height: 1.5; color: var(--text-secondary); max-width: 980px; }
/* The live board: the ground image with the marks laid over it by the page (land-activity.js renderBoard). */
.land-act2-board-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.land-act2-board-chips button { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; }
.land-act2-board-chips button[aria-pressed="true"] { border-color: var(--accent); color: var(--text-primary); }
.land-act2-board-chips button[aria-pressed="false"] { opacity: .6; text-decoration: line-through; }
.land-act2-board-chips button[data-board-view][aria-pressed="false"] { opacity: .85; text-decoration: none; }
.land-act2-board figure.is-turn { cursor: grab; touch-action: pan-y; user-select: none; outline: none; }
.land-act2-board figure.is-turn:focus-visible { border-color: var(--accent); }
.land-act2-board figure.is-turn.is-turning { cursor: grabbing; }
.land-act2-board figure.is-turn > img { pointer-events: none; }
.land-act2-3d-wrap { display: flex; align-items: stretch; background: #0c111c; }
.land-act2-3d { position: relative; flex: 1 1 auto; min-width: 0; width: 100%; aspect-ratio: 16 / 10; max-height: 82vh; background: #0c111c; }
.land-act2-fold { background: none; border: 0; padding: 0 2px 0 0; margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1; cursor: pointer; }
.land-act2-fold:hover { color: var(--text-primary); }
.land-act2-board.is-folded .land-act2-board-h, .land-act2-strip-h:has(.land-act2-fold[aria-expanded="false"]) { margin-bottom: 0; }
.lt3-panel { position: relative; flex: 0 0 290px; border-right: 1px solid rgba(255, 255, 255, .08); user-select: none; }
.land-act2-board figure .land-act2-3d-wrap > .lt3-panel { display: flex; flex-direction: column; text-transform: none; letter-spacing: 0; }
.lt3-panel p, .lt3-panel b, .lt3-panel span, .lt3-panel button, .lt3-panel input { text-transform: none; letter-spacing: 0; }
.lt3-panel .lt3-tabs { position: absolute; top: 0; left: 0; right: 0; height: 31px; box-sizing: border-box; display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.lt3-panel .lt3-tabs button { flex: 1 1 0; padding: 5px 4px 6px; border: 0; border-bottom: 2px solid transparent; background: none; color: #8792a6; font: 600 10.5px/1 'IBM Plex Sans', 'Segoe UI', sans-serif; letter-spacing: .04em; cursor: pointer; }
.lt3-panel .lt3-tabs button:hover { color: #dfe5ee; }
.lt3-panel .lt3-tabs button[aria-selected="true"] { color: #ffffff; border-bottom-color: var(--accent, #3b82f6); }
.lt3-panel .lt3-pane { position: absolute; top: 31px; left: 0; right: 0; bottom: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }   /* laid over the panel, so a long list scrolls and never stretches the view */
.lt3-panel .lt3-filter { flex: 0 0 auto; margin: 8px 8px 4px; padding: 4px 8px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 6px; background: rgba(255, 255, 255, .04); color: #e6ebf3; font: 11px 'IBM Plex Sans', 'Segoe UI', sans-serif; }
.lt3-panel .lt3-note { margin: 2px 10px 6px; font: 10px/1.35 'IBM Plex Sans', 'Segoe UI', sans-serif; color: #8792a6; }
.lt3-panel .lt3-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 4px 6px; }
.lt3-panel .lt3-list button { display: block; width: 100%; padding: 5px 6px; border: 0; border-radius: 5px; background: none; text-align: left; cursor: pointer; }
.lt3-panel .lt3-list button:hover { background: rgba(255, 255, 255, .06); }
.lt3-panel .lt3-list button.is-on { background: rgba(77, 208, 225, .16); }
.lt3-panel .lt3-list b { display: block; font: 600 11px/1.25 'IBM Plex Sans', 'Segoe UI', sans-serif; color: #e6ebf3; }
.lt3-panel .lt3-list span { display: block; font: 10px/1.3 'IBM Plex Sans', 'Segoe UI', sans-serif; color: #8792a6; }
.lt3-panel .lt3-list i { font-style: normal; }
.lt3-panel .lt3-list i.is-drilled { color: #46d26e; }
.lt3-panel .lt3-list i.is-permit { color: #f0f4fa; }
.lt3-panel .lt3-list i.is-lease { color: #4dd0e1; }
.lt3-panel .lt3-list i.is-rights { color: #ff9ae0; }
.lt3-panel .lt3-checks { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 2px 10px 4px; font: 11px/1.4 'IBM Plex Sans', 'Segoe UI', sans-serif; color: #c9d2e0; }
.lt3-panel .lt3-checks label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.lt3-panel .lt3-checks input { accent-color: #3b82f6; margin: 0; }
.lt3-panel svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border: 0; background: none; border-radius: 0; }
.lt3-panel svg text { text-transform: none; letter-spacing: 0; }
.lt3-panel .lt3-h { font: 600 9.5px/1 'IBM Plex Sans', 'Segoe UI', sans-serif; letter-spacing: .08em; fill: #9aa6ba; }
.lt3-panel .lt3-sub, .lt3-panel .lt3-tick { font: 9px/1 'IBM Plex Sans', 'Segoe UI', sans-serif; fill: #8792a6; }
.lt3-panel .lt3-tick { text-anchor: end; }
.lt3-panel .lt3-name { font: 500 11px/1 'IBM Plex Sans', 'Segoe UI', sans-serif; fill: #dfe5ee; }
.lt3-panel .lt3-drilled { fill: #46d26e; font-weight: 600; font-size: 10px; }
.lt3-panel .lt3-permit { fill: #f0f4fa; font-weight: 600; font-size: 10px; }
.lt3-panel .lt3-box { cursor: pointer; outline: none; }
.lt3-panel .lt3-box rect { fill: rgba(255, 255, 255, .04); stroke: #8792a6; stroke-width: 1; }
.lt3-panel .lt3-box .lt3-tick-mark { fill: none; stroke: transparent; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lt3-panel .lt3-box.is-on rect { fill: #3b82f6; stroke: #3b82f6; }
.lt3-panel .lt3-box.is-on .lt3-tick-mark { stroke: #0c111c; }
.lt3-panel .lt3-box:hover rect, .lt3-panel .lt3-box:focus-visible rect { stroke: #dfe5ee; }
.lt3-panel .lt3-box.is-poor { cursor: default; opacity: .45; }
.lt3-panel .lt3-box.is-poor .lt3-tick-mark { stroke: #8792a6; stroke-width: 1; }
.lt3-panel .lt3-box.is-poor:hover rect { stroke: #8792a6; }
.lt3-panel .lt3-clear { font: 9.5px/1 'IBM Plex Sans', 'Segoe UI', sans-serif; fill: #7fb0ff; text-anchor: end; cursor: pointer; text-decoration: underline; }
.lt3-panel .lt3-lead { stroke: #6b768a; stroke-width: .7; fill: none; }
.lt3-panel .lt3-range { stroke: #c8d2e4; stroke-width: 1.4; opacity: .7; }
.lt3-panel .lt3-band { fill: none; stroke: #ffb74d; stroke-width: 1.8; pointer-events: none; }
.lt3-panel .lt3-mark { fill: #ffffff; pointer-events: none; }
.lt3-panel .lt3-row { cursor: pointer; outline: none; }
.lt3-panel .lt3-row.is-cherokee .lt3-name { fill: #ffc46e; font-weight: 700; }
.lt3-panel .lt3-row.is-atoka .lt3-name { fill: #c8b8ec; font-weight: 700; }
.lt3-panel svg.has-on .lt3-row:not(.is-on) { opacity: .38; }
.lt3-panel .lt3-row.is-on .lt3-name { fill: #ffffff; font-weight: 700; }
@media (max-width: 860px) { .land-act2-board figure .land-act2-3d-wrap > .lt3-panel { display: none; } }
.land-act2-3d-tip { position: absolute; z-index: 2; max-width: 220px; padding: 6px 9px; border-radius: 6px; background: rgba(12, 17, 28, .94); border: 1px solid rgba(255, 255, 255, .18); color: #e6ebf3; font-size: 11px; line-height: 1.35; pointer-events: none; display: flex; flex-direction: column; }
.land-act2-3d-tip[hidden] { display: none; }
.lt3-tag { position: absolute; z-index: 1; pointer-events: none; white-space: nowrap; font: 600 12px/1 'IBM Plex Sans', 'Segoe UI', sans-serif; text-shadow: 0 0 3px #0c111c, 0 0 3px #0c111c, 0 0 6px #0c111c; transform: translate(8px, -50%); }
.lt3-tag.is-left { transform: translate(calc(-100% - 8px), -50%); }
.lt3-tag[hidden] { display: none; }
.land-act2-3d-tip b { font-size: 12px; }
.land-act2-3d-tip span { color: #aab4c6; }
.land-act2-3d-tip.is-wide { max-width: 320px; }
.land-act2-3d-tip span strong { font-weight: 600; color: #dfe5ee; }
.land-act2-3d-tip span.is-all strong { color: #4dd0e1; }
.land-act2-3d-tip span.is-miss strong { color: #ff9ae0; }
.land-act2-3d-tip span.is-wood strong { color: #ffb347; }
.land-act2-turn-key { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0 0 8px; font-size: 11px; color: var(--text-muted); }
.land-act2-turn-key span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.land-act2-turn-key i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.land-act2-turn-key i.is-oil { background: #46d26e; }
.land-act2-turn-key i.is-gas { background: #ff5f5f; }
.land-act2-turn-key i.is-other { background: #60a5fa; }
.land-act2-turn-key i.is-plug { background: #848c9a; }
.land-act2-turn-key i.is-permit { border: 1px solid var(--text-secondary); }
.land-act2-turn-key i.is-solid, .land-act2-turn-key i.is-dash { width: 22px; height: 0; border-radius: 0; border-top: 2px solid var(--text-secondary); }
.land-act2-turn-key i.is-dash { border-top-style: dashed; }
.land-act2-turn-key i.is-excello { width: 16px; height: 8px; border-radius: 2px; background: rgba(255, 183, 77, .45); border: 1px solid #ffb74d; }
.land-act2-turn-key i.is-atoka { width: 16px; height: 8px; border-radius: 2px; background: rgba(179, 157, 219, .4); border: 1px solid #b39ddb; }
.land-act2-turn-key i.is-pierce { width: 9px; height: 9px; background: transparent; border: 2px solid #ffb74d; }
.land-act2-3d-tip span.is-excello { color: #ffc46e; }
.land-act2-board-chips button[data-board-3d-excello][aria-pressed="false"] { text-decoration: none; }
.land-act2-board-chips button:disabled { opacity: .4; cursor: default; text-decoration: none; }
.land-act2-board-chips button i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.land-act2-board-chips i.is-amber, .land-act2-dot.is-amber { background: #ffb74d; }
.land-act2-board-chips i.is-green, .land-act2-dot.is-green { background: #76d686; }
.land-act2-board-chips span { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.land-act2-stage { position: relative; width: 100%; background: transparent; overflow: hidden; --k: 1; }
/* The slab lifted off its page: the ground clipped to the task's footprint, a soft shadow under it in light mode, the key and the north mark the page's own. */
.land-act2-clipdef { position: absolute; width: 0; height: 0; }
.land-act2-shadow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; display: none; fill: #0e131f; opacity: .28; filter: blur(10px); transform: translate(.4%, 1.1%); }
body.theme-light .land-act2-shadow { display: block; }
.land-act2-north { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.land-act2-north line { stroke: var(--text-secondary); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.land-act2-north polygon { fill: var(--text-secondary); }
.land-act2-north text { fill: var(--text-primary); font: 700 30px 'JetBrains Mono', monospace; }
.land-act2-board-key { position: absolute; top: 2.4%; right: 2.2%; max-width: 64%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 14px; font-size: max(11px, calc(var(--k) * 15px)); color: var(--text-secondary); pointer-events: none; }
.land-act2-board-key span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.land-act2-board-key i { width: .7em; height: .7em; border-radius: 50%; display: inline-block; border: 1px solid rgba(255, 255, 255, .5); }
.land-act2-board-key i.is-oil { background: #46d26e; }
.land-act2-board-key i.is-gas { background: #ff5f5f; }
.land-act2-board-key i.is-plug { background: #969eaa; }
.land-act2-board-key i.is-permit { background: transparent; border-color: var(--text-muted); }
.land-act2-board-key img { height: 1.6em; width: auto; }
.land-act2-board.is-large .land-act2-stage { width: 2800px; max-width: none; }
.land-act2-boardground { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }   /* the board's ground image; .land-act2-ground is the mosaic's Ground toggle */
.land-act2-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.land-act2-arrows path.halo { fill: none; stroke: #0e131f; stroke-opacity: .85; stroke-width: 5; vector-effect: non-scaling-stroke; }
.land-act2-arrows path.line { fill: none; stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.land-act2-arrows polygon.head { stroke: #0e131f; stroke-width: 1; vector-effect: non-scaling-stroke; }
.land-act2-arrows .is-amber { stroke: #ffb74d; fill: #ffb74d; }
.land-act2-arrows .is-green { stroke: #76d686; fill: #76d686; }
.land-act2-arrows path.line.is-amber, .land-act2-arrows path.line.is-green { fill: none; }
.land-act2-glow { position: absolute; width: 7%; aspect-ratio: 1.6; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 183, 77, .55) 0%, rgba(255, 183, 77, .22) 38%, rgba(255, 183, 77, 0) 70%); }
.land-act2-glow.is-green { background: radial-gradient(ellipse at center, rgba(118, 214, 134, .55) 0%, rgba(118, 214, 134, .22) 38%, rgba(118, 214, 134, 0) 70%); }
.land-act2-secs { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.land-act2-secs polygon.halo { fill: none; stroke: #0e131f; stroke-opacity: .6; stroke-width: 5; vector-effect: non-scaling-stroke; }
.land-act2-secs polygon.sec { fill: none; stroke-width: 2.4; stroke-opacity: .92; vector-effect: non-scaling-stroke; }
.land-act2-secs polygon.sec.is-amber { stroke: #ffb74d; }
.land-act2-secs polygon.sec.is-green { stroke: #76d686; }
.land-act2-sprite { position: absolute; display: block; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.land-act2-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.land-act2-bcard { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 5px 9px; border-radius: 6px; border: 1px solid; background: rgba(14, 19, 31, .9);
  color: #fff; font-size: max(10px, calc(var(--k) * 14px)); line-height: 1.25; white-space: nowrap; cursor: grab; touch-action: none; user-select: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.land-act2-bcard b { font-size: max(11px, calc(var(--k) * 17px)); }
.land-act2-bcard span { color: #d6dce8; }
.land-act2-bcard em { font-style: normal; }
.land-act2-bcard.is-amber { border-color: rgba(255, 183, 77, .8); }
.land-act2-bcard.is-amber em { color: #ffb74d; }
.land-act2-bcard.is-green { border-color: rgba(118, 214, 134, .85); }
.land-act2-bcard.is-green em { color: #76d686; }
.land-act2-bcard.is-drag { cursor: grabbing; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }

.land-act2-docview { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-primary); }
.land-act2-docview[hidden] { display: none; }
.land-act2-docview-bar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }
.land-act2-docview-bar b { color: var(--text-primary); font-size: 11.5px; }
.land-act2-docview-bar a { margin-left: auto; color: var(--accent-ink, var(--accent)); font-size: 11px; }
/* The briefing in its own browser tab: the pop-out, the bar's one filled button; the download link follows it. */
.land-act2-docview-bar a.land-act2-docview-pop { padding: 4px 11px; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.land-act2-docview-bar a.land-act2-docview-pop:hover { filter: brightness(1.08); }
.land-act2-docview-bar a.land-act2-docview-pop:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.land-act2-docview-bar a.land-act2-docview-pop + a { margin-left: 0; }
.land-act2-docview-close { border: 0; background: transparent; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.land-act2-docview-close:hover { color: var(--text-primary); }
.land-act2-docview-msg { padding: 10px 12px; font-size: 11px; color: var(--text-muted); }
.land-act2-docview-msg[hidden] { display: none; }
.land-act2-docview iframe { display: block; width: 100%; height: 680px; border: 0; background: #fff; }
.land-act2-docview iframe[hidden] { display: none; }
.land-act2-nights-key { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 5px; font-size: 10px; color: var(--text-muted); }
.land-act2-nights-key span { display: inline-flex; align-items: center; gap: 5px; }
.land-act2-nights-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--border); }
.land-act2-tier summary b { font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--text-primary); }
.land-act2-tier summary i { font: 700 11px 'JetBrains Mono', monospace; font-style: normal; padding: 1px 7px; border-radius: 9px; color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 18%, transparent); }
.land-act2-tier summary span { font-size: 10.5px; color: var(--text-muted); }
.land-act2-tier.is-routine summary b { color: var(--text-secondary); }
.land-act2-tier.is-routine summary i { background: color-mix(in srgb, var(--text-muted) 22%, transparent); }
.land-act2-items { border-top: 1px solid var(--border); padding: 4px 14px 8px; }
.land-act2-it { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.land-act2-it:last-child { border-bottom: 0; }
.land-act2-it-date { font: 600 10.5px 'JetBrains Mono', monospace; color: var(--text-muted); padding-top: 2px; }
.land-act2-it-date.is-when { color: var(--accent-ink, var(--accent)); }
.land-act2-it-h { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.land-act2-it-d { margin-top: 2px; font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.land-act2-it-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 5px; font-size: 10px; color: var(--text-muted); }
.land-act2-sec { border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text-primary); padding: 1px 8px;
  font: 600 10px 'JetBrains Mono', monospace; cursor: pointer; }
.land-act2-sec:hover { border-color: var(--accent); }
.land-act2-more-secs { font: 600 10px 'JetBrains Mono', monospace; }
.land-act2-it.k-step .land-act2-it-h, .land-act2-it.k-frac .land-act2-it-h, .land-act2-it.k-permit .land-act2-it-h { color: var(--accent-ink, var(--accent)); }
.land-act2-it.k-order .land-act2-it-h, .land-act2-it.k-protest .land-act2-it-h { color: var(--warning); }
.land-act2-none { padding: 10px 0; font-size: 11px; color: var(--text-muted); }
.land-act2-side .land-act2-sources { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px 12px; font-size: 10.5px; line-height: 1.55; color: var(--text-secondary); }
.land-act2-side .land-act2-sources b { display: block; margin-top: 6px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-act2-side .land-act2-sources ul { margin: 4px 0; padding-left: 16px; }
.land-act2-side .land-act2-sources p { margin: 6px 0 0; }
.land-act2-side .land-act2-sources li.is-stale { color: var(--warning); }
/* The column an Activity item sits in: filed (a filing or report of record) or, from Phase C, observed. */
.land-act2-col { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 3px; font: 600 8.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; vertical-align: 1px; color: var(--text-muted); border: 1px solid var(--border); }
.land-act2-col.is-observed { color: var(--accent-ink, var(--accent)); border-color: var(--accent); }
/* The satellite strip beside a spud or a frac job: three 128 px chips at their native 10 m pixels. */
.land-act2-chips { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; margin: 7px 0 2px; }
.land-act2-chips figure { margin: 0; width: 128px; }
.land-act2-chips img { display: block; width: 128px; height: 128px; image-rendering: pixelated; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-secondary, #eee); }
.land-act2-chips figcaption { margin-top: 3px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .04em; color: var(--text-muted); line-height: 1.4; }
.land-act2-chips figcaption b { color: var(--text-primary); font-weight: 600; }
.land-act2-chips figcaption span { display: block; font-weight: 500; letter-spacing: 0; font-family: inherit; color: var(--accent-ink, var(--accent)); }
.land-act2-chips-note { flex-basis: 100%; font-size: 9.5px; color: var(--text-muted); }
/* The ICOP read line on the Opportunity section card: one well of the cycle per line, from its filed record. */
.land-opp-reads { margin: 6px 0 2px; font-size: 11px; line-height: 1.5; color: var(--text-secondary); }
.land-opp-reads > b { display: block; margin-bottom: 2px; font: 600 9.5px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.land-opp-reads div { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.land-opp-reads .w { font-weight: 600; color: var(--text-primary); }
.land-opp-reads i { font: 600 10px 'JetBrains Mono', monospace; color: var(--text-muted); font-style: normal; }
@media (max-width: 1100px) { .land-act2-body { grid-template-columns: minmax(0, 1fr); } }

/* Texas land surveys and Railroad Commission wells on the project map
   (js/texas-context-layer.js). Labels are plain text over the basemap with a
   halo, so they read on street, light and satellite alike. */
.tx-survey-label { background: none; border: none; }
.tx-survey-label-box {
  position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap;
  font: 600 10px/1.25 'IBM Plex Sans', Calibri, Arial, sans-serif; color: #5b4520; letter-spacing: 0.2px;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; pointer-events: none;
}
.tx-survey-name { display: none; }
.tx-survey-names .tx-survey-name { display: block; font-weight: 500; }
.tx-survey-num { display: block; }
.tx-cell-label {
  position: absolute; transform: translate(4px, 3px); white-space: nowrap;
  font: 500 10px/1.2 'IBM Plex Sans', Calibri, Arial, sans-serif; color: #56606b;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; pointer-events: none;
}
.tx-well-tip { font: 400 11.5px/1.4 'IBM Plex Sans', Calibri, Arial, sans-serif; }

/* Post-Frac > Flowback (js/flowback.js): summary tiles, three time-series panels, operator notes. */
.fb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fb-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.fb-title-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.fb-source { font-size: 11px; color: var(--text-muted); }
.fb-source a { color: var(--accent); text-decoration: none; }
.fb-source a:hover { text-decoration: underline; }
.fb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fb-tile { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px; padding: 9px 11px; min-width: 0; }
.fb-tile-label { font-size: 9.5px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
.fb-tile-value { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-top: 3px; font-variant-numeric: tabular-nums; }
.fb-tile-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.fb-chart { height: 240px; width: 100%; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; background: var(--bg-secondary); }
.fb-chart.fb-chart-last { height: 270px; }
.fb-notes { margin-top: 6px; font-size: 11.5px; color: var(--text-secondary); }
.fb-notes summary { cursor: pointer; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); padding: 4px 0; }
.fb-notes table { border-collapse: collapse; width: 100%; margin-top: 4px; }
.fb-notes td { padding: 3px 10px 3px 0; vertical-align: top; border-bottom: 1px solid var(--border); }
.fb-notes td:first-child { white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; width: 1%; }
