/* ================= MODE 1: IN-SITU PDF OVERLAY (DUAL-RAIL TABLE LENS + CONTINUOUS SCROLL) ================= */
#view-pdf { flex-direction: row; }

/* Far-Left Column 1: Grayscale Chapter Band Overview + Figure/Table Marks */
.pdf-lens-rail {
  width: 26px;
  flex: 0 0 26px;
  border-right: 1px solid var(--line);
  background: #f1f2ee;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  user-select: none;
}
.pdf-lens-track {
  flex: 1 1 auto;
  min-height: 0;
  width: 18px;
  position: relative;
  margin: 5px 0 3px;
  cursor: ns-resize;
  overflow: hidden;
  border-radius: 3px;
  background: var(--chap-0);
  box-shadow: inset 0 0 0 1px rgba(30, 38, 36, 0.14);
}
.pdf-lens-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.lens-hit-slice {
  cursor: pointer;
}
.lens-hit-slice:hover {
  fill: rgba(255, 255, 255, 0.22);
}
.pdf-lens-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.lens-glyph {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  padding: 0;
  border: 0;
  transition: transform 0.1s, box-shadow 0.1s;
}
.lens-glyph-fig {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--glyph-fig-photo);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92);
}
.lens-glyph-fig.is-photo {
  background: var(--glyph-fig-photo);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.94);
}
.lens-glyph-fig.is-line {
  background: var(--glyph-fig-line);
  border: 1px solid var(--glyph-fig-line-border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.90);
}
.lens-glyph-tbl {
  width: 6.5px;
  height: 6.5px;
  border-radius: 1px;
  background: var(--glyph-tbl);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.94);
}
.lens-glyph:hover {
  transform: translate(-50%, -50%) scale(1.38);
  box-shadow: 0 0 0 1.5px var(--ink);
  z-index: 4;
}
.pdf-lens-viewport-box {
  position: absolute;
  left: -1px;
  right: -1px;
  top: 0;
  height: 8%;
  z-index: 3;
  border: 1.8px solid #1c2826;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.22);
  transition: top 0.06s linear, height 0.08s linear;
}
.pdf-lens-legend-btn {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 5px;
  padding: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-align: center;
}
.pdf-lens-legend-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Adjacent Column 2: Compact Thumbnail Rail & Unified Grayscale Figure/Table Glyphs */
.pdf-rail {
  width: 98px;
  flex: 0 0 98px;
  border-right: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pdf-page-list {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 3px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pdf-page-list::-webkit-scrollbar { width: 4px; }
.pdf-page-list::-webkit-scrollbar-thumb { background: #c5ccc7; border-radius: 99px; }
.pdf-page-list::-webkit-scrollbar-track { background: transparent; }
.page-rail-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.page-rail-item:hover {
  background: rgba(35, 100, 92, 0.06);
  border-color: #cbd7d3;
}
.page-rail-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.page-rail-thumb {
  width: 40px;
  height: 56px;
  flex: 0 0 40px;
  object-fit: cover;
  border: 1px solid #c9cfc7;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 35, 32, 0.08);
  display: block;
}
.page-rail-item.active .page-rail-thumb {
  border-color: var(--accent);
}
.page-rail-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.page-rail-num {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1;
}
.page-rail-item.active .page-rail-num { color: var(--accent); }
.page-rail-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  max-width: 36px;
  min-height: 8px;
}
.rail-glyph {
  display: inline-block;
  width: 6.5px;
  height: 6.5px;
  flex: 0 0 6.5px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.rail-glyph-fig {
  border-radius: 50%;
  background: var(--glyph-fig-photo);
}
.rail-glyph-fig.is-photo {
  background: var(--glyph-fig-photo);
}
.rail-glyph-fig.is-line {
  background: var(--glyph-fig-line);
  border: 1px solid var(--glyph-fig-line-border);
}
.rail-glyph-tbl {
  border-radius: 1px;
  background: var(--glyph-tbl);
}
.page-rail-item.active .rail-glyph-fig.is-photo {
  background: #1d2422;
}
.page-rail-item.active .rail-glyph-fig.is-line {
  background: #9aa5a0;
  border-color: #929d98;
}
.page-rail-item.active .rail-glyph-tbl {
  background: #2c3532;
}
.rail-glyph:hover {
  transform: scale(1.32);
  box-shadow: 0 0 0 1.2px var(--ink);
}
.inline-media-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  vertical-align: -1px;
  margin-right: 4px;
  flex: 0 0 auto;
}
.inline-media-dot.is-photo {
  border-radius: 50%;
  background: var(--glyph-fig-photo);
}
.inline-media-dot.is-line {
  border-radius: 50%;
  background: var(--glyph-fig-line);
  border: 1px solid var(--glyph-fig-line-border);
}
.inline-media-dot.is-tbl {
  border-radius: 1px;
  background: var(--glyph-tbl);
}

.pdf-canvas-col {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.pdf-toolbar {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  background: #f5f4ee;
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
  gap: 8px;
}
.pdf-toolbar .toolbar-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
}
.pdf-tb-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
  margin: 0 3px;
  flex: 0 0 1px;
}
.pdf-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
.pdf-tb-btn:hover:not(:disabled) {
  background: rgba(30, 38, 36, 0.065);
  color: var(--ink);
}
.pdf-tb-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pdf-tb-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}
.pdf-tb-page {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 0 6px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.pdf-tb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
.pdf-tb-toggle:hover {
  background: rgba(30, 38, 36, 0.065);
  color: var(--ink);
}
.pdf-tb-toggle input {
  margin: 0;
  accent-color: var(--accent);
}
.pdf-tb-toggle:has(input:checked),
.pdf-tb-toggle.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}
.pdf-tb-select {
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}
.pdf-tb-select:hover,
.pdf-tb-select:focus {
  background: rgba(30, 38, 36, 0.065);
  color: var(--ink);
  outline: none;
}
.pdf-stage-split {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.pdf-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  background: #dcdfd8;
  padding: 18px 16px 48px;
  scroll-behavior: auto;
}
.pdf-pages-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.pdf-page-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pdf-fig-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0.24;
  cursor: pointer;
  transition: stroke 0.14s, fill 0.14s;
}
.pdf-fig-hit:hover {
  fill: rgba(35, 100, 92, 0.05);
  stroke: rgba(35, 100, 92, 0.55);
  stroke-dasharray: 0.8 0.4;
}
.pdf-fig-hit.highlighted {
  fill: rgba(35, 100, 92, 0.08);
  stroke: var(--accent);
  stroke-width: 0.36;
  stroke-dasharray: none;
}
.insp-subfig-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid var(--fine);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.insp-subfig-row:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.insp-subfig-thumb {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  border: 1px solid var(--fine);
  border-radius: 3px;
  background: #fff;
  padding: 1px;
}
.pdf-page-frame {
  position: relative;
  display: block;
  background: #fff;
  box-shadow: 0 6px 20px rgba(20, 35, 32, 0.14);
  border: 1px solid #c2c8be;
  transition: box-shadow 0.15s;
}
.pdf-page-card.active-page .pdf-page-frame {
  border-color: #93b0aa;
  box-shadow: 0 8px 26px rgba(20, 45, 40, 0.18);
}
.pdf-page-frame img { display: block; width: 100%; height: 100%; user-select: none; }
.pdf-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pdf-block-rect {
  fill: rgba(75, 88, 84, 0.025);
  stroke: rgba(75, 88, 84, 0.30);
  stroke-width: 0.16;
  stroke-dasharray: 0.7 0.45;
  cursor: pointer;
  transition: fill 0.12s, stroke-width 0.12s;
}
.pdf-block-rect:hover, .pdf-block-rect.highlighted {
  fill: rgba(35, 100, 92, 0.12);
  stroke: var(--accent);
  stroke-width: 0.34;
  stroke-dasharray: none;
}
.pdf-block-rect.repaired { stroke: var(--repair); fill: rgba(107, 76, 138, 0.06); }
.pdf-block-rect.has-layer-controls {
  stroke: rgba(35, 100, 92, 0.58);
  stroke-width: 0.24;
  fill: rgba(35, 100, 92, 0.03);
}
.pdf-block-rect.has-layer-controls:hover,
.pdf-block-rect.has-layer-controls.ctx-active {
  stroke: var(--accent);
  stroke-width: 0.36;
  stroke-dasharray: none;
  fill: rgba(35, 100, 92, 0.06);
}
.pdf-ctx-trigger {
  cursor: pointer;
}
.pdf-ctx-trigger-bg {
  fill: rgba(230, 240, 238, 0.92);
  stroke: rgba(35, 100, 92, 0.65);
  stroke-width: 0.18;
  transition: fill 0.12s ease, stroke 0.12s ease;
}
.pdf-ctx-trigger-label {
  font-family: var(--sans);
  font-size: 1.25px;
  font-weight: 700;
  fill: #1e2d2b;
  pointer-events: none;
  transition: fill 0.12s ease;
}
.pdf-ctx-trigger:hover .pdf-ctx-trigger-bg,
.pdf-ctx-trigger.ctx-active .pdf-ctx-trigger-bg {
  fill: var(--accent);
  stroke: var(--accent);
}
.pdf-ctx-trigger:hover .pdf-ctx-trigger-label,
.pdf-ctx-trigger.ctx-active .pdf-ctx-trigger-label {
  fill: #ffffff;
}

/* Contextual Floating Object-Bound Layer Controls Popover (Mode 1 PDF) */
.pdf-ctx-layer-pop {
  position: fixed;
  z-index: 1120;
  min-width: 156px;
  max-width: 210px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
  border: 1px solid var(--accent-border);
  border-top: 2.5px solid var(--accent);
  border-radius: 7px;
  box-shadow: 0 10px 28px rgba(20, 35, 32, 0.16);
  padding: 7px 9px 8px;
  font-size: 11.5px;
  color: var(--ink);
}
.ctx-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 5px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--fine);
}
.ctx-pop-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--mast);
  white-space: nowrap;
}
.ctx-pop-close {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  color: var(--muted);
  padding: 0;
}
.ctx-pop-close:hover {
  background: var(--fine);
  color: var(--ink);
}
.ctx-pop-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ctx-pop-chk {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--fine);
  background: var(--paper);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.ctx-pop-chk:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.ctx-pop-chk input {
  margin: 0;
  accent-color: var(--accent);
}
.ctx-pop-hint {
  margin-top: 5px;
  font-size: 9.5px;
  color: var(--muted);
  line-height: 1.35;
}
.pdf-table-row-rect {
  fill: rgba(68, 82, 78, 0.04);
  stroke: rgba(68, 82, 78, 0.45);
  stroke-width: 0.24;
  cursor: pointer;
  transition: fill 0.12s, stroke-width 0.12s;
}
.pdf-table-row-rect:hover, .pdf-table-row-rect.highlighted {
  fill: rgba(35, 100, 92, 0.14);
  stroke: var(--accent);
  stroke-width: 0.40;
}
.pdf-pin-group { cursor: pointer; transition: opacity 0.15s; }
.pdf-pin-group.dimmed { opacity: 0.12; }
.pdf-pin-ring { transition: r 0.12s, fill-opacity 0.12s, stroke-width 0.12s; }
.pdf-pin-group:hover .pdf-pin-ring {
  fill-opacity: 0.45 !important;
  stroke-width: 0.36 !important;
}

/* Mode 1 PDF Fig. 2 Spatial Zone Polygons (hairline non-scaling stroke — crisp at any zoom) */
.pdf-overlay-svg [tabindex],
.pdf-overlay-svg [tabindex]:focus,
.pdf-overlay-svg [tabindex]:active,
.pdf-overlay-svg .zone-poly,
.pdf-overlay-svg .zone-poly:focus {
  outline: none !important;
}
.pdf-overlay-svg .zone-poly {
  cursor: pointer;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-width: 0.95px;
  stroke-opacity: 0.56;
  transition: fill-opacity 0.14s ease, stroke 0.14s ease, stroke-width 0.14s ease, stroke-opacity 0.14s ease;
}
.pdf-overlay-svg .zone-poly:hover {
  fill: var(--accent);
  fill-opacity: 0.10;
  stroke: var(--accent);
  stroke-width: 1.3px;
  stroke-opacity: 0.84;
}
.pdf-overlay-svg .zone-poly.selected {
  fill: var(--accent);
  fill-opacity: 0.11;
  stroke: var(--accent);
  stroke-width: 1.5px;
  stroke-opacity: 0.92;
  filter: drop-shadow(0 0 2px rgba(35, 100, 92, 0.22));
}

/* Interactive Artifact Plate Contours & Tight BBoxes (Pages 5–14, always-on unless Pure Reading) */
.plate-hotspot-group {
  cursor: pointer;
}
.plate-hotspot-group.is-dimmed {
  opacity: 0.28;
}
.plate-hotspot-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.plate-hotspot-photo-hit,
.plate-hotspot-bbox-hit {
  fill: transparent;
  stroke: transparent;
}
.plate-hotspot-bbox {
  fill: none;
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.20;
  stroke-dasharray: 0.72 0.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, stroke-width 0.14s ease;
}
.plate-hotspot-halo {
  fill: none;
  stroke: #ffffff;
  stroke-width: 0.80;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-opacity: 0;
  pointer-events: none;
  transition: stroke-opacity 0.14s ease;
}
.plate-hotspot-poly {
  fill: var(--plate-color, var(--accent));
  fill-opacity: 0;
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.26;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-opacity: 0;
  pointer-events: none;
  transition: fill-opacity 0.14s ease, stroke-opacity 0.14s ease, stroke-width 0.14s ease;
}
.pdf-page-frame: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;
}
.pdf-page-frame:hover .plate-hotspot-group.is-photo:not(.is-hovered):not(.is-selected):not(:hover) .plate-hotspot-poly {
  stroke-opacity: 0.22;
}
.plate-hotspot-group.is-filtered-match .plate-hotspot-poly {
  stroke-opacity: 0.34;
  fill-opacity: 0.05;
}
.plate-hotspot-group.is-selected .plate-hotspot-bbox {
  opacity: 0.52;
  stroke-dasharray: none;
  stroke-width: 0.22;
}
.plate-hotspot-group.is-selected .plate-hotspot-halo {
  stroke-opacity: 0.82;
}
.plate-hotspot-group.is-selected .plate-hotspot-poly {
  fill-opacity: 0.17;
  stroke-opacity: 0.96;
  stroke-width: 0.44;
}
.plate-hotspot-group.is-hovered .plate-hotspot-bbox,
.plate-hotspot-group:hover .plate-hotspot-bbox {
  opacity: 0.46;
}
.plate-hotspot-group.is-hovered .plate-hotspot-halo,
.plate-hotspot-group:hover .plate-hotspot-halo {
  stroke-opacity: 0.86;
}
.plate-hotspot-group.is-photo.is-hovered .plate-hotspot-halo,
.plate-hotspot-group.is-photo:hover .plate-hotspot-halo {
  stroke-opacity: 0.92;
}
.plate-hotspot-group.is-hovered .plate-hotspot-poly,
.plate-hotspot-group:hover .plate-hotspot-poly {
  fill-opacity: 0.18;
  stroke-opacity: 1;
  stroke-width: 0.44;
}
.plate-hotspot-group.is-photo.is-hovered .plate-hotspot-poly,
.plate-hotspot-group.is-photo:hover .plate-hotspot-poly {
  fill-opacity: 0.14;
  stroke-opacity: 1;
  stroke-width: 0.44;
}
.plate-hotspot-group.is-selected.is-hovered .plate-hotspot-poly,
.plate-hotspot-group.is-selected:hover .plate-hotspot-poly {
  fill-opacity: 0.25;
  stroke-opacity: 1;
  stroke-width: 0.48;
}
.plate-hotspot-pill {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.13s ease;
  --tag-fill: #e3efed;
  --tag-stroke: #8db5ae;
  --tag-ink: #1c4c46;
}
.plate-hotspot-pill.status-normal {
  --tag-fill: #e3efed;
  --tag-stroke: #8db5ae;
  --tag-ink: #1c4c46;
}
.plate-hotspot-pill.status-conflict {
  --tag-fill: #fae8e8;
  --tag-stroke: #dfa0a1;
  --tag-ink: #8f1f21;
}
.plate-hotspot-pill.status-review {
  --tag-fill: #faf0dc;
  --tag-stroke: #d8b778;
  --tag-ink: #7a4f0f;
}
.plate-hotspot-pill.is-hovered,
.plate-hotspot-pill.is-selected {
  opacity: 1;
}
.plate-pill-bg {
  fill: var(--plate-color, var(--accent));
  fill-opacity: 0.96;
  stroke: #ffffff;
  stroke-width: 0.24;
}
.plate-pill-text {
  fill: #ffffff;
  font-family: var(--sans);
  font-size: 1.22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.plate-pill-text.is-mono-primary {
  font-family: var(--mono);
  font-size: 1.18px;
}
.plate-tag-halo {
  fill: none;
  stroke: rgba(255, 255, 255, 0.90);
  stroke-width: 0.42;
}
.plate-tag-bg {
  fill: var(--tag-fill, #e3efed);
  fill-opacity: 0.97;
  stroke: var(--tag-stroke, #8db5ae);
  stroke-width: 0.22;
}
.plate-tag-text {
  fill: var(--tag-ink, #1c4c46);
  font-family: var(--mono);
  font-size: 1.08px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Selected Line-Drawing Drawn Graduated Rulers (TOP & LEFT) & Interactive Clickable Scale Bars */
.plate-dims-layer {
  pointer-events: none;
}
.plate-dim-witness {
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.14;
  stroke-opacity: 0.56;
  stroke-dasharray: 0.45 0.32;
  stroke-linecap: round;
}
.plate-ruler-body {
  fill: rgba(252, 251, 248, 0.96);
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.17;
  stroke-opacity: 0.90;
}
.plate-ruler-seg {
  fill: var(--plate-color, var(--accent));
  fill-opacity: 0.85;
}
.plate-ruler-tick-minor {
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.13;
  stroke-opacity: 0.72;
  stroke-linecap: square;
}
.plate-ruler-tick-major {
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.19;
  stroke-opacity: 0.95;
  stroke-linecap: square;
}
.plate-ruler-tick-end {
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.24;
  stroke-opacity: 1;
  stroke-linecap: square;
}
.plate-ruler-num {
  fill: var(--plate-color, var(--accent));
  font-family: var(--mono);
  font-size: 0.76px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 0.34px;
}
.plate-dim-pill-bg {
  fill: rgba(255, 255, 255, 0.97);
  stroke: var(--plate-color, var(--accent));
  stroke-width: 0.18;
  stroke-opacity: 0.90;
}
.plate-dim-pill-text {
  fill: var(--plate-color, var(--accent));
  font-family: var(--mono);
  font-size: 1.02px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Interactive Clickable Plate Scale Bars (refined hairline frame + corner viewfinder brackets) */
.plate-scale-highlight.is-interactive {
  cursor: pointer;
  outline: none !important;
}
.plate-scale-highlight:focus,
.plate-scale-highlight:active {
  outline: none !important;
}
.plate-scale-hit {
  fill: transparent;
  stroke: transparent;
}
.plate-scale-box {
  fill: rgba(35, 100, 92, 0.015);
  stroke: var(--accent);
  stroke-width: 0.9px;
  stroke-dasharray: 3.5 2.5;
  stroke-opacity: 0.30;
  vector-effect: non-scaling-stroke;
  transition: fill 0.14s ease, stroke-opacity 0.14s ease, stroke-width 0.14s ease;
}
.plate-scale-corners {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.65px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transition: stroke-opacity 0.14s ease;
}
.plate-scale-bar-line,
.plate-scale-bar-tick {
  stroke: var(--accent);
  stroke-width: 1.25px;
  stroke-linecap: round;
  stroke-opacity: 0.22;
  vector-effect: non-scaling-stroke;
  transition: stroke-opacity 0.14s ease, stroke-width 0.14s ease;
}
.plate-scale-tag {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
.pdf-page-frame:hover .plate-scale-highlight.is-interactive .plate-scale-box {
  stroke-opacity: 0.48;
  fill: rgba(35, 100, 92, 0.035);
}
.plate-scale-highlight.is-linked .plate-scale-box,
.plate-scale-highlight.is-hovered .plate-scale-box,
.plate-scale-highlight:hover .plate-scale-box,
.plate-scale-highlight:focus-visible .plate-scale-box {
  fill: rgba(35, 100, 92, 0.08);
  stroke-opacity: 0.72;
  stroke-width: 1.05px;
}
.plate-scale-highlight:active .plate-scale-box {
  fill: rgba(35, 100, 92, 0.14);
}
.plate-scale-highlight.is-selected .plate-scale-box {
  fill: rgba(35, 100, 92, 0.10);
  stroke-opacity: 0.62;
  stroke-width: 1.0px;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 2.5px rgba(35, 100, 92, 0.22));
}
.plate-scale-highlight.is-linked .plate-scale-corners,
.plate-scale-highlight.is-hovered .plate-scale-corners,
.plate-scale-highlight:hover .plate-scale-corners,
.plate-scale-highlight:focus-visible .plate-scale-corners {
  stroke-opacity: 0.82;
}
.plate-scale-highlight.is-selected .plate-scale-corners {
  stroke-opacity: 1;
}
.plate-scale-highlight.is-linked .plate-scale-bar-line,
.plate-scale-highlight.is-linked .plate-scale-bar-tick,
.plate-scale-highlight.is-hovered .plate-scale-bar-line,
.plate-scale-highlight.is-hovered .plate-scale-bar-tick,
.plate-scale-highlight:hover .plate-scale-bar-line,
.plate-scale-highlight:hover .plate-scale-bar-tick,
.plate-scale-highlight.is-selected .plate-scale-bar-line,
.plate-scale-highlight.is-selected .plate-scale-bar-tick {
  stroke-opacity: 0.96;
  stroke-width: 1.55px;
}
.plate-scale-highlight.is-linked .plate-scale-tag,
.plate-scale-highlight.is-hovered .plate-scale-tag,
.plate-scale-highlight:hover .plate-scale-tag,
.plate-scale-highlight:focus-visible .plate-scale-tag,
.plate-scale-highlight.is-selected .plate-scale-tag {
  opacity: 1;
}
.plate-scale-tag-bg {
  fill: rgba(242, 247, 246, 0.96);
  stroke: var(--accent);
  stroke-width: 0.9px;
  stroke-opacity: 0.72;
  vector-effect: non-scaling-stroke;
}
.plate-scale-highlight.is-selected .plate-scale-tag-bg {
  fill: var(--accent);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1px;
}
.plate-scale-tag-text {
  fill: #1b4b45;
  font-family: var(--mono);
  font-size: 1.00px;
  font-weight: 700;
}
.plate-scale-highlight.is-selected .plate-scale-tag-text {
  fill: #ffffff;
}
/* Highlight all artifacts calibrated by a hovered/selected plate scale bar */
.plate-hotspot-group.is-scale-hovered .plate-hotspot-poly {
  fill-opacity: 0.10;
  stroke-opacity: 0.72;
  stroke-width: 0.36;
}
.plate-hotspot-group.is-scale-linked .plate-hotspot-poly {
  fill-opacity: 0.14;
  stroke-opacity: 0.90;
  stroke-width: 0.40;
}
.plate-hotspot-group.is-scale-linked .plate-hotspot-halo {
  stroke-opacity: 0.74;
}
body.pure-reading .plate-hotspots-layer,
body.pure-reading .plate-hotspot-pills-layer,
body.pure-reading .plate-dims-layer,
body.pure-reading .plate-scale-layer,
body.pure-reading .fig2-dims-layer,
body.pure-reading .fig2-section-cuts-layer,
body.pure-reading .fig2-north-arrow-layer,
body.pure-reading .section-scale-layer,
body.pure-reading .section-drawings-layer,
body.pure-reading .tomb-photo-ann-layer,
body.pure-reading .tomb-photo-ann-pills {
  display: none;
}
body.pure-reading .pdf-ctx-layer-pop {
  display: none !important;
}

.pinned-ref-pane {
  width: 300px;
  flex: 0 0 300px;
  border-left: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pinned-ref-body { flex: 1 1 auto; overflow: auto; padding: 10px; }

.pdf-page-blocks-strip {
  flex: 0 0 34px;
  height: 34px;
  position: relative;
  overflow: visible;
  border-top: 1px solid var(--line);
  background: #f5f4ee;
  padding: 0;
  display: flex;
  align-items: stretch;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.pdf-foot-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  min-width: 0;
}
.pdf-foot-cell:last-child {
  border-right: 0;
}
.pdf-foot-blocks {
  flex: 0 0 auto;
  cursor: pointer;
  transition: background-color 0.12s;
}
.pdf-foot-blocks:hover {
  background: rgba(30, 38, 36, 0.05);
}
.pdf-foot-media {
  flex: 0 0 auto;
  gap: 7px;
}
.pdf-foot-media-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pdf-foot-specimens {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  gap: 7px;
  padding-right: 10px;
}
.foot-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  flex: 0 0 auto;
}
.foot-num {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  flex: 0 0 auto;
}
.foot-repair-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--repair);
}
.foot-empty {
  font-size: 11px;
  color: var(--muted);
}
.foot-specimen-preview {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}
.foot-specimen-preview .sem-chip {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.35;
  padding: 1px 4px;
}
.foot-more-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  background: rgba(30, 38, 36, 0.07);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  transition: background-color 0.14s, color 0.14s;
}
.pdf-foot-specimens.has-overflow:hover .foot-more-pill,
.pdf-foot-specimens.has-overflow.popout-open .foot-more-pill {
  background: var(--accent-soft);
  color: var(--accent);
}

/* In-Place Upward Slide Popout for All Page Specimens */
.specimen-popout {
  position: absolute;
  left: -1px;
  right: 0;
  bottom: 0;
  z-index: 1140;
  background: rgba(252, 251, 248, 0.985);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  box-shadow: 0 -10px 28px rgba(20, 35, 32, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  visibility: hidden;
  transition: transform 190ms cubic-bezier(0.22, 1, 0.36, 1), opacity 150ms ease, visibility 0s linear 190ms;
}
.pdf-foot-specimens.has-overflow.popout-open .specimen-popout {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition: transform 190ms cubic-bezier(0.22, 1, 0.36, 1), opacity 150ms ease, visibility 0s linear 0s;
}
.specimen-popout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 11px;
  border-bottom: 1px solid var(--fine);
  background: #f5f4ee;
  border-radius: 5px 5px 0 0;
  font-size: 11px;
}
.specimen-popout-head strong {
  color: var(--mast);
  font-weight: 700;
}
.specimen-popout-meta {
  font-size: 10.5px;
  color: var(--muted);
}
.specimen-popout-grid {
  padding: 8px 11px 10px;
  max-height: min(260px, 42vh);
  overflow-y: auto;
  scrollbar-width: thin;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 6px;
  white-space: normal;
}
.specimen-popout-grid .sem-chip {
  font-size: 11px;
  line-height: 1.4;
  padding: 1px 5px;
}

