[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--fg);
  font: 400 var(--fs-2)/var(--lh) var(--font-ui);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--accent);
}
a:hover {
  text-decoration: underline;
}
.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--fg-muted);
}
.small,
small {
  font-size: var(--fs-1);
}
.hidden {
  display: none !important;
}
kbd {
  font: 500 var(--fs-1) var(--font-mono);
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  color: var(--fg);
}
/* Cesium host: left/width are set by Globe.resize() so the globe stays centred in the area not covered by panels */
#globe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  overflow: hidden;
  background: #01030a;
}
#globe .cesium-widget,
#globe .cesium-widget canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#globe canvas:focus {
  outline: none;
}
/* imagery and terrain attributions (required by the tile providers' terms) */
#credits {
  position: fixed;
  left: 340px;
  bottom: calc(var(--timeline-h) + 2px);
  z-index: var(--z-credit);
  max-width: 46vw;
  font: var(--fs-1)/1.3 var(--font-ui);
  color: rgba(230, 241, 247, 0.62);
  pointer-events: auto;
}
body.rail-collapsed #credits {
  left: 8px;
}
#credits a {
  color: rgba(160, 210, 240, 0.8);
}
#credits .cesium-credit-logoContainer {
  display: none !important;
}
#credits .cesium-credit-textContainer {
  display: inline;
}
#lasso {
  position: fixed;
  inset: 0;
  z-index: var(--z-lasso);
  cursor: crosshair;
}
/* top bar */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-2);
  background: linear-gradient(180deg, rgba(3, 6, 12, 0.94), rgba(3, 6, 12, 0.72));
  border-bottom: 1px solid var(--line);
  z-index: var(--z-chrome);
  backdrop-filter: blur(6px);
}
.brand {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: var(--fs-2);
  white-space: nowrap;
}
.brand small {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--fg-muted);
  margin-left: var(--s-1);
}
.logo {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent);
}
.searchbox {
  position: relative;
  flex: 1;
  max-width: 560px;
}
#search {
  width: 100%;
  height: 36px;
  padding: 0 var(--s-1);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
}
#search::placeholder {
  color: var(--fg-dim);
}
#search-results {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: var(--s-h);
  list-style: none;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
}
#search-results li {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: var(--s-1);
  padding: 8px var(--s-1);
  border-radius: var(--radius-1);
  cursor: pointer;
}
#search-results li small {
  grid-column: 2;
  color: var(--fg-muted);
}
#search-results li.active,
#search-results li:hover {
  background: var(--bg-3);
}
#search-results li.foot {
  display: block;
  color: var(--fg-dim);
  font-size: var(--fs-1);
  cursor: default;
}
mark {
  background: rgba(56, 232, 255, 0.25);
  color: var(--fg);
}
.tools {
  display: flex;
  gap: var(--s-h);
  align-items: center;
  margin-left: auto;
}
.sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 var(--s-h);
}
.btn {
  height: 32px;
  padding: 0 var(--s-1);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  cursor: pointer;
  font-weight: 500;
  font-size: var(--fs-2);
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn.primary {
  background: rgba(56, 232, 255, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}
.btn.sm {
  height: 26px;
  padding: 0 var(--s-1);
  font-size: var(--fs-1);
}
.btn.icon {
  width: 32px;
  padding: 0;
  font-size: 16px;
}
.btn.icon.sm {
  width: 26px;
}
.btn.ghost {
  background: transparent;
}
.menuwrap {
  position: relative;
}
.menu {
  position: absolute;
  right: 0;
  top: 38px;
  min-width: 240px;
  padding: var(--s-h);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
  z-index: var(--z-menu);
}
.menu button,
.menu .file {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px var(--s-1);
  border-radius: var(--radius-1);
  cursor: pointer;
}
.menu button:hover,
.menu .file:hover {
  background: var(--bg-3);
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
}
.menu .file input {
  display: none;
}

#rail {
  position: fixed;
  top: calc(var(--topbar-h) + var(--s-1));
  left: var(--s-1);
  bottom: calc(var(--timeline-h) + var(--s-1));
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  z-index: var(--z-rail);
  backdrop-filter: blur(8px);
}
body.rail-collapsed #rail {
  width: auto;
  bottom: auto;
}
body.rail-collapsed #rail .pane,
body.rail-collapsed #rail .count {
  display: none !important;
}

.count {
  padding: var(--s-1) var(--s-1);
  font-size: var(--fs-1);
  color: var(--fg-muted);
  border-bottom: 1px solid var(--line);
}
.count b {
  color: var(--accent);
  font-size: var(--fs-2);
}
.pane {
  overflow: auto;
  padding: var(--s-1) var(--s-1) var(--s-2);
  flex: 1;
}
.pane h4,
.panel h4 {
  margin: var(--s-2) 0 var(--s-1);
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.pane h4 small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.lg h4 {
  margin-top: var(--s-1);
}
.lrow {
  display: grid;
  grid-template-columns: 1fr 64px 22px;
  align-items: center;
  gap: var(--s-h);
  padding: 4px 0;
}
.lrow label {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  min-width: 0;
}
.lrow label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lrow.waiting label {
  color: var(--fg-dim);
}
.lrow .n {
  color: var(--fg-dim);
  font: 400 var(--fs-1) var(--font-mono);
}
.lrow .op {
  width: 64px;
  accent-color: var(--accent);
}
.info {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--fg-muted);
  font: 600 var(--fs-1) var(--font-mono);
  cursor: pointer;
}
.lsrc {
  grid-column: 1/-1;
  display: none;
  padding: var(--s-h) 0 var(--s-1) 24px;
  font-size: var(--fs-1);
  color: var(--fg-muted);
}
.lsrc.open {
  display: block;
}
.lgd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 8px 2px 0;
}
.lgd i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.src {
  margin-top: 4px;
}
.tog {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-1);
  color: var(--fg-muted);
  padding: 2px 0;
  cursor: pointer;
}
input[type='checkbox'] {
  accent-color: var(--accent);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  font-size: var(--fs-1);
  cursor: pointer;
  color: var(--fg);
}
.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.chip .n {
  color: var(--fg-dim);
  font-family: var(--font-mono);
}
.chip.on {
  border-color: var(--accent);
  background: rgba(56, 232, 255, 0.14);
}
.chip .x {
  background: none;
  border: 0;
  color: var(--fg-muted);
  cursor: pointer;
}
.fhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hint {
  font-size: var(--fs-1);
  color: var(--fg-muted);
  margin: var(--s-1) 0;
}
.row {
  display: flex;
  gap: var(--s-h);
}
.row input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
}

#dossier h2 {
  font-size: var(--fs-4);
  line-height: var(--lh-tight);
  margin: var(--s-1) 0 var(--s-1);
}
.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-1);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--c);
  color: var(--c);
  font: 600 var(--fs-1) var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: none;
}
.pbadge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--fg);
  font-size: var(--fs-1);
  text-transform: none;
  letter-spacing: 0;
}
.pbadge.pin {
  color: var(--ok);
}
.pbadge.circ {
  color: var(--accent-2);
}
table.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-2);
}
table.kv th {
  text-align: left;
  font-weight: 500;
  color: var(--fg-muted);
  padding: 4px var(--s-1) 4px 0;
  vertical-align: top;
  width: 34%;
  font-size: var(--fs-1);
}
table.kv td {
  padding: 4px 0;
  vertical-align: top;
  word-break: break-word;
}
.rel {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rel li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.rel a {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rel small {
  display: block;
  color: var(--fg-muted);
  margin-left: 16px;
}
.dz-actions {
  display: flex;
  gap: var(--s-1);
  margin-top: var(--s-2);
  flex-wrap: wrap;
}

.wars-head {
  position: sticky;
  top: 0;
  background: var(--bg-1);
  padding: var(--s-1) 0;
  z-index: 1;
}
.wars-head .chips {
  margin-top: 8px;
}
.wars-head select,
.an-opts input,
.an-opts select {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  height: 28px;
  padding: 0 8px;
}
table.wars {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-1);
}
table.wars th {
  position: sticky;
  top: 0;
  text-align: left;
  color: var(--fg-muted);
  font-weight: 500;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line-strong);
}
table.wars td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.wars tr[data-id] {
  cursor: pointer;
}
table.wars tr[data-id]:hover {
  background: var(--bg-3);
}
#analysis {
  overflow: hidden;
}
.an-opts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-1);
  align-items: center;
  padding: var(--s-1) var(--s-2) 0;
  font-size: var(--fs-1);
}
.an-opts input[type='number'] {
  width: 72px;
}
#analysis .win-body > p {
  padding: 0 var(--s-2);
}
#an-out {
  padding: 0 var(--s-2) var(--s-2);
  flex: 1;
}
.banner {
  margin: var(--s-1) 0;
  padding: var(--s-1) var(--s-1);
  border-left: 3px solid var(--warn);
  background: rgba(255, 200, 87, 0.08);
  font-weight: 600;
}
.warnbox {
  margin: var(--s-1) 0;
  padding: var(--s-1) var(--s-1);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-1);
  font-size: var(--fs-1);
}
.warnbox.soft {
  border-color: var(--warn);
  color: var(--warn);
}
table.an {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-1);
}
table.an th,
table.an td {
  padding: 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
table.an thead th {
  color: var(--fg-muted);
  font-weight: 500;
}
.an-ref {
  margin-top: var(--s-2);
}
.hist {
  width: 420px; /* drawn 1:1 so the 12 px axis labels stay 12 px (v1.5 audit) */
  max-width: 100%;
  height: auto;
  margin-top: var(--s-1);
}
.bias {
  margin-top: var(--s-3);
  padding: var(--s-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
}
#graph .g-opts {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-2);
  flex-wrap: wrap;
}
.g-wrap {
  position: relative;
  flex: 1;
  min-height: 200px;
}
#graph-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#graph .win-body > p {
  padding: 0 var(--s-2);
}

.cgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
}
.cgrid figure {
  margin: 0;
}
.cgrid figure.wide {
  grid-column: 1/-1;
}
.cgrid figcaption {
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: var(--s-h);
}
.cgrid figcaption small {
  font-weight: 400;
}
.cgrid svg {
  width: 100%;
  height: auto;
}
.bar {
  cursor: pointer;
}

#brief-body,
#help table,
#help p {
  padding: 0 var(--s-2) var(--s-2);
}
#help .keys th {
  width: 120px;
}
.md img {
  max-width: 100%;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-1);
}
.gallery img {
  width: 100%;
  border-radius: var(--radius-1);
  border: 1px solid var(--line);
}
.scroll {
  max-height: 240px;
  overflow: auto;
}
textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  padding: var(--s-1);
}
.ok {
  color: var(--ok);
}
#compare-bar {
  position: fixed;
  top: calc(var(--topbar-h) + var(--s-1));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--s-1);
  align-items: center;
  padding: 8px var(--s-1);
  border-radius: var(--radius-2);
  z-index: var(--z-chrome);
  font-size: var(--fs-1);
}
#compare-bar input,
#compare-bar select {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  height: 26px;
  padding: 0 8px;
  font-family: var(--font-mono);
}
#cmp-divider {
  position: fixed;
  top: var(--topbar-h);
  bottom: var(--timeline-h);
  left: 50%;
  width: 4px;
  margin-left: -2px;
  background: var(--warn);
  box-shadow: 0 0 12px var(--warn);
  cursor: ew-resize;
  z-index: var(--z-overlay);
}
/* timeline */
#timeline {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--timeline-h);
  background: linear-gradient(0deg, rgba(3, 6, 12, 0.96), rgba(3, 6, 12, 0.82));
  border-top: 1px solid var(--line);
  z-index: var(--z-chrome);
  display: flex;
  flex-direction: column;
  padding: 8px var(--s-2) 4px;
}
.tl-controls {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}
.tl-steps {
  display: flex;
  gap: 2px;
}
.tl-controls select,
.tl-date input {
  height: 26px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 8px;
  font-size: var(--fs-1);
}
.tl-date {
  font-size: var(--fs-1);
  color: var(--fg-muted);
}
.tl-date input {
  width: 118px;
  font-family: var(--font-mono);
  color: var(--fg);
  font-size: var(--fs-2);
}
#tl-label {
  color: var(--accent);
  font-size: var(--fs-2);
  min-width: 64px;
}
.tl-hour {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: var(--fs-1);
  color: var(--fg-muted);
}
.tl-hour input {
  width: 90px;
  accent-color: var(--accent);
}
#tl-play {
  width: 40px;
  font-size: 14px;
}
#tl-canvas {
  flex: 1;
  width: 100%;
  min-height: 0;
  cursor: pointer;
  margin-top: 4px;
}
/* misc */
.tooltip {
  position: fixed;
  pointer-events: none;
  max-width: 320px;
  padding: 8px 8px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  font-size: var(--fs-1);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow);
}
.tooltip .why {
  margin-top: 4px;
  color: var(--ok);
}
#graph-tip {
  position: absolute;
}
#status {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--timeline-h) + var(--s-1));
  font-size: var(--fs-1);
  color: var(--fg-muted);
  z-index: var(--z-chrome);
  pointer-events: none;
  text-shadow: 0 1px 2px #000;
}
#fps {
  position: fixed;
  right: var(--s-1);
  top: calc(var(--topbar-h) + 4px);
  font: 500 var(--fs-1) var(--font-mono);
  color: var(--ok);
  z-index: var(--z-chrome);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 8px;
  border-radius: 4px;
}
.spin {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sp 0.8s linear infinite;
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}
@media (width < 1100px) {
  .tools .btn:not(.icon) {
    padding: 0 8px;
  }
  .brand small {
    display: none;
  }
  :root {
    --rail-w: 280px;
    --dossier-w: 360px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spin {
    animation: none;
  }
}

/* ---- v1.0 cinematic + reference additions (8 px grid; motion tokens) ---- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.btn svg,
.tab svg {
  vertical-align: -3px;
}
.btn[data-icon]:not(.icon) svg {
  margin-right: 8px;
}
.btn.icon svg {
  margin: 0;
}
.btn.ghost {
  background: transparent;
}
.spotlight {
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 32px rgba(56, 232, 255, 0.45) !important;
  transition: box-shadow var(--dur-3) var(--ease-out);
  z-index: var(--z-tour);
}
/* layer tree */
.tree {
  margin: 0 0 var(--s-1) 28px;
  font-size: var(--fs-1);
}
.tree summary {
  cursor: pointer;
  color: var(--fg-muted);
  padding: 2px 0;
}
.tnode > label,
.tkids label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.tkids {
  margin-left: 20px;
  display: grid;
}
.tree .n {
  color: var(--fg-dim);
  margin-left: auto;
  font-family: var(--font-mono);
}
.tree .sw {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

#hs-formula {
  padding: 0 var(--s-2);
}
.hsl {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: h;
}
.hsl li {
  counter-increment: h;
}
.hsb {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-areas: 't n' 't g' 't s';
  column-gap: var(--s-1);
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: var(--s-1) 0;
  cursor: pointer;
}
.hsb:hover {
  background: var(--bg-3);
}
.hsb .tier {
  grid-area: t;
  align-self: center;
}
.hsb b {
  grid-area: n;
  font-family: var(--font-display);
  font-size: var(--fs-3);
  letter-spacing: 0.04em;
}
.hsb .glyphs {
  grid-area: g;
}
.hsb small {
  grid-area: s;
  color: var(--fg-muted);
}
.tier {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--c);
  color: var(--c);
  font: 700 16px var(--font-display);
  border-radius: 4px;
}
.glyphs .gl {
  display: inline-block;
  width: auto;
  margin-right: 8px;
  color: var(--warn);
}
.glyphs.big .gl {
  margin-right: 8px;
}

#hs-dossier h3 {
  font-family: var(--font-display);
  font-size: var(--fs-4);
  margin: 0;
}
.note {
  border-left: 3px solid var(--warn);
  padding: var(--s-1) var(--s-1);
  background: rgba(255, 200, 87, 0.08);
  font-size: var(--fs-1);
}

.rep-out {
  padding: var(--s-2);
}
.rp-doc {
  background: #f4f1e8;
  color: #16120c;
  padding: var(--s-4);
  font: 400 14px/1.5 var(--font-ui);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #c9c0a8;
  position: relative;
}
.rp-doc a {
  color: #7a2a12;
}
.rp-bar {
  font: 700 13px var(--font-mono);
  letter-spacing: 0.3em;
  text-align: center;
  color: #a01a1a;
  border: 2px solid #a01a1a;
  padding: 4px;
  margin: 0 auto var(--s-2);
  width: max-content;
}
.rp-kicker {
  font: 600 var(--fs-1) var(--font-mono);
  letter-spacing: 0.2em;
  color: #5b5240;
}
.rp-head h1 {
  font: 700 32px/1.1 var(--font-display);
  letter-spacing: 0.06em;
  margin: var(--s-1) 0 var(--s-1);
  text-transform: uppercase;
}
.rp-meta th {
  text-align: left;
  padding-right: var(--s-2);
  color: #5b5240;
  font: 500 var(--fs-1) var(--font-mono);
  text-transform: uppercase;
}
.rp-sec {
  border-top: 1px dashed #a89f88;
  padding-top: var(--s-1);
  margin-top: var(--s-2);
}
.rp-sec h2 {
  font: 700 16px var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 var(--s-1);
}
.rp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.rp-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  list-style: none;
  padding: 0;
}
.rp-kpis b {
  display: block;
  font: 700 24px var(--font-mono);
  filter: brightness(0.6);
}
.rp-kpis span {
  font-size: var(--fs-1);
  color: #5b5240;
}
.rp-snap {
  width: 100%;
  border: 1px solid #a89f88;
  margin-bottom: var(--s-1);
}
.rp-cap {
  font-size: var(--fs-1);
  color: #5b5240;
}
.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-1);
}
.rp-table th,
.rp-table td {
  border-bottom: 1px solid #d6cdb5;
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
}
.rp-sub {
  color: #5b5240;
  max-width: 52ch;
}
.rp-grade {
  font: 600 var(--fs-1) var(--font-mono);
  padding: 1px 4px;
  border: 1px solid currentColor;
}
.rp-src {
  columns: 2;
  font-size: var(--fs-1);
}
.rp-src span {
  color: #5b5240;
}
.rp-foot {
  margin-top: var(--s-3);
  font-size: var(--fs-1);
  color: #5b5240;
  border-top: 1px solid #a89f88;
  padding-top: var(--s-1);
}
.rp-doc svg text {
  fill: #3b3326;
}
.rp-doc .typed {
  font-family: var(--font-mono);
}

.ref-body {
  padding: var(--s-1) var(--s-2);
}
.gloss dt {
  font-weight: 600;
  margin-top: var(--s-1);
}
.gloss dd {
  margin: 2px 0 0 var(--s-2);
  color: var(--fg-muted);
}
.idxl {
  columns: 2;
  padding-left: var(--s-2);
  font-size: var(--fs-1);
}
.az-jump a {
  margin-right: 8px;
  font-family: var(--font-mono);
}
.kv.idx th {
  font-weight: 500;
  width: auto;
}
.cov {
  border-collapse: collapse;
  font-size: var(--fs-1);
  width: 100%;
}
.cov td,
.cov th {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.cov th {
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 500;
}
.cov thead td,
.cov thead th {
  color: var(--fg-muted);
  position: sticky;
  top: 0;
  background: var(--bg-1);
}
.cov tr.lvl0 th {
  font-weight: 700;
}
.cov .cbar {
  display: inline-block;
  width: 40px;
  height: 6px;
  margin-right: 4px;
  background: linear-gradient(90deg, var(--c) var(--w), var(--bg-3) var(--w));
}
.prof[data-p='wide but shallow'] {
  color: var(--warn);
}
.prof[data-p='deep but narrow'] {
  color: var(--accent-2);
}
.prof[data-p='wide and deep'] {
  color: var(--ok);
}
.prof[data-p='narrow and shallow'] {
  color: var(--danger);
}
.vbadge {
  display: inline-block;
  font: 600 var(--fs-1) var(--font-mono);
  color: #1b1300;
  background: var(--warn);
  padding: 1px 8px;
  border-radius: 3px;
}
.cbadge {
  display: inline-block;
  font: 600 var(--fs-1) var(--font-mono);
  color: #fff;
  background: var(--conflict);
  padding: 1px 8px;
  border-radius: 3px;
}

#set-body {
  padding: var(--s-1) var(--s-2);
  display: grid;
  gap: var(--s-1);
}
#set-body label {
  display: flex;
  gap: var(--s-1);
  align-items: center;
}
#set-body input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}
#set-body h4 {
  margin: var(--s-1) 0 0;
}
/* HUD */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-hud);
}
.reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
}
.reticle i {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(56, 232, 255, 0.65);
}
.reticle i:nth-child(1) {
  left: 0;
  top: 0;
  border-right: 0;
  border-bottom: 0;
}
.reticle i:nth-child(2) {
  right: 0;
  top: 0;
  border-left: 0;
  border-bottom: 0;
}
.reticle i:nth-child(3) {
  left: 0;
  bottom: 0;
  border-right: 0;
  border-top: 0;
}
.reticle i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
}
.hud-coord,
.hud-date {
  position: absolute;
  left: calc(var(--rail-w) + var(--s-2));
  bottom: calc(var(--timeline-h) + var(--s-1));
  font: 500 var(--fs-1) var(--font-mono);
  color: rgba(56, 232, 255, 0.85);
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px #000;
}
.hud-date {
  bottom: calc(var(--timeline-h) + var(--s-4));
}
body.rail-collapsed .hud-coord,
body.rail-collapsed .hud-date {
  left: var(--s-4);
}
.hud-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0,
    rgba(56, 232, 255, 0.1) 48%,
    rgba(56, 232, 255, 0.28) 50%,
    transparent 52%
  );
  transform: translateY(-100%);
  opacity: 0;
}
.hud-sweep.go {
  animation: sweep var(--dur-4) var(--ease-inout) 1;
}
@keyframes sweep {
  0% {
    transform: translateY(-60%);
    opacity: 1;
  }
  100% {
    transform: translateY(60%);
    opacity: 0;
  }
}
/* lower third */
#lowerthird {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--timeline-h) + var(--s-2));
  width: min(880px, 92vw);
  z-index: var(--z-tour);
  background: linear-gradient(90deg, rgba(3, 6, 12, 0.94), rgba(9, 16, 28, 0.86));
  border-left: 4px solid var(--accent);
  padding: var(--s-1) var(--s-2) var(--s-1);
  box-shadow: var(--shadow);
  animation: ltin var(--dur-3) var(--ease-out);
}
@keyframes ltin {
  from {
    transform: translate(-50%, 16px);
    opacity: 0;
  }
}
.lt-bar {
  display: flex;
  justify-content: space-between;
  font: 500 var(--fs-1) var(--font-mono);
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}
#lt-title {
  font-size: 28px;
  margin: 4px 0;
  line-height: 1.1;
}
#lt-text {
  margin: 0 0 var(--s-1);
  min-height: 3em;
  font-size: var(--fs-3);
  max-width: 80ch;
}
#lt-text.typing::after {
  content: '▌';
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.lt-ctl {
  display: flex;
  gap: var(--s-h);
  align-items: center;
}
.lt-ctl .muted {
  margin-left: var(--s-1);
}
.lt-progress {
  height: 2px;
  margin-top: var(--s-1);
  background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line) var(--p, 0%));
  transition: background var(--dur-2);
}
body.touring #status {
  display: none;
}
/* boot */
#boot {
  position: fixed;
  inset: 0;
  z-index: var(--z-boot);
  display: grid;
  place-items: center;
  background: #02040a;
}
#boot-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.boot-card {
  position: relative;
  text-align: center;
  max-width: 720px;
  padding: var(--s-4);
  animation: bootin 1.6s var(--ease-out);
}
@keyframes bootin {
  from {
    opacity: 0;
    letter-spacing: 0.4em;
    filter: blur(6px);
  }
}
.boot-tag {
  font: 600 13px var(--font-mono);
  letter-spacing: 0.4em;
  color: #ff5a5a;
  border: 1.5px solid #ff5a5a;
  display: inline-block;
  padding: 4px 12px;
}
.boot-card h1 {
  font-size: clamp(48px, 9vw, 112px);
  margin: var(--s-1) 0 0;
  line-height: 1;
  color: #e8fbff;
  text-shadow: 0 0 24px rgba(56, 232, 255, 0.55);
}
.boot-sub {
  color: var(--fg-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: var(--fs-1);
}
.boot-lines {
  min-height: 96px;
  margin: var(--s-2) 0;
  color: var(--accent);
  font-size: 13px;
  text-align: left;
  display: inline-block;
}
.boot-lines p {
  margin: 2px 0;
}
.engage {
  display: block;
  margin: var(--s-2) auto var(--s-1);
  font: 700 28px var(--font-display);
  letter-spacing: 0.4em;
  padding: 16px 48px 16px 60px;
  color: #02040a;
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 48px rgba(56, 232, 255, 0.55);
  animation: pulse 2.4s ease-in-out infinite;
}
.engage:hover,
.engage:focus-visible {
  background: #9ff4ff;
}
@keyframes pulse {
  50% {
    box-shadow:
      0 0 0 1px var(--accent),
      0 0 80px rgba(56, 232, 255, 0.85);
  }
}
.boot-hint {
  font-size: var(--fs-1);
  color: var(--fg-muted);
}
.boot-alt {
  display: flex;
  gap: var(--s-1);
  justify-content: center;
  margin-top: var(--s-1);
}
.boot-legal {
  margin-top: var(--s-2);
  font-size: var(--fs-1);
  color: var(--fg-dim);
}
/* reduced motion / performance */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .engage,
  .boot-card,
  #lowerthird,
  .hud-sweep.go {
    animation: none;
  }
}
body.perf .panel {
  backdrop-filter: none;
}
@media (width < 820px) {
  #hotspots,
  #hs-dossier {
    left: var(--s-1);
    right: var(--s-1);
    width: auto;
  }
  .rp-cols {
    grid-template-columns: 1fr;
  }
  .idxl,
  .rp-src {
    columns: 1;
  }
  #lt-title {
    font-size: 20px;
  }
  .tools .btn:not(.icon) {
    font-size: 0;
    width: 32px;
    padding: 0;
  }
  .tools .btn:not(.icon) svg {
    margin: 0;
  }
}
/* print: only the report */
@media print {
  html,
  body {
    overflow: visible;
    height: auto;
    background: #fff;
  }
  body.printing-report > *:not(#reports) {
    display: none !important;
  }
  body.printing-report #reports {
    position: static;
    transform: none;
    width: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border: 0;
    background: #fff;
  }
  body.printing-report #reports > header,
  body.printing-report #rep-form {
    display: none;
  }
  .rp-doc {
    box-shadow: none;
    background: #fff;
    padding: 0;
  }
  .rp-sec {
    break-inside: avoid;
  }
  .rp-table tr {
    break-inside: avoid;
  }
}

.data-body .cgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--s-1);
}
.data-body figure {
  margin: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-1);
  padding: var(--s-1) var(--s-1);
  min-width: 0;
}
.data-body figure.wide {
  grid-column: 1 / -1;
}
.data-body figcaption {
  font-weight: 600;
  margin-bottom: var(--s-1);
}
.dsrc {
  display: block;
  font-weight: 400;
}
.dbars {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-1);
}
.dbars th {
  text-align: left;
  font-weight: 400;
  width: 34%;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 8px 1px 0;
}
.dbars td {
  padding: 1px 0;
}
.dbars td:not(.n) {
  display: flex;
  height: 14px;
}
.dbars td span {
  display: block;
  height: 100%;
  min-width: 1px;
}
.dbars td.n {
  width: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-left: 8px;
}
.dlegend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: var(--fs-1);
  margin-bottom: 4px;
}
.dlegend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  vertical-align: -1px;
}

.dheat,
.dtable {
  border-collapse: collapse;
  font-size: var(--fs-1);
}
.dheat th,
.dheat td,
.dtable th,
.dtable td {
  border: 1px solid var(--line);
  padding: 2px 8px;
  vertical-align: top;
}
.dheat th {
  font-weight: 400;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dheat td {
  text-align: center;
  min-width: 34px;
  font-variant-numeric: tabular-nums;
}
.dtable {
  width: 100%;
}
.dtable thead th {
  position: sticky;
  top: 0;
  background: var(--bg-1, #0b1118);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.dtable th.asc::after {
  content: ' ▲';
}
.dtable th.desc::after {
  content: ' ▼';
}
.dtable td {
  max-width: 420px;
}
.dconf,
tr.dconf td {
  color: #ffb547;
}

.dlist a {
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  font-size: var(--fs-1);
}
.dlist a.on,
.dlist a:hover {
  background: var(--bg-2);
}
.dmain {
  min-width: 0;
}
.dfilters select {
  background: var(--bg-2);
  color: inherit;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  height: 28px;
}
.dsvg {
  width: 100%;
  height: auto;
}
.dtools {
  margin: 0 0 4px;
  text-align: right;
}
