/* app-dms-rail.css · the left-edge DMS rail, extracted from filing_review.html on 2026-06-27
   So the workbench (and any future page) can include the same rail with one tag.
   Do not edit by hand without updating filing_review.html in lockstep yet — the
   extraction is verbatim, no logic changes. */

/* ─── Body grid baseline · added 2026-06-27 ──────────────────────────
   The collapsed/wide/cms-rail-open variants below assume the body is a
   3-column grid. filing_review.html declares this baseline inline (after
   this file loads) so it doesn't override there. Pages that DO need this
   baseline (e.g. project_workbench.html) get it for free. Opt out by
   setting `body.dms-rail-no-grid` if a page needs a different layout. */
body:not(.dms-rail-no-grid) {
  display: grid;
  grid-template-columns: 360px 1fr 0;
  /* No grid-template-rows · default is all-auto, each row sizes to its
     content. Filing_review.html relies on this implicit row sizing: row 1
     is the topnav (~53px), row 2 is the rail + main, additional rows for
     any other body children. Setting `auto 1fr` here would collapse row 1
     to 0 when the topnav injects asynchronously. */
  min-height: 100vh;
  /* sovren-standard.css sets html,body { height: 100% } which caps the
     body at viewport height and prevents grid auto-rows from expanding to
     fit tall content. Override to let the body grow naturally. */
  height: auto;
}
html:not(.dms-rail-no-grid) { height: auto; }
body:not(.dms-rail-no-grid).cms-rail-open { grid-template-columns: 360px 1fr 360px; }

/* Direct children of body that are NOT the rail or main column (topnav,
   chatbar, banners, toast) span all columns so they don't land in the
   360px rail slot. */
body:not(.dms-rail-no-grid) > nav.app-topnav,
body:not(.dms-rail-no-grid) > [data-app-topnav],
body:not(.dms-rail-no-grid) > #app-chatbar,
body:not(.dms-rail-no-grid) > .gce-status-banner,
body:not(.dms-rail-no-grid) > .gce-error-banner,
body:not(.dms-rail-no-grid) > #kbd-help-overlay,
body:not(.dms-rail-no-grid) > .cms-rail,
body:not(.dms-rail-no-grid) > #aor-back-to-top,
body:not(.dms-rail-no-grid) > #back-to-top-btn,
body:not(.dms-rail-no-grid) > script,
body:not(.dms-rail-no-grid) > .toast { grid-column: 1 / -1; }

  /* ───── Per-card move controls in TOC (2026-06-09) ───── */
  .toc-move-ctrls {
    display: inline-flex; gap: 1px;
    margin-left: 4px; vertical-align: middle;
    opacity: 0;   /* show on row hover */
    transition: opacity 0.15s ease;
  }

  nav.toc a:hover .toc-move-ctrls { opacity: 1; }

  .toc-move-ctrls button {
    font-size: 9px; line-height: 1;
    padding: 1px 4px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    color: #4b5563;
  }

  .toc-move-ctrls button:hover {
    background: #f3f4f6; color: #111827; border-color: #6b7280;
  }

  .toc-move-ctrls button:active { background: #e5e7eb; }


  /* ───── 🔄 Regenerate flow chart button (2026-06-09) ───── */
  .toc-regen-btn {
    margin-left: 4px;
    padding: 1px 5px;
    font-size: 11px;
    border: 1px solid #d1d5db;
    background: #fef3c7;
    border-radius: 3px;
    cursor: pointer;
    color: #92400e;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  nav.toc a:hover .toc-regen-btn { opacity: 1; }

  .toc-regen-btn:hover { background: #fde68a; }

  /* Left-nav collapse — mirrors the right-side CMS rail (frontend/css/app-cms-rail.css).
     Collapsed strip is 28px wide, dark gradient, amber label rotated
     vertical-rl — byte-for-byte symmetric with the CMS edge tab.
     State persists in localStorage('left-nav-collapsed'). */
  body.left-nav-collapsed                 { grid-template-columns: 28px 1fr 0; }

  body.left-nav-collapsed.cms-rail-open   { grid-template-columns: 28px 1fr 360px; }

  body.left-nav-collapsed nav.toc {
    padding: 0; overflow: hidden;
    background: linear-gradient(180deg, #1f2937, #111827);
    border-right: 1px solid #475569;
  }

  body.left-nav-collapsed nav.toc > *:not(.left-nav-toggle) { display: none !important; }


  /* Toggle button — two visual modes:
     · expanded: a normal top-of-nav button reading "❮ Collapse"
     · collapsed: the FULL 28px vertical strip (icon + label stacked,
       same dimensions/typography as .cms-rail-tab on the right) */
  .left-nav-toggle {
    display: block; background: #374151; color: #f3f4f6;
    border: 0; border-radius: 4px; cursor: pointer;
    font: 11px/1 ui-monospace, Menlo, monospace;
    padding: 6px 8px; margin: 0 0 12px 0;
    width: 100%; text-align: left;
  }

  .left-nav-toggle:hover { background: #4b5563; }


  /* Wide-mode toggle button — sits below the collapse toggle */
  .left-nav-wide-toggle {
    display: block; background: #1e40af; color: #fff;
    border: 0; border-radius: 4px; cursor: pointer;
    font: 11px/1 ui-monospace, Menlo, monospace;
    padding: 6px 8px; margin: 0 0 12px 0;
    width: 100%; text-align: left;
  }

  .left-nav-wide-toggle:hover { background: #1e3a8a; }

  .left-nav-wide-toggle .lnw-text-wide { display: none; }

  body.left-nav-collapsed .left-nav-wide-toggle { display: none; }


  /* Dedicated reorder-mode link (sibling of the wide toggle) */
  .left-nav-reorder-btn {
    display: block; padding: 6px 8px; margin: 0 0 12px 0;
    background: #0f766e; color: #fff;
    border-radius: 4px; cursor: pointer; text-align: left;
    font: 11px/1 ui-monospace, Menlo, monospace;
    text-decoration: none;
  }

  .left-nav-reorder-btn:hover { background: #115e59; color: #fff; }

  body.left-nav-collapsed .left-nav-reorder-btn,
  body.left-nav-wide .left-nav-reorder-btn { display: none; }

  /* Wide mode: drawer fills viewport, TOC becomes grid */
  body.left-nav-wide                 { grid-template-columns: 1fr 0 0; }

  body.left-nav-wide.cms-rail-open   { grid-template-columns: 1fr 0 360px; }

  body.left-nav-wide main            { display: none; }

  body.left-nav-wide nav.toc {
    padding: 22px 32px;
    height: calc(100vh - 40px);
    overflow-y: auto;
  }

  body.left-nav-wide .left-nav-wide-toggle .lnw-text-narrow { display: none; }

  body.left-nav-wide .left-nav-wide-toggle .lnw-text-wide   { display: inline; }

  body.left-nav-wide .left-nav-wide-toggle { background: #15803d; }

  body.left-nav-wide .left-nav-wide-toggle:hover { background: #166534; }

  /* TOC links → grid in wide mode. auto-fill keeps it responsive to
     viewport width; min 280px per card, max 1fr. */
  body.left-nav-wide #toc-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
  }

  /* Group headers span the full grid row */
  body.left-nav-wide #toc-links .toc-group { grid-column: 1 / -1; }

  /* Card-style anchors in wide mode */
  body.left-nav-wide #toc-links a {
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0;   /* gap is grid-managed */
    font-size: 12.5px;
    line-height: 1.4;
  }

  body.left-nav-wide #toc-links a:hover {
    background: #4b5563; border-color: #6b7280;
  }

  body.left-nav-wide #toc-links a.active {
    background: #1e3a8a; border-color: #60a5fa;
  }

  /* Companion rows lose indent in grid (each card is its own cell);
     restore a small visual offset with a left-side band instead. */
  body.left-nav-wide #toc-links a[data-pair-role="receipt"],
  body.left-nav-wide #toc-links a[data-pair-role="reader"],
  body.left-nav-wide #toc-links a[data-pair-role="source_pdf"] {
    margin-left: 0 !important;
    border-left: 3px solid #6366f1;
    padding-left: 10px;
    font-size: 11.5px;
  }

  /* Move controls always visible in wide mode (no need to hover) */
  body.left-nav-wide #toc-links .toc-move-ctrls { opacity: 1; }

  body.left-nav-wide #toc-links .toc-move-ctrls button {
    background: #1f2937; color: #d1d5db; border-color: #4b5563;
  }

  body.left-nav-wide #toc-links .toc-move-ctrls button:hover {
    background: #111827; color: #fff;
  }

  .left-nav-toggle .left-nav-icon,
  .left-nav-toggle .left-nav-vlabel { display: none; }

  body.left-nav-collapsed .left-nav-toggle {
    width: 28px; height: calc(100vh - 40px);
    margin: 0; padding: 0; border-radius: 0;
    background: transparent;
    color: #fde68a;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
  }

  body.left-nav-collapsed .left-nav-toggle:hover {
    background: linear-gradient(180deg, #334155, #1f2937);
  }

  body.left-nav-collapsed .left-nav-toggle .left-nav-text { display: none; }

  body.left-nav-collapsed .left-nav-toggle .left-nav-icon  { display: block; font-size: 16px; }

  body.left-nav-collapsed .left-nav-toggle .left-nav-vlabel {
    display: block;
    writing-mode: vertical-rl; transform: rotate(180deg);
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
  }

  /* Side nav (table of contents) — top:40px lets the app-topnav stay
     visible above; height adjusts to fill the rest of viewport. */
  nav.toc { background: #1f2937; color: #d1d5db; padding: 18px 14px; position: sticky;
             top: 40px; height: calc(100vh - 40px); overflow-y: auto; }

  nav.toc h1 { color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
                text-transform: uppercase; margin: 0 0 14px 0; }

  nav.toc .subhead { color: #9ca3af; font-size: 11px; margin-bottom: 18px; line-height: 1.5; }

  nav.toc a { display: block; padding: 8px 10px; color: #d1d5db; text-decoration: none;
              border-radius: 4px; font-size: 13px; margin-bottom: 2px;
              border-left: 3px solid transparent; position: relative; }

  nav.toc a:hover { background: #374151; color: #fff; }

  nav.toc a.active { background: #374151; color: #fff; border-left-color: #60a5fa; }

  /* TOC anchor band coloring · matches the readiness chip band (#108).
     Border-left was already used for active-state; band coloring sits on
     box-shadow so .active outlines still win. */
  nav.toc a[data-band="red"]   { box-shadow: inset 4px 0 0 0 #dc2626; padding-left: 14px; }

  nav.toc a[data-band="amber"] { box-shadow: inset 4px 0 0 0 #d97706; padding-left: 14px; }

  nav.toc a[data-band="green"] { box-shadow: inset 4px 0 0 0 #16a34a; padding-left: 14px; }

  /* Drag-handle hint · only on draggable rows. Faint at rest, visible on
     hover so the row's reorderability is discoverable without clutter. */
  nav.toc a[draggable="true"]::before {
    content: "⋮⋮"; position: absolute; left: -4px; top: 50%;
    transform: translateY(-50%); font-size: 10px;
    color: #4b5563; line-height: 1; letter-spacing: -2px;
    opacity: 0.35; transition: opacity .12s, color .12s;
    pointer-events: none;
  }

  nav.toc a[draggable="true"]:hover::before { opacity: 0.9; color: #9ca3af; }

  /* 1-line discoverability hint under the TOC list */
  nav.toc .drag-hint {
    margin: 8px 4px 0; color: #6b7280; font-size: 10px;
    font-style: italic; letter-spacing: 0.2px;
  }

  nav.toc .num { display: inline-block; width: 22px; color: #9ca3af; font-weight: 600; }

  nav.toc a.dirty .num { color: #f59e0b; }

  nav.toc a.dirty::after { content: "● unsaved"; font-size: 10px; color: #f59e0b;
                            margin-left: 6px; font-weight: 600; }

  nav.toc .actions { margin-top: 28px; border-top: 1px solid #374151; padding-top: 16px; }

  nav.toc button { display: block; width: 100%; padding: 9px 12px; margin-bottom: 8px;
                    background: #374151; color: #f3f4f6; border: none; border-radius: 4px;
                    font: inherit; cursor: pointer; font-size: 13px; font-weight: 500;
                    text-align: left; }

  nav.toc button:hover { background: #4b5563; }

  nav.toc button.primary { background: #2563eb; color: #fff; }

  nav.toc button.primary:hover { background: #1d4ed8; }

  nav.toc button.warn { background: #b91c1c; color: #fff; }

  nav.toc button.warn:hover { background: #991b1b; }

  nav.toc .receipt { margin-top: 18px; padding: 10px; background: #111827;
                      border-radius: 4px; font-size: 11px; color: #9ca3af; line-height: 1.5; }

  nav.toc .receipt b { color: #f3f4f6; }

  nav.toc .receipt .hash { font-family: SF Mono, Consolas, monospace; font-size: 10px; }

  /* Days-remaining badge */
  /* Filing-readiness scoreboard — one big 0-100% number derived from
     /preflight + /stamps. Sits at the very top so the operator sees
     "where we are" before scrolling anything. Color codes match the
     three readiness bands: 0-49 red, 50-89 amber, 90-100 green. */
  nav.toc .readiness { margin-top: 12px; padding: 12px 14px; border-radius: 6px;
                         background: #f8fafc; color: #111827; border: 1px solid #e5e7eb;
                         display: flex; flex-direction: column; align-items: stretch; gap: 8px; }

  nav.toc .readiness.red   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

  nav.toc .readiness.amber { background: #fffbeb; color: #92400e; border-color: #fde68a; }

  nav.toc .readiness.green { background: #f0fdf4; color: #065f46; border-color: #bbf7d0; }

  /* TOC group headers · visible labels inserted between component <a> rows
     when their group changes. Drag-and-drop ignores non-<a> children, so
     headers stay put while items reorder around them. */
  nav.toc .toc-group {
    margin: 14px 0 4px;
    padding: 4px 10px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6b7280;
    border-top: 1px solid #374151;
    padding-top: 10px;
    display: flex; justify-content: space-between; align-items: baseline;
    cursor: pointer; user-select: none;
  }

  nav.toc .toc-group:hover { color: #9ca3af; }

  nav.toc .toc-group:first-of-type { border-top: 0; margin-top: 6px; padding-top: 4px; }

  nav.toc .toc-group .count { color: #4b5563; font-weight: 500; }

  nav.toc .toc-group .chev { font-size: 9px; margin-right: 4px; color: #6b7280; transition: transform .12s; }

  nav.toc .toc-group.collapsed .chev { transform: rotate(-90deg); }

  nav.toc .readiness .pct { font-size: 28px; font-weight: 700;
                              line-height: 1; min-width: 65px; }

  nav.toc .readiness .label { font-size: 10px; font-weight: 700;
                                text-transform: uppercase;
                                letter-spacing: 0.06em; opacity: 0.8; }

  nav.toc .readiness .verdict { font-size: 12px; line-height: 1.45;
                                  margin-top: 2px; }

  nav.toc .days-left { margin-top: 12px; padding: 10px; background: #fff7ed;
                        color: #9a3412; border: 1px solid #ffedd5; border-radius: 4px; font-size: 11px;
                        line-height: 1.4; }

  nav.toc .days-left b { color: #9a3412; font-size: 18px; display: block; }

  nav.toc .days-left.warn { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

  nav.toc .days-left.warn b { color: #991b1b; }

  /* TOC entries — show audit pass/fail dot */
  nav.toc a .audit-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
                          margin-left: 6px; vertical-align: middle;
                          background: #4b5563; opacity: 0.5; }

  nav.toc a .audit-dot.pass { background: #16a34a; opacity: 1; }

  nav.toc a .audit-dot.fail { background: #dc2626; opacity: 1; }

  nav.toc a .audit-dot.warn { background: #f59e0b; opacity: 1; }

  nav.toc a .audit-dot[title]:hover { cursor: help; }

  /* Audit-dot legend · a 1-line key under the TOC so dot colors are
     readable without hovering each one. */
  nav.toc .dot-legend {
    margin: 6px 4px 0; color: #6b7280; font-size: 10px;
    display: flex; gap: 10px; flex-wrap: wrap; line-height: 1.4;
  }

  nav.toc .dot-legend .key {
    display: inline-flex; align-items: center; gap: 4px;
  }

  nav.toc .dot-legend .key .swatch {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  }

  nav.toc .dot-legend .key .swatch.pass { background: #16a34a; }

  nav.toc .dot-legend .key .swatch.fail { background: #dc2626; }

  nav.toc .dot-legend .key .swatch.warn { background: #f59e0b; }

  nav.toc .dot-legend .key .swatch.unknown { background: #4b5563; opacity: 0.5; }

  /* "Where you are" status strip — operator answers all four state
     questions at a glance before scrolling */
  nav.toc .status-strip { margin-top: 12px; margin-bottom: 12px; padding: 10px 12px;
                           background: #1f2937; color: #f3f4f6; border-radius: 4px;
                           font-size: 11px; line-height: 1.6; }

  nav.toc .status-strip h4 { color: #9ca3af; margin: 0 0 6px 0; font-size: 10px;
                              font-weight: 700; text-transform: uppercase;
                              letter-spacing: 0.06em; }

  nav.toc .status-strip .row { display: flex; align-items: baseline;
                                 padding: 2px 0; font-family: SF Mono, Consolas, monospace; }

  nav.toc .status-strip .row .lbl { width: 70px; color: #9ca3af; }

  nav.toc .status-strip .row .val { flex: 1; }

  nav.toc .status-strip .ok    { color: #6ee7b7; }

  nav.toc .status-strip .warn  { color: #fcd34d; }

  nav.toc .status-strip .miss  { color: #fca5a5; }

  /* Section labels above each cluster of action buttons */
  nav.toc .actions-section { margin-top: 10px; }

  nav.toc .actions-section .label { font-size: 9px; font-weight: 700;
                                       text-transform: uppercase;
                                       letter-spacing: 0.08em;
                                       color: #6b7280; padding: 0 0 4px 0; }

  nav.toc .actions-section .more-toggle { font-size: 10px; color: #6b7280;
                                            background: none; border: none;
                                            cursor: pointer; padding: 4px 0;
                                            text-align: left; }

  nav.toc .actions-section .more-toggle:hover { color: #2563eb; }

  nav.toc .actions-section .more-content { display: none; padding-top: 4px; }

  nav.toc .actions-section.more-open .more-content { display: block; }

  /* Certification panel */
  nav.toc .cert-panel { margin-top: 14px; padding: 12px; background: #1e3a8a;
                         color: #dbeafe; border-radius: 4px; font-size: 11px;
                         line-height: 1.5; }

  nav.toc .cert-panel.done { background: #14532d; color: #d1fae5; }

  nav.toc .cert-panel h4 { color: #fff; margin: 0 0 8px 0; font-size: 12px;
                            font-weight: 700; text-transform: uppercase;
                            letter-spacing: 0.06em; }

  nav.toc .cert-panel label { display: flex; align-items: flex-start; gap: 8px;
                                cursor: pointer; padding: 4px 0; }

  nav.toc .cert-panel input[type=checkbox] { margin-top: 2px; flex-shrink: 0;
                                                cursor: pointer; }

  nav.toc .cert-panel .cert-status { color: #f3f4f6; font-style: italic; }

  nav.toc .cert-panel .cert-when { color: #a7f3d0; font-size: 10px; margin-top: 4px;
                                     font-family: SF Mono, Consolas, monospace; }

  /* Professional stamp tracker */
  nav.toc .stamps-panel { margin-top: 14px; padding: 12px; background: #eef2ff;
                            color: #3730a3; border: 1px solid #c7d2fe; border-radius: 4px;
                            font-size: 11px; line-height: 1.5; }

  nav.toc .stamps-panel h4 { color: #3730a3; margin: 0 0 8px 0; font-size: 12px;
                              font-weight: 700; text-transform: uppercase;
                              letter-spacing: 0.06em; }

  nav.toc .stamps-panel .stamp-row { padding: 6px 0; border-bottom: 1px solid
                                       #c7d2fe; }

  nav.toc .stamps-panel .stamp-row:last-child { border-bottom: none; }

  nav.toc .stamps-panel .stamp-doc { font-weight: 600; color: #1e293b;
                                       font-size: 11px; line-height: 1.3; }

  nav.toc .stamps-panel .stamp-pro { font-size: 10px; color: #6366f1;
                                       margin-top: 1px; }

  nav.toc .stamps-panel .stamp-status { display: inline-block; padding: 2px 6px;
                                          border-radius: 3px; font-size: 9px;
                                          font-weight: 700; text-transform: uppercase;
                                          letter-spacing: 0.04em; margin-top: 4px; }

  nav.toc .stamps-panel .stamp-status.needed { background: #fbbf24; color: #78350f; }

  nav.toc .stamps-panel .stamp-status.sent { background: #60a5fa; color: #1e3a8a; }

  nav.toc .stamps-panel .stamp-status.received { background: #a78bfa; color: #4c1d95; }

  nav.toc .stamps-panel .stamp-status.integrated { background: #34d399; color: #064e3b; }

  nav.toc .stamps-panel .stamp-advance { background: #fff;
                                           color: #3730a3; border: 1px solid #c7d2fe;
                                           padding: 3px 8px; border-radius: 3px;
                                           font-size: 10px; cursor: pointer;
                                           margin-top: 4px; margin-left: 4px;
                                           font: inherit; font-weight: 500; }

  nav.toc .stamps-panel .stamp-advance:hover { background: #e0e7ff; }

  /* Suggested next step chip */
  nav.toc .next-step { margin-top: 14px; padding: 12px; background: #fffbeb;
                        color: #92400e; border-radius: 4px; font-size: 11px;
                        line-height: 1.5; border-left: 3px solid #f59e0b; }

  nav.toc .next-step.ok { background: #ecfdf5; color: #065f46;
                            border-left-color: #10b981; }

  nav.toc .next-step.alert { background: #fef2f2; color: #991b1b;
                                border-left-color: #ef4444; }

  nav.toc .next-step h4 { color: inherit; margin: 0 0 6px 0; font-size: 11px;
                            font-weight: 700; text-transform: uppercase;
                            letter-spacing: 0.06em; opacity: 0.9; }

  .editor .bar-chart .bc-label { font-weight: 600; color: #374151;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .section header .label { flex: 1; }

  /* Per-doc filing-readiness chip · color-banded by score. Populated from
     /api/save/project_filing_readiness on page load; click jumps to the
     full per-doc dashboard. */
  .section header .readiness-chip {
    display: inline-block; margin-left: 8px; padding: 2px 9px;
    border-radius: 11px; font-size: 11px; font-weight: 700;
    vertical-align: middle;
  }

  .section header .readiness-chip.green { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

  .section header .readiness-chip.amber { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

  .section header .readiness-chip.red   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

  .section header .readiness-chip.gray  { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

  .section header .actions .doc-more-toggle { background: #f9fafb; color: #6b7280; font-weight: 600; }

  .section header .actions .doc-more-toggle:hover { background: #e5e7eb; color: #111827; }

  .section header .actions.more-open .doc-more-toggle { background: #1f2937; color: #fff; border-color: #1f2937; }

  .section .doc-subtoc .subtoc-label {
    color: #6b7280; font-weight: 600; text-transform: uppercase;
    font-size: 10px; letter-spacing: 0.4px; margin-right: 4px;
  }

  .format-toolbar .fmt-label { font-size: 10px; color: #6b7280; text-transform: uppercase;
                                letter-spacing: 0.05em; margin-right: 4px; align-self: center; }
media. */
  body.reading-mode nav.toc,
  body.reading-mode .app-topnav,
  body.reading-mode .cms-rail,
  body.reading-mode .app-chatbar,
  body.reading-mode .app-diagnostic,
  body.reading-mode #bulk-actions,
  body.reading-mode .needs-you-panel,
  body.reading-mode .stamps-panel,
  body.reading-mode .cert-panel,
  body.reading-mode .actions-section,
  body.reading-mode .next-step,
  body.reading-mode .status-strip,
  body.reading-mode .receipt,
  body.reading-mode .days-left,
  body.reading-mode .format-toolbar,
  body.reading-mode .doc-more-toggle,
  body.reading-mode #bulk-cancel-btn,
  body.reading-mode .section header .actions { display: none !important; }

  body.reading-mode { display: block; background: #fff; }

  body.reading-mode .section { box-shadow: none; max-width: 760px; margin: 0 auto 22px; }

  body.reading-mode main { width: 100%; padding: 0; }

  /* Reading-mode exit button — fixed top-right */
  #reading-mode-exit {
    position: fixed; top: 12px; right: 16px; z-index: 100;
    background: #2563eb; color: #fff; border: 0;
    padding: 6px 12px; border-radius: 4px;
    cursor: pointer; font-size: 12px; font-weight: 600;
    display: none;
  }

  body.reading-mode #reading-mode-exit { display: block; }

/* Tab-driven chrome toggle: when Omnibus tab is active, hide all
   NYSDEC-filing-specific chrome (status panels, action buttons,
   cert/stamps/receipt panels, filing-specific banners + topbar).
   Show only the omnibus-specific topbar. Tab switcher itself + tabs
   button + copy-all stay visible always (cross-context). */
body.omnibus-active .filing-only { display: none !important; }

/* Hide the Copy-all button on Omnibus tab — it's filing-package-specific.
   We'll add omnibus-specific actions in a later phase. */
body.omnibus-active #copy-all-btn { display: none !important; }
. Hide NYSDEC-specific chrome (audit panels, cert, stamps,
   chain receipts) but keep TOC + section editor + Copy-all. */
body.project-active .nysdec-only { display: none !important; }

body.project-active .filing-only { display: none !important; }

body.project-active .project-only { display: block !important; }

body:not(.project-active) .project-only { display: none !important; }

/* Phase 5: elements that should show in BOTH NYSDEC and project mode.
   Overrides .filing-only's hide-in-project-mode rule. */
body.project-active .project-also { display: block !important; }

body.project-active .readiness.project-also { display: flex !important; }


/* 2026-06-05 — Generic projects (DMS Build, scratchpads, R&D) have no
   regulatory-filing workflow. Hide filing-readiness scoreboard, blockers
   inbox, "Suggested next step", days-left countdown, status strip, plus
   the file/submit/ack/tasks/lock buttons. KEEP Certify + Sign visible —
   operator wants any project to be certifiable. */
body.project-active.generic-project #readiness-box,
body.project-active.generic-project #days-left-box,
body.project-active.generic-project #next-step-box,
body.project-active.generic-project #needs-you-panel,
body.project-active.generic-project #status-strip,
body.project-active.generic-project #filing-readiness-dashboard-btn,
body.project-active.generic-project #project-file-btn,
body.project-active.generic-project #project-submit-btn,
body.project-active.generic-project #project-ack-btn,
body.project-active.generic-project #project-tasks-btn,
body.project-active.generic-project #project-lock-btn,
body.project-active.generic-project #project-unlock-btn { display: none !important; }

  #add-doc-body label { display:block; font-size:12px; font-weight:600; color:#374151;
                         margin-bottom:5px; margin-top:12px; }

        .rf-label { color:#111; font-weight:600; }

        .rf-label .crit { display:inline-block; font-size:9px; font-weight:700;
                            color:#991b1b; background:#fee2e2; padding:1px 6px;
                            border-radius:8px; margin-left:6px; vertical-align:middle; }

        .sg-label  { font-size:13px;font-weight:600;color:#111;margin:3px 0 6px 0;line-height:1.3; }

        .diff-section-label { background:#eef2ff;color:#4338ca;font-weight:600;font-size:11px;
                                padding:5px 12px;text-transform:uppercase;letter-spacing:.06em; }

        .wf-stage-header .pct { color:#6b7280;font-weight:400;margin-left:6px;font-size:11px; }

        .cma-label { font-weight:600;font-size:13px;color:#111;margin-bottom:6px; }

        #rcn-status-strip { display:flex;flex-wrap:wrap;gap:2px;padding:6px 22px;
                              background:#fafafa;border-bottom:1px solid #f3f4f6; }

        #rcn-status-strip .dot { width:14px;height:14px;border-radius:3px;cursor:pointer;
                                   background:#e5e7eb;font-size:9px;color:#6b7280;
                                   display:flex;align-items:center;justify-content:center;font-weight:600; }

        #rcn-status-strip .dot.pending  { background:#e5e7eb; color:#6b7280; }

        #rcn-status-strip .dot.edited   { background:#fde68a; color:#854d0e; }

        #rcn-status-strip .dot.resolved { background:#86efac; color:#166534; }

        #rcn-status-strip .dot.skipped  { background:#d1d5db; color:#374151; }

        #rcn-status-strip .dot.current  { outline:2px solid #2563eb; outline-offset:1px; }

        #rcn-body .label { font-size:11px;font-weight:600;color:#6b7280;
                             text-transform:uppercase;letter-spacing:.06em;
                             margin:0 0 6px 0; }

        #af-body .col-label { font-size:11px;font-weight:600;color:#6b7280;
                                text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px; }

      .pxc-verdict { padding:14px 18px;border-radius:6px;font-size:14px;font-weight:600;
                      margin-bottom:16px; }

      .pxc-stat-tile .label { font-size:10px;font-weight:600;color:#6b7280;
                                text-transform:uppercase;letter-spacing:.06em; }

      .pxc-doc-label { font-weight:600;color:#111;flex:1;
                        white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
                        margin-right:10px; }

  /* ─────────────────────────────────────────────────────────────────────
     LIGHT DMS FILING RAIL (2026-07-24, operator-requested). The nav.toc
     sidebar + its toggles, buttons, cert-panel, receipt, status-strip and
     wide-mode cards were a dark slate sidebar; this trailing layer flips the
     whole rail to the light theme to match the rest of the app (chat bar,
     top-nav, dashboard). Status panels (stamps/next-step/readiness/days-left)
     were lit above. Declared as an override layer so the many individually-
     tuned rules above don't each need editing. #2563eb / status colours kept.
     ───────────────────────────────────────────────────────────────────── */
  nav.toc { background: #ffffff; color: #374151; border-right: 1px solid #e5e7eb; }
  nav.toc h1 { color: #111827; }
  nav.toc .subhead { color: #6b7280; }
  nav.toc a { color: #374151; }
  nav.toc a:hover { background: #f1f5f9; color: #111827; }
  nav.toc a.active { background: #eff6ff; color: #1d4ed8; border-left-color: #2563eb; }
  nav.toc a[draggable="true"]::before { color: #cbd5e1; }
  nav.toc a[draggable="true"]:hover::before { color: #6b7280; }
  nav.toc .num { color: #6b7280; }
  nav.toc .actions { border-top-color: #e5e7eb; }
  nav.toc button { background: #ffffff; color: #374151; border: 1px solid #d1d5db; }
  nav.toc button:hover { background: #f1f5f9; }
  nav.toc button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
  nav.toc button.primary:hover { background: #1d4ed8; }
  nav.toc button.warn { background: #b91c1c; color: #fff; border-color: #b91c1c; }
  nav.toc .receipt { background: #f8fafc; color: #6b7280; border: 1px solid #e5e7eb; }
  nav.toc .receipt b { color: #111827; }
  nav.toc .toc-group { border-top-color: #e5e7eb; }
  nav.toc .status-strip { background: #f8fafc; color: #374151; border: 1px solid #e5e7eb; }
  nav.toc .cert-panel { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
  nav.toc .cert-panel.done { background: #f0fdf4; color: #065f46; border-color: #bbf7d0; }
  nav.toc .cert-panel h4 { color: #1e3a8a; }
  nav.toc .cert-panel.done h4 { color: #065f46; }
  nav.toc .cert-panel .cert-status { color: #374151; }
  /* rail toggles */
  .left-nav-toggle { background: #ffffff; color: #374151; border: 1px solid #d1d5db; }
  .left-nav-toggle:hover { background: #f1f5f9; }
  .left-nav-wide-toggle { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
  .left-nav-wide-toggle:hover { background: #dbeafe; }
  .left-nav-reorder-btn { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }
  .left-nav-reorder-btn:hover { background: #ccfbf1; color: #0f766e; }
  body.left-nav-wide .left-nav-wide-toggle { background: #dcfce7; color: #15803d; }
  body.left-nav-wide .left-nav-wide-toggle:hover { background: #bbf7d0; }
  body.left-nav-collapsed nav.toc { background: #f8fafc; border-right: 1px solid #e5e7eb; }
  body.left-nav-collapsed .left-nav-toggle { background: transparent; color: #92400e; }
  body.left-nav-collapsed .left-nav-toggle:hover { background: #eef2ff; }
  /* wide-mode cards */
  body.left-nav-wide #toc-links a { background: #ffffff; border: 1px solid #e5e7eb; }
  body.left-nav-wide #toc-links a:hover { background: #f1f5f9; border-color: #d1d5db; }
  body.left-nav-wide #toc-links a.active { background: #eff6ff; border-color: #2563eb; color: #1d4ed8; }
  body.left-nav-wide #toc-links .toc-move-ctrls button { background: #ffffff; color: #374151; border-color: #d1d5db; }
  body.left-nav-wide #toc-links .toc-move-ctrls button:hover { background: #f1f5f9; color: #111827; }
