/* =====================================================================
   The World — interface
   An instrument and its wall labels: one engraved scale (the ruler) is
   the memorable thing; every panel is a quiet porcelain label.
   ===================================================================== */
:root {
  --srch-row: 36px;         /* the row under the main buttons that holds the search field (desktop) */
  --srch-btn-w: 76px;       /* the Search button at the top right of a phone */
  --paper: #edf0f0;        /* porcelain panels */
  --paper-2: #e2e7e8;      /* insets, hover */
  --ink: #17202a;          /* text */
  --ink-2: #3a4651;        /* secondary text */
  --muted: #5b6873;        /* captions, meta */
  --rule: #c6ced2;         /* hairlines */
  --accent: #1e4e8f;       /* Prussian blue: the one interactive colour */
  --index: #f0c330;        /* the ruler's needle — "you are here" only */
  --screen: #0f1822;       /* figure insets */
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-panel: 6px; --r-ctl: 3px;
  --lift: 0 1px 0 rgba(23,32,42,.05), 0 18px 40px -22px rgba(0,0,0,.55);
  --ruler-w: 184px;
  /* legacy tokens still read by older scene code */
  --text: var(--ink); --dim: var(--muted); --line: var(--rule); --gold: var(--index); --panel: var(--paper);
}
* { box-sizing: border-box }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); font: 400 14px/1.45 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; font-variant-numeric: tabular-nums }
button { font: inherit; color: inherit }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none }
.glass { background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift) }

/* ---------- the instrument: scale ruler down the left edge ---------- */
#ruler { position: fixed; left: 0; top: 0; bottom: 0; width: var(--ruler-w); z-index: 6; background: rgba(237,240,240,.94); border-right: 1px solid var(--rule); display: flex; flex-direction: column }
#ruler .mark { padding: 16px 16px 10px; border-bottom: 1px solid var(--rule) }
#ruler .mark b { display: block; font: 600 21px/1.05 var(--serif); letter-spacing: -.01em; color: var(--ink) }
#ruler .mark span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px }
#ruler .scale { position: relative; flex: 1; margin: 10px 0 10px }
#ruler svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible }
#ruler svg .tk { stroke: var(--ink); stroke-width: 1 }
#ruler svg .tk.mi { stroke: #b2bcc2 }
#ruler svg .ex { font: 500 10.5px var(--sans); fill: var(--ink) }
#ruler svg .un { font: 400 9.5px var(--sans); fill: var(--muted) }
#ruler .lm { position: absolute; left: 62px; right: 6px; transform: translateY(-50%); border: 0; background: none; padding: 1px 4px; text-align: left; font: 400 12px/1.2 var(--sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: var(--r-ctl) }
#ruler .lm:hover { color: var(--accent); background: var(--paper-2) }
#ruler .lm.near { color: var(--ink); font-weight: 600 }
#ruler svg .lead { stroke: #a9b4ba; stroke-width: 1; fill: none }
#rulerMark { position: absolute; left: 0; right: -1px; height: 0; border-top: 2px solid var(--index); pointer-events: none; transition: top .08s linear }
#rulerMark .ro { position: absolute; left: 100%; top: -13px; margin-left: 0; background: var(--index); color: var(--ink); font: 600 13px/24px var(--sans); padding: 0 9px 0 8px; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; white-space: nowrap; box-shadow: 0 6px 16px -8px rgba(0,0,0,.6) }
#ruler .foot { border-top: 1px solid var(--rule); padding: 8px 12px 10px; display: flex; gap: 6px }
#ruler .foot button { flex: 1; border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 6px 4px; font-size: 12px; cursor: pointer; color: var(--ink-2) }
#ruler .foot button:hover { border-color: var(--accent); color: var(--accent) }
body.trackOpen #ruler { visibility: hidden }

/* ---------- top-right navigation ---------- */
#topright { position: fixed; top: 14px; right: 16px; z-index: 7; display: flex; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); overflow: hidden }
.tb { border: 0; border-left: 1px solid var(--rule); background: none; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--ink) }
.tb:first-child { border-left: 0 }
.tb:hover { background: var(--paper-2); color: var(--accent) }
.tb.off { color: var(--muted) }
.tb.on { box-shadow: inset 0 -2px 0 var(--accent) }

/* ---------- wall label: what you're looking at ---------- */
#timebar { display: flex; align-items: center; gap: 6px }
#timebar button { border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 2px 7px; font-size: 11.5px; cursor: pointer; color: var(--ink-2) }
#timebar button:hover { border-color: var(--accent); color: var(--accent) }
#timeT { color: var(--ink-2) }

/* ---------- scene controls ---------- */
#controls { position: fixed; left: calc(var(--ruler-w) + 16px); right: calc(var(--srch-w, 352px) + 32px); top: 14px; z-index: 6; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; justify-content: center; pointer-events: none }
#controls > * { pointer-events: auto }
.seg { display: flex; max-width: 100%; flex-wrap: wrap; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); overflow: hidden }
.seg button { border: 0; border-left: 1px solid var(--rule); background: none; padding: 7px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); white-space: nowrap }
.seg button:first-child { border-left: 0 }
.seg button:hover { background: var(--paper-2); color: var(--ink) }
.seg button.on { background: var(--ink); color: var(--paper) }
.seg .segMore { display: none }
@media (max-width: 860px) {
  /* a phone: the choice in force and one button that opens the rest (js/engine.js, seg) */
  .seg.fold { flex-wrap: nowrap }
  .seg.fold:not(.open) > button[data-k]:not(.on) { display: none }
  .seg.fold.open { flex-direction: column; flex-wrap: nowrap; max-height: 46vh; overflow-y: auto }
  .seg.fold.open > button { border-left: 0; border-top: 1px solid var(--rule); text-align: left }
  .seg.fold .segMore { display: block; color: var(--accent); font-weight: 600 }
  .seg.fold.open .segMore { order: -1; border-top: 0 }
  .seg button { min-height: 40px }
}
.act { border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 7px 13px; border-radius: var(--r-panel); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: var(--lift) }
.act:hover { background: #173f75 }
.molsel { max-width: 240px; padding: 7px 10px; border-radius: var(--r-panel); background: var(--paper); color: var(--ink); border: 1px solid rgba(23,32,42,.14); font: 12.5px var(--sans); box-shadow: var(--lift) }

/* ---------- zoom and tour ---------- */
#zoombtns { position: fixed; right: 16px; bottom: 16px; z-index: 6; display: flex; flex-direction: column; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); overflow: hidden }
#zoombtns button { width: 38px; height: 36px; border: 0; background: none; font: 400 20px/1 var(--sans); cursor: pointer; color: var(--ink) }
#zoombtns button + button { border-top: 1px solid var(--rule) }
#zoombtns button:hover { background: var(--paper-2); color: var(--accent) }
#tourbtns { position: fixed; right: 66px; bottom: 16px; z-index: 6; display: flex; flex-direction: column; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); overflow: hidden }
#tourbtns button { border: 0; background: none; padding: 0 12px; height: 36px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); text-align: left }
#tourbtns button + button { border-top: 1px solid var(--rule) }
#tourbtns button:hover { background: var(--paper-2); color: var(--accent) }

/* ---------- labels in the 3D world ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden }
.lbl { position: absolute; left: 0; top: 0; font: 500 12px/1 var(--sans); color: #fff; padding: 2px 4px 2px 11px; white-space: nowrap; pointer-events: auto; cursor: pointer; will-change: transform; text-shadow: 0 0 2px rgba(0,0,0,.95), 0 1px 3px rgba(0,0,0,.8) }
.lbl::before { content: ''; position: absolute; left: 2px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 1.5px rgba(0,0,0,.55) }
.lbl:hover { color: var(--index) }
.lbl.you { color: var(--index); font-weight: 600 }

#tip { position: fixed; z-index: 9; pointer-events: none; padding: 5px 9px; font-size: 12.5px; border-radius: var(--r-ctl); background: var(--paper); color: var(--ink); border: 1px solid rgba(23,32,42,.2); box-shadow: var(--lift); opacity: 0; transition: opacity .12s; white-space: nowrap }
#tip.show { opacity: 1 }
#tip small { color: var(--muted); margin-left: 6px }
#toasts { position: fixed; bottom: 22px; left: calc(50% + var(--ruler-w) / 2); transform: translateX(-50%); z-index: 12; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none }
.toast { background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--r-panel); font-size: 13px; box-shadow: var(--lift); max-width: 440px; text-align: center }
.toast.m { background: var(--paper); color: var(--ink); border: 1px solid var(--rule) }
#push { position: fixed; left: calc(50% + var(--ruler-w) / 2); bottom: 76px; transform: translateX(-50%); z-index: 6; padding: 9px 16px 11px; font-size: 13px; text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none; min-width: 250px }
#push.show { opacity: 1 }
#push .bar { height: 3px; background: var(--rule); margin-top: 7px; overflow: hidden }
#push .bar i { display: block; height: 100%; width: 0; background: var(--accent) }
#fade { position: fixed; inset: 0; background: #000; opacity: 1; pointer-events: none; z-index: 20 }

/* ---------- the card: everything about one thing ---------- */
#info { display: none; user-select: text; -webkit-user-select: text }   /* the card of what is selected: a section of #panel (see ONE PANEL at the end of this file) */
#info.open { display: block }
#info .x { position: absolute; top: 0; right: 0; border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--ink-2) }
#info .x:hover { border-color: var(--accent); color: var(--accent) }
#info .tag { font-size: 12.5px; color: var(--muted); padding-right: 36px }
#info .tag:empty { display: none }
#info h2 { font: 600 28px/1.12 var(--serif); letter-spacing: -.012em; margin: 4px 36px 8px 0; color: var(--ink) }
.cert { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); margin: 0 0 4px }
.cert i { width: 8px; height: 8px; background: var(--c) }
#info .tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--rule); margin: 16px 0 12px }
#info .tabs button { border: 0; background: none; padding: 6px 0 8px; margin-bottom: -1px; font-size: 13px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent }
#info .tabs button:hover { color: var(--ink) }
#info .tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500 }
#info .body { font: 400 15.5px/1.62 var(--serif); color: var(--ink) }
#info .body p { margin: 0 0 .7em; max-width: 62ch }
#info .body p b { font-weight: 600 }
#info .expert { font-size: 15px }
#info dl { display: grid; grid-template-columns: auto 1fr; margin: 12px 0 4px; border-top: 1px solid var(--rule) }
#info dt, #info dd { padding: 7px 0; border-bottom: 1px solid var(--rule); margin: 0 }
#info dt { font-size: 12.5px; color: var(--muted); padding-right: 14px }
#info dd { font-size: 13.5px; color: var(--ink) }
#info .fun { margin: 14px 0 4px; padding: 2px 0 2px 12px; border-left: 2px solid var(--accent); font: italic 400 14.5px/1.55 var(--serif); color: var(--ink-2) }
#info .fun b { display: block; font: 600 12.5px var(--sans); font-style: normal; color: var(--ink); margin-bottom: 2px }
#info .note { margin-top: 10px; font: italic 13px/1.5 var(--serif); color: var(--muted) }
.formula { margin: 12px 0 4px; padding: 10px 12px; background: var(--paper-2); border-radius: var(--r-ctl); font: italic 400 16px/1.5 var(--serif); color: var(--ink); overflow-x: auto }
.regime { margin-top: 10px; font-size: 13px; color: var(--ink-2); padding: 9px 11px; background: var(--paper-2); border-radius: var(--r-ctl) }
ul.ev { margin: 4px 0 0; padding-left: 18px; font: 14px/1.5 var(--serif); color: var(--ink-2) }
ul.ev li + li { margin-top: 3px }
#info .btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px }
#info .zoom { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 8px 14px; border-radius: var(--r-panel); font-size: 13px; font-weight: 500; cursor: pointer }
#info .zoom:hover { background: #173f75 }
#info .zoom.alt, #info .zoom.lab { background: #fff; color: var(--accent) }
#info .zoom.alt:hover, #info .zoom.lab:hover { background: var(--paper-2) }
#info .refs { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rule) }
#info .rh, .pop .rh { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px }
.chips { display: block; font: 14.5px/1.6 var(--serif); color: var(--muted) }
.chip { display: inline; border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: rgba(30,78,143,.3); text-underline-offset: 3px }
.chip:hover { text-decoration-color: var(--accent) }
.chip + .chip::before { content: ', '; color: var(--muted); text-decoration: none; display: inline-block; white-space: pre }
.chip.pr { font-weight: 600 }
.chip.lock { color: var(--muted); cursor: default }
a.ref { display: block; padding: 6px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink-2); font-size: 13px; line-height: 1.35 }
a.ref:last-child { border-bottom: 0 }
a.ref b { display: block; font-weight: 500; color: var(--accent) }
a.ref:hover b { text-decoration: underline }
.kn { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: none; padding: 8px 0; cursor: pointer; font-size: 13.5px; color: var(--ink) }
.kn:hover { color: var(--accent) }
.kn span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35 }
.kn.chip { display: inline; width: auto; border: 0; padding: 0; font: inherit }
.simhit { display: block; width: 100%; text-align: left; padding: 8px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; cursor: pointer; font-size: 13.5px }
.simhit span { display: block; font-size: 12px; color: var(--muted) }
#info .mini, .mini { font-size: 12px; color: var(--muted) }

/* figures inside cards: a dark instrument screen on the label */
.vzh { position: relative; margin: 14px 0 4px }
.vz { position: relative }
.vz canvas { display: block; width: 100%; background: var(--screen); border-radius: var(--r-ctl); touch-action: none }
.vzc { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 0 2px; align-items: center }
.vzc label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex: 1 1 150px }
.vzc input { flex: 1; min-width: 60px; accent-color: var(--accent) }
.vzc b { color: var(--ink); font-weight: 500; min-width: 40px; font-size: 12px; text-align: right }
.vzp { border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 3px 9px; cursor: pointer; font-size: 11.5px; color: var(--ink-2) }
.vzr { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 12.5px; color: var(--muted); padding-top: 2px }
.vzr b { color: var(--ink); font-weight: 600 }
.vzcap { font: italic 400 13.5px/1.5 var(--serif); color: var(--ink-2); padding: 6px 0 0 }
.vzbig { position: absolute; top: 6px; right: 6px; height: 24px; padding: 0 8px; border-radius: var(--r-ctl); border: 0; background: rgba(237,240,240,.14); color: #dfe6ea; cursor: pointer; font-size: 11.5px }
.vzbig:hover { background: rgba(237,240,240,.28) }
#vizModal { position: fixed; inset: 0; z-index: 45; background: rgba(10,14,20,.6); display: none; align-items: center; justify-content: center }
#vizModal.open { display: flex }
#vizModal .vm { width: min(920px, 94vw); padding: 18px 22px 20px; position: relative; background: var(--paper); border-radius: var(--r-panel); box-shadow: var(--lift) }
#vizModal h3 { font: 600 22px var(--serif); margin: 0 0 12px }
#vizModal .x { position: absolute; top: 12px; right: 12px; border: 0; background: none; font-size: 18px; width: 30px; height: 30px; cursor: pointer; color: var(--muted) }

/* track prev / next on the card */
.trnav { display: flex; align-items: stretch; gap: 0; margin: 12px 0 0; border: 1px solid var(--rule); border-radius: var(--r-panel); overflow: hidden }
.trnav button { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: #fff; padding: 7px 10px; font-size: 12px; cursor: pointer; color: var(--ink-2); text-align: left }
.trnav button:last-child { text-align: right }
.trnav button:hover:not(:disabled) { color: var(--accent); background: var(--paper-2) }
.trnav button:disabled { color: var(--rule); cursor: default }
.trnav span { flex: none; display: flex; align-items: center; padding: 0 10px; font-size: 11.5px; color: var(--muted); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule) }

/* ---------- panels: library and tracks ---------- */
.pop { position: fixed; top: 62px; right: 16px; width: 380px; max-height: calc(100% - 140px); overflow-y: auto; z-index: 9; padding: 18px 20px; display: none; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); user-select: text; scrollbar-width: thin }
.pop.open { display: block }
.pop h3 { margin: 0 0 4px; font: 600 22px var(--serif) }
.pop .sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.45 }
#library input { width: 100%; padding: 9px 11px; border-radius: var(--r-ctl); border: 1px solid var(--rule); background: #fff; color: var(--ink); font: 14px var(--sans); outline: none }
#library input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,78,143,.14) }
#libRes { margin-top: 10px }
.jl { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 16px 0 4px }
.term { padding: 7px 0; border-bottom: 1px solid var(--rule) }
.term .tt { font: 600 14px var(--serif); margin-bottom: 2px }
.lic { margin-top: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.45 }
details summary { cursor: pointer; padding: 6px 0; font-size: 13.5px; list-style: none; color: var(--ink) }
details summary::-webkit-details-marker { display: none }
details summary::before { content: '+'; display: inline-block; width: 14px; color: var(--muted) }
details[open] > summary::before { content: '−' }
#tracks { position: fixed; left: 0; top: 0; bottom: 0; right: auto; width: 360px; max-height: none; border-radius: 0; border-width: 0 1px 0 0; padding: 18px 18px 24px }
#tracks > details > summary { font: 600 17px var(--serif) }
#tracks details details { margin-left: 14px }
#tracks details details > summary { font-size: 13px; color: var(--ink-2) }
.meter { height: 3px; background: var(--rule); margin: 6px 0 10px }
.meter i { display: block; height: 100%; background: var(--accent) }
.trn { display: flex; flex-direction: column; margin: 2px 0 10px 14px; border-left: 1px solid var(--rule) }
.trk { text-align: left; border: 0; background: none; padding: 4px 10px; font-size: 13px; cursor: pointer; color: var(--ink-2) }
.trk:hover { color: var(--accent) }
.trk.seen { color: var(--muted) }
.trk.seen::after { content: ' (visited)'; font-size: 11px; color: var(--rule) }
.trk.cur { color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent) }
.trk .lb { font-size: 11px; color: var(--accent); font-weight: 500 }

/* ---------- welcome ---------- */
#help { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(8,12,18,.55) }
#help.hide { display: none }
#help .card { width: min(600px, 92vw); max-height: 90vh; overflow: auto; padding: 30px 34px 28px; background: var(--paper); border-radius: var(--r-panel); box-shadow: var(--lift) }
#help h1 { font: 600 34px/1.08 var(--serif); letter-spacing: -.015em; margin: 0 0 12px }
#help p { font: 16px/1.6 var(--serif); color: var(--ink-2); margin: 0 0 18px; max-width: 60ch }
#help .grid { display: grid; grid-template-columns: 130px 1fr; border-top: 1px solid var(--rule) }
#help .grid > * { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px }
#help .key { font-weight: 500; color: var(--ink) }
#help .grid span:not(.key) { color: var(--ink-2) }
#help .go { margin-top: 20px; border: 0; background: var(--accent); color: #fff; padding: 11px 20px; border-radius: var(--r-panel); font-size: 14px; font-weight: 500; cursor: pointer }
#help .go:hover { background: #173f75 }

/* ---------- labs and processes ---------- */
#lab { position: fixed; inset: 0; z-index: 40; background: #0a0e17; display: none; flex-direction: column }
#lab.open { display: flex }
#lab .labbar { height: 48px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: var(--paper); border-bottom: 1px solid var(--rule); color: var(--ink) }
#lab .labbar button { border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2) }
#lab .labbar button:hover { border-color: var(--accent); color: var(--accent) }
#lab .labbar b { font: 600 18px var(--serif) }
#labFrom { color: var(--muted); font-size: 12.5px }
#labBody { position: relative; flex: 1; overflow: hidden }
.labload { padding: 40px; color: #9aa6b0 }
#proc { display: none; margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--rule) }   /* the steps of a process: a section of the panel (#procSlot) */
#proc.open { display: block }
#proc .ph { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; color: var(--muted) }
#proc .ph b { color: var(--ink); font-weight: 600 }
#proc .ph .x { margin-left: auto; border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--ink-2) }
#proc h3 { font: 600 19px var(--serif); margin: 8px 0 4px }
#proc p { font: 15px/1.55 var(--serif); color: var(--ink-2); margin: 0 0 12px }
#proc .pb { display: flex; align-items: center; gap: 10px }
#proc .pb button { border: 1px solid var(--accent); background: #fff; color: var(--accent); padding: 6px 14px; border-radius: var(--r-panel); cursor: pointer; font-size: 12.5px }
#proc .pb button:last-child { background: var(--accent); color: #fff }
#proc .pb button:disabled { opacity: .35 }
#proc .dots { flex: 1; display: flex; gap: 4px; justify-content: center }
#proc .dots i { width: 18px; height: 3px; background: var(--rule) }
#proc .dots i.on { background: var(--accent) }

/* ---------- older in-scene widgets (periodic table, orbitals, spectra…) ---------- */
.wrapRel { position: relative }
.ptable { position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%); display: none; padding: 10px; z-index: 9; width: max-content }
.ptable.open { display: block }
.ptable .grid { display: grid; grid-template-columns: repeat(18, 30px); gap: 3px }
.ptable button { width: 30px; height: 32px; border-radius: 2px; border: 0; cursor: pointer; font: 600 11px var(--sans); color: #fff; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1 }
.ptable button small { font-size: 8px; font-weight: 400; opacity: .75 }
.ptable button.on { outline: 2px solid var(--ink); outline-offset: 1px }
.ptable .lg { font-size: 11px; color: var(--muted); margin-top: 6px; text-align: center }
.cfg { display: flex; gap: 10px; align-items: flex-end; padding: 7px 10px; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); max-width: min(640px, calc(100vw - 40px)); overflow-x: auto }
.cfg .sh { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; padding: 2px 3px; border-radius: var(--r-ctl) }
.cfg .sh:hover { background: var(--paper-2) }
.cfg .sh.on { box-shadow: inset 0 -2px 0 var(--accent) }
.cfg .bx { display: flex; gap: 2px }
.cfg .bx i { width: 15px; height: 17px; border: 1px solid var(--rule); font-style: normal; font-size: 10px; display: flex; align-items: center; justify-content: center; color: var(--accent); background: #fff }
.cfg .nm { font: 600 10.5px var(--sans); color: var(--ink-2) }
.cfg .lbl0 { font-size: 11px; color: var(--muted); align-self: center; white-space: nowrap }
#seq { display: flex; gap: 4px; padding: 6px 8px; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); overflow-x: auto; max-width: min(720px, calc(100vw - 40px)) }
.codon { display: flex; flex-direction: column; align-items: center; padding: 2px 4px; background: #fff; border: 1px solid var(--rule) }
.codon .l { font: 600 12px var(--sans); letter-spacing: .04em }
.codon .aa { font-size: 9.5px; color: var(--muted) }
#seqLbl { font-size: 11px; color: var(--muted); align-self: center; padding: 0 4px; white-space: nowrap }
.spec { position: relative; width: 240px; height: 18px; background: linear-gradient(90deg,#6a00d8,#0028ff,#00a8ff,#00d860,#d8ef00,#ffb000,#ff2a00,#800000); overflow: hidden }
.spec i { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff }
.specw { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); font-size: 11.5px; color: var(--muted) }
.q { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13px; line-height: 1.35 }
.q .ck { width: 16px; height: 16px; border: 1px solid var(--muted); flex: none; display: flex; align-items: center; justify-content: center; font-size: 10px; margin-top: 1px }
.q.done { color: var(--muted) }
.q.done .ck { background: var(--accent); border-color: var(--accent); color: #fff }
.q .h { font-size: 12px; color: var(--muted); margin-top: 2px }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  :root { --ruler-w: 52px }
  #ruler .mark span, #ruler .lm { display: none }
  #ruler .mark { padding: 12px 6px 8px; text-align: center }
  #ruler .mark b { font-size: 15px }
  #ruler .foot { display: none }
  #controls { left: calc(var(--ruler-w) + 8px); right: calc(var(--srch-btn-w) + 8px); top: 52px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap }
  #tourbtns { display: none }
  #zoombtns { right: 8px; bottom: 10px }
  #controls { flex-wrap: wrap !important; overflow: visible !important; row-gap: 4px }
  #library.open ~ #controls, #tracks.open ~ #controls { display: none }
  #topright { right: 8px; top: 8px }
  .tb { padding: 7px 10px; font-size: 12.5px }
  .pop { left: calc(var(--ruler-w) + 8px); right: 8px; width: auto }
  #tracks { width: auto; right: 0 }
  .ptable .grid { grid-template-columns: repeat(18, 17px); gap: 2px }
  .ptable button { width: 17px; height: 22px; font-size: 8px }
  .ptable button small { display: none }
}

/* ---- tour bar and the core-sample block of a card ---- */
#tourBar { position: fixed; left: 50%; top: 58px; transform: translateX(-50%); z-index: 30; display: none; align-items: center; gap: 12px; padding: 7px 8px 7px 14px; max-width: calc(100vw - 32px); background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 6px 22px rgba(20, 30, 50, .18); font: 13px/1.3 var(--sans); }
#tourBar.on { display: flex; }
#tourBar button { font: inherit; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); cursor: pointer; }
#tourBar button:hover { border-color: var(--accent); color: var(--accent); }
.core { margin: 10px 0 12px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: rgba(255, 255, 255, .45); }
.core .where { margin: 0 0 8px; font: 14px/1.4 var(--serif); }
.core ol { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: c; }
.core li { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; border-top: 1px solid var(--rule); font: 13px/1.3 var(--sans); }
.core li:first-child { border-top: 0; }
.core li .core-go { flex: 1; text-align: left; background: none; border: 0; padding: 2px 0; color: var(--accent); cursor: pointer; font: inherit; }
.core li .core-go:hover { text-decoration: underline; }
.core li.cur .core-go { color: var(--ink); font-weight: 600; }
.core li.cur::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); align-self: center; }
.core li.off .core-go { color: var(--muted); }
.core li.off .core-go::after { content: ' (hidden)'; font-size: 11px; }
.core .gap { color: var(--muted); font-size: 12.5px; margin: 4px 0 8px; font-style: italic; }
.core li .dp { color: var(--muted); font-size: 12px; white-space: nowrap; }
.core li .core-peel { font: 12px var(--sans); color: var(--muted); background: none; border: 1px solid var(--rule); border-radius: 5px; padding: 1px 6px; cursor: pointer; }
.core li .core-peel:hover { color: var(--accent); border-color: var(--accent); }
.core li.more { color: var(--muted); }
.cnote { margin: 6px 0 0; color: var(--muted); font: 12px/1.4 var(--sans); }
@media (max-width: 860px) { #tourBar { top: 52px; font-size: 12px; } }

/* ---- one card: header, back, certainty row ---- */
#info .cardhead { display: flex; align-items: baseline; gap: 10px; padding-right: 36px; min-height: 18px }
#info .cardhead .tag { padding-right: 0 }
#info .cardhead { flex-wrap: wrap } #info .cardhead .thNote { order: 2; flex: 1 1 100%; margin-top: 4px }   /* a thing's model note goes under the kind line, the panel's full width (it stood beside it, and the kind line read like a stray column) */
.back { border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--accent); flex: none }
.back:hover:not(:disabled) { border-color: var(--accent) }
.back:disabled { color: var(--muted); opacity: .55; cursor: default }
.back[hidden] { display: none }
#info .certrow { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2) }
#info .rs { font-size: 12px; color: var(--muted); margin: 6px 0 2px }
#info .rs:first-child { margin-top: 0 }
.gohit b { font-weight: 500; color: var(--accent) }

/* ---- the path, in the panel's head: Back on the first line, the path on the next, each step a whole button; the middle folds into "N more" (a list in the panel) ---- */
#crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; flex: 1 }
#crumbList { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: 12.5px; line-height: 1.3; min-width: 0; flex: 1 1 100% }
#crumbList li { flex: 0 1 auto; min-width: 0; display: flex; align-items: center }
#crumbList li + li::before { content: '\203A'; color: var(--muted); margin: 0 2px; flex: none }
.crumb { border: 0; background: none; padding: 3px 5px; min-height: 26px; font: inherit; color: var(--accent); cursor: pointer; border-radius: 3px; white-space: normal; overflow-wrap: anywhere; text-align: left }
.crumb:hover { background: var(--paper-2); text-decoration: underline }
.crumb.cur { color: var(--ink); font-weight: 600; cursor: default; display: inline-flex; align-items: center }
.crumb.cur:hover { background: none; text-decoration: none }
.crumb.more { color: var(--ink-2); border: 1px solid var(--rule); background: #fff; padding: 2px 8px; white-space: nowrap }
.crumb.more[aria-expanded="true"] { border-color: var(--accent); color: var(--accent) }
#crumbMenu { flex: 1 1 100%; order: 3; max-height: min(52vh, 420px); overflow-y: auto; margin: 2px 0 0; padding: 4px 0; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-ctl); overscroll-behavior: contain }
#crumbMenu[hidden] { display: none }
#crumbMenu .cmi { display: flex; align-items: center; width: 100%; min-height: 32px; padding: 4px 12px; border: 0; background: none; font: 13px/1.3 var(--sans); color: var(--accent); text-align: left; cursor: pointer; overflow-wrap: anywhere }
#crumbMenu button.cmi:hover, #crumbMenu button.cmi:focus-visible { background: var(--paper-2); text-decoration: underline }
#crumbMenu .cmi.cur { color: var(--ink); font-weight: 600; cursor: default }

/* ---- welcome, first minute ---- */
#help .lead { font: 17px/1.5 var(--serif); color: var(--ink); margin: 0 0 14px }
#help .steps { list-style: none; counter-reset: s; margin: 0 0 16px; padding: 0 }
#help .steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; padding: 10px 0; border-top: 1px solid var(--rule) }
#help .steps li::before { content: counter(s); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 600 13px/24px var(--sans); text-align: center; margin-top: 1px }
#help .steps b { font: 600 18px/1.25 var(--serif); color: var(--ink) }
#help .steps span { font: 14px/1.5 var(--sans); color: var(--ink-2) }
#help .fine { margin-top: 12px; font-size: 12px; color: var(--muted) }
@media (max-width: 860px) {
  /* things to tap are at least 40 px tall: the steps of the path were 22 px and "Got it" 19 px */
  #crumbList .crumb { min-height: 40px; display: inline-flex; align-items: center; padding: 0 6px }
  #crumbMenu .cmi { min-height: 44px }
  #panelHint { align-items: center } #panelHint button { min-height: 40px; padding: 0 8px }
  /* and the rest the tester measured on a phone: Back 23 px, Minimise 23, Time 21, Close 28 x 28, the zoom buttons 38 x 36, Leave trail 20 */
  #navBack, #panelMin { min-height: 40px; padding: 0 12px }
  #clockBtn { position: relative; pointer-events: auto }   /* the field of view stays one small line: the Time button's tap area reaches past its box */
  #clockBtn::before { content: ''; position: absolute; left: -4px; right: -4px; top: -14px; bottom: -14px }
  #info .x { min-height: 40px; min-width: 44px }
  #zoombtns button { width: 44px; height: 44px }
  .tr-leave, #trail .tr-btns button { min-height: 40px; padding: 0 10px }
  #help .card { padding: 20px 18px 18px }
  #help h1 { font-size: 27px }
  #help .grid { grid-template-columns: 96px 1fr }
}

@media (pointer: coarse), (max-width: 860px) { .kb { display: none } }
.tours2 { display: none; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap }
.tours2 button { font: inherit; padding: 5px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); cursor: pointer }
@media (max-width: 860px) { .tours2 { display: flex } }


/* ---- learning tools: panels you can always close, label priority, caption that folds ---- */
.lbl.lblhide { visibility: hidden; pointer-events: none }
.pop .px { position: absolute; top: 14px; right: 14px; border: 1px solid var(--rule); background: #fff; color: var(--ink-2); border-radius: var(--r-ctl); padding: 4px 10px; font-size: 12.5px; cursor: pointer }
.pop .px:hover { border-color: var(--accent); color: var(--accent) }
#topright { z-index: 12 }
#tracks { z-index: 9 }
.trnav button { white-space: normal; text-align: left; line-height: 1.25 }
@media (max-width: 860px) {
  #tracks { top: 52px; left: 8px; right: 8px; bottom: 8px; width: auto; border-radius: var(--r-panel); border-width: 1px }
  #help .go { position: sticky; bottom: -18px; box-shadow: 0 0 0 10px var(--paper) }
}

/* ---- performance meter (js/perf.js): shown with ?stats=1 or Shift+P; sits left of the zoom buttons, and left of the card when one is open ---- */
#perf { position: fixed; right: 66px; bottom: 16px; width: 372px; max-width: calc(100vw - 32px); z-index: 11; display: none; padding: 10px 12px 10px; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); font: 400 12px/1.4 var(--sans); color: var(--ink); user-select: text; -webkit-user-select: text }
#perf.open { display: block }
#perf header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px }
#perf header b { font: 600 15px/1.2 var(--serif) }
#perf button { border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 2px 8px; font-size: 11.5px; cursor: pointer; color: var(--ink-2) }
#perf button:hover { border-color: var(--accent); color: var(--accent) }
#perf .pf-btns { display: flex; gap: 6px }
#perf dl { display: grid; grid-template-columns: auto 1fr; margin: 0; border-top: 1px solid var(--rule) }
#perf dt, #perf dd { margin: 0; padding: 3px 0; border-bottom: 1px solid var(--rule) }
#perf dt { color: var(--muted); padding-right: 12px; white-space: nowrap }
#perf dd { overflow-wrap: anywhere }
#perf .pf-warn { margin: 0 0 8px; padding: 6px 8px; border-left: 3px solid var(--accent); background: #fff; font-size: 12px; line-height: 1.45 }
#perf .pf-sw { margin-top: 8px; display: grid; gap: 4px }
#perf .pf-row { display: flex; align-items: center; justify-content: space-between; gap: 8px }
#perf .pf-row > span:first-child { color: var(--muted) }
#perf .pf-seg { display: flex; flex-wrap: wrap; justify-content: flex-end }
#perf .pf-seg button { border-radius: 0; margin-left: -1px; padding: 1px 7px }
#perf .pf-seg button.on { background: var(--ink); color: var(--paper); border-color: var(--ink) }
#perf .pf-foot { margin-top: 8px; color: var(--muted); font-size: 11.5px; line-height: 1.4 }
#perf .pf-note { margin-top: 6px; color: var(--muted); min-height: 0 }
#perf .pf-note:empty { display: none }
#perf textarea { width: 100%; height: 110px; margin-top: 6px; font: 11px/1.35 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--rule); border-radius: var(--r-ctl); background: #fff; color: var(--ink); resize: vertical }
/* phone: the meter sits under the top buttons, scrolls inside itself (it never traps a drag meant for the page: the rest of the screen is still the canvas), and its Hide button stays in view */
#perf header { position: sticky; top: -10px; z-index: 1; margin: -10px -12px 6px; padding: 10px 12px 6px; background: var(--paper) }
@media (max-width: 860px) {
  #perf, body.panelOpen #perf { right: 8px; left: 8px; bottom: auto; top: 96px; width: auto; max-height: min(52vh, calc(100vh - 150px)); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch }
  #perf button { min-height: 34px; padding: 4px 12px }
  #perf .pf-seg button { min-height: 30px; padding: 3px 9px }
  #perf textarea { height: 80px }
}

/* what is still arriving (js/nodes.js loadNote): a quiet line at the bottom of the view, gone when everything has loaded */
#loadNote { position: fixed; left: calc(50% + var(--ruler-w) / 2); bottom: 118px; transform: translateX(-50%); z-index: 6; display: none; padding: 5px 12px; max-width: min(520px, calc(100vw - 32px)); background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); font: italic 400 13px/1.4 var(--serif); color: var(--ink-2); text-align: center; pointer-events: none }
#loadNote.on { display: block }
@media (max-width: 860px) { #loadNote { left: 50%; bottom: auto; top: 100px; width: max-content } }
#library .libsb { display: block; width: 100%; margin: 4px 0 0; padding: 8px 11px; border-radius: var(--r-ctl); border: 1px solid var(--accent); background: #fff; color: var(--accent); font: 500 14px var(--sans); cursor: pointer; text-align: left }
#library .libsb:hover { background: var(--accent); color: #fff }

/* phone: the places on the scale, in a small list beside the ruler strip (the strip has no room for names) */
#scalePop { display: none; position: fixed; left: calc(var(--ruler-w) + 6px); width: min(260px, calc(100vw - var(--ruler-w) - 16px)); z-index: 14; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); padding: 6px; max-height: 70vh; overflow-y: auto }
#scalePop.open { display: block }
#scalePop .sph { font: 400 12.5px/1.4 var(--sans); color: var(--muted); padding: 4px 6px 6px }
#scalePop button { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 8px; border-radius: var(--r-ctl); font: 400 14px/1.2 var(--sans); color: var(--ink); text-align: left; cursor: pointer; min-height: 40px; align-items: center }
#scalePop button span { color: var(--muted); font-size: 12px; white-space: nowrap }
#scalePop button:hover, #scalePop button:active { background: var(--paper-2) }
#scalePop button.near b { font-weight: 600; color: var(--accent) }
#scalePop .spx { color: var(--accent); justify-content: center; border-top: 1px solid var(--rule); border-radius: 0 0 var(--r-ctl) var(--r-ctl); margin-top: 2px }


/* ===================== ONE PANEL =====================
   Everything there is to read lives in #panel, on the right: the path (where you are) and Back at the top; then a question trail
   when one is playing (#trail), the steps of a process (#proc), the card of the thing you selected (#info) or else the place
   itself (#place); then the scene's own explanations (#sceneSecs: "What this picture is", keys, legends), and the clock (#timeSec).
   Minimise folds it to #panelTab at the right edge (a pill at the bottom on a phone). Nothing else on the page is an
   information box: the field of view is one small line (#fov). */
:root { --panel-w: 384px }
#panel { position: fixed; right: 16px; top: calc(62px + var(--srch-row)); bottom: 16px; width: var(--panel-w); max-width: calc(100vw - 32px); z-index: 8; display: flex; flex-direction: column; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-radius: var(--r-panel); box-shadow: var(--lift); transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s }
#panel.min { transform: translateX(calc(100% + 40px)); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s .28s }
@media (prefers-reduced-motion: reduce) { #panel, #panel.min { transition: none } }
#panelHead { flex: none; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 9px 12px 8px 14px; border-bottom: 1px solid var(--rule) }
#panelMin { flex: none; border: 1px solid var(--rule); background: #fff; border-radius: var(--r-ctl); padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--ink-2) }
#panelMin:hover { border-color: var(--accent); color: var(--accent) }
#panelBody { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 22px 22px; user-select: text; -webkit-user-select: text; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; scrollbar-gutter: stable; overscroll-behavior: contain }
#panel .grab { display: none; position: absolute; left: 0; right: 0; top: 0; height: 22px; cursor: ns-resize; touch-action: none; z-index: 2 }
#panel .grab::after { content: ''; position: absolute; left: 50%; top: 7px; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: var(--rule) }
#panelHint { margin: 0 0 14px; padding: 8px 10px; background: var(--paper-2); border-radius: var(--r-ctl); font: 13px/1.45 var(--sans); color: var(--ink-2); display: flex; gap: 10px; align-items: baseline; justify-content: space-between }
#panelHint[hidden], body.trailOn #panelHint { display: none }
#panelHint button { flex: none; border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px }
/* the card of what is selected */
#info { position: relative; padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--rule) }
#info .cardhead { padding-right: 62px; min-height: 22px }
#info h2 { margin-right: 0; overflow-wrap: anywhere }
#info .lookrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px }
#info .lookrow .zoom { padding: 7px 13px }
#info .lookNote { margin: -6px 0 12px }
#info .nobuilt, #place .nobuilt { margin: 0 0 12px; padding: 8px 10px; border-left: 3px solid var(--accent); background: #fff; font: 14px/1.5 var(--serif); color: var(--ink) }
#info .nobuilt { margin-right: 66px }   /* clear of the card's Close button, which sits at the top right */
#place .nobuilt:empty { display: none }
#place .nobuilt { margin-top: 12px }
#selMark { position: fixed; left: 0; top: 0; z-index: 4; display: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(23,32,42,.75), inset 0 0 0 1px rgba(23,32,42,.75); pointer-events: none }
/* the place itself: shown in full when nothing is selected, as two quiet lines under a card */
#place .ptag { font-size: 12.5px; color: var(--muted) }
#place .n { font: 600 28px/1.12 var(--serif); letter-spacing: -.012em; margin: 4px 0 8px; color: var(--ink); overflow-wrap: anywhere }
#place .d { font: 400 15.5px/1.62 var(--serif); color: var(--ink); max-width: 62ch }
#place .d:empty, #place .nt:empty, #place .tn:empty { display: none }
#place .nt { margin-top: 10px; font: italic 13.5px/1.5 var(--serif); color: var(--muted) }
#place .tn { margin-top: 6px; font: 12.5px/1.45 var(--sans); color: var(--muted); overflow-wrap: anywhere }
#place .btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px }
#place .zoom { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 8px 14px; border-radius: var(--r-panel); font-size: 13px; font-weight: 500; cursor: pointer }
#place .zoom:hover { background: #173f75 }
#place .zoom.alt { background: #fff; color: var(--accent) }
#place .zoom.alt:hover { background: var(--paper-2) }
#place .zoom[hidden] { display: none }
#panel.hasSel #place .n { font: 600 17px/1.25 var(--serif); margin: 2px 0 2px }
#panel.hasSel #place .d, #panel.hasSel #place .btnrow { display: none }
#panel.hasSel #place .nt { margin-top: 4px }
/* sections: the scene's own explanations, and the clock */
.psec { border-top: 1px solid var(--rule); margin-top: 16px }
.psec > summary { cursor: pointer; font: 600 12.5px var(--sans); color: var(--ink); padding: 10px 0 8px; list-style: none; display: flex; justify-content: space-between; gap: 10px }
.psec > summary::-webkit-details-marker { display: none }
.psec > summary::before, .psec[open] > summary::before { content: none; display: none }
.psec > summary::after { content: 'Show'; flex: none; font-weight: 400; font-size: 12px; color: var(--accent) }
.psec[open] > summary::after { content: 'Hide' }
.psec > summary:hover::after { text-decoration: underline }
#sceneSecs .psec > div { position: static; display: block; left: auto; right: auto; top: auto; bottom: auto; width: auto; max-width: none; max-height: none; overflow: visible; z-index: auto; margin: 0; padding: 0 0 8px; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 13px; line-height: 1.5; color: var(--ink-2) }
#sceneSecs .psec > div[hidden], #sceneSecs .psec.empty { display: none }
#sceneSecs .pxh:first-child, #sceneSecs .thLH { display: none }   /* the section's summary already carries the title */
#sceneSecs .pxsm .pxh:first-child { display: block }
#sceneSecs .atomNote .nl { display: block; font: 600 16px/1.25 var(--serif); color: var(--ink) }
#sceneSecs .atomSpec .sh { font-weight: 600; color: var(--ink) }
#timebar { flex-wrap: wrap; padding: 0 0 8px; font-size: 12.5px; color: var(--muted) }
#timeSec[hidden] { display: none }
/* minimised: a slim tab at the right edge */
#panelTab { position: fixed; right: 0; top: calc(66px + var(--srch-row)); z-index: 8; display: none; align-items: stretch; background: var(--paper); border: 1px solid rgba(23,32,42,.14); border-right: 0; border-radius: var(--r-panel) 0 0 var(--r-panel); box-shadow: var(--lift); max-width: min(460px, calc(100vw - var(--ruler-w) - 24px)); overflow: hidden }
body.panelMin #panelTab { display: flex }
#panelTabB { border: 0; background: none; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 11px; cursor: pointer; min-width: 0; color: var(--ink) }
#panelTabB:hover { background: var(--paper-2) }
#panelTabB .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; font: 600 14px/1.2 var(--serif) }
#panelTabB .to { flex: none; color: var(--accent); font-size: 12px }
#panelTabB .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--rule); transition: background .4s }
#panelTab.new .dot { background: var(--accent) }
#tabTrail { display: flex }
#tabTrail[hidden] { display: none }
#tabTrail button { border: 0; border-right: 1px solid var(--rule); background: none; padding: 7px 10px; font-size: 12.5px; cursor: pointer; color: var(--accent); white-space: nowrap }
#tabTrail button:hover:not(:disabled) { background: var(--paper-2) }
#tabTrail button:disabled { color: var(--muted); opacity: .55; cursor: default }
/* the field of view: one line, no box of its own to read */
#fov { position: fixed; left: calc(var(--ruler-w) + 14px); bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); pointer-events: none }
#fov .k, #clockBtn { background: rgba(237,240,240,.82); padding: 2px 8px; border-radius: var(--r-ctl) }
#fov .k.g { color: var(--ink); background: rgba(237,240,240,.92) }   /* what an empty stretch of a descent is doing (zoomStretch) */
#fov .k.g[hidden] { display: none }
@media (min-width: 861px) {   /* the stretch line wraps inside the free area: never under the panel or the zoom buttons */
  #fov { right: 84px; flex-wrap: wrap; row-gap: 4px }
  body.panelOpen #fov { right: calc(var(--panel-w) + 84px) }
  #fov .k.g { white-space: normal; flex: 0 1 auto; min-width: 0 }
}
#clockBtn { pointer-events: auto; border: 0; font-size: 12px; color: var(--accent); cursor: pointer }
#clockBtn:hover { background: var(--paper) ; text-decoration: underline }
#clockBtn[hidden] { display: none }
body.trackOpen #fov { left: 376px }
/* what moves out of the panel's way while it is open */
body.panelOpen #controls { right: calc(var(--panel-w) + 32px) }
body.panelOpen #zoombtns { right: calc(var(--panel-w) + 28px) }
body.panelOpen #perf { right: calc(var(--panel-w) + 78px) }
@media (min-width: 861px) { body.panelOpen #toasts, body.panelOpen #push, body.panelOpen #loadNote { left: calc(50% + var(--ruler-w) / 2 - var(--panel-w) / 2 - 8px) } }   /* messages sit in the middle of the free area */
@media (max-width: 860px) {
  #panel { left: calc(var(--ruler-w) + 6px); right: 6px; top: auto; bottom: 8px; width: auto; max-width: none; height: 36vh; transition: transform .25s, height .2s, visibility 0s }
  #panel.min { transform: translateY(calc(100% + 40px)); transition: transform .25s, height .2s, visibility 0s .25s }
  #panel.tall { height: 82vh }
  #panel .grab { display: block }
  #panelHead { padding: 20px 10px 7px 12px }
  #panelBody { padding: 10px 14px 16px }
  #place .n { font-size: 22px }
  #place .d { font-size: 15px; line-height: 1.5 }
  #panelTab { top: auto; bottom: 10px; right: auto; left: calc(var(--ruler-w) + 8px); border-right: 1px solid rgba(23,32,42,.14); border-radius: 17px; max-width: calc(100vw - var(--ruler-w) - 66px) }
  #panelTabB { padding: 8px 14px 8px 12px; min-height: 34px }
  #panelTabB .tt { max-width: 38vw }
  #tabTrail button { padding: 8px 9px }
  #tabTrail:not([hidden]) ~ #panelTabB .to { display: none }   /* "Show text" already opens it */
  #trail .tr-dots { gap: 5px }
  body.panelOpen #controls { right: calc(var(--srch-btn-w) + 8px) }
  body.panelOpen #zoombtns { right: 8px; bottom: calc(36vh + 16px) }
  body.panelOpen #perf { right: 8px }
  #fov { left: calc(var(--ruler-w) + 68px); right: 54px; bottom: 54px }   /* clear of the ruler's own read-out, which can sit at this height, and of the zoom buttons */
  #fov .k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  #fov { flex-wrap: wrap; row-gap: 4px } #fov .k.g { flex: 1 0 100%; order: -1; white-space: normal }   /* the stretch line gets a row of its own, above the field of view */
  #clockBtn { flex: none }
  body.panelOpen #fov { bottom: calc(36vh + 14px) }
  body.trackOpen #fov, #library.open ~ #fov { display: none }
}
