/* Map player styles. Three looks, switched with S:
   atlas (light, the default), night (dark room), trace (black lines on white, for the wall map). */

:root {
  --u: 18px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body.style-atlas {
  --ocean: #a8cde2; --land: #f6f1e4; --coast: #3f5f72; --border: #8c8270; --state: #a39678;
  --text: #1b2833; --halo: rgba(255, 252, 244, 0.92); --river: #2f7fc4; --grat: rgba(30, 70, 100, 0.22);
  --panel: rgba(255, 252, 245, 0.95); --panel-text: #1b2833; --muted: #5d6a73; --accent: #c8412f;
  --hl-opacity: 0.88; --other: rgba(120, 110, 95, 0.10);
}
body.style-night {
  --ocean: #0d1d2a; --land: #2a3843; --coast: #8db4c9; --border: #6a8292; --state: #50646f;
  --text: #f4efe4; --halo: rgba(8, 16, 24, 0.9); --river: #5aa9e8; --grat: rgba(160, 200, 230, 0.16);
  --panel: rgba(12, 22, 32, 0.92); --panel-text: #f4efe4; --muted: #9fb0bb; --accent: #ff8a5c;
  --hl-opacity: 0.85; --other: rgba(200, 220, 235, 0.08);
}
body.style-trace {
  --ocean: #ffffff; --land: #ffffff; --coast: #000000; --border: #000000; --state: #444444;
  --text: #000000; --halo: #ffffff; --river: #1d5fd1; --grat: rgba(0, 0, 0, 0.35);
  --panel: rgba(255, 255, 255, 0.96); --panel-text: #000; --muted: #444; --accent: #d11;
  --hl-opacity: 0; --other: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ocean); color: var(--text); font-family: var(--sans); }
#map { position: fixed; inset: 0; display: block; cursor: grab; }
#map:active { cursor: grabbing; }

/* ---------- Geography */
.geo path { vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.ocean path { fill: var(--ocean); stroke: none; }
.graticule path { fill: none; stroke: var(--grat); stroke-width: 0.8px; }
.land path { fill: var(--land); stroke: none; }
.countries path, .states path { fill: transparent; stroke: none; transition: fill 0.6s; }
.countries path.hl, .states path.hl { fill-opacity: var(--hl-opacity); }
.coast path { fill: none; stroke: var(--coast); stroke-width: 1.3px; }
.country-borders path { fill: none; stroke: var(--border); stroke-width: 0.9px; transition: opacity 0.6s; }
.state-borders path { fill: none; stroke: var(--state); stroke-width: 0.9px; transition: opacity 0.6s; }
.rivers path { fill: none; stroke: var(--river); stroke-width: 0.9px; opacity: 0.75; }
.rivers path.major { stroke-width: 2.6px; opacity: 1; }
.lines path { fill: none; stroke-width: 2.4px; }
.boxes path { fill: none; stroke-width: 2.8px; stroke-dasharray: 9 6; }
.ghosts path { fill-opacity: 0.55; stroke-width: 2px; }
.night path { fill: #08163a; fill-opacity: 0.16; stroke: none; pointer-events: none; }
.night path:first-child { fill-opacity: 0.2; stroke: rgba(8, 22, 58, 0.35); stroke-width: 1px; }
body.style-night .night path { fill: #000; fill-opacity: 0.22; }
body.style-trace .night path { fill: #000; fill-opacity: 0.07; }

/* Deserts (deserts: {...}): a soft sandy wash with a dotted edge, since deserts have no sharp edges. */
.deserts path { fill: none; stroke: none; pointer-events: none; transition: fill 0.6s; }
.deserts path.hl { fill-opacity: 0.5; stroke: #b07a2a; stroke-opacity: 0.7; stroke-width: 1.4px; stroke-dasharray: 2 4; }
body.has-tint .deserts path.hl { fill-opacity: 0.6; }
body.style-night .deserts path.hl { fill-opacity: 0.35; stroke: #e2b56a; }
body.style-trace .deserts path.hl { fill: none !important; stroke: #000; stroke-opacity: 1; }

.history path { stroke: var(--border); stroke-width: 0.8px; fill: transparent; transition: fill 0.6s; }
.history path.hl { fill-opacity: 0.78; stroke: rgba(0, 0, 0, 0.55); stroke-width: 1.2px; }
.history path.other-faint { fill: var(--other); }
.history path.other-hidden { stroke: none; }
.history path.other-outline { fill: transparent; }

body.has-history .country-borders path,
body.has-history .state-borders path { opacity: 0.18; }
body.no-borders .country-borders path { opacity: 0; }
body.no-states .state-borders path, body.no-states .states path { display: none; }

body.style-trace .countries path, body.style-trace .states path,
body.style-trace .history path { fill: transparent !important; }
body.style-trace .coast path { stroke-width: 2px; }
body.style-trace .country-borders path { stroke-width: 1.2px; }
body.style-trace .ghosts path { fill-opacity: 0; stroke-width: 2.5px; }

/* ---------- Overlay text */
.lbl, .overlay text {
  font-family: var(--sans);
  fill: var(--text);
  paint-order: stroke;
  stroke: var(--halo);
  stroke-width: calc(var(--u) * 0.28);
  stroke-linejoin: round;
  pointer-events: none;
}
.auto { text-anchor: middle; }
.country-label { font-weight: 650; letter-spacing: 0.02em; }
.state-label { font-weight: 500; }
.history-label { font-family: var(--serif); font-style: italic; fill: var(--muted); }
.history-label.hl { font-weight: 700; font-style: normal; fill: var(--text); font-size: calc(var(--u) * 1.05) !important; }
.river-label { font-family: var(--serif); font-style: italic; fill: var(--river); font-weight: 600; }
.line-label { font-size: calc(var(--u) * 0.95); font-weight: 700; }
.free-label { text-anchor: middle; font-weight: 650; }
.free-label.ocean { font-family: var(--serif); font-style: italic; font-weight: 500; fill: var(--river); letter-spacing: 0.08em; }
.free-label.continent { font-family: var(--serif); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; }
.free-label.past { opacity: 0.7; }
.ghost-label { text-anchor: middle; font-weight: 800; font-size: calc(var(--u) * 1.1); }

body.morphing .auto-labels, body.morphing .line-labels { display: none; }
body.morphing .land, body.morphing .countries, body.morphing .states, body.morphing .coast,
body.morphing .country-borders, body.morphing .state-borders, body.morphing .rivers, body.morphing .history,
body.morphing .deserts { display: none; }
.morph path { fill: var(--land); stroke: var(--coast); stroke-width: 0.8px; }
body.no-labels .auto-labels, body.no-labels .marker-label, body.no-labels .free-label,
body.no-labels .arrow-label { display: none; }

/* Markers */
.marker circle { fill: var(--accent); stroke: var(--halo); stroke-width: 2.5px; }
.marker circle.city { fill: var(--text); }
.marker circle.capital { fill: var(--halo); stroke: var(--text); stroke-width: 4px; }
.marker .icon { text-anchor: middle; dominant-baseline: central; stroke-width: 0; }
.marker .icon-img { clip-path: inset(0 round 12%); }
.marker .icon-frame { fill: #fff; stroke: rgba(0, 0, 0, 0.35); stroke-width: 1px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.marker .leader { stroke: #333; stroke-width: 1.5px; }
.marker .leader-dot { fill: #333; }
.marker-label { font-size: calc(var(--u) * 1.0); font-weight: 650; }
.marker.past { opacity: 0.75; }
.marker .pop { animation: pop 0.5s ease-out backwards; transform-box: fill-box; }
@keyframes pop { from { transform: scale(0); opacity: 0; } 60% { transform: scale(1.25); } to { transform: scale(1); opacity: 1; } }

/* Arrows */
.arrow { --c: #c8412f; }
.arrow-line { fill: none; stroke: var(--c); stroke-width: calc(var(--u) * 0.24); stroke-linecap: round; filter: drop-shadow(0 0 2px var(--halo)); }
.arrow-head { fill: var(--c); stroke: var(--halo); stroke-width: 1.5px; }
.arrow-label { text-anchor: middle; font-weight: 750; fill: var(--c); font-size: calc(var(--u) * 1.0); transition: opacity 0.4s; }
.arrow-token { text-anchor: middle; dominant-baseline: central; stroke-width: 0; }
.arrow.past { opacity: 0.45; }
.arrow.dashed:not(.drawing) .arrow-line { stroke-dasharray: 10 8; }
.arrow.no-head .arrow-head { display: none; }
/* Winds and currents: the dashes keep moving once the arrow is drawn */
.arrow.flow:not(.drawing) .arrow-line { stroke-dasharray: 18 12; animation: flow 1.1s linear infinite; }
.arrow.flow.past .arrow-line { animation-duration: 2.2s; }
@keyframes flow { to { stroke-dashoffset: -30; } }
.sun-icon { text-anchor: middle; dominant-baseline: central; fill: #f5b301 !important; stroke: rgba(255, 220, 120, 0.55) !important;
  stroke-width: 6px !important; filter: drop-shadow(0 0 8px rgba(255, 190, 0, 0.9)); }

/* ---------- Panels */
.panel {
  background: var(--panel); color: var(--panel-text);
  border-radius: 10px; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.22);
}

#caption {
  position: fixed; left: calc(var(--u) * 1.2); bottom: calc(var(--u) * 4.2);
  max-width: min(46vw, calc(var(--u) * 34)); padding: calc(var(--u) * 0.8) calc(var(--u) * 1.1);
  transition: opacity 0.4s;
}
#caption.empty, body.hide-caption #caption, body.style-trace #caption { opacity: 0; pointer-events: none; }
#cap-year { font-family: var(--serif); font-size: calc(var(--u) * 3.2); font-weight: 700; line-height: 1; color: var(--accent); }
#cap-year:empty { display: none; }
#cap-title { font-family: var(--serif); font-size: calc(var(--u) * 1.6); margin: 0.15em 0 0.25em; line-height: 1.15; }
#cap-text { font-size: calc(var(--u) * 1.12); line-height: 1.4; margin: 0; }
#cap-text b { color: var(--accent); }
#cap-chip { margin-top: 0.6em; font-size: calc(var(--u) * 0.72); color: var(--muted); }
#cap-chip:empty { display: none; }
#cap-clock, #p-clock { margin-top: 0.5em; font-size: calc(var(--u) * 0.95); font-weight: 650; font-variant-numeric: tabular-nums; }
#cap-clock:empty, #p-clock:empty { display: none; }

#notes {
  position: fixed; right: calc(var(--u) * 1.2); top: calc(var(--u) * 1.2);
  width: min(30vw, calc(var(--u) * 24)); padding: calc(var(--u) * 0.8) calc(var(--u) * 1);
  font-size: calc(var(--u) * 0.9); line-height: 1.45; display: none;
}
body.show-notes #notes { display: block; }
#notes h4 { margin: 0 0 0.4em; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

#bar {
  position: fixed; left: 50%; bottom: calc(var(--u) * 0.8); transform: translateX(-50%);
  display: flex; gap: 6px; align-items: center; padding: 6px 8px; max-width: 96vw;
  transition: opacity 0.5s;
}
#bar button, .panel button { font: inherit; cursor: pointer; }
#bar > button {
  border: 0; background: transparent; color: var(--panel-text);
  font-size: calc(var(--u) * 1.0); padding: 4px 10px; border-radius: 6px;
}
#bar > button:hover:not(:disabled) { background: rgba(127, 127, 127, 0.18); }
#bar > button:disabled { opacity: 0.3; cursor: default; }
#bar > button.on { color: var(--accent); }
#scenario-title { flex: 0 1 auto; min-width: 0; font-size: calc(var(--u) * 0.8); color: var(--muted); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14vw; }
#bar > button { flex: none; }
/* The way to the other maps: a word and a filled pill, so it is not mistaken for a step button. */
#bar > #menu-btn {
  display: inline-flex; align-items: center; gap: 0.45em; padding: 5px 0.95em;
  border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: calc(var(--u) * 0.85);
}
#bar > #menu-btn:hover { background: var(--accent); filter: brightness(1.1); }
#menu-btn svg { width: 0.95em; height: 0.95em; fill: currentColor; }
/* With the Meanwhile list and the picture panel both open the bar is short of room: steps first. */
body.mw-open.panel-docked #scenario-title { display: none; }
/* The steps stay on one line. When they don't all fit, the strip slides to keep the current step in
   the middle, and fades at an edge where more steps are hidden (a trackpad or wheel scrolls it too). */
#steps {
  display: flex; gap: 4px; flex: 0 1 auto; min-width: 0; max-width: min(54vw, calc(var(--u) * 40));
  overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth;
}
#steps::-webkit-scrollbar { display: none; }
#steps.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 2.4em); mask-image: linear-gradient(to right, transparent, #000 2.4em); }
#steps.more-right { -webkit-mask-image: linear-gradient(to left, transparent, #000 2.4em); mask-image: linear-gradient(to left, transparent, #000 2.4em); }
#steps.more-left.more-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 2.4em, #000 calc(100% - 2.4em), transparent);
  mask-image: linear-gradient(to right, transparent, #000 2.4em, #000 calc(100% - 2.4em), transparent);
}
#steps button {
  flex: none; white-space: nowrap;
  border: 2px solid transparent; background: rgba(127, 127, 127, 0.14); color: var(--panel-text);
  min-width: calc(var(--u) * 1.9); padding: 3px 8px; border-radius: 6px; font-size: calc(var(--u) * 0.8); font-variant-numeric: tabular-nums;
}
#steps button.done { background: rgba(127, 127, 127, 0.3); }
#steps button.on { border-color: var(--accent); background: var(--accent); color: #fff; }

body.idle #bar { opacity: 0; }
/* The contributor's credit: small and quiet at the top centre of the map. */
#credit {
  position: fixed; left: 50%; top: calc(var(--u) * 0.8); transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 0.45em; padding: 3px 10px 3px 3px; border-radius: 999px;
  font-size: calc(var(--u) * 0.72); font-weight: 600; color: var(--muted); opacity: 0.85;
  pointer-events: none; transition: left 0.25s;
}
#credit[hidden] { display: none; }
#credit img { width: calc(var(--u) * 1.5); height: calc(var(--u) * 1.5); border-radius: 50%; object-fit: cover; }
#credit img[hidden] { display: none; }
#credit:has(img[hidden]) { padding-left: 10px; }
body.panel-docked #credit { left: calc((100vw - var(--panel-w, 32vw)) / 2); }
body.mw-open #credit { left: calc((100vw + var(--mw-w)) / 2); }
body.mw-open.panel-docked #credit { left: calc((100vw + var(--mw-w) - var(--panel-w, 32vw)) / 2); }
body.style-trace #credit { display: none; }
@media print { #credit { display: none !important; } }
body.idle, body.idle #map { cursor: none; }

.overlay-panel {
  position: fixed; inset: 6vh 10vw; padding: calc(var(--u) * 1.2) calc(var(--u) * 1.6);
  overflow: auto; z-index: 10; backdrop-filter: blur(10px) saturate(0.6); -webkit-backdrop-filter: blur(10px) saturate(0.6);
}
.overlay-panel h2 { font-family: var(--serif); margin: 0 0 0.4em; font-size: calc(var(--u) * 1.8); }
.overlay-panel h3 { margin: 1.2em 0 0.5em; font-size: calc(var(--u) * 0.8); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.overlay-panel .close { position: absolute; right: 14px; top: 10px; border: 0; background: none; color: var(--muted); font-size: calc(var(--u) * 1.4); }
#menu-search {
  display: block; width: min(100%, calc(var(--u) * 22)); margin: 0.2em 0 0.4em; padding: 0.55em 0.9em;
  font: inherit; font-size: calc(var(--u) * 0.95); color: var(--panel-text);
  border: 1px solid rgba(127, 127, 127, 0.45); border-radius: 999px; background: rgba(127, 127, 127, 0.07);
}
#menu-search:focus { outline: none; border-color: var(--accent); }
#menu-search::placeholder { color: var(--muted); }
.no-maps { grid-column: 1 / -1; color: var(--muted); font-size: calc(var(--u) * 0.9); }
.scenario u { text-decoration: none; font-size: calc(var(--u) * 0.78); font-weight: 600; color: var(--accent); }
/* "With recordings from [Takaro]": narrows the list to maps that have a source's voice notes */
#menu-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: calc(var(--u) * 0.8); color: var(--muted); }
#menu-filters[hidden] { display: none; }
#menu-filters .source {
  display: inline-flex; align-items: center; gap: 0.45em; padding: 0.25em 0.8em 0.25em 0.3em; border-radius: 999px;
  border: 1.5px solid rgba(127, 127, 127, 0.4); background: transparent; color: var(--panel-text); font-size: inherit; cursor: pointer;
}
#menu-filters .source:not(:has(img)) { padding-left: 0.8em; }
#menu-filters .source img { width: 1.7em; height: 1.7em; border-radius: 50%; object-fit: cover; }
#menu-filters .source b { font-weight: 600; }
#menu-filters .source i { font-style: normal; color: var(--muted); }
#menu-filters .source.on { border-color: var(--accent); background: var(--accent); color: #fff; }
#menu-filters .source.on i { color: rgba(255, 255, 255, 0.85); }
#menu-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 17), 1fr)); gap: 10px; }
#menu-list h3 { grid-column: 1 / -1; }
.scenario {
  text-align: left; border: 1px solid rgba(127, 127, 127, 0.3); background: rgba(127, 127, 127, 0.07);
  color: var(--panel-text); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.scenario:hover { border-color: var(--accent); }
.more-maps {
  grid-column: 1 / -1; justify-self: start; margin-top: 0.6em; padding: 0.6em 1.2em; border-radius: 8px;
  border: 1px solid var(--accent); background: none; color: var(--accent); font-size: calc(var(--u) * 0.9); font-weight: 600;
}
.more-maps:hover { background: rgba(127, 127, 127, 0.12); }
.scenario .cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; margin-bottom: 4px; }
.scenario small { font-size: calc(var(--u) * 0.62); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.scenario b { font-size: calc(var(--u) * 1.0); }
.scenario span { font-size: calc(var(--u) * 0.78); color: var(--muted); line-height: 1.35; }
.scenario i { font-size: calc(var(--u) * 0.7); color: var(--muted); }
.scenario .by { display: flex; align-items: center; gap: 0.5em; margin-top: 0.3em; font-style: normal; font-size: calc(var(--u) * 0.78); font-weight: 600; }
.scenario .by img { width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
/* The row of faces above the maps (js/voices.js): pressing one plays that person's voice notes in turn */
.face {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.5em; height: 2.5em; border-radius: 50%;
  overflow: hidden; background: var(--muted); color: #fff; font-weight: 700; font-style: normal;
}
.face img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
#menu-faces { display: flex; gap: calc(var(--u) * 0.9); overflow-x: auto; padding: 8px 4px 12px; margin: 0 0 4px; }
#menu-faces[hidden], #menu-story[hidden] { display: none; }
.story-face {
  flex: none; width: calc(var(--u) * 5.2); display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; color: var(--panel-text); font-size: calc(var(--u) * 0.74); padding: 0;
}
.story-face .face { width: 3.5em; height: 3.5em; font-size: calc(var(--u) * 1.05); margin-bottom: 5px; outline: 2px solid rgba(127, 127, 127, 0.4); outline-offset: 3px; }
.story-face.fresh .face { outline: 3px solid var(--accent); }
.story-face.open .face { outline-width: 5px; }
.story-face b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-face i { font-style: normal; color: var(--muted); }
.story-face.fresh i { color: var(--accent); font-weight: 600; }
#menu-story {
  max-width: calc(var(--u) * 32); margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.3); background: rgba(127, 127, 127, 0.07);
}
.story-bars { display: flex; gap: 4px; margin-bottom: 10px; }
.story-bars s { --p: 0%; flex: 1; height: 4px; border-radius: 2px; background: rgba(127, 127, 127, 0.35); overflow: hidden; text-decoration: none; }
.story-bars s i { display: block; height: 100%; width: var(--p); background: var(--accent); transition: width 0.25s linear; }
.story-bars s.done i { width: 100%; }
#menu-story header { display: flex; align-items: center; gap: 10px; }
#menu-story header div { flex: 1; min-width: 0; }
#menu-story header b { font-size: calc(var(--u) * 0.98); }
#menu-story header b em { margin-left: 0.5em; padding: 0.1em 0.6em; border: 1px solid rgba(127, 127, 127, 0.4); border-radius: 999px; font-style: normal; font-weight: 500; font-size: calc(var(--u) * 0.65); color: var(--muted); vertical-align: middle; }
#menu-story header div span { display: block; font-size: calc(var(--u) * 0.75); color: var(--muted); }
#menu-story header a { color: var(--accent); }
#menu-story .story-close { border: 0; background: none; color: var(--muted); font-size: calc(var(--u) * 1.1); }
.story-about {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 8px 12px; text-align: left;
  border: 1px solid rgba(127, 127, 127, 0.3); border-radius: 8px; background: rgba(127, 127, 127, 0.07); color: var(--panel-text);
}
.story-about:hover { border-color: var(--accent); }
.story-about div { flex: 1; min-width: 0; }
.story-about b { display: block; font-size: calc(var(--u) * 0.9); }
.story-about span { font-size: calc(var(--u) * 0.75); color: var(--muted); }
.story-about u { text-decoration: none; white-space: nowrap; color: var(--accent); font-size: calc(var(--u) * 0.78); font-weight: 600; }
.story-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.story-play { width: 2.6em; height: 2.6em; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.story-play svg { width: 1.4em; height: 1.4em; fill: currentColor; }
.story-step { width: 2em; height: 2em; border-radius: 50%; border: 1px solid rgba(127, 127, 127, 0.4); background: none; color: var(--panel-text); font-size: calc(var(--u) * 1.0); line-height: 1; }
.story-step:disabled { opacity: 0.3; cursor: default; }
.story-row time { margin-left: auto; font-size: calc(var(--u) * 0.8); color: var(--muted); font-variant-numeric: tabular-nums; }
/* On a map's card: the faces of those who talk on it */
.scenario .talks { display: flex; align-items: center; gap: 0.5em; margin-top: 0.2em; font-style: normal; font-size: calc(var(--u) * 0.74); font-weight: 600; color: var(--accent); }
.scenario .talks span { display: inline-flex; padding-left: 0.4em; }
.scenario .talks .face { width: 1.9em; height: 1.9em; font-size: calc(var(--u) * 0.68); margin-left: -0.4em; border: 2px solid var(--land); color: #fff; }
#help table { border-collapse: collapse; font-size: calc(var(--u) * 0.9); }
#help td { padding: 4px 18px 4px 0; vertical-align: top; }
#help kbd {
  font-family: var(--sans); font-size: 0.85em; border: 1px solid rgba(127, 127, 127, 0.5); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; margin-right: 3px;
}
#help p { color: var(--muted); font-size: calc(var(--u) * 0.8); max-width: 60em; }

#toasts { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 20; }
.toast { background: #7a1f12; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 14px; max-width: 70vw; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }

/* ---------- Meanwhile: other maps at the same time (T) */
:root { --mw-w: min(34vw, calc(var(--u) * 26)); }
.year-row { display: flex; align-items: center; flex-wrap: wrap; gap: calc(var(--u) * 0.7); }
button.mw-badge {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3em 0.75em; border-radius: 999px;
  border: 1.5px solid rgba(127, 127, 127, 0.45); background: transparent; color: var(--panel-text);
  font: 600 calc(var(--u) * 0.85) var(--sans); cursor: pointer;
}
button.mw-badge[hidden] { display: none; }
button.mw-badge:hover, body.mw-open button.mw-badge { background: rgba(127, 127, 127, 0.16); }
.mw-badge svg, .mw-kicker svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mw-badge b {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; height: 1.6em; padding: 0 0.4em;
  box-sizing: border-box; border-radius: 0.8em; background: var(--panel-text); color: var(--panel); font-size: 0.82em;
}
#meanwhile {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--mw-w); z-index: 6;
  border-radius: 0; display: flex; flex-direction: column;
}
#meanwhile[hidden] { display: none; }
#meanwhile header { position: relative; padding: calc(var(--u) * 1.1) calc(var(--u) * 2.4) calc(var(--u) * 0.8) calc(var(--u) * 1.1); border-bottom: 1px solid rgba(127, 127, 127, 0.25); }
.mw-kicker { display: flex; align-items: center; gap: 0.4em; font-size: calc(var(--u) * 0.72); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
#mw-when { font-family: var(--serif); font-size: calc(var(--u) * 1.45); line-height: 1.15; margin: 0.25em 0 0; }
#meanwhile .close { position: absolute; right: 10px; top: 8px; border: 0; background: none; color: var(--muted); font-size: calc(var(--u) * 1.3); }
#mw-list { flex: 1; overflow-y: auto; padding: calc(var(--u) * 0.3) calc(var(--u) * 0.6) calc(var(--u) * 0.8); }
#mw-list h3 {
  display: flex; align-items: center; gap: 0.5em; margin: 1em 0.5em 0.35em;
  font-size: calc(var(--u) * 0.68); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
#mw-list h3.mw-auto::after { content: ''; flex: 1; height: 1px; background: rgba(127, 127, 127, 0.3); }
#meanwhile .swatch { flex: none; width: 0.9em; height: 0.9em; border-radius: 2px; }
#mw-list button.mw-item {
  display: flex; gap: 0.8em; width: 100%; text-align: left; padding: 0.55em 0.6em; border: 0; border-radius: 8px;
  background: transparent; color: var(--panel-text); font: inherit; cursor: pointer;
}
#mw-list button.mw-item.sel { background: rgba(127, 127, 127, 0.16); box-shadow: inset 0 0 0 2px var(--accent); }
.mw-year { flex: none; width: 4.8em; font-family: var(--serif); font-size: calc(var(--u) * 0.95); font-weight: 700; color: var(--accent); }
.mw-item.auto .mw-year { color: var(--muted); }
.mw-body { display: flex; flex-direction: column; gap: 0.2em; min-width: 0; }
.mw-body b { font-size: calc(var(--u) * 0.95); line-height: 1.3; }
.mw-body i { font-size: calc(var(--u) * 0.8); line-height: 1.35; color: var(--muted); }
.mw-body small { display: flex; align-items: center; gap: 0.4em; font-size: calc(var(--u) * 0.72); color: var(--muted); }
#meanwhile footer { padding: 0.7em calc(var(--u) * 1.1); border-top: 1px solid rgba(127, 127, 127, 0.25); font-size: calc(var(--u) * 0.72); color: var(--muted); }
#meanwhile kbd { font-family: var(--sans); font-size: 0.9em; border: 1px solid rgba(127, 127, 127, 0.5); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin-right: 2px; }
#mw-back {
  position: fixed; top: calc(var(--u) * 1); left: calc(var(--u) * 1.2); z-index: 6;
  padding: 0.45em 1.1em; border: 2px solid var(--accent); border-radius: 999px;
  font: 600 calc(var(--u) * 0.9) var(--sans); color: var(--panel-text); cursor: pointer; transition: left 0.25s;
}
#mw-back[hidden] { display: none; }
#caption { transition: opacity 0.4s, left 0.25s; }
body.mw-open #caption, body.mw-open #mw-back { left: calc(var(--mw-w) + var(--u) * 1.2); }
body.mw-open.panel-open #notes { left: calc(var(--mw-w) + var(--u) * 1.2); }
body.mw-open #bar { left: calc((100vw + var(--mw-w)) / 2); max-width: calc(100vw - var(--mw-w) - var(--u) * 2); }
body.mw-open.panel-docked #bar {
  left: calc((100vw + var(--mw-w) - var(--panel-w, 32vw)) / 2);
  max-width: calc(100vw - var(--mw-w) - var(--panel-w, 32vw) - var(--u) * 2);
}
body.style-trace #mw-back { display: none; }
@media print { #meanwhile, #mw-back, .mw-badge { display: none !important; } }

/* ---------- Picture panel */
#panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 5;
  border-radius: 0; display: flex; flex-direction: column;
  padding: calc(var(--u) * 1.1) calc(var(--u) * 1.2) calc(var(--u) * 0.8);
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.18);
  animation: slide-in 0.45s ease-out;
}
#panel[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
body:not(.panel-docked) #panel { top: calc(var(--u) * 1); right: calc(var(--u) * 1); bottom: calc(var(--u) * 4); border-radius: 10px; }
body.panel-open #caption { opacity: 0; pointer-events: none; }
body.panel-docked #bar { left: calc((100vw - var(--panel-w, 32vw)) / 2); }
body.style-trace #panel { display: none; }
body.panel-open #notes { right: auto; left: calc(var(--u) * 1.2); }
#panel .close { position: absolute; right: 10px; top: 6px; border: 0; background: none; color: var(--muted); font-size: calc(var(--u) * 1.3); cursor: pointer; }
#panel header { flex: none; padding-right: calc(var(--u) * 1.4); }
#p-year { font-family: var(--serif); font-size: calc(var(--u) * 2.6); font-weight: 700; line-height: 1; color: var(--accent); }
#p-year:empty { display: none; }
#p-title { font-family: var(--serif); font-size: calc(var(--u) * 1.45); margin: 0.12em 0 0.2em; line-height: 1.15; }
#p-text { font-size: calc(var(--u) * 1.0); line-height: 1.4; margin: 0; }
#p-text b { color: var(--accent); }
#p-chip { margin-top: 0.4em; font-size: calc(var(--u) * 0.68); color: var(--muted); }
#p-chip:empty { display: none; }

#p-card { flex: 1; min-height: 0; margin: calc(var(--u) * 0.8) 0 0; display: flex; flex-direction: column; gap: calc(var(--u) * 0.5); }
.p-frame {
  flex: 1; min-height: calc(var(--u) * 8); display: flex; align-items: center; justify-content: center;
  background: rgba(127, 127, 127, 0.1); border-radius: 6px; overflow: hidden;
}
#p-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; transition: opacity 0.3s; display: block; }
#p-img.loading { opacity: 0.15; }
#p-video { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; display: block; border-radius: 4px; }
#p-card.has-video #p-img, #p-video[hidden] { display: none; }
#p-card.no-image .p-frame { display: none; }
#p-card figcaption { flex: none; display: flex; flex-direction: column; gap: 0.25em; }
#p-card-title { font-size: calc(var(--u) * 1.05); }
#p-card-text { font-size: calc(var(--u) * 0.92); line-height: 1.4; }
#p-credit { font-size: calc(var(--u) * 0.66); color: var(--muted); }
#p-credit a { color: inherit; }
#panel nav { flex: none; display: flex; align-items: center; gap: 8px; margin-top: calc(var(--u) * 0.6); }
#panel nav button {
  border: 1px solid rgba(127, 127, 127, 0.35); background: transparent; color: var(--panel-text);
  border-radius: 6px; padding: 4px 12px; font-size: calc(var(--u) * 0.85); cursor: pointer;
}
#panel nav button[hidden] { display: none; }
#p-print { margin-left: auto; }
#p-dots { flex: none; display: flex; justify-content: center; gap: 6px; }
#p-dots:empty { display: none; }
#p-dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(127, 127, 127, 0.35); transition: width 0.3s, background 0.3s; }
#p-dots i.on { width: 24px; background: var(--accent); }
#p-card.enter-next { animation: card-next 0.35s ease-out; }
#p-card.enter-prev { animation: card-prev 0.35s ease-out; }
@keyframes card-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes card-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #p-card.enter-next, #p-card.enter-prev { animation: none; } }
@media print { #p-dots { display: none !important; } }
#p-count { font-size: calc(var(--u) * 0.8); color: var(--muted); font-variant-numeric: tabular-nums; }

/* Markers that open a picture glow gently */
.marker.has-media { cursor: pointer; pointer-events: all; }
.marker.has-media .icon, .marker.has-media .icon-img, .marker.has-media .icon-frame, .marker.has-media .dot { pointer-events: all; }
.marker .ring { fill: none; stroke: var(--accent); stroke-width: 3px; opacity: 0; }
.marker.has-media .ring { animation: glow 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes glow { 0%, 100% { opacity: 0.15; transform: scale(0.85); } 50% { opacity: 0.75; transform: scale(1.1); } }

/* Full-screen picture */
#lightbox {
  position: fixed; inset: 0; z-index: 30; background: rgba(8, 10, 14, 0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: zoom-out;
}
#lightbox[hidden] { display: none; }
#lightbox-img, #lightbox-video { max-width: 96vw; max-height: 90vh; object-fit: contain; box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6); }
#lightbox-img[hidden], #lightbox-video[hidden] { display: none; }
#lightbox-cap { color: #ddd; font-size: calc(var(--u) * 0.85); margin-top: 10px; text-align: center; max-width: 90vw; }

/* Print just the picture card (the 🖨 button) */
@media print {
  body.print-card > *:not(#panel) { display: none !important; }
  body.print-card { background: #fff !important; overflow: visible; }
  body.print-card #panel {
    position: static; display: block !important; width: auto !important; box-shadow: none; background: #fff; color: #000;
    padding: 0; animation: none;
  }
  body.print-card #panel .close, body.print-card #panel nav, body.print-card #p-chip, body.print-card #p-text { display: none; }
  body.print-card #p-year { color: #000; font-size: 28pt; }
  body.print-card #p-title { font-size: 20pt; }
  body.print-card .p-frame { background: none; display: block; }
  body.print-card #p-img { max-height: 15cm; max-width: 100%; margin: 0.5cm auto; }
  body.print-card #p-card.has-video #p-img { display: block; } /* a clip prints as its still picture */
  body.print-card #p-video { display: none; }
  body.print-card #p-card-title { font-size: 16pt; }
  body.print-card #p-card-text { font-size: 13pt; }
  body.print-card #p-credit { font-size: 8pt; color: #444; }
  @page { size: A5 portrait; margin: 1.2cm; }
}

/* ---------- Relief (js/relief.js): relief: true or 'shade' */
.relief-tint, .relief-shade { display: none; pointer-events: none; }
body.has-tint .relief-tint, body.has-relief .relief-shade { display: inline; }
body.morphing .relief-tint, body.morphing .relief-shade,
body.style-trace .relief-tint, body.style-trace .relief-shade { display: none; }
.relief-tint image, .relief-shade image { image-rendering: auto; }
body.style-night .relief-tint image { opacity: 0.8; }
body.has-tint .countries path.hl, body.has-tint .states path.hl { fill-opacity: 0.55; }
body.has-tint .state-borders path { opacity: 0.55; }
.free-label.range { font-family: var(--serif); text-transform: uppercase; letter-spacing: 0.22em; font-weight: 700; fill: #5a3418; }
.free-label.region { font-family: var(--serif); font-style: italic; font-weight: 700; fill: #23401f; }
body.style-night .free-label.range { fill: #f1d3b3; }
body.style-night .free-label.region { fill: #d9efcf; }

#relief-key {
  position: fixed; right: calc(var(--u) * 1.2); bottom: calc(var(--u) * 4.2); display: none;
  padding: calc(var(--u) * 0.6) calc(var(--u) * 0.8); font-size: calc(var(--u) * 0.72); min-width: calc(var(--u) * 7.5);
}
body.has-tint #relief-key { display: flex; flex-direction: column; }
body.panel-docked #relief-key { right: calc(var(--panel-w, 32vw) + var(--u) * 1.2); }
body.style-trace #relief-key, body.hide-caption #relief-key { display: none; }
#relief-key b { font-size: calc(var(--u) * 0.9); }
#relief-key small { color: var(--muted); margin-bottom: 0.6em; }
#relief-key .bar { position: relative; width: calc(var(--u) * 1.1); height: calc(var(--u) * 10); border-radius: 3px; margin: 0.5em 0 0.5em; }
#relief-key .bar span { position: absolute; left: calc(100% + 6px); transform: translateY(50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.marker circle.peak { fill: #7a2e12; }

/* ---------- Areas, key, bars, quiz pins ---------- */
.areas path { stroke: none; pointer-events: none; }
.areas path.geology { stroke-width: 0.8px; vector-effect: non-scaling-stroke; }
.areas path.dashed { stroke: rgba(0, 0, 0, 0.45); stroke-width: 1.2px; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
body.style-trace .areas { display: none; }

#map-key {
  position: fixed; left: calc(var(--u) * 1.2); top: calc(var(--u) * 1.2); z-index: 4;
  padding: calc(var(--u) * 0.6) calc(var(--u) * 0.9); font-size: calc(var(--u) * 0.85);
  max-width: calc(var(--u) * 16);
}
#map-key[hidden] { display: none; }
#map-key .key-title { font-family: var(--serif); font-weight: 700; margin-bottom: calc(var(--u) * 0.3); }
#map-key ul { list-style: none; margin: 0; padding: 0; }
#map-key li { display: flex; align-items: center; gap: calc(var(--u) * 0.45); margin: calc(var(--u) * 0.25) 0; }
#map-key .key-swatch { width: calc(var(--u) * 1.1); height: calc(var(--u) * 0.8); border-radius: 3px; opacity: 0.75; flex: none; }
#map-key .key-icon { width: calc(var(--u) * 1.5); height: calc(var(--u) * 1.5); object-fit: contain; flex: none; }
#map-key .key-emoji { font-size: calc(var(--u) * 1.2); width: calc(var(--u) * 1.5); text-align: center; flex: none; }
#map-key .key-swatch + .key-icon { margin-left: calc(var(--u) * -0.2); }

.bars rect { stroke: rgba(0, 0, 0, 0.35); stroke-width: 1px; animation: bar-grow 0.8s ease-out; transform-box: fill-box; transform-origin: bottom; }
.bars .bar-value { text-anchor: middle; font-weight: 700; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.marker.quiz { cursor: pointer; }
.marker.quiz .icon, .marker.quiz .icon-img, .marker.quiz .icon-frame { pointer-events: all; }

/* ---------- Find it: guesses, the line to the real place, the distance ---------- */
body.finding #map { cursor: crosshair; }
.find .find-pop { animation: pop 0.4s ease-out backwards; transform-box: fill-box; transform-origin: center; }
.find .find-dot { fill: var(--c); stroke: #fff; stroke-width: 3px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.find .find-centre { fill: #fff; }
.find .find-line { stroke: var(--c); stroke-width: 3px; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.find .guess.shown .find-line { animation: find-draw 1.2s ease-in-out 0.3s forwards; }
.find .find-dist { fill: var(--c); font-size: calc(var(--u) * 0.9); font-weight: 650; text-anchor: middle; dominant-baseline: central; opacity: 0; }
.find .guess.shown .find-dist { animation: find-fade 0.6s ease-out 1.4s forwards; }
@keyframes find-draw { to { stroke-dashoffset: 0; } }
@keyframes find-fade { to { opacity: 1; } }
.find-reveal { display: block; margin-top: 0.4em; }

/* ---------- Voice notes (js/voices.js) */
.voices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.55em; }
.voices[hidden] { display: none; }
.voice {
  --p: 0%; position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 0.5em;
  border: 0; border-radius: 999px; padding: 0.38em 1em 0.38em 0.7em;
  background: var(--accent); color: #fff; font-size: calc(var(--u) * 0.95); font-weight: 650; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  animation: voice-nudge 1.5s ease-out 0.5s 2;   /* two soft rings when it appears: "there is something to hear" */
}
.voice::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: #fff; opacity: 0.3; transition: width 0.25s linear; }
.voice.current { animation: none; }
.voice b { font-weight: normal; display: inline-flex; }
.voice svg { width: 1.45em; height: 1.45em; fill: currentColor; }
.voice img.from { width: 1.7em; height: 1.7em; border-radius: 50%; object-fit: cover; background: #fff; margin: -0.12em 0 -0.12em -0.25em; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
#voice-now a { position: relative; color: var(--accent); font-size: 0.9em; white-space: nowrap; }
#voice-now a[hidden] { display: none; }
.voice svg .wave { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.voice i { font-style: normal; font-weight: normal; opacity: 0.85; font-variant-numeric: tabular-nums; font-size: 0.9em; }
@keyframes voice-nudge {
  0% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 0.9em transparent; }
}
@media (prefers-reduced-motion: reduce) { .voice { animation: none; } }
.voice i:empty { display: none; }
.voice span, .voice b, .voice i { position: relative; }
#card-voices { margin-top: 0.3em; }

.marker .voice-badge { display: none; }
.marker.has-voice .voice-badge { display: inline; }
.marker .voice-badge circle { fill: var(--accent); stroke: #fff; stroke-width: 2.5px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)); }
.overlay .marker .voice-badge .voice-icon path { fill: #fff; stroke: none; }
.overlay .marker .voice-badge .voice-icon path.wave { fill: none; stroke: #fff; stroke-width: 2.2px; stroke-linecap: round; }
.marker.has-voice { cursor: pointer; pointer-events: all; }
.marker.has-voice .icon, .marker.has-voice .dot, .marker.has-voice .voice-badge { pointer-events: all; }

#auto-btn svg { width: 1.25em; height: 1.25em; vertical-align: middle; fill: currentColor; }
#auto-btn svg .wave, #auto-btn svg .slash { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
#auto-btn svg .slash { display: none; }
#auto-btn.off { color: var(--muted); }
#auto-btn.off svg .wave { display: none; }
#auto-btn.off svg .slash { display: inline; }
#auto-btn[hidden] { display: none; }

#recorder {
  position: fixed; left: calc(var(--u) * 1.2); top: calc(var(--u) * 1.2); z-index: 6;
  width: min(34vw, calc(var(--u) * 26)); min-width: 280px; padding: calc(var(--u) * 0.8) calc(var(--u) * 1);
  font-size: calc(var(--u) * 0.85); line-height: 1.4; display: flex; flex-direction: column; gap: 0.5em;
}
#recorder[hidden], #recorder [hidden] { display: none !important; }
#recorder h4 { margin: 0; font-size: 1.05em; }
#recorder p { margin: 0; }
#recorder .close { position: absolute; right: 8px; top: 4px; border: 0; background: none; color: var(--muted); font-size: 1.3em; }
#recorder .rec-who, #recorder .rec-hint { color: var(--muted); font-size: 0.9em; }
#help button.link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; font-size: inherit; cursor: pointer; }
#recorder button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0; font-size: inherit; }
#rec-here { display: flex; flex-direction: column; gap: 0.55em; }
#recorder label { display: flex; flex-direction: column; gap: 2px; font-size: 0.9em; color: var(--muted); }
#recorder label.check { flex-direction: row; align-items: flex-start; gap: 6px; color: var(--panel-text); }
#recorder select, #recorder input:not([type=checkbox]) {
  font: inherit; font-size: 1.05em; color: var(--panel-text); background: rgba(127, 127, 127, 0.1);
  border: 1px solid rgba(127, 127, 127, 0.4); border-radius: 6px; padding: 4px 6px;
}
.rec-row { display: flex; align-items: center; gap: 8px; }
#recorder .rec-row button {
  border: 1px solid rgba(127, 127, 127, 0.45); background: transparent; color: var(--panel-text);
  border-radius: 6px; padding: 5px 12px; font-size: 1em;
}
#rec-go { color: var(--accent) !important; border-color: var(--accent) !important; font-weight: 650; }
#rec-go.on { background: var(--accent) !important; color: #fff !important; animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: 0.7; } }
#recorder .rec-row button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
#recorder .rec-row button:disabled { opacity: 0.5; cursor: default; }
#rec-time { font-variant-numeric: tabular-nums; min-width: 3em; }
#rec-level { --level: 0; flex: 1; height: 8px; border-radius: 4px; background: rgba(127, 127, 127, 0.2); overflow: hidden; position: relative; }
#rec-level::after { content: ''; position: absolute; inset: 0; width: calc(var(--level) * 100%); background: #3a9a4b; transition: width 0.08s; }
#rec-preview { width: 100%; height: 36px; }
#rec-mine h5 { margin: 0.4em 0 0.3em; font-size: 0.85em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
#rec-mine .mine { display: flex; align-items: center; gap: 6px; font-size: 0.9em; padding: 2px 0; }
#rec-mine .mine span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rec-mine .mine em { color: var(--muted); font-size: 0.9em; white-space: nowrap; }
#rec-mine .mine button { border: 0; background: none; color: var(--panel-text); padding: 0 4px; }
.toast.ok { background: #1f5f2c; }

@media print {
  .voices, #recorder { display: none !important; }
}
#voice-now {
  --p: 0%; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--u) * 4.2); z-index: 5;
  display: flex; align-items: center; gap: 0.6em; padding: 0.35em 0.5em 0.35em 0.9em; border-radius: 999px;
  font-size: calc(var(--u) * 0.85); overflow: hidden; max-width: 60vw;
}
#voice-now[hidden] { display: none; }
#voice-now::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--accent); opacity: 0.15; transition: width 0.25s linear; }
#voice-now b, #voice-now span { position: relative; cursor: pointer; font-weight: normal; }
#voice-now span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#voice-now button { position: relative; border: 0; background: none; color: var(--muted); }
body.panel-docked #voice-now { left: calc((100vw - var(--panel-w, 32vw)) / 2); }
@media print { #voice-now { display: none !important; } }
