/* Archival restoration workspace — KBatch site theme (match Rosetta / Dictionary) */

.arc-root {
  --arc-ink: var(--ink, var(--text, #e6edf3));
  --arc-muted: var(--muted, #8b949e);
  --arc-gold: var(--accent, #58a6ff);
  --arc-panel: var(--card, rgba(22, 27, 34, 0.85));
  --arc-line: var(--line, #30363d);
  --arc-bg: var(--bg, #0d1117);
  color: var(--arc-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.arc-root .arc-kicker,
.arc-root .arc-status,
.arc-root .arc-btn,
.arc-root select,
.arc-root .arc-dl,
.arc-root .arc-layout-chip,
.arc-root .arc-line-btn .id,
.arc-root .arc-line-btn .kind {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.arc-mast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  padding: 18px 4px 14px;
  border-bottom: 1px solid var(--arc-line);
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .arc-mast {
    grid-template-columns: 1fr;
  }
}

.arc-kicker {
  margin: 0 0 6px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--arc-muted);
  font-weight: 650;
}

.arc-title {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--arc-ink);
}
.arc-title span {
  color: var(--arc-gold);
}

.arc-sub {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--arc-muted);
}

.arc-doctrine {
  margin: 0;
  max-width: 62rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: color-mix(in srgb, var(--arc-ink) 88%, var(--arc-muted));
}

.arc-mast-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: 0.8rem;
}

.arc-mast-links a {
  color: var(--arc-gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.arc-mast-links a:hover {
  border-bottom-color: var(--arc-gold);
}

/* Research slide slot: pointer to sticky site History harness (not a second rail) */
.arc-research {
  margin: 0 0 12px;
  padding: 0;
  max-width: 100%;
}
.arc-research-harness-pointer {
  border: 1px solid var(--line, #30363d);
  border-radius: 10px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--panel, #161b22) 90%, #c9a227 6%);
}
.arc-hist-pointer {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  line-height: 1.4;
}
.arc-hist-pointer .arc-btn {
  flex-shrink: 0;
}
.arc-research:not(.arc-research-harness-pointer) {
  margin-bottom: 12px;
  border: 1px solid var(--arc-line);
  border-radius: 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--arc-panel) 90%, #000);
}

.arc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--arc-line);
  margin-bottom: 12px;
}

.arc-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 650 0.65rem/1 system-ui;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--arc-muted);
}

.arc-toolbar select {
  min-width: 9rem;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--arc-line);
  background: var(--arc-panel);
  color: var(--arc-ink);
  font: 500 0.85rem/1.2 system-ui;
  text-transform: none;
  letter-spacing: 0;
}

.arc-check {
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  padding-bottom: 6px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

.arc-btn {
  appearance: none;
  border: 1px solid var(--arc-line);
  background: var(--arc-panel);
  color: var(--arc-ink);
  padding: 7px 12px;
  border-radius: 6px;
  font: 600 0.78rem/1 system-ui;
  cursor: pointer;
}

.arc-btn:hover {
  border-color: var(--arc-gold);
  color: var(--arc-gold);
}

.arc-status {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--arc-muted);
  padding-bottom: 8px;
}

.arc-workspace {
  display: grid;
  grid-template-columns: minmax(200px, 0.65fr) minmax(0, 1.75fr) minmax(240px, 0.9fr);
  gap: 12px;
  align-items: start;
  min-height: min(68vh, 720px);
}

.arc-center-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

@media (max-width: 1100px) {
  .arc-workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

/* Four-layer simultaneous zoom under primary pair */
.arc-quad-wrap {
  border: 1px solid var(--arc-line);
  border-radius: 10px;
  background: var(--arc-panel);
  padding: 10px 12px 12px;
}

.arc-quad-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.arc-quad-head h2,
.arc-pulse-head h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--arc-gold);
  letter-spacing: 0.03em;
}

.arc-sync-check {
  margin-left: auto;
  padding-bottom: 0 !important;
}

.arc-quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  min-height: min(56vh, 640px);
  height: min(56vh, 640px);
}

.arc-quad-pane {
  min-height: 0;
  height: 100%;
}

.arc-quad-pane .arc-dz {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.arc-quad-pane .dz-root {
  height: 100%;
  min-height: 200px;
}

.arc-quad-pane .dz-status {
  font-size: 0.6rem;
  padding: 2px 6px;
}

/* Live pattern-flow pulse stream */
.arc-pulse-wrap {
  border: 1px solid var(--arc-line);
  border-radius: 10px;
  background: #0a0908;
  padding: 10px 12px 12px;
}

.arc-pulse-head {
  margin-bottom: 8px;
}

.arc-line-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid var(--arc-line);
  background: rgba(0, 0, 0, 0.35);
  max-height: 5.5rem;
  overflow: auto;
  font-family: "Iowan Old Style", Georgia, serif;
}

.arc-seg-ch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.95rem;
  padding: 2px 3px;
  border-radius: 3px;
  font-size: 0.85rem;
  color: #c9c4bc;
  border: 1px solid transparent;
}

.arc-seg-ch.sp {
  opacity: 0.35;
  min-width: 0.5rem;
}

.arc-seg-ch.on {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  color: #a7f3d0;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.35);
}

.arc-pulse-stream {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 4px 10px;
  min-height: 3.2rem;
  border-bottom: 1px solid var(--arc-line);
  scroll-behavior: smooth;
}

.arc-pulse-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(184, 151, 58, 0.35);
  background: rgba(184, 151, 58, 0.08);
  font-size: 0.72rem;
  max-width: 10rem;
}

.arc-pulse-chip.pulse-in {
  animation: arcPulseIn 0.28s ease-out;
}

.arc-pulse-chip strong {
  color: var(--arc-gold);
  font-size: 0.9rem;
}

.arc-pulse-chip code {
  font: 600 0.62rem/1.2 ui-monospace, Menlo, monospace;
  color: #6ee7b7;
  word-break: break-all;
}

.arc-pulse-ddr {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 2px;
  min-height: 1.8rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #93c5fd;
}

.arc-pulse-ddr-step {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  animation: arcPulseIn 0.2s ease-out;
}

.arc-pulse-meta {
  margin: 4px 0 0;
  font: 600 0.68rem/1.3 ui-monospace, Menlo, monospace;
  color: var(--arc-muted);
}

@keyframes arcPulseIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.arc-lines,
.arc-rail {
  border: 1px solid var(--arc-line);
  border-radius: 10px;
  background: var(--arc-panel);
  padding: 10px 12px;
  overflow: auto;
  max-height: min(68vh, 720px);
}

.arc-lines h2,
.arc-rail h2,
.arc-glyph-band h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--arc-gold);
  letter-spacing: 0.03em;
}

.arc-line-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.arc-line-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  font: inherit;
}

.arc-line-btn:hover,
.arc-line-btn.on {
  border-color: color-mix(in srgb, var(--arc-gold) 45%, var(--arc-line));
  background: color-mix(in srgb, var(--arc-gold) 8%, transparent);
}

.arc-line-btn .id {
  font: 700 0.68rem/1.2 ui-monospace, Menlo, monospace;
  color: var(--arc-gold);
  grid-row: 1 / span 2;
  align-self: center;
}

.arc-line-btn .kind {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--arc-muted);
  grid-column: 2;
}

.arc-line-btn .tx {
  font-size: 0.82rem;
  line-height: 1.4;
  grid-column: 2;
  white-space: normal;
  word-break: break-word;
}
.arc-line-btn .tx.tx-full {
  -webkit-line-clamp: unset;
  display: block;
  max-height: none;
}

.arc-viewports {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: min(68vh, 720px);
}

.arc-viewports.arc-single {
  grid-template-columns: 1fr;
}

.arc-pane {
  border: 1px solid var(--arc-line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.arc-pane-label {
  flex: 0 0 auto;
  padding: 6px 10px;
  font: 600 0.72rem/1.2 system-ui;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--arc-muted);
  background: var(--arc-panel);
  border-bottom: 1px solid var(--arc-line);
}

.arc-dz {
  flex: 1 1 auto;
  min-height: 240px;
  position: relative;
}

.arc-dz .dz-root {
  height: 100%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #c9c4bc;
  font-family: system-ui, sans-serif;
}
.arc-dz .dz-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  padding: 4px 6px;
  background: #141210;
  border-bottom: 1px solid #2c2926;
  font-size: 0.7rem;
}
.arc-dz .dz-toolbar button,
.arc-dz .dz-toolbar select {
  appearance: none;
  border: 1px solid #2c2926;
  background: #1a1816;
  color: #c9c4bc;
  padding: 3px 7px;
  border-radius: 4px;
  font: 600 0.7rem/1 system-ui;
  cursor: pointer;
}
.arc-dz .dz-viewport {
  flex: 1 1 auto;
  min-height: 200px;
  overflow: hidden;
  position: relative;
  touch-action: none;
  cursor: grab;
}
.arc-dz .dz-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.arc-dz .dz-stage img {
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.arc-dz .dz-status {
  margin: 0;
  padding: 3px 8px;
  font-size: 0.65rem;
  color: #8a8580;
  background: #141210;
  border-top: 1px solid #2c2926;
}
.arc-dz .dz-glyph-broadcast {
  display: none;
}
.arc-dz .dz-sep {
  opacity: 0.35;
  margin: 0 2px;
}
.arc-dz .dz-layout-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: #8a8580;
}

.arc-focus-text {
  font-size: 1.05rem;
  line-height: 1.5;
  padding: 10px 12px;
  border-left: 3px solid var(--arc-gold);
  background: rgba(184, 151, 58, 0.06);
  margin-bottom: 8px;
}

.arc-focus-meta {
  font-size: 0.72rem;
  color: var(--arc-muted);
  margin-bottom: 10px;
  font-family: system-ui, sans-serif;
}

.arc-rail h3 {
  margin: 12px 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--arc-muted);
  font-family: system-ui, sans-serif;
}

.arc-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 8px;
}

.arc-dl div {
  border: 1px solid var(--arc-line);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.25);
}

.arc-dl dt {
  margin: 0;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--arc-muted);
}

.arc-dl dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.arc-code {
  display: block;
  font: 0.75rem/1.4 ui-monospace, Menlo, monospace;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--arc-line);
  background: rgba(0, 0, 0, 0.3);
  word-break: break-word;
  margin-bottom: 6px;
  max-height: 5.5rem;
  overflow: auto;
}

.arc-code.braille {
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.arc-code.arc-ddr {
  font-size: 0.95rem;
}

.arc-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.arc-layout-chip {
  appearance: none;
  border: 1px solid var(--arc-line);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arc-layout-chip:hover,
.arc-layout-chip.on {
  border-color: color-mix(in srgb, var(--arc-gold) 50%, var(--arc-line));
  background: color-mix(in srgb, var(--arc-gold) 10%, transparent);
}

.arc-layout-chip .lid {
  font: 700 0.65rem/1 ui-monospace, Menlo, monospace;
  color: var(--arc-gold);
}

.arc-layout-chip .sample {
  font-size: 0.75rem;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Layout ring · lattice expansions */
.arc-layouts h3,
.arc-layouts h4 {
  margin: 10px 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--arc-gold);
  font-weight: 700;
}

.arc-layouts h3 {
  font-size: 0.85rem;
}

.lattice-epi {
  font-size: 0.68rem;
  opacity: 0.85;
  line-height: 1.35;
}

.lattice-boards {
  grid-template-columns: 1fr 1fr;
}

.lattice-boards .arc-layout-chip .diff,
.lattice-boards .arc-layout-chip .script {
  font: 600 0.58rem/1.2 ui-monospace, Menlo, monospace;
  color: var(--arc-muted);
  opacity: 0.95;
}

.lattice-sense-wrap {
  max-height: 16rem;
  overflow: auto;
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  margin-top: 4px;
}

.lattice-sense {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.lattice-sense th,
.lattice-sense td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--arc-line);
  vertical-align: top;
  text-align: left;
}

.lattice-sense th {
  position: sticky;
  top: 0;
  background: var(--arc-panel, #161b22);
  color: var(--arc-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.62rem;
  z-index: 1;
}

.lattice-sense .lid {
  font: 600 0.6rem ui-monospace, Menlo, monospace;
  color: var(--arc-muted);
  margin-left: 4px;
}

.lattice-sense .gloss-miss {
  color: var(--arc-muted);
}

.lattice-sense code.shadow {
  font-size: 0.68rem;
  color: #6ee7b7;
  word-break: break-all;
}

.lattice-paths {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 12rem;
  overflow: auto;
}

.lattice-path {
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  padding: 6px 8px;
}

.lattice-path .fam {
  font-size: 0.65rem;
  color: var(--arc-muted);
  margin-left: 6px;
}

.lattice-path ol {
  margin: 4px 0 0;
  padding-left: 1.1rem;
  font-size: 0.7rem;
  line-height: 1.35;
}

.lattice-peers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lattice-peer {
  appearance: none;
  border: 1px solid var(--arc-line);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  cursor: pointer;
}

.lattice-peer:hover {
  border-color: var(--arc-gold);
  color: var(--arc-gold);
}

.lattice-peer .lid {
  opacity: 0.65;
  margin-left: 3px;
  font-family: ui-monospace, Menlo, monospace;
}

.lattice-origins {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.origin-chip {
  font: 600 0.62rem/1.2 system-ui, sans-serif;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--oc, #888) 55%, transparent);
  color: var(--oc, #aaa);
  background: color-mix(in srgb, var(--oc, #888) 12%, transparent);
}

.lattice-overlap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 6.5rem;
  overflow: auto;
}

.ov-hit {
  font: 600 0.68rem/1.2 ui-monospace, Menlo, monospace;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, #34d399 40%, var(--arc-line));
  background: color-mix(in srgb, #34d399 10%, transparent);
  color: #a7f3d0;
}

.ov-hit b {
  color: #ecfdf5;
  font-weight: 700;
}

.arc-etym-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  max-height: 10rem;
  overflow: auto;
}

.arc-hero-glyph {
  font-size: 4.5rem;
  line-height: 1;
  text-align: center;
  padding: 16px;
  border: 1px solid var(--arc-line);
  border-radius: 10px;
  background: #000;
  color: var(--arc-gold);
  margin-bottom: 6px;
}

/* Airport flipboard · every letter on the scribe path */
.arc-fb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 6px;
  background: #0a0908;
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 8px;
}

.arc-fb-cell {
  appearance: none;
  width: 2.15rem;
  min-height: 2.65rem;
  padding: 3px 2px 2px;
  border-radius: 4px;
  border: 1px solid #3a3632;
  background: linear-gradient(180deg, #2a2622 0%, #1a1816 48%, #12100e 52%, #1c1a17 100%);
  color: #f0ebe3;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: "Iowan Old Style", Georgia, serif;
  transition: border-color 0.08s, transform 0.08s, background 0.08s;
}

.arc-fb-cell .ch {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.1;
}

.arc-fb-cell .n,
.arc-fb-sp .n {
  font: 600 0.55rem/1 ui-monospace, Menlo, monospace;
  opacity: 0.55;
  letter-spacing: 0.02em;
}

.arc-fb-cell:hover {
  border-color: var(--arc-gold);
}

.arc-fb-cell.on,
.arc-fb-cell.scan {
  border-color: #34d399;
  background: linear-gradient(180deg, #1a3a2a 0%, #0f2418 48%, #0a1a12 52%, #122a1c 100%);
  color: #a7f3d0;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35);
}

.arc-fb-sp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  min-height: 2.65rem;
  font-size: 0.7rem;
  opacity: 0.4;
  border: 1px dashed #333;
  border-radius: 4px;
  color: #888;
}

.arc-fb-sp.on {
  opacity: 0.9;
  border-color: #34d399;
  color: #6ee7b7;
}

.arc-fb-live {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.arc-fb-hero {
  font-size: 2.4rem;
  line-height: 1;
  text-align: center;
  padding: 10px 6px;
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  background: #000;
  color: var(--arc-gold);
  font-family: "Iowan Old Style", Georgia, serif;
}

.arc-fb-live-meta {
  font: 600 0.72rem/1.35 ui-monospace, Menlo, monospace;
  color: var(--arc-muted);
  word-break: break-word;
}

/* Word grid · sequential unlock */
.arc-wg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 12rem;
  overflow: auto;
  margin-bottom: 8px;
}

.arc-wg-cell {
  appearance: none;
  border: 1px solid var(--arc-line);
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  font: inherit;
}

.arc-wg-cell .wn {
  font: 700 0.58rem/1 ui-monospace, Menlo, monospace;
  color: var(--arc-gold);
}

.arc-wg-cell .ww {
  font-size: 0.82rem;
}

.arc-wg-cell:hover,
.arc-wg-cell.on {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

.arc-scan-log {
  font: 600 0.7rem/1.35 ui-monospace, Menlo, monospace;
  color: #6ee7b7;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(6, 40, 28, 0.45);
  min-height: 1.6rem;
  margin-top: 6px;
}

.arc-toolbar input[type="number"] {
  width: 4.2rem;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--arc-line);
  background: var(--arc-panel);
  color: var(--arc-ink);
  font: 600 0.85rem/1.2 ui-monospace, Menlo, monospace;
}

.arc-lines {
  max-height: min(72vh, 780px);
}

.arc-glyph-band {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--arc-line);
  /* Contain wide calligraphy strips so only .arc-strip-scroll pans */
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.arc-glyph-band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.arc-glyph-band-head h2 {
  margin: 0;
}

.arc-folio-nav {
  display: flex;
  gap: 6px;
}

.arc-strips {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
  max-width: 100%;
  min-width: 0;
  /* Only the active folio — no stacked neighbors */
  overflow: hidden;
}

/* Live flipboard analysis — under title+subtitle straight-row strip */
.arc-scribe-analysis {
  order: 0;
  margin: 4px 0 8px;
  padding: 14px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--arc-gold) 35%, var(--arc-line));
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--arc-gold) 6%, var(--arc-panel)),
    var(--arc-panel) 40%
  );
}

.arc-scribe-analysis-head h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--arc-gold);
  font-family: system-ui, sans-serif;
}

.arc-strip-fig--anchor {
  margin-bottom: 0;
}

.arc-scribe-jump a {
  color: var(--arc-gold);
}

.arc-scribe-analysis .arc-fb-row {
  max-height: min(22rem, 40vh);
}

.arc-strip-fig {
  margin: 0;
  max-width: 100%;
  min-width: 0;
}

.arc-strip-fig figcaption {
  font: 600 0.75rem/1.3 system-ui;
  color: var(--arc-muted);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.arc-strip-preview {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  color: var(--arc-ink);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Horizontal pan surface for wide calligraphy / glyph strips */
.arc-strip-scroll {
  background: #fff;
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 12px 16px;
  cursor: grab;
  touch-action: pan-x;
}

.arc-strip-scroll:active {
  cursor: grabbing;
}

.arc-strip-scroll:focus-visible {
  outline: 2px solid var(--arc-gold);
  outline-offset: 2px;
}

.arc-strip-scroll img {
  height: min(220px, 32vh);
  width: auto;
  max-width: none; /* allow wider-than-viewport images */
  display: block;
  pointer-events: none; /* drag/scroll the container, not the image */
  user-select: none;
}

.arc-err {
  padding: 2rem;
  color: #f87171;
}

.arc-dl-wide {
  grid-template-columns: 1fr;
}

.arc-fbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  height: 8px;
}

.arc-fbar i {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent, #58a6ff), #3fb950);
  min-width: 4px;
  max-width: 70%;
  flex: 1 1 auto;
}

.arc-fbar span {
  font: 700 0.68rem/1 ui-monospace, Menlo, monospace;
  color: var(--arc-muted);
  min-width: 2.4rem;
}

.arc-forensics {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--arc-line);
}

.arc-sections {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--arc-line);
}

.arc-sections h3 {
  font-size: 0.82rem;
  margin: 0 0 4px;
}

.arc-section-words {
  max-height: 9rem;
  overflow: auto;
}

.arc-strip-fig figcaption {
  font: 600 0.72rem/1.3 ui-monospace, Menlo, monospace;
  color: var(--arc-muted);
  margin-bottom: 4px;
}

.arc-strip-fig--dual {
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  padding: 8px 10px 12px;
  background: color-mix(in srgb, var(--arc-bg, #111) 92%, #888 8%);
  max-width: 100%;
  min-width: 0;
  overflow: hidden; /* force children to own their scrollports */
}

.arc-dual-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
}

.arc-dual-lab {
  display: block;
  font: 700 0.68rem/1.2 ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--arc-muted);
  margin-bottom: 4px;
}

.arc-dual-pane {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.arc-dual-pane .arc-strip-scroll {
  background: #f4f2ec;
  border-radius: 4px;
  border: 1px solid var(--arc-line);
}

.arc-dual-pane .arc-strip-scroll img {
  min-height: 56px;
  height: min(180px, 26vh);
  max-height: min(260px, 34vh);
  width: auto;
  max-width: none;
  image-rendering: auto;
}

/* Penmanship layers · inverted dark-field + stroke cone */
.pm-layers {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  min-width: 0;
}
.pm-block {
  border: 1px solid var(--arc-line);
  border-radius: 10px;
  padding: 10px 12px 12px;
  background: color-mix(in srgb, var(--arc-panel, #161b22) 88%, #000 12%);
}
.pm-h {
  margin: 0 0 4px;
  font: 700 0.85rem/1.3 ui-sans-serif, system-ui, sans-serif;
  color: var(--arc-ink, #e6edf3);
}
.pm-invert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .pm-invert-grid {
    grid-template-columns: 1fr;
  }
}
.pm-fig {
  margin: 0;
}
.pm-fig figcaption {
  font: 600 0.68rem/1.3 ui-monospace, Menlo, monospace;
  color: var(--arc-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pm-fig--pair {
  margin-top: 10px;
}
.pm-frame {
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f4f2ec;
  padding: 6px 8px;
  -webkit-overflow-scrolling: touch;
}
.pm-frame--dark {
  background: #0a0c10;
  border-color: #2a3040;
}
.pm-frame img,
.pm-cone-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(280px, 40vh);
  object-fit: contain;
  object-position: left center;
}
.pm-frame--cone {
  background: #12141a;
  min-height: 80px;
}
.pm-frame--cone .pm-cone-img {
  max-height: min(360px, 52vh);
}
.pm-cone-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 8px 0 6px;
}
.pm-pass-btns,
.pm-mode-btns,
.pm-src-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pm-pass-btn,
.pm-mode-btn,
.pm-src-btn {
  min-width: 2rem;
}
.pm-pass-btn.on,
.pm-mode-btn.on,
.pm-src-btn.on {
  outline: 2px solid color-mix(in srgb, #e3b341 70%, transparent);
  outline-offset: 1px;
  background: color-mix(in srgb, #e3b341 18%, transparent);
}
.pm-pass-label {
  margin: 0 0 6px;
  font: 600 0.72rem/1.35 ui-monospace, Menlo, monospace;
  color: #e3b341;
}
.pm-raw-ref {
  margin-bottom: 8px;
}
.tag-raw {
  background: color-mix(in srgb, #d29922 28%, transparent);
  color: #e3b341;
  padding: 1px 5px;
  border-radius: 3px;
  font: 800 0.58rem/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
}
.tag-stone {
  background: color-mix(in srgb, #58a6ff 28%, transparent);
  color: #79c0ff;
  padding: 1px 5px;
  border-radius: 3px;
  font: 800 0.58rem/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
}

/* Live scribe dual (ink-aligned geometry) */
.sl-dual {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
}
.sl-meta,
.sl-foot {
  margin: 0;
  font-size: 0.72rem;
  color: var(--arc-muted);
  line-height: 1.35;
}
.sl-foot code {
  font-size: 0.65rem;
}
/* Always-visible full sentence text (not an image crop) */
.sl-sentence {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--arc-line);
  background: color-mix(in srgb, var(--arc-panel) 80%, #000 20%);
  font: 600 1.05rem/1.45 "Iowan Old Style", Georgia, "Times New Roman", serif;
  color: var(--arc-ink);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.sl-sentence-plain {
  margin: 0;
  padding: 12px;
  font: 600 1.1rem/1.4 Georgia, serif;
  text-align: center;
  color: #141414;
}
.sl-pane {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.sl-lab {
  display: block;
  font: 700 0.65rem/1.2 ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--arc-muted);
  margin-bottom: 4px;
}
/* Full sentence image: always fit entire line in frame (no zoom fragment) */
.sl-full-frame {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  background: #f7f4ec;
  padding: 8px 10px;
  box-sizing: border-box;
  overflow: hidden;
}
.sl-full-frame-clean {
  background: #fafafa;
}
.sl-full-img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 auto;
  object-fit: contain;
}
.sl-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--arc-line);
  border-radius: 6px;
  background: #f4f2ec;
  padding: 8px;
}
.sl-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  align-items: flex-start;
  padding-bottom: 4px;
  width: max-content;
  min-width: 100%;
}
.sl-canvas-strip {
  display: block;
  vertical-align: top;
}
.sl-canvas-wrap {
  display: block;
}
.sl-cell {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.sl-tile {
  display: block;
  border: 1px solid #cfc8b8;
  border-radius: 3px;
  background-color: #fffef9;
  box-sizing: border-box;
}
.sl-tile-clean {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.sl-ch {
  font: 600 1.35rem/1 "Iowan Old Style", Georgia, "Times New Roman", serif;
  color: #141414;
}
.sl-n {
  font: 600 0.58rem/1 ui-monospace, Menlo, monospace;
  color: #6b6560;
}
.sl-cell.on .sl-tile {
  border-color: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35);
}
.sl-cell.on .sl-n {
  color: #34d399;
}
.sl-err {
  color: #f85149;
  font-size: 0.8rem;
  margin: 0;
}
.sl-dual--locked .sl-row-callig,
.sl-dual--locked .sl-row-clean {
  /* identical horizontal metric — linked scroll */
  scrollbar-gutter: stable;
}
.sl-integrity--ok {
  color: #3fb950;
}
.sl-integrity--mismatch {
  color: #f85149;
}
.sl-hit.on {
  outline: 2px solid #34d399;
  outline-offset: -2px;
  opacity: 0.25 !important;
  background: rgba(52, 211, 153, 0.25);
}
.arc-strip-preview--wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  display: block;
  margin-top: 4px;
  font: 500 0.9rem/1.4 Georgia, serif;
  color: var(--arc-ink);
  opacity: 1;
}

/* Raw vs Stone symbology */
.arc-symbology {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--arc-line);
}
.sym-panel h3,
.sym-panel h4 {
  margin: 8px 0 4px;
  font-size: 0.82rem;
  color: var(--arc-gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sym-why {
  line-height: 1.4;
}
.sym-sources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}
.sym-src {
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.72rem;
  line-height: 1.35;
}
.sym-src .tag {
  display: inline-block;
  font: 800 0.6rem/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.06em;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.sym-src-raw .tag {
  background: color-mix(in srgb, #d29922 25%, transparent);
  color: #e3b341;
}
.sym-src-stone .tag {
  background: color-mix(in srgb, #58a6ff 25%, transparent);
  color: #79c0ff;
}
.sym-src .dim {
  display: block;
  color: var(--arc-muted);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.62rem;
  margin: 2px 0 4px;
}
.sym-src p {
  margin: 0;
  opacity: 0.9;
}
.sym-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}
.sym-mode-btn {
  appearance: none;
  border: 1px solid var(--arc-line);
  background: var(--arc-panel);
  color: inherit;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.65rem;
  cursor: pointer;
}
.sym-mode-btn.on,
.sym-mode-btn:hover {
  border-color: var(--arc-gold);
  color: var(--arc-gold);
}
.sym-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 18rem;
  overflow: auto;
  font-size: 0.72rem;
}
.sym-list li {
  border: 1px solid var(--arc-line);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 6px;
}
.sym-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 4px 0;
}
.sym-cols em {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--arc-muted);
  letter-spacing: 0.04em;
}
.sym-cols p {
  margin: 2px 0 0;
  line-height: 1.35;
}
.sym-an {
  margin: 4px 0 0;
  color: var(--arc-muted);
  line-height: 1.35;
}
.sym-cage {
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, #d29922 40%, var(--arc-line));
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.72rem;
}
.sym-cage summary {
  cursor: pointer;
  font-weight: 700;
  color: #e3b341;
}
.sym-cage ul {
  margin: 4px 0 8px;
  padding-left: 1.1rem;
  line-height: 1.4;
}
@media (max-width: 700px) {
  .sym-sources,
  .sym-cols {
    grid-template-columns: 1fr;
  }
}

/* Full engrossed line: show entire line in the pane (scale down to fit) */
.arc-dual-pane--full .arc-strip-scroll {
  overflow-x: auto;
  background: #f7f4ec;
  text-align: center;
}

.arc-dual-pane--full .arc-strip-scroll img {
  height: auto;
  max-height: min(140px, 22vh);
  width: auto;
  max-width: 100%; /* full line visible for L01-scale headers */
  margin: 0 auto;
}

/* Numbered tile strips (calligraphy + clean): fixed tile height, horizontal pan */
.arc-dual-pane--tiles .arc-strip-scroll img {
  height: min(160px, 24vh);
  max-height: 200px;
  width: auto;
  max-width: none;
}

/* Path panel overflow (keyboard analysis) */
.arc-root .path-geometry-panel,
.arc-root .dual-pane {
  max-width: 100%;
  overflow: hidden;
}

.arc-root .dual-line code,
.arc-root .path-geometry-panel code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 0.72rem;
  line-height: 1.35;
}

/* Fit declaration page when embedded */
.dec-page .arc-root {
  max-width: min(1600px, 100%);
  margin: 0 auto;
}
