/* ==========================================================================
   Science, Again! Atlas (/satlas/) — M33 40/60 Swiss Rail × Stacked Panes
   - Authentic M33 GIS Swiss Report visual grammar (tokens.css v1.2–v1.4)
   - Whisper 0.86 GPU cotton-rag archival paper substrate (#paper-canvas / #paper-glaze)
   - Cartographic Teal–Sand–Crimson + Abyss Ink hierarchy (#001219)
   - Initial 2-column M33 40% / 60% composition (Index Rail + Wide Pane 1)
   - Introducing Pane 2 (3rd rail) smoothly shrinks Pane 1 and overlaps the
     wide Index Rail into a clickable 42px sticky rotated spine—identical to
     every subsequent Andy Matuschak stacked pane.
   ========================================================================== */

:root {
  /* Typography (Canonical M33 Swiss Stack) */
  --font-sans: "Neue Haas Grotesk Display Pro", "Neue Haas Grotesk Text Pro", "Neue Haas Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --text-nav: 14px;
  --text-body: 13px;
  --text-meta: 11px;
  --text-kpi: 24px;
  --text-mark-sub: 8.5px;
  --tracking-swiss: -0.015em;

  /* Canvas & Achromatic Ink-Opacity Hierarchy (Tinted toward #001219 Abyss Ink) */
  --canvas: #FFFFFF;
  --paper-fallback: #F9F8F3;
  --paper-pane: #F8F7F1;
  --ink-1: rgba(0, 18, 25, 0.88);
  --ink-2: rgba(0, 18, 25, 0.74);
  --ink-3: rgba(0, 18, 25, 0.56);
  --ink-4: rgba(0, 18, 25, 0.42);
  --ink-5: rgba(0, 18, 25, 0.34);
  --rule: rgba(0, 18, 25, 0.17);
  --rule-strong: rgba(0, 18, 25, 0.30);
  --grid: rgba(0, 18, 25, 0.08);
  --hover-wash: rgba(0, 18, 25, 0.032);
  --active-wash: rgba(0, 95, 115, 0.055);

  /* Master Cartographic Palette (Teal – Sand – Crimson) */
  --c-abyss: #001219;
  --c-petrol: #005F73;
  --c-cyan: #0A9396;
  --c-mint: #94D2BD;
  --c-sand: #E9D8A6;
  --c-amber: #EE9B00;
  --c-orange: #CA6702;
  --c-rust: #BB3E03;
  --c-brick: #AE2012;
  --c-crimson: #9B2226;

  /* Neutral Slate Focus+Context Ramp */
  --neutral-1: #5C6268;
  --neutral-2: #7A8085;
  --neutral-3: #B4B8BC;
  --neutral-4: #D8D6CE;

  /* Colorblind-Safe Semantic Aliases */
  --accent: var(--c-petrol);
  --status-pass: var(--c-cyan);
  --status-warn: var(--c-orange);
  --status-fail: var(--c-crimson);
  --status-muted: var(--neutral-2);

  /* Sticky-Note Yellow Table Modal Tokens (Warm Archival Butter-Yellow) */
  --sticky-bg: #F6DE7E;
  --sticky-search-bg: #FBF1BF;
  --sticky-ink: rgba(20, 18, 12, 0.90);
  --sticky-ink-2: rgba(20, 18, 12, 0.72);
  --sticky-ink-soft: rgba(20, 18, 12, 0.50);
  --sticky-rule: rgba(20, 18, 12, 0.18);
  --sticky-dot: rgba(20, 18, 12, 0.28);
  --sticky-chip-bg: rgba(20, 18, 12, 0.085);
  --sticky-chip-hover: rgba(20, 18, 12, 0.155);

  /* M33 40/60 -> Stacked Pane Proportions */
  --spine-w: 42px;
  --rail-w: clamp(360px, 40vw, 660px);
  --pane-w-single: calc(100vw - var(--rail-w));
  --pane-w-stacked: clamp(440px, calc((100vw - var(--spine-w)) / 2), 680px);
  --col-gutter: 22px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  background: var(--paper-fallback);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-paper="off"] {
  background: var(--canvas);
  --paper-fallback: #FFFFFF;
  --paper-pane: #FFFFFF;
}

body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: var(--tracking-swiss);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease;
}
a:hover {
  color: var(--ink-1);
}

button {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 80;
  padding: 8px 12px;
  background: var(--c-abyss);
  color: var(--paper-fallback);
  font-family: var(--font-mono);
  font-size: 11px;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- GPU Whisper 0.86 Cotton-Rag Paper Layers ---------- */
#paper-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

#paper-glaze {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 40;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.16;
}

html[data-paper="off"] #paper-canvas,
html[data-paper="off"] #paper-glaze {
  display: none;
}

/* ---------- Mobile Breadcrumb Trail Bar (Hidden on Desktop) ---------- */
.mobile-bar {
  display: none;
}

/* ==========================================================================
   UNIFIED HORIZONTAL STAGE (Rail = Column 0 + Specimen Panes = Columns 1..N)
   ========================================================================== */
.pane-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100vw;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
}

.pane-stage.is-single-pane {
  overflow-x: hidden;
}

.pane-stage-spacer {
  flex: 0 0 max(36px, calc(100vw - var(--pane-w-stacked) * 2 - var(--spine-w)));
}

.pane-stage.is-single-pane .pane-stage-spacer {
  display: none;
}

/* ==========================================================================
   COLUMN 0: M33 SWISS INDEX RAIL (40% Initial Width -> Sticky 42px Spine)
   ========================================================================== */
.rail {
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  height: 100vh;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--paper-pane);
  border-right: 1px solid var(--rule);
  overflow: hidden;
}

.rail-inner {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(156px, 1fr) minmax(46vh, 52vh);
  transition: opacity 150ms ease;
}

.rail[data-obscured="true"] .rail-inner {
  opacity: 0.06;
  pointer-events: none;
}

/* Row 1: Canonical M33 Borderless Top Nav + Monographs Mouseover Menu */
.rail-top {
  padding: 12px 24px 0;
  position: relative;
  z-index: 20;
}

.rail-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 14px;
  font-size: var(--text-nav);
  font-weight: 500;
  line-height: 1.2;
}

.rail-nav > button,
.rail-menu-trigger {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  color: var(--ink-5);
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease;
}
.rail-nav > button:hover,
.rail-nav > button.nav-active,
.rail-nav-menu:hover .rail-menu-trigger,
.rail-nav-menu:focus-within .rail-menu-trigger,
.rail-nav-menu.is-open .rail-menu-trigger {
  color: var(--ink-1);
}
.rail-nav .nav-cnt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  margin-left: 3px;
}
.rail-nav > button.nav-active .nav-cnt,
.rail-nav-menu:hover .rail-menu-trigger .nav-cnt,
.rail-nav-menu.is-open .rail-menu-trigger .nav-cnt {
  color: var(--accent);
}

.rail-nav-menu {
  position: relative;
}

/* Invisible hover bridge prevents mouseover flicker between trigger and menu */
.rail-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 8px;
  min-width: 256px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  z-index: 30;
}

.rail-dropdown::before {
  content: "";
  position: absolute;
  inset: 8px 0 0 0;
  background: var(--paper-fallback);
  border-top: 1px solid var(--ink-1);
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  box-shadow: 0 12px 28px rgba(0, 18, 25, 0.08);
  z-index: -1;
}

.rail-nav-menu:hover .rail-dropdown,
.rail-nav-menu:focus-within .rail-dropdown,
.rail-nav-menu.is-open .rail-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.rail-drop-item {
  display: grid;
  grid-template-columns: 3.4ch 1fr auto;
  gap: 0.65rem;
  align-items: baseline;
  padding: 8px 12px;
  border-bottom: 1px solid var(--grid);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-2);
  transition: color 120ms ease, background 120ms ease;
}
.rail-drop-item:last-child {
  border-bottom: 0;
}
.rail-drop-item:hover,
.rail-drop-item:focus-visible {
  color: var(--ink-1);
  background: var(--hover-wash);
  outline: none;
}
.rail-drop-item.is-quiet {
  color: var(--ink-3);
}
.rail-drop-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}
.rail-drop-item.is-quiet .rail-drop-num {
  color: var(--ink-4);
}
.rail-drop-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-drop-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
}
.rail-drop-sep {
  height: 1px;
  background: var(--rule);
}

/* Row 2: Narrow Upper-Mid M33 Editorial Brief (~28ch) + Brand Lockup at Midline */
.rail-mid {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 24px 18px;
  min-height: 0;
}

.rail-brief {
  margin: auto 0;
  padding: 10px 0 18px;
  max-width: 28ch;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: var(--tracking-swiss);
  color: var(--ink-3);
}

.rail-brief-title {
  margin: 0 0 0.85em 0;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink-1);
  line-height: 1.25;
  letter-spacing: var(--tracking-swiss);
}

.rail-brief p {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: var(--tracking-swiss);
  color: var(--ink-3);
}

/* Canonical M33 .brand-lockup Position (40% Rail Width, Left-Anchored Directly Above Index) */
.rail-brand-row {
  display: flex;
  align-items: flex-end;
}

.brand-lockup {
  display: block;
  width: 40%;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  mix-blend-mode: multiply;
  opacity: 0.92;
  transition: opacity 140ms ease;
}
.brand-lockup:hover {
  opacity: 1;
}
.brand-lockup img {
  width: 100%;
  height: auto;
  display: block;
}

/* Row 3 (Lower ~50% of Viewport): Inset 1px Top Rule -> Scrollable Swiss Index -> Single "Table" Trigger */
.rail-bottom {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 24px;
}

.rail-index-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

/* Single Quiet Bottom-Left Delta (Δ) Trigger + Pointing Tooltip */
.rail-table-bar {
  flex-shrink: 0;
  padding: 10px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.delta-trigger-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.table-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: -4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.table-trigger-btn:hover,
.table-trigger-btn:focus-visible {
  color: var(--sticky-ink);
  background: rgba(246, 222, 126, 0.55);
  border-color: rgba(20, 18, 12, 0.16);
  outline: none;
}
.table-trigger-btn.is-filtered:not(.is-open) {
  color: var(--sticky-ink);
  background: rgba(246, 222, 126, 0.65);
  border-color: rgba(20, 18, 12, 0.22);
}
.table-trigger-btn.is-open,
.table-trigger-btn[aria-expanded="true"] {
  color: var(--sticky-ink);
  background: var(--sticky-bg);
  border-color: rgba(20, 18, 12, 0.20);
  box-shadow: 0 2px 8px rgba(0, 18, 25, 0.12);
}
.delta-glyph {
  display: block;
}

/* Pointing Tooltip Anchored Directly to the Right of Δ */
.delta-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 4px 9px;
  background: var(--c-abyss);
  color: var(--paper-fallback);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 6px 16px rgba(0, 18, 25, 0.16);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  z-index: 25;
}
.delta-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--c-abyss);
}

.delta-trigger-wrap:hover .delta-tooltip,
.table-trigger-btn:focus-visible + .delta-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}
.table-trigger-btn.is-open + .delta-tooltip {
  opacity: 0 !important;
  visibility: hidden !important;
}

.table-trigger-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

/* ==========================================================================
   HOVERING STICKY-NOTE YELLOW TABLE MODAL (Wide, Low-Profile Above "Table")
   Leaves the top rows of the live Swiss table clearly visible above the card!
   ========================================================================== */
.table-modal {
  position: fixed;
  left: 24px;
  bottom: 54px;
  z-index: 60;
  width: min(860px, calc(100vw - 48px));
  max-height: min(46vh, 320px);
  overflow-y: auto;
  background: var(--sticky-bg);
  color: var(--sticky-ink);
  border-radius: 3px;
  box-shadow:
    0 22px 54px rgba(0, 18, 25, 0.18),
    0 6px 18px rgba(0, 18, 25, 0.10),
    0 0 0 1px rgba(20, 18, 12, 0.12);
  transform-origin: bottom left;
  animation: stickyPop 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.table-modal[hidden] {
  display: none !important;
}

@keyframes stickyPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Band 1: Unified Search + Inline Order/Receipts Bar */
.tm-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 12px 18px;
  background: var(--sticky-search-bg);
  border-bottom: 1px solid var(--sticky-rule);
}

.tm-search-field {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tm-search-icon {
  flex-shrink: 0;
  color: var(--sticky-ink);
}

.tm-search-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 2px 0;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--sticky-ink);
  outline: none;
}
.tm-search-input::placeholder {
  color: rgba(20, 18, 12, 0.34);
}
.tm-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.tm-search-clear {
  background: none;
  border: 0;
  padding: 3px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sticky-ink-soft);
  cursor: pointer;
}
.tm-search-clear:hover {
  color: var(--sticky-ink);
}

.tm-header-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  flex-shrink: 0;
}

.tm-order-row {
  padding-right: 10px;
  border-right: 1px solid var(--sticky-rule);
}

.tm-close-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--sticky-ink);
  color: var(--sticky-search-bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease;
}
.tm-close-btn:hover {
  transform: scale(1.06);
}

/* Band 2: Wide 3-Column Filter Grid (Rooms | Epistemic | Types) */
.tm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.9fr) minmax(0, 1.65fr);
  gap: 14px 18px;
  padding: 13px 18px 14px;
}
.tm-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.tm-col-div {
  border-left: 1px solid var(--sticky-rule);
  padding-left: 16px;
}

.tm-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sticky-ink-soft);
}

.tm-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 6px;
}

.tm-chip,
.tm-chip-row > button:not(.tm-action-link) {
  background: var(--sticky-chip-bg);
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--sticky-ink-2);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.tm-chip:hover,
.tm-chip-row > button:not(.tm-action-link):hover {
  background: var(--sticky-chip-hover);
  color: var(--sticky-ink);
}
.tm-chip.active,
.tm-chip.is-receipts-on,
.tm-chip-row > button:not(.tm-action-link).active {
  background: var(--sticky-ink);
  color: var(--sticky-bg);
}
.tm-chip-row .fcnt {
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: 0.58;
  margin-left: 3px;
}
.tm-chip-row > button.active .fcnt {
  opacity: 0.78;
}

/* Band 3: Single-Line Status, Jumps & Zero-Prose Archive Desk Footer */
.tm-footer {
  padding: 10px 18px 11px;
  border-top: 1px dotted var(--sticky-dot);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}
.tm-footer-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sticky-ink-soft);
}
.tm-dot { opacity: 0.48; }

.tm-footer-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 13px;
}

.tm-action-link {
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(20, 18, 12, 0.30);
  padding: 1px 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--sticky-ink);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 120ms ease, border-color 120ms ease;
}
.tm-action-link:hover {
  border-bottom-color: var(--sticky-ink);
  opacity: 0.72;
}
.tm-action-link.is-reset {
  color: var(--c-crimson);
  border-bottom-color: rgba(155, 34, 38, 0.38);
}

/* Scrollable Hairline Swiss Index List (Flush to Inset 1px Top Rule) */
.rail-index {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 12px;
}

.idx-group-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--paper-pane);
  padding: 8px 0 5px;
  border-bottom: 1px solid var(--ink-1);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.idx-row {
  display: grid;
  grid-template-columns: 4.1ch 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 6px 2px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-3);
  cursor: pointer;
  position: relative;
  transition: color 120ms ease, background 120ms ease;
}
.idx-row:hover {
  color: var(--ink-1);
  background: var(--hover-wash);
}
.idx-row.is-in-stack {
  color: var(--ink-1);
  background: var(--active-wash);
}

.idx-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
}
.idx-row.is-in-stack .idx-num {
  color: var(--accent);
  font-weight: 600;
}

.idx-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.idx-title {
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.22;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.idx-sub {
  font-size: 10.5px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idx-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.idx-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-4);
  white-space: nowrap;
}
.idx-tag.ep-measured { color: var(--c-cyan); }
.idx-tag.ep-computed { color: var(--c-petrol); }
.idx-tag.ep-inferred { color: var(--neutral-1); }
.idx-tag.ep-hypothesis { color: var(--c-orange); }
.idx-tag.ep-open { color: var(--c-crimson); }

.idx-append-btn {
  background: none;
  border: 0;
  padding: 0 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: var(--ink-4);
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease, color 120ms ease;
}
.idx-row:hover .idx-append-btn,
.idx-row:focus-within .idx-append-btn,
.idx-append-btn:focus-visible {
  opacity: 1;
}
.idx-append-btn:hover {
  color: var(--accent);
}

.trail-row-actions {
  display: inline-flex;
  gap: 6px;
}
.trail-mini-btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  cursor: pointer;
}
.trail-mini-btn:hover { color: var(--ink-1); }

.desk-btn {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 1px 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}
.desk-btn:hover {
  color: var(--ink-1);
  border-bottom-color: var(--ink-1);
}

/* ==========================================================================
   COLUMNS 1..N: SPECIMEN PANES (Wide 60% Initially -> Shrinks on 2nd Pane)
   ========================================================================== */
.pane {
  flex: 0 0 var(--pane-w-stacked);
  width: var(--pane-w-stacked);
  height: 100vh;
  position: sticky;
  left: calc(var(--pane-idx, 1) * var(--spine-w));
  z-index: calc(3 + var(--pane-idx, 1));
  background: var(--paper-pane);
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    flex-basis 280ms cubic-bezier(0.22, 1, 0.36, 1),
    width 280ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease,
    border-color 180ms ease;
}

/* Single-pane M33 40/60 mode: First Pane expands cleanly to the full remaining 60vw! */
.pane-stage.is-single-pane .pane {
  flex: 1 0 var(--pane-w-single);
  width: var(--pane-w-single);
  border-left: 0;
}

.pane[data-overlay="true"] {
  border-left: 1px solid rgba(0, 18, 25, 0.24);
  box-shadow: -8px 0 24px rgba(0, 18, 25, 0.068);
}

.pane.is-pulsing {
  animation: panePulse 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panePulse {
  0% { background: rgba(0, 95, 115, 0.09); }
  100% { background: var(--paper-pane); }
}

.pane.is-entering {
  animation: paneEnter 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes paneEnter {
  from { opacity: 0.4; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Sticky Rotated Vertical Spine (Shared Identically by Index Rail & All Panes!) */
.pane-spine {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--spine-w);
  z-index: 8;
  background: var(--paper-pane);
  border: 0;
  border-right: 1px solid var(--grid);
  padding: 14px 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, background 140ms ease;
}

.rail[data-obscured="true"] .pane-spine,
.pane[data-obscured="true"] .pane-spine {
  opacity: 1;
  pointer-events: auto;
}

.pane-spine:hover {
  background: rgba(0, 95, 115, 0.045);
}

.pane-spine-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
}
.pane-spine-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-1);
  max-height: calc(100vh - 96px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pane-spine-room {
  margin-top: auto;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
}

/* Inner Vertical Scrolling Pane Content */
.pane-scroll {
  flex: 1 1 auto;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 28px 22vh;
  transition: opacity 150ms ease, padding 260ms ease;
}

.pane-stage.is-single-pane .pane-scroll {
  padding: 12px clamp(28px, 3.4vw, 52px) 22vh;
}

.pane[data-obscured="true"] .pane-scroll {
  opacity: 0.06;
  pointer-events: none;
}

/* Pane Top Bridge / Utility Bar */
.pane-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}
.pane-bridge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pane-bridge .bridge-rel {
  color: var(--accent);
  font-weight: 600;
}
.pane-bridge .bridge-cross {
  color: var(--c-orange);
  font-weight: 600;
}
.pane-bar-actions {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}
.pane-act-btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  cursor: pointer;
}
.pane-act-btn:hover,
.pane-act-btn.is-pinned {
  color: var(--accent);
}

/* ==========================================================================
   CANONICAL M33 SWISS REPORT STAGE COMPONENTS (INSIDE EACH PANE)
   ========================================================================== */
.section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 14px;
}

.section-num {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--accent);
}

.section-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-1);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.section-source {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  white-space: nowrap;
}

.kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

.status-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-tag.pass, .status-tag.ep-measured { color: var(--c-cyan); }
.status-tag.ep-computed { color: var(--c-petrol); }
.status-tag.ep-inferred { color: var(--neutral-1); }
.status-tag.warn, .status-tag.ep-hypothesis { color: var(--c-orange); }
.status-tag.fail, .status-tag.ep-open { color: var(--c-crimson); }

.pane-lead {
  margin: 0 0 18px;
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.44;
  color: var(--ink-1);
  max-width: 64ch;
}

.pane-prose {
  margin: 0 0 14px;
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.44;
  color: var(--ink-3);
  max-width: 64ch;
}

.receipts-stripped-note {
  margin: 0 0 14px;
  padding: 5px 0;
  border-top: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

/* Flat Hairline KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  border-top: 1px solid var(--ink-1);
  border-bottom: 1px solid var(--rule);
  margin: 14px 0 24px;
}

.kpi-cell {
  padding: 10px 12px 11px 0;
}
.kpi-label {
  font-size: 11px;
  color: var(--ink-4);
  margin-bottom: 4px;
}
.kpi-val {
  font-size: var(--text-kpi);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink-1);
  line-height: 1.08;
  word-break: break-word;
}
.kpi-val.is-compact {
  font-size: 16.5px;
  line-height: 1.2;
}
.kpi-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  margin-top: 4px;
}
.kpi-note.ok { color: var(--status-pass); }
.kpi-note.warn { color: var(--status-warn); }
.kpi-note.fail { color: var(--status-fail); }

/* 6-Column Editorial Subgrid (Patterns A–E from M33) */
.subgrid-6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--col-gutter);
  row-gap: 16px;
  align-items: start;
  margin: 18px 0 22px;
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }

/* Pattern B: Balanced 3+3 Column Subheaders (Aligns / Breaks) */
.col-header {
  border-top: 1px solid var(--ink-1);
  padding-top: 6px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-body);
  color: var(--ink-1);
}
.col-header.is-aligns { border-top-color: var(--c-cyan); }
.col-header.is-breaks { border-top-color: var(--c-crimson); }
.col-header .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
}
.col-header.is-aligns .tag { color: var(--c-cyan); }
.col-header.is-breaks .tag { color: var(--c-crimson); }

.copy-col p {
  margin: 0 0 10px;
  font-size: var(--text-body);
  line-height: 1.42;
  color: var(--ink-2);
}
.copy-col p:last-child { margin-bottom: 0; }

/* Editorial Quote (Verbatim Primary Voice) */
.editorial-quote {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 14px;
  margin: 14px 0 18px;
  font-size: 14px;
  line-height: 1.46;
  color: var(--ink-1);
  max-width: 62ch;
}
.editorial-quote-attr {
  margin-top: 8px;
  font-size: var(--text-meta);
  color: var(--ink-3);
}

/* Pattern D: Editorial Imagery Plate */
.plate-wrap {
  margin: 12px 0 20px;
}
.plate-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #14191f;
  cursor: zoom-in;
  position: relative;
}
.plate-btn img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  background: #14191f;
  mix-blend-mode: normal;
}
.plate-zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  background: rgba(0, 18, 25, 0.72);
  color: #F9F8F3;
  font-family: var(--font-mono);
  font-size: 10px;
}
.plate-caption {
  margin-top: 6px;
  font-size: var(--text-meta);
  color: var(--ink-4);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* Pattern E: Hanging-Label Spec Rows */
.spec-rows {
  border-top: 1px solid var(--ink-1);
  margin: 14px 0 20px;
}
.spec-row {
  display: grid;
  grid-template-columns: minmax(104px, 28%) 1fr;
  column-gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--grid);
  align-items: baseline;
}
.spec-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}
.spec-val {
  font-size: var(--text-body);
  line-height: 1.4;
  color: var(--ink-2);
  min-width: 0;
  word-break: break-word;
}
.spec-val.is-strong { color: var(--ink-1); }
.spec-val.is-warn { color: var(--c-orange); }
.spec-val.is-fail { color: var(--c-crimson); }
.spec-val.is-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-1);
}

/* Runnable Dataset Query Recipe */
.recipe-box {
  margin: 12px 0 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
}
.recipe-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  text-transform: uppercase;
}
.recipe-code {
  margin: 0 0 6px;
  padding: 8px 10px;
  background: rgba(0, 18, 25, 0.042);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-1);
  white-space: pre-wrap;
  word-break: break-all;
}
.recipe-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* Sidenote / Callout */
.sidenote {
  border-top: 1px solid var(--rule);
  padding-top: 6px;
  margin: 14px 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-3);
}
.sidenote-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.sidenote.is-warn .sidenote-kicker { color: var(--c-orange); }
.sidenote.is-fail .sidenote-kicker { color: var(--c-crimson); }

/* Swiss Tables */
.table-wrap {
  overflow-x: auto;
  margin: 14px 0 22px;
}
.swiss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.swiss-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ink-4);
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--ink-1);
}
.swiss-table th.num,
.swiss-table td.num {
  text-align: right;
  padding-right: 0;
  padding-left: 8px;
}
.swiss-table td {
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--grid);
  color: var(--ink-2);
}
.swiss-table tr.summary-row td {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-1);
}
.matrix-cell-btn {
  background: none;
  border: 0;
  padding: 1px 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.matrix-cell-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}
.matrix-cell-zero {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-5);
}

/* M33 Diagonal Hatching Chapter Break */
.pane-hatch {
  height: 52px;
  margin: 28px 0;
  background-image: repeating-linear-gradient(
    -52deg,
    transparent 0px,
    transparent 11px,
    rgba(0, 18, 25, 0.055) 11px,
    rgba(0, 18, 25, 0.055) 12px
  );
}

/* Starter Chain Rows on Frontispiece */
.chain-list {
  border-top: 1px solid var(--ink-1);
  margin: 12px 0 24px;
}
.chain-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  cursor: pointer;
  transition: background 120ms ease;
}
.chain-item:hover {
  background: var(--hover-wash);
  padding-left: 8px;
  padding-right: 8px;
  margin: 0 -8px;
  width: calc(100% + 16px);
}
.chain-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.chain-item-title {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink-1);
}
.chain-item-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
}
.chain-item-path {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* Typed Graph Links / Branch-Out Section Inside Panes */
.links-block {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-1);
}
.links-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.links-block-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}
.links-block-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
}

.edge-group {
  margin-bottom: 12px;
}
.edge-rel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-4);
  margin-bottom: 3px;
}
.edge-rel-label.is-friction { color: var(--c-crimson); }
.edge-rel-label.is-bridge { color: var(--c-petrol); }
.edge-rel-label.is-support { color: var(--c-cyan); }

.edge-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--grid);
  padding: 7px 0;
  cursor: pointer;
  color: var(--ink-2);
  transition: color 120ms ease, background 120ms ease;
}
.edge-btn:hover {
  color: var(--ink-1);
  background: var(--hover-wash);
  padding-left: 6px;
  padding-right: 6px;
  margin: 0 -6px;
  width: calc(100% + 12px);
}
.edge-btn.is-in-stack {
  background: var(--active-wash);
  padding-left: 6px;
  padding-right: 6px;
  margin: 0 -6px;
  width: calc(100% + 12px);
}
.edge-btn-title {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink-1);
}
.edge-btn-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  white-space: nowrap;
}
.edge-btn-meta.is-cross {
  color: var(--c-petrol);
  font-weight: 600;
}
.edge-btn-note {
  grid-column: 1 / -1;
  font-size: 11.5px;
  line-height: 1.36;
  color: var(--ink-3);
}

/* Provenance Band */
.prov-band {
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.prov-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.prov-links a {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}
.prov-links a:hover {
  border-bottom-color: var(--ink-1);
}

/* ==========================================================================
   TIER 2 ARCHIVAL PLATE LIGHTBOX (<dialog>) — M33 SWISS STYLE
   ========================================================================== */
.plate-dialog {
  width: min(92vw, 1040px);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--rule-strong);
  background: var(--paper-fallback);
  color: var(--ink-1);
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0, 18, 25, 0.24);
}
.plate-dialog::backdrop {
  background: rgba(0, 18, 25, 0.54);
  backdrop-filter: blur(2px);
}
.dialog-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper-fallback);
  z-index: 2;
}
.dialog-kind {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.dialog-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-1);
}
.dialog-nav {
  display: inline-flex;
  gap: 12px;
  align-items: baseline;
}
.dialog-nav form { margin: 0; }
.dialog-ctrl {
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
}
.dialog-ctrl:hover {
  color: var(--ink-1);
  border-bottom-color: var(--ink-1);
}
.dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 24px;
  padding: 20px;
  align-items: start;
}
.dialog-figure { margin: 0; }
.dialog-mount {
  background: #14191f;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialog-mount img {
  display: block;
  max-width: 100%;
  max-height: 66vh;
  width: auto;
  height: auto;
}
.dialog-figure figcaption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}
.dialog-subhead {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--ink-4);
}
.dialog-dl {
  margin: 0 0 14px;
  border-top: 1px solid var(--ink-1);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  padding-top: 8px;
  font-size: 12px;
}
.dialog-dl dt { color: var(--ink-4); font-family: var(--font-mono); font-size: 10.5px; }
.dialog-dl dd { margin: 0; color: var(--ink-1); text-align: right; font-family: var(--font-mono); font-size: 11px; }
.dialog-provenance {
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin-bottom: 12px;
}
.opus-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ==========================================================================
   RESPONSIVE COLLAPSE (< 960px — Mobile Trail Bar + Single Active Pane)
   ========================================================================== */
@media (max-width: 960px) {
  body {
    overflow: auto;
    height: auto;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 35;
    background: var(--paper-fallback);
    border-bottom: 1px solid var(--rule);
    padding: 8px 14px;
    overflow-x: auto;
    white-space: nowrap;
  }
  .mobile-index-toggle {
    background: none;
    border: 0;
    border-right: 1px solid var(--rule);
    padding: 2px 10px 2px 0;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
  }
  .mobile-crumb {
    background: none;
    border: 0;
    padding: 2px 4px;
    font-size: 11.5px;
    color: var(--ink-4);
    cursor: pointer;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-crumb.active {
    color: var(--ink-1);
    border-bottom: 1.5px solid var(--accent);
  }

  .pane-stage,
  .pane-stage.is-single-pane {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
  }
  .pane-stage-spacer { display: none !important; }

  .rail {
    position: fixed;
    inset: 38px 0 0 0;
    width: 100vw;
    height: calc(100vh - 38px);
    background: var(--paper-fallback);
    border-right: 0;
    z-index: 32;
    transform: translateX(-100%);
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .pane-stage.is-mobile-rail-open .rail {
    transform: translateX(0);
  }
  .rail-inner {
    grid-template-rows: auto auto 1fr;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .rail-brief { display: none; }
  .rail-mid { padding: 10px 16px 10px; }
  .rail-top { padding: 10px 16px 0; }
  .rail-bottom { padding: 0 16px; }
  .rail-index { padding: 0 0 12px; }
  .rail-table-bar { padding: 10px 0 14px; }

  .table-modal {
    left: 12px;
    right: 12px;
    bottom: 50px;
    width: auto;
    max-height: 70vh;
  }
  .tm-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tm-col-div {
    border-left: 0;
    border-top: 1px solid var(--sticky-rule);
    padding-left: 0;
    padding-top: 12px;
  }
  .tm-order-row {
    border-right: 0;
    padding-right: 0;
  }

  .pane,
  .pane-stage.is-single-pane .pane {
    position: static;
    width: 100%;
    height: auto;
    border-left: 0;
    box-shadow: none !important;
    display: none;
  }
  .pane.is-mobile-active {
    display: flex;
  }
  .pane-spine { display: none !important; }
  .pane-scroll,
  .pane-stage.is-single-pane .pane-scroll {
    height: auto;
    overflow: visible;
    padding: 14px 16px 64px;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .subgrid-6 { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4, .span-6 { grid-column: span 1; }
  .dialog-body { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pane-stage { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  html, body {
    background: #FFFFFF !important;
    overflow: visible !important;
    height: auto !important;
  }
  #paper-canvas, #paper-glaze, .mobile-bar, .rail, .table-modal, .pane-spine, .pane-bar-actions {
    display: none !important;
  }
  .brand-lockup { mix-blend-mode: normal !important; }
  .pane-stage {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  .pane, .pane-stage.is-single-pane .pane {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    border: 0 !important;
    box-shadow: none !important;
    page-break-after: always;
  }
  .pane-scroll {
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
  }
}
