/* ================= MODE 2: EXTRACTED WEB STREAM & REORG ================= */
.stream-header-bar {
  flex: 0 0 auto;
  padding: 6px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reorg-segmented {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
}
.reorg-btn {
  padding: 5px 15px;
  border-right: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
  line-height: 1.25;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.reorg-btn:last-child { border-right: 0; }
.reorg-btn:hover { background: #f3f6f4; color: var(--ink); }
.reorg-btn.active { background: var(--mast); color: #fff; }

.stream-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stream-box-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-weight: 600;
  border-color: #bfc9c4;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.stream-box-toggle[aria-pressed="true"] {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.stream-box-toggle[aria-pressed="true"]:hover {
  background: #1a544d;
  color: #fff;
  border-color: #1a544d;
}
.mini-info-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #b5c0ba;
  background: var(--card);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.mini-info-btn:hover {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}
.stream-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}
.stream-layout.is-typo-compact {
  grid-template-columns: 168px minmax(0, 1fr);
}
.stream-layout.hide-toc {
  grid-template-columns: minmax(0, 1fr);
}
.stream-layout.hide-toc > .stream-toc {
  display: none;
}
@media (max-width: 1220px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) 315px; }
  .stream-layout { grid-template-columns: 208px minmax(0, 1fr); }
  .stream-layout.is-typo-compact { grid-template-columns: 148px minmax(0, 1fr); }
  .stream-layout.hide-toc { grid-template-columns: minmax(0, 1fr); }
  .pilot-tag { display: none; }
  .brand-sub { display: none; }
}
.stream-toc {
  border-right: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.toc-head {
  padding: 5px 9px;
  gap: 6px;
}
.toc-gran-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--card);
}
.toc-gran-btn {
  padding: 1.5px 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  border-right: 1px solid var(--line);
  transition: background 0.12s, color 0.12s;
}
.toc-gran-btn:last-child { border-right: 0; }
.toc-gran-btn:hover { color: var(--ink); background: #f2f4f0; }
.toc-gran-btn.active { background: var(--teal); color: #fff; }

.toc-list {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 6px 6px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-item {
  width: 100%;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 12px;
  text-align: left;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.toc-item:hover { background: var(--teal-soft); color: var(--teal); }
.toc-item.lvl2 { padding-left: 16px; font-size: 11.5px; color: var(--muted); }
.toc-count { font-family: var(--mono); font-size: 10px; color: var(--muted); flex-shrink: 0; }

/* Hierarchical Fine-Grained TOC Nodes + Figure(Circle) / Table(Square) Glyphs */
.toc-node { display: flex; flex-direction: column; }
.toc-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3.5px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.3;
  transition: background 0.11s, color 0.11s;
}
.toc-row:hover { background: var(--teal-soft); color: var(--teal); }
.toc-row.depth-1 { font-weight: 700; color: var(--mast); margin-top: 3px; }
.toc-row.depth-1:first-child { margin-top: 0; }
.toc-row.depth-2 { padding-left: 14px; font-weight: 600; font-size: 11.5px; color: var(--ink); }
.toc-row.depth-3 { padding-left: 24px; font-size: 11.5px; color: var(--ink-soft); }
.toc-row.depth-4 { padding-left: 35px; font-size: 11px; color: var(--muted); }
.toc-row.depth-5 { padding-left: 46px; font-size: 10.5px; color: var(--muted); }
.toc-chevron {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--muted);
  border-radius: 3px;
  padding: 0;
}
.toc-chevron:hover { background: rgba(35, 107, 99, 0.14); color: var(--teal); }
.toc-chevron-spacer { width: 13px; flex: 0 0 13px; }
.toc-label-btn {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 0;
  color: inherit;
  font-weight: inherit;
}
.toc-label-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-meta-qty {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}
.toc-media-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3.5px;
  padding: 1px 6px 4px;
}
.toc-media-strip.depth-1 { padding-left: 21px; }
.toc-media-strip.depth-2 { padding-left: 30px; }
.toc-media-strip.depth-3 { padding-left: 40px; }
.toc-media-strip.depth-4 { padding-left: 51px; }
.toc-media-strip.depth-5 { padding-left: 62px; }

.toc-glyph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 3px;
  transition: background 0.1s, transform 0.1s;
}
.toc-glyph-btn:hover {
  background: rgba(35, 107, 99, 0.14);
  transform: scale(1.22);
}
.toc-glyph {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
}
.toc-glyph-fig {
  border-radius: 50%;
  background: var(--glyph-fig-photo);
  box-shadow: none;
}
.toc-glyph-fig.is-photo {
  background: var(--glyph-fig-photo);
}
.toc-glyph-fig.is-line {
  background: var(--glyph-fig-line);
  border: 1px solid var(--glyph-fig-line-border);
}
.toc-glyph-tbl {
  border-radius: 1px;
  background: var(--glyph-tbl);
  box-shadow: none;
}
.toc-media-legend {
  flex: 0 0 auto;
  border-top: 1px solid var(--fine);
  background: #f5f4ee;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
}
.toc-media-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== Fluid Editorial Web-Stream (Default: zero boxes, floating scaled images) ===== */
.stream-content {
  overflow-y: auto;
  padding: 28px 36px 64px;
  background: #fdfcf9;
}
.stream-inner {
  max-width: 800px;
  margin: 0 auto;
}
.stream-inner::after {
  content: "";
  display: block;
  clear: both;
}

/* Title & Editorial Frontmatter */
.stream-article-title {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 8px;
  color: var(--mast);
  letter-spacing: 0.4px;
}
.stream-front-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.stream-abstract {
  margin: 14px 0 22px;
  padding: 12px 0 12px 14px;
  border-left: 2px solid var(--brass);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  clear: both;
}

/* Default Fluid Blocks: NO card frames, NO noisy meta bars */
.stream-block {
  margin: 0 0 0.85em;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  position: relative;
  transition: background 0.16s, border-color 0.16s;
}
.stream-block.highlighted {
  background: rgba(35, 107, 99, 0.08);
  box-shadow: -4px 0 0 var(--teal);
  padding: 4px 8px;
  border-radius: 3px;
}
.stream-block-meta {
  display: none;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--muted);
}
.stream-prose {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.92;
  color: #1d2825;
  text-align: justify;
  text-indent: 2em;
  letter-spacing: 0.015em;
}
.stream-prose.no-indent { text-indent: 0; }
.stream-heading {
  clear: both;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--mast);
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--brass);
  margin: 28px 0 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.stream-heading.lvl3 {
  font-size: 16px;
  border-bottom: 1px dashed var(--line);
  margin: 20px 0 10px;
}
.stream-heading-page {
  display: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.stream-footnote {
  clear: both;
  margin: 0 0 6px;
  padding: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.stream-editorial {
  clear: both;
  margin: 14px 0 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.stream-table-wrap {
  clear: both;
  margin: 22px 0;
}

/* Borderless Editorial Figures with Floating & Scaled Flow */
.stream-figure {
  margin: 18px auto 22px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: center;
}
.stream-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  cursor: zoom-in;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.stream-figure img:hover { opacity: 0.94; }

/* Interactive Inline Figure Stage (Mode 02 Original Stream — full parity with Mode 01 PDF) */
.stream-fig-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  vertical-align: top;
}
.stream-fig-stage.stream-fig2-stage {
  display: block;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}
.stream-fig2-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.stream-fig2-svg [tabindex],
.stream-fig2-svg [tabindex]:focus,
.stream-fig2-svg [tabindex]:active,
.stream-fig-overlay-svg [tabindex],
.stream-fig-overlay-svg [tabindex]:focus,
.stream-fig-overlay-svg [tabindex]:active {
  outline: none !important;
}
.stream-fig2-zone {
  cursor: pointer;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  outline: none !important;
  transition: fill-opacity 0.14s ease, stroke 0.14s ease, stroke-width 0.14s ease;
}
.stream-fig2-zone:hover {
  fill: var(--accent);
  fill-opacity: 0.11;
  stroke: var(--accent);
  stroke-width: 1.35px;
}
.stream-fig2-zone.selected {
  fill: var(--accent);
  fill-opacity: 0.13;
  stroke: var(--accent);
  stroke-width: 1.55px;
  filter: drop-shadow(0 0 2px rgba(35, 100, 92, 0.20));
}
.stream-fig2-pin {
  cursor: pointer;
  transition: opacity 0.14s ease;
}
.stream-fig2-pin.dimmed {
  opacity: 0.16;
}
.stream-fig-stage .stream-fig-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  cursor: default;
}
.stream-fig-stage .stream-fig-img:hover {
  opacity: 1;
}
.stream-fig-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 2;
}
/* Gentle hover reveal on Mode 02 inline plates matching Mode 01 .pdf-page-frame:hover */
.stream-fig-stage:hover .plate-hotspot-group.is-line:not(.is-hovered):not(.is-selected):not(:hover) .plate-hotspot-poly {
  stroke-opacity: 0.16;
  fill-opacity: 0.012;
}
.stream-fig-stage:hover .plate-hotspot-group.is-photo:not(.is-hovered):not(.is-selected):not(:hover) .plate-hotspot-poly {
  stroke-opacity: 0.22;
}
.stream-fig-stage:hover .plate-scale-highlight.is-interactive .plate-scale-box {
  stroke-opacity: 0.48;
  fill: rgba(35, 100, 92, 0.035);
}
.stream-fig-zoom-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(35, 100, 92, 0.30);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(4px);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.stream-fig-stage:hover .stream-fig-zoom-btn,
.stream-fig-zoom-btn:focus-visible {
  opacity: 1;
}
.stream-fig-zoom-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
body.pure-reading .stream-fig-overlay-svg,
body.pure-reading .stream-fig-zoom-btn {
  display: none !important;
}
.stream-figure figcaption {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}
.stream-figure figcaption strong {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink-soft);
}
.stream-figure .fig-legend {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: left;
  line-height: 1.55;
}

/* Floating Figures Inside Text Flow (Active in default fluid mode!) */
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-right {
  float: right;
  width: 268px;
  margin: 4px 0 14px 24px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-left {
  float: left;
  width: 268px;
  margin: 4px 24px 14px 0;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-portrait {
  width: 205px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-section {
  float: right;
  width: 430px;
  margin: 4px 0 16px 24px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-right figcaption,
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-left figcaption,
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-section figcaption {
  text-align: left;
  font-size: 11.5px;
  padding-top: 2px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-right img,
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-left img {
  max-height: 270px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-section img {
  max-height: 235px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-wide {
  clear: both;
  max-width: 680px;
  margin: 34px auto 26px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-wide.fig-plan {
  max-width: 780px;
}
.stream-content:not(.show-pdf-boxes) .stream-figure.fig-wide img {
  max-height: 490px;
}

/* Paired Consecutive Compact Figures (Borderless Side-by-Side) */
.stream-fig-pair {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: end;
  margin: 18px auto 22px;
  max-width: 780px;
}
.stream-fig-pair .stream-figure {
  margin: 0;
  float: none !important;
  width: auto !important;
}
.stream-fig-pair .stream-figure img {
  max-height: 290px;
}
@media (max-width: 900px) {
  .stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-right,
  .stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-left,
  .stream-content:not(.show-pdf-boxes) .stream-figure.fig-float-section {
    float: none;
    width: auto;
    max-width: 340px;
    margin: 14px auto;
  }
  .stream-fig-pair { grid-template-columns: 1fr; }
}

/* ===== Opt-In PDF Block Box Correspondence Mode (.show-pdf-boxes) ===== */
.pdf-boxes-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 12px;
  color: var(--mast);
}
.stream-content.show-pdf-boxes {
  background: #f2f3ed;
  padding: 20px 28px 56px;
}
.stream-content.show-pdf-boxes .pdf-boxes-banner {
  display: flex;
}
.stream-content.show-pdf-boxes .stream-inner {
  max-width: 880px;
}
.stream-content.show-pdf-boxes .stream-block,
.stream-content.show-pdf-boxes .stream-abstract,
.stream-content.show-pdf-boxes .stream-footnote,
.stream-content.show-pdf-boxes .stream-editorial,
.stream-content.show-pdf-boxes .stream-table-wrap {
  clear: both;
  margin: 0 0 11px;
  padding: 10px 14px;
  background: #fff;
  border: 1px dashed #b9c5bf;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.stream-content.show-pdf-boxes .stream-block.is-repaired,
.stream-content.show-pdf-boxes .stream-figure.is-repaired {
  border-color: #c3afd8;
  border-left: 3px solid var(--repair);
  background: #fdfbff;
}
.stream-content.show-pdf-boxes .stream-block:hover,
.stream-content.show-pdf-boxes .stream-figure:hover {
  border-style: solid;
  border-color: var(--teal);
}
.stream-content.show-pdf-boxes .stream-block-meta {
  display: flex;
  flex-wrap: wrap;
}
.stream-content.show-pdf-boxes .stream-heading {
  background: #fff;
  padding: 8px 14px;
  border: 1px dashed #b9c5bf;
  border-left: 3px solid var(--ink-soft);
  border-radius: 6px;
  margin: 18px 0 10px;
}
.stream-content.show-pdf-boxes .stream-heading-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stream-content.show-pdf-boxes .stream-figure {
  clear: both;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px dashed #b9c5bf;
  border-left: 3px solid #596864;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.stream-content.show-pdf-boxes .stream-figure img {
  max-height: 400px;
}
.stream-content.show-pdf-boxes .stream-figure figcaption {
  text-align: left;
}
.stream-content.show-pdf-boxes .stream-prose {
  text-indent: 0;
  font-size: 14.5px;
  line-height: 1.8;
}

/* Inline Semantic Entity Chips (Restrained, Low-Saturation, Redundant Line-Style + Typography) */
.sem-chip {
  display: inline;
  padding: 0 2.5px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.sem-tomb {
  background: rgba(35, 100, 92, 0.09);
  border-bottom: 1.5px solid #235952;
  color: #183d38;
  font-weight: 600;
}
.sem-tomb:hover { background: var(--accent); color: #fff; }
.sem-artifact {
  background: rgba(38, 48, 45, 0.065);
  border-bottom: 1.5px solid #636e6b;
  color: #222c2a;
  font-family: var(--mono);
  font-size: 0.86em;
  white-space: nowrap;
}
.sem-artifact:hover, .sem-artifact.selected { background: var(--ink); color: #fff; }
.sem-artifact.has-conflict { background: var(--conflict-bg); border-bottom: 2px wavy var(--conflict); color: var(--conflict); }
.sem-artifact.has-conflict:hover { background: var(--conflict); color: #fff; }
.sem-artifact.has-review { background: var(--review-bg); border-bottom: 1.5px dotted var(--review); color: var(--review); }
.sem-artifact.has-review:hover { background: var(--review); color: #fff; }
.sem-zone {
  background: rgba(35, 100, 92, 0.07);
  border-bottom: 1.5px solid #2b6a61;
  color: #1a4741;
}
.sem-zone:hover, .sem-zone.selected { background: var(--accent); color: #fff; }
.sem-typology {
  background: rgba(138, 109, 59, 0.06);
  border-bottom: 1.5px dashed #8a6d3b;
  color: #473921;
}
.sem-typology:hover { background: #735a30; color: #fff; }
.sem-ref {
  background: rgba(74, 100, 124, 0.065);
  border-bottom: 1.5px dotted #4a647c;
  color: #2b4156;
}
.sem-ref:hover { background: #4a647c; color: #fff; }

/* Interactive Table 1 in Web-Stream */
.table-scroll-wrap { width: 100%; overflow-x: auto; }
.scholar-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  margin: 10px 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.scholar-table th, .scholar-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  vertical-align: top;
  text-align: left;
}
.scholar-table th { background: #eef1ec; font-weight: 700; color: var(--ink); }
.scholar-table tr.highlighted td { background: #eef7f5; }
.tbl-entry-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin: 2px 4px 2px 0;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--fine);
  background: var(--paper);
  font-size: 11.5px;
  max-width: 100%;
}
.tbl-entry-pill.conflict-pill { border-color: var(--conflict); background: var(--conflict-bg); }
.tbl-entry-pill.review-pill { border-color: var(--review-border); background: var(--review-bg); }
.tbl-loc-conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 1.5px 6px;
  border-radius: 4px;
  border: 1px solid #ebb7b6;
  background: var(--conflict-bg);
  color: var(--conflict);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.tbl-loc-conflict-badge:hover {
  background: var(--conflict);
  color: #fff;
  border-color: var(--conflict);
}
.reorg-group-issue-note {
  margin: 0 0 9px;
  padding: 6px 10px;
  background: var(--conflict-bg);
  border: 1px solid #ebb7b6;
  border-left: 3px solid var(--conflict);
  border-radius: 4px;
  font-size: 11.5px;
  color: #7c181a;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Reorganized Cards (Spatial & Typological Views) */
.reorg-section-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.reorg-card-head {
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reorg-card-title { display: flex; align-items: center; gap: 10px; }
.reorg-card-title h3 { margin: 0; font-family: var(--serif); font-size: 16.5px; }
.phase-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 99px;
}
.reorg-card-body { padding: 14px 16px; }
.reorg-two-col {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 14px;
  margin-bottom: 12px;
}
@media (max-width: 1100px) { .reorg-two-col { grid-template-columns: 1fr; } }

.func-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--fine);
  margin: 8px 0 4px;
}
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.artifact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  gap: 9px;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.12s, box-shadow 0.14s;
}
.artifact-card:hover { border-color: var(--teal); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.artifact-card.selected { border-color: var(--teal); background: #eef7f5; box-shadow: 0 0 0 2px rgba(35, 107, 99, 0.2); }
.artifact-card.has-conflict { border-color: var(--conflict); background: #fff9f8; }
.art-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: contain;
  border: 1px solid var(--fine);
  border-radius: 4px;
  background: #fff;
  padding: 2px;
}
.art-thumb-empty {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--paper);
}
.art-card-info { min-width: 0; flex: 1; }
.art-card-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.art-id { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink); }
.art-name { font-weight: 600; font-size: 12.5px; color: var(--ink); margin: 2px 0; }
.art-meta { font-size: 11px; color: var(--muted); line-height: 1.4; }
.tag-mini {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--fine);
  color: var(--ink-soft);
  margin-right: 3px;
  margin-top: 3px;
}
.tag-mini.warn { background: var(--conflict-bg); color: var(--conflict); font-weight: 600; }
.tag-mini.review { background: var(--review-bg); color: var(--review); font-weight: 600; border: 1px solid var(--review-border); }
.tag-mini.info { background: var(--note-bg); color: var(--muted); font-weight: 500; border: 1px solid var(--note-border); }

/* ================= COMPACT REORG TOOLBAR & WIDE CANVAS ================= */
.reorg-density-switch {
  display: inline-flex;
  border: 1px solid #bfc9c4;
  border-radius: 5px;
  overflow: hidden;
  background: var(--card);
}
.reorg-density-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  border-right: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s, color 0.12s;
}
.reorg-density-btn:last-child { border-right: 0; }
.reorg-density-btn:hover { background: #f2f5f3; color: var(--ink); }
.reorg-density-btn.active { background: var(--accent); color: #fff; }
.inline-kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1;
  padding: 1.5px 4px;
  border-radius: 3px;
  border: 1px solid currentColor;
  opacity: 0.72;
  color: inherit;
}

.stream-content.is-reorg-wide {
  padding: 8px 12px 28px;
  background: #f8f8f4;
}
.stream-content.is-typo-compact {
  padding: 6px 10px 18px;
  background: #fafaf6;
}
.reorg-wide-inner {
  max-width: 1380px;
}
.typo-d3-outer {
  max-width: 1520px;
}

.reorg-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
}
.reorg-top-bar.is-slim {
  padding: 3.5px 8px;
  margin-bottom: 5px;
}
.reorg-top-bar.is-spatial {
  border-left: 3px solid var(--accent);
}
.reorg-top-bar.is-typo {
  border-left: 3px solid var(--brass);
}
.reorg-top-bar.is-unified-typo {
  justify-content: flex-start;
  gap: 12px;
  padding: 4px 10px;
}
.reorg-count-stat {
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}
.reorg-count-stat strong {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mast);
}
.typo-inline-legend {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
}
.reorg-top-main {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  min-width: 0;
}
.reorg-top-main strong {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--mast);
}
.reorg-top-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.reorg-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2.5px 8px;
  border-radius: 4px;
  border: 1px solid #c3cbc7;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.reorg-inline-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.reorg-inline-toggle.is-open {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.reorg-inline-toggle.is-open:hover {
  background: #1a5049;
  color: #fff;
}

.toc-layout-ico {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}
.toc-item.is-expanded-toc {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ================= SHARED EVIDENCE-RICHNESS GLYPHS & COMPACT ARTIFACT TOKENS ================= */
.typo-evidence-legend,
.spatial-dock-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.typo-evidence-legend {
  padding: 3px 8px;
  margin-bottom: 6px;
  background: #f5f6f2;
  border: 1px solid var(--fine);
  border-radius: 3px;
}
.typo-evidence-legend.is-d3-legend {
  gap: 8px;
  font-size: 10.5px;
}
.ev-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ev-leg-thumb-svg {
  display: block;
  flex-shrink: 0;
}
.ev-leg-sep {
  width: 1px;
  height: 11px;
  background: var(--line);
}
.ev-leg-ring {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.ev-leg-ring.is-conflict { border: 1.8px solid var(--conflict); background: var(--conflict-bg); }
.ev-leg-ring.is-review { border: 1.6px dashed var(--review); background: var(--review-bg); }
.ev-leg-item.is-conflict-lbl { color: var(--conflict); font-weight: 600; }
.ev-leg-item.is-review-lbl { color: var(--review); font-weight: 600; }

/* Desaturated Teal-Slate / Archival Lightness Ramp for Unillustrated Artifacts */
.art-glyph-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
}
.art-glyph-dot.is-rich {
  background: #4e736e;
  border: 1px solid #34524e;
}
.art-glyph-dot.is-brief {
  background: #8faaa5;
  border: 1px solid #67837e;
}
.art-glyph-dot.is-undescribed {
  background: #edf1ee;
  border: 1px solid #b8c4bf;
}
.art-glyph-dot.is-minimal {
  background: #fcfcf9;
  border: 1.3px dashed #9faea8;
}

.compact-token-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 5px;
}
.compact-token-flow.is-flat-strip {
  padding: 2px 0;
}
.compact-token-flow.is-spatial-mini {
  align-items: center;
  gap: 4px;
}

.compact-art-token {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  border-radius: 4px;
  position: relative;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.compact-art-token:hover {
  transform: translateY(-1px);
  z-index: 2;
}

/* Medium size: Typological Compact View (thumbs + labeled circular glyphs) */
.compact-art-token.sz-md.is-img {
  width: 50px;
}
.compact-art-token.sz-md .compact-thumb-box {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  border: 1px solid #dce1dc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.compact-art-token.sz-md .compact-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.compact-art-token.sz-md:hover .compact-thumb-box {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(35, 100, 92, 0.16);
}
.compact-art-token.sz-md.is-selected .compact-thumb-box {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(35, 100, 92, 0.28);
  background: #f2f8f7;
}
.compact-art-token.sz-md.has-conflict .compact-thumb-box {
  border-color: var(--conflict);
  background: #fff9f8;
  box-shadow: 0 0 0 1px rgba(192, 41, 43, 0.25);
}
.compact-art-token.sz-md.has-review .compact-thumb-box {
  border: 1.5px dashed var(--review);
  background: #fffdf7;
}

.compact-photo-dot {
  position: absolute;
  top: 2.5px;
  right: 2.5px;
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: var(--glyph-fig-photo);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}
.compact-qty-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  padding: 1.5px 3px;
  border-radius: 2.5px;
  background: rgba(30, 45, 43, 0.84);
  color: #fff;
}

.compact-art-token.sz-md.is-glyph {
  min-width: 24px;
  padding: 0 1px;
}
.compact-art-token.sz-md .compact-glyph-box {
  width: 22px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compact-art-token.sz-md .art-glyph-dot {
  width: 15px;
  height: 15px;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.compact-art-token.sz-md.is-glyph:hover .art-glyph-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(35, 100, 92, 0.22);
  transform: scale(1.12);
}
.compact-art-token.sz-md.is-glyph.is-selected .art-glyph-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(35, 100, 92, 0.36);
}
.compact-art-token.sz-md.is-glyph.has-conflict .art-glyph-dot {
  border-color: var(--conflict);
  box-shadow: 0 0 0 2px rgba(192, 41, 43, 0.28);
}
.compact-art-token.sz-md.is-glyph.has-review .art-glyph-dot {
  border: 1.6px dashed var(--review);
  box-shadow: 0 0 0 2px rgba(156, 99, 17, 0.22);
}

.compact-art-lbl {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.1;
  color: var(--muted);
  white-space: nowrap;
}
.compact-art-token.has-conflict .compact-art-lbl { color: var(--conflict); font-weight: 700; }
.compact-art-token.has-review .compact-art-lbl { color: var(--review); font-weight: 700; }
.compact-art-token.is-selected .compact-art-lbl { color: var(--accent); font-weight: 700; }

/* Small size: Spatial Single-Figure Atlas Miniature Dock */
.compact-art-token.sz-sm.is-img .compact-thumb-box {
  width: 40px;
  height: 40px;
  border-radius: 3.5px;
  border: 1px solid #dde2dd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  position: relative;
  overflow: hidden;
}
.compact-art-token.sz-sm .compact-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.compact-art-token.sz-sm:hover {
  transform: scale(1.08);
}
.compact-art-token.sz-sm:hover .compact-thumb-box {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(35, 100, 92, 0.22);
}
.compact-art-token.sz-sm.is-selected .compact-thumb-box {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(35, 100, 92, 0.35);
}
.compact-art-token.sz-sm.has-conflict .compact-thumb-box {
  border: 1.5px solid var(--conflict);
  background: #fff7f6;
}
.compact-art-token.sz-sm.has-review .compact-thumb-box {
  border: 1.4px dashed var(--review);
  background: #fffcf4;
}
.compact-art-token.sz-sm .compact-qty-badge {
  font-size: 8px;
  padding: 1px 2.5px;
  top: 1.5px;
  left: 1.5px;
}

.compact-art-token.sz-sm.is-glyph {
  width: 18px;
  height: 20px;
  justify-content: center;
}
.compact-art-token.sz-sm .compact-glyph-box {
  width: 18px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compact-art-token.sz-sm .art-glyph-dot {
  width: 14px;
  height: 14px;
}
.compact-art-token.sz-sm.is-glyph:hover .art-glyph-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(35, 100, 92, 0.25);
}
.compact-art-token.sz-sm.is-glyph.is-selected .art-glyph-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(35, 100, 92, 0.4);
}
.compact-art-token.sz-sm.is-glyph.has-conflict .art-glyph-dot {
  border-color: var(--conflict);
  box-shadow: 0 0 0 2px rgba(192, 41, 43, 0.32);
}
.compact-art-token.sz-sm.is-glyph.has-review .art-glyph-dot {
  border: 1.5px dashed var(--review);
  box-shadow: 0 0 0 1.5px rgba(156, 99, 17, 0.26);
}

/* ================= TYPOLOGICAL COMPACT BOTTOM-UP LAYOUT ================= */
.typo-mat-heading {
  margin: 16px 0 8px !important;
  font-size: 16.5px !important;
  padding-bottom: 4px !important;
  border-bottom-color: var(--brass) !important;
}
.typo-mat-heading:first-of-type { margin-top: 8px !important; }
.typo-mat-cnt {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}

.typo-material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
  align-items: start;
}
.typo-material-grid.is-all-expanded {
  grid-template-columns: 1fr;
}
@media (max-width: 1060px) {
  .typo-material-grid { grid-template-columns: 1fr; }
}

.typo-class-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.typo-class-card.span-full { grid-column: 1 / -1; }
.typo-class-card.is-expanded {
  border-color: var(--accent-border);
  box-shadow: 0 2px 10px rgba(35, 100, 92, 0.09);
}

.typo-card-head {
  padding: 6px 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--fine);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.typo-class-card.is-expanded .typo-card-head {
  padding: 9px 13px;
  background: #f1f6f5;
  border-bottom-color: var(--accent-border);
}
.typo-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.typo-card-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--mast);
}
.typo-cls-cnt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.typo-layout-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: #ecefe9;
  color: var(--ink-soft);
  border: 1px solid #d7dcd6;
  white-space: nowrap;
}
.typo-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.typo-phase-strip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 10px;
}
.typo-phase-dot {
  padding: 1px 4px;
  border-radius: 3px;
  background: #f0f2ee;
  color: #a6afa9;
}
.typo-phase-dot.is-hit {
  background: #394845;
  color: #fff;
}
.typo-phase-pill {
  padding: 2px 6px;
  border-radius: 4px;
  background: #eceee9;
  color: #9aa39f;
}
.typo-phase-pill.is-hit {
  background: #344340;
  color: #fff;
}
.typo-centroid {
  color: var(--muted);
  margin-left: 2px;
}

.typo-card-body {
  padding: 8px 10px;
}
.typo-class-card.is-expanded .typo-card-body {
  padding: 10px 12px;
  background: var(--paper);
}

/* ================= D3.JS HIGH-DENSITY TYPOLOGICAL SVG SHEET ================= */
.typo-d3-sheet-root {
  width: 100%;
  min-height: 80px;
}
.typo-empty-state {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: #fff;
}
.typo-d3-mat-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 10px;
  row-gap: 8px;
}
.typo-d3-mat-band {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.typo-d3-mat-band.is-full-band {
  flex: 1 1 100%;
  width: 100%;
}
.typo-d3-mat-band.is-inline-band {
  max-width: 100%;
}
.typo-d3-mat-head {
  margin: 0;
  padding: 0 2px 2.5px;
  border-bottom: 1.25px solid var(--brass);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.2;
}
.typo-d3-mat-name {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--mast);
  letter-spacing: 0.3px;
}
.typo-d3-mat-stat {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.typo-d3-svg-slot {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.typo-d3-svg {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
}
.typo-d3-inline-expanded {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

/* Editorial SVG Typography & Micro-Interactions */
.typo-d3-panel-title {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--mast);
}
.typo-d3-panel-cnt {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  fill: var(--muted);
}
.typo-d3-layout-glyph {
  font-family: var(--mono);
  font-size: 10px;
  fill: #84918c;
  cursor: help;
}
.typo-d3-sub-title {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  fill: var(--mast);
}
.typo-d3-sub-meta {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--muted);
}
.typo-d3-row-lbl {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--ink);
}
.typo-d3-row-cnt {
  font-family: var(--mono);
  font-size: 8.5px;
  fill: var(--muted);
}
.typo-d3-mat-corner {
  font-family: var(--mono);
  font-size: 8.5px;
  fill: var(--muted);
}
.typo-d3-mat-colhdr {
  font-family: var(--serif);
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--ink);
}
.typo-d3-empty-dot {
  font-family: var(--mono);
  font-size: 12px;
  fill: #c1c9c4;
}
.typo-d3-parallel-foot {
  font-family: var(--sans);
  font-size: 9.2px;
  fill: var(--muted);
}

.typo-d3-expand-btn {
  cursor: pointer;
}
.typo-d3-expand-btn:hover .typo-d3-expand-bg {
  fill: var(--accent-soft);
  stroke: var(--accent);
}
.typo-d3-expand-btn:hover path {
  stroke: var(--accent);
}

/* Specimen SVG Items (Thumbnails + Multi-row Circular Glyphs) */
.typo-d3-item {
  cursor: pointer;
}
.typo-d3-item.is-img .typo-d3-thumb-frame {
  transition: stroke 0.1s ease, stroke-width 0.1s ease, fill 0.1s ease;
}
.typo-d3-item.is-img:hover .typo-d3-thumb-frame,
.typo-d3-item.is-img.is-hovered .typo-d3-thumb-frame {
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: #f3f9f8;
}
.typo-d3-thumb-no {
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 600;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 2.3px;
  stroke-linejoin: round;
  pointer-events: none;
}
.typo-d3-item.is-img:hover .typo-d3-thumb-no {
  fill: var(--accent);
}

.typo-d3-item.is-dot .typo-d3-dot {
  transition: stroke 0.1s ease, stroke-width 0.1s ease, transform 0.1s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.typo-d3-item.is-dot:hover .typo-d3-dot,
.typo-d3-item.is-dot.is-hovered .typo-d3-dot {
  stroke: var(--accent);
  stroke-width: 1.6;
  transform: scale(1.18);
}

@keyframes typoTocFlash {
  0% { stroke: var(--accent); stroke-width: 2.4; }
  100% { stroke: #d8ded8; stroke-width: 0.75; }
}
.typo-d3-panel.is-toc-flash .typo-d3-panel-bg {
  animation: typoTocFlash 0.9s ease-out;
}

/* ================= SPATIAL SINGLE-FIGURE ATLAS & ON-DEMAND EXPAND ================= */
.spatial-atlas-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.atlas-ctrl-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-soft);
  cursor: pointer;
}
.atlas-ctrl-range {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-soft);
}
.atlas-ctrl-range input[type="range"] {
  width: 68px;
  accent-color: var(--accent);
}

.spatial-atlas-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(340px, 1fr);
  gap: 10px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 880px) {
  .spatial-atlas-shell { grid-template-columns: 1fr; }
}

.spatial-atlas-map-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  position: sticky;
  top: 6px;
}
.spatial-atlas-map-wrap {
  border: 1px solid var(--fine);
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spatial-atlas-svg {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 205px);
  min-height: 320px;
  display: block;
}
.atlas-zone-poly {
  cursor: pointer;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  outline: none !important;
  transition: fill-opacity 0.14s ease, stroke-width 0.14s ease, fill 0.14s ease, stroke 0.14s ease;
}
.atlas-zone-poly:hover,
.atlas-zone-poly.is-group-hover {
  fill: var(--accent) !important;
  fill-opacity: 0.17 !important;
  stroke: var(--accent) !important;
  stroke-width: 1.35px !important;
}
.atlas-zone-poly.is-selected-zone {
  fill: var(--accent) !important;
  fill-opacity: 0.16 !important;
  stroke: var(--accent) !important;
  stroke-width: 1.55px !important;
  filter: drop-shadow(0 0 2px rgba(35, 100, 92, 0.20));
}
.spatial-atlas-svg [tabindex],
.spatial-atlas-svg [tabindex]:focus,
.spatial-atlas-svg [tabindex]:active {
  outline: none !important;
}
.atlas-pin {
  cursor: pointer;
  transition: opacity 0.14s;
}
.atlas-pin.dimmed { opacity: 0.28; }
.atlas-pin.is-group-dim { opacity: 0.22; }

.spatial-atlas-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--paper);
  border: 1px solid var(--fine);
  font-size: 10.5px;
  color: var(--ink-soft);
}
.atlas-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  white-space: nowrap;
}
.group-shape-ico {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.spatial-atlas-dock {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.spatial-dock-legend {
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--paper);
  border: 1px solid var(--fine);
  font-size: 10.5px;
  gap: 7px;
}
.spatial-dock-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  border: 1px solid #dde2dc;
  border-radius: 6px;
  overflow: hidden;
  background: #fcfcf9;
}

.spatial-region-strip {
  border: 0;
  border-bottom: 1px solid #dde2dc;
  border-radius: 0;
  background: #fcfcf9;
  position: relative;
  transition: background 0.14s, box-shadow 0.14s;
}
.spatial-region-strip:first-child {
  border-radius: 5px 5px 0 0;
}
.spatial-region-strip:last-child {
  border-bottom: 0;
  border-radius: 0 0 5px 5px;
}
.spatial-region-strip:hover,
.spatial-region-strip.is-map-hover {
  background: #f4f9f8;
  box-shadow: inset 3px 0 0 var(--accent);
}
.spatial-region-strip.is-expanded {
  background: #f0f7f6;
  box-shadow: inset 3px 0 0 var(--accent);
}
.spatial-region-strip.is-empty {
  opacity: 0.56;
}
.spatial-strip-head {
  padding: 4.5px 8px;
  background: #fff;
  border-bottom: 1px solid #ecefe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  cursor: pointer;
}
.spatial-region-strip.is-expanded .spatial-strip-head {
  background: #e9f3f1;
  border-bottom-color: var(--accent-border);
}
.spatial-strip-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 11.5px;
}
.spatial-strip-title strong {
  color: var(--mast);
  white-space: nowrap;
}
.spatial-strip-zone {
  color: var(--ink-soft);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spatial-strip-phase {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}
.spatial-strip-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.spatial-strip-count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
}
.spatial-mini-fbar {
  display: inline-flex;
  width: 34px;
  height: 5.5px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--fine);
}
.spatial-mini-fbar span {
  display: block;
  height: 100%;
}
.spatial-hdr-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--conflict-bg);
  border: 1px solid #e6a9a8;
  color: var(--conflict);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.spatial-hdr-flag:hover { background: var(--conflict); color: #fff; }
.spatial-strip-body {
  padding: 6px 8px;
}
.spatial-strip-empty {
  font-size: 10.5px;
  color: var(--muted);
  padding: 2px 0;
}

.spatial-expanded-drawer {
  margin-top: 14px;
}
.spatial-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  font-size: 12px;
  color: var(--mast);
}
.spatial-detail-card {
  margin-bottom: 14px;
}


