/* Base viewer style. Colours and fonts are tokens set by the brand kit's
   brand/brand.css, which index.html loads first:
     --font-sans, --font-mono   text and figures
     --accent, --accent-tint    rules, buttons, hover
     --panel                    interactive panels
     --card-bg, --caption-bg    video title cards / lower thirds, chips, clock
     --fg, --fg-soft, --fg-notes, --muted, --rule   text and dividers */

html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--fg);
  font: 400 14px/1.35 var(--font-sans), system-ui, sans-serif; }
#globe { position: absolute; inset: 0; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Cesium chrome: keep only the credits, compact. */
.cesium-viewer-bottom { left: auto; right: 6px; bottom: 4px; padding: 0; }
.cesium-widget-credits { font-size: 10px; color: #ddd; text-shadow: 0 0 2px #000; }
.cesium-credit-logoContainer img { height: 14px; }

#brandbar { position: absolute; top: 12px; left: 12px; display: flex; gap: 12px; align-items: center;
  background: var(--panel); padding: 8px 14px; border-radius: 6px; border-left: 4px solid var(--accent); }
#brandbar img { height: 26px; }
#brandbar span { color: var(--muted); margin-left: 6px; }

#panel { position: absolute; top: 66px; left: 12px; width: 270px; max-height: calc(100% - 140px); overflow: auto;
  background: var(--panel); border-radius: 6px; padding: 4px 14px 10px; }
#panel h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 12px 0 6px; font-weight: 400; }
#panel ul { list-style: none; margin: 0; padding: 0; }
#panel li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
#panel label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; }
#panel .n { margin-left: auto; color: var(--muted); font-family: var(--font-mono), monospace; font-size: 12px; }
#sites li { cursor: pointer; border-bottom: 1px solid var(--rule); padding: 5px 0; }
#sites li:hover { color: #fff; background: var(--accent-tint); }
#sites .code { color: var(--muted); font-size: 12px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; flex: none; box-sizing: border-box; }
.swatch.group { box-shadow: 0 0 0 2px currentColor; }
.line-swatch { width: 18px; height: 0; border-top: 2px dashed; flex: none; }

#info { position: absolute; top: 12px; right: 12px; width: 330px; max-height: calc(100% - 90px); overflow: auto;
  background: var(--panel); border-radius: 6px; }
#info img { width: 100%; display: block; border-radius: 6px 6px 0 0; background: #111; min-height: 120px; }
#info-body { padding: 10px 14px 14px; }
#info-body h3 { margin: 0 0 6px; font-size: 16px; }
#info-body dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0; font-size: 13px; }
#info-body dt { color: var(--muted); }
#info-body dd { margin: 0; }
#info-body .notes { font-size: 12.5px; color: var(--fg-notes); white-space: pre-wrap; border-top: 1px solid var(--rule); padding-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); margin: 0 4px 4px 0; font-size: 12.5px; }
#info-close { position: absolute; top: 6px; right: 8px; background: rgba(0, 0, 0, .55); border: 0; border-radius: 50%;
  width: 28px; height: 28px; font-size: 18px; line-height: 1; }

#tourbar { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: min(760px, calc(100% - 24px));
  display: flex; gap: 10px; align-items: center; background: var(--panel); padding: 8px 12px; border-radius: 6px; box-sizing: border-box; }
#tourbar button { background: var(--accent); border: 0; border-radius: 4px; padding: 4px 10px; min-width: 34px; }
#tour-scrub { flex: 1; accent-color: var(--accent); }
#tour-time { font-family: var(--font-mono), monospace; font-size: 12px; color: var(--muted); min-width: 34px; }
#tour-chapters { display: flex; gap: 4px; }
#tour-chapters button { background: rgba(255, 255, 255, .08); font-size: 12px; padding: 3px 7px; }

#loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55);
  font-size: 18px; pointer-events: none; transition: opacity .4s; }
#loading.done { opacity: 0; }
#loading.error { color: #ffb4a8; background: rgba(0, 0, 0, .8); }

/* Tour overlays, shared by interactive playback and the video. Sized in
   viewport units so a 960x540 preview frames the same as 1920x1080. */
#overlay { position: absolute; inset: 0; pointer-events: none; font-size: max(12px, 1.75vh); }
#captions > * { position: absolute; }
.cap-card { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; background: var(--card-bg);
  padding: 2.2em 3.2em; border-radius: .5em; border-top: .3em solid var(--accent); min-width: 22em; }
.cap-card h1 { margin: 0 0 .3em; font-size: 2.6em; font-weight: 700; letter-spacing: -.01em; }
.cap-card p { margin: 0; font-size: 1.2em; color: var(--fg-soft); font-weight: 300; }
.cap-card img { height: 2.2em; margin-top: 1.4em; }
.cap-card table { margin: 1.2em auto 0; border-collapse: collapse; font-size: 1.05em; text-align: left; }
.cap-card td { padding: .2em .6em; }
.cap-card td.n { text-align: right; font-family: var(--font-mono), monospace; }
.cap-lower { left: 4vw; bottom: 9vh; background: var(--caption-bg); padding: .7em 1.3em .8em; border-left: .35em solid var(--accent);
  border-radius: .3em; max-width: 50vw; }
.cap-lower h2 { margin: 0; font-size: 1.6em; font-weight: 700; }
.cap-lower p { margin: .2em 0 0; color: var(--fg-soft); font-size: 1.05em; }
.cap-chip { left: 4vw; bottom: 9vh; display: flex; align-items: center; gap: .7em; background: var(--caption-bg);
  padding: .6em 1.2em .6em .8em; border-radius: 999px; font-size: 1.3em; }
.cap-chip .swatch { width: 1.1em; height: 1.1em; border-width: .18em; }
.cap-chip b { font-weight: 700; }
.cap-chip span { color: var(--fg-soft); }
#video-legend { position: absolute; top: 3vh; right: 2.5vw; background: var(--card-bg); padding: .7em 1em; border-radius: .4em;
  opacity: 0; font-size: .95em; }
#video-legend div { display: flex; align-items: center; gap: .6em; padding: .15em 0; }
#video-legend .swatch { width: .95em; height: .95em; border-width: .16em; }
#video-mark { position: absolute; right: 2.5vw; bottom: 3.5vh; height: 2.4em; opacity: .9; display: none; }

/* Video mode (?video=1): no interactive chrome. */
body.video #brandbar, body.video #panel, body.video #tourbar, body.video #info, body.video #loading { display: none !important; }
body.video #video-mark { display: block; }
body.video .cesium-viewer-bottom { right: auto; left: 1vw; bottom: .6vh; }
body:not(.video) #video-legend { display: none; }
body.touring #panel { opacity: .35; }

@media (max-width: 700px) {
  #panel { width: calc(100% - 24px); max-height: 32%; top: auto; bottom: 86px; }
  #brandbar img { height: 20px; }
  #info { left: 12px; width: auto; }
  #tour-chapters { display: none; }
}
