:root {
  --paper: #ffffff;
  --ink: #111418;
  --ink-2: #4a4f57;
  --ink-3: #8b9098;
  --hair: #e3e2dc;
  --hair-2: #cfcec7;
  --grid-a: rgba(17, 20, 24, 0.045);
  --grid-b: rgba(17, 20, 24, 0.085);
  --accent: #f23b1d;
  --surface: #ffffff;
  --soft: #f4f3ee;
  --on-ink: #ffffff;
  --on-ink-dim: #9aa0a8;
  --bar: rgba(255, 255, 255, 0.92);
  --swatch-line: rgba(17, 20, 24, 0.25);
  --check: #e9e9e9;
  --good-bg: #f4fbf7;
  --good-ink: #0f8a4f;
  color-scheme: light;
  --sans: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
/* dark: the same drafting sheet, inked in reverse */
:root[data-theme="dark"] {
  --paper: #0e1013;
  --surface: #14171b;
  --soft: #1d2126;
  --ink: #ecebe5;
  --ink-2: #b3b7be;
  --ink-3: #7c828b;
  --hair: #262a30;
  --hair-2: #383d44;
  --grid-a: rgba(236, 235, 229, 0.035);
  --grid-b: rgba(236, 235, 229, 0.07);
  --on-ink: #111418;
  --on-ink-dim: #5d636b;
  --bar: rgba(20, 23, 27, 0.9);
  --swatch-line: rgba(236, 235, 229, 0.3);
  --check: #22262b;
  --good-bg: #12241a;
  --good-ink: #3ad68a;
  color-scheme: dark;
}
.theme-btn { padding: 5px 9px; }
.theme-btn i { width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 50%; display: inline-block; background: linear-gradient(90deg, currentColor 50%, transparent 50%); vertical-align: -1px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--sans); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.dim { color: var(--ink-3); }
button { font: inherit; color: inherit; }

/* architectural drafting grid */
#grid {
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-b) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-b) 1px, transparent 1px),
    linear-gradient(var(--grid-a) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-a) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-position: center center;
}
body.alpha { background: repeating-conic-gradient(var(--check) 0 25%, var(--surface) 0 50%) 0 0 / 24px 24px; }
body.alpha #grid { display: none; }
#stage, #overlay { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#overlay { pointer-events: none; z-index: 1; }
#stage.framed { box-shadow: 0 0 0 1px var(--ink); }

/* top bar */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; gap: 24px; padding: 0 20px;
  border-bottom: 1px solid var(--ink); background: var(--bar);
  backdrop-filter: blur(6px); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 50%; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--ink); }
.brand-mark::before { left: 50%; top: -4px; bottom: -4px; width: 1px; }
.brand-mark::after { top: 50%; left: -4px; right: -4px; height: 1px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.modes { display: flex; gap: 0; margin: 0 auto; border: 1px solid var(--ink); }
.mode-btn {
  background: none; border: 0; border-right: 1px solid var(--ink); padding: 8px 14px; cursor: pointer;
  display: flex; gap: 8px; align-items: baseline; font-size: 13px; font-weight: 500;
}
.mode-btn:last-child { border-right: 0; }
.mode-btn .n { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.mode-btn:hover { background: var(--soft); }
.mode-btn.on { background: var(--ink); color: var(--on-ink); }
.mode-btn.on .n { color: var(--on-ink-dim); }
.tools { display: flex; gap: 6px; }
.tool {
  background: var(--surface); border: 1px solid var(--hair-2); padding: 6px 10px; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 6px;
}
.tool:hover { border-color: var(--ink); }
.tool.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.tool.rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.tool.rec.on { background: var(--accent); border-color: var(--accent); }
.tool.rec.on i { background: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* left rail */
#left {
  position: fixed; top: 76px; left: 20px; width: 260px; z-index: 5;
  background: var(--surface); border: 1px solid var(--ink);
  max-height: calc(100vh - 76px - 66px); overflow-y: auto; /* stops above the LAT / LON / ALT readout */
}
.search input {
  width: 100%; border: 0; border-bottom: 1px solid var(--ink); padding: 12px 14px; font: 500 14px var(--sans);
  outline: none; background: transparent;
}
.block { padding: 12px 14px 14px; border-bottom: 1px solid var(--hair); }
.block-h { color: var(--ink-3); margin-bottom: 8px; display: flex; justify-content: space-between; }
.desc { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.opts { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.opt { display: flex; gap: 8px; align-items: center; font-size: 12.5px; cursor: pointer; }
.opt input { accent-color: var(--ink); margin: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; cursor: pointer; }
.check input { accent-color: var(--ink); margin: 0; }
.source { padding: 10px 14px; color: var(--ink-3); font-size: 9.5px; }

.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; }
.sw { width: 14px; height: 14px; flex: none; border: 1px solid var(--swatch-line); }
.legend-ramp { display: flex; height: 12px; border: 1px solid var(--ink); }
.legend-ramp span { flex: 1; }
.legend-ticks { display: flex; justify-content: space-between; margin-top: 4px; font-family: var(--mono); font-size: 9.5px; color: var(--ink-2); }

/* profile panel */
#profile {
  position: fixed; top: 76px; right: 20px; bottom: 20px; width: 400px; z-index: 5;
  background: var(--surface); border: 1px solid var(--ink); overflow-y: auto; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s;
}
#profile.hidden { transform: translateX(30px); opacity: 0; pointer-events: none; }
.p-head { padding: 16px 18px 18px; border-bottom: 1px solid var(--ink); position: relative; }
.p-close { position: absolute; top: 12px; right: 12px; background: none; border: 1px solid var(--hair-2); width: 26px; height: 26px; cursor: pointer; font-size: 14px; line-height: 1; }
.p-close:hover { border-color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid var(--ink); padding: 2px 6px; }
.chip.solid { background: var(--ink); color: var(--on-ink); }
.chip.red { background: var(--accent); border-color: var(--accent); color: #fff; }
.p-name { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin: 14px 0 6px; }
.p-region { font-size: 13px; color: var(--ink-2); }
.hero-stat { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ink); }
.hero-stat > div { padding: 14px 18px; }
.hero-stat > div + div { border-left: 1px solid var(--hair); }
.hs-v { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.hs-l { margin-top: 6px; color: var(--ink-3); }
.stats { display: grid; grid-template-columns: 1fr 1fr; }
.stat { padding: 10px 18px; border-bottom: 1px solid var(--hair); }
.stat:nth-child(odd) { border-right: 1px solid var(--hair); }
.stat .l { color: var(--ink-3); font-size: 9.5px; }
.stat .v { font-size: 15px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.sec { padding: 14px 18px; border-bottom: 1px solid var(--hair); }
.sec-h { display: flex; justify-content: space-between; color: var(--ink-3); margin-bottom: 10px; }
.bar { display: flex; height: 22px; border: 1px solid var(--ink); }
.bar span { height: 100%; min-width: 0; }
.bar-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin-top: 10px; }
.bl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.bl b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
table.pg { width: 100%; border-collapse: collapse; font-size: 12px; }
table.pg th { text-align: left; font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 0 0 6px; border-bottom: 1px solid var(--ink); }
table.pg td { padding: 6px 0; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.pg td.r, table.pg th.r { text-align: right; font-variant-numeric: tabular-nums; }
.sq { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--swatch-line); }
.pg-sub { color: var(--ink-3); font-size: 10.5px; }

/* readout + tooltip */
#readout { position: fixed; left: 20px; bottom: 20px; display: flex; gap: 0; border: 1px solid var(--ink); background: var(--surface); z-index: 5; }
#readout span { padding: 6px 10px; min-width: 96px; }
#readout span + span { border-left: 1px solid var(--hair); }
#tooltip {
  position: fixed; pointer-events: none; z-index: 20; background: var(--ink); color: var(--on-ink);
  padding: 8px 10px; font-size: 12px; max-width: 260px; transform: translate(14px, 14px);
}
#tooltip .tt-n { font-weight: 600; font-size: 13px; }
#tooltip .tt-m { font-family: var(--mono); font-size: 10.5px; color: var(--on-ink-dim); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
#tooltip.hidden { display: none; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--surface); z-index: 50; }
#loading.done { display: none; }

/* clean mode: hide chrome for recording */
body.clean .chrome { display: none !important; }
body.clean #stage { cursor: none; }

/* studio bar */
#studio-btn { margin-left: 0; }
#studio-btn .cam { width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; display: inline-block; }
#studio {
  position: fixed; top: 56px; right: 0; left: 0; height: 44px; z-index: 9; display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 0 20px; border-bottom: 1px solid var(--ink); background: var(--bar); backdrop-filter: blur(6px);
}
#studio.hidden { display: none; }
body.studio #left, body.studio #profile { top: 120px; }
body.studio #left { max-height: calc(100vh - 120px - 66px); }
.seg { display: flex; border: 1px solid var(--ink); }
.seg button { background: var(--surface); border: 0; border-right: 1px solid var(--ink); padding: 5px 10px; cursor: pointer; font: 500 10.5px var(--mono); letter-spacing: .05em; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--on-ink); }
.sep { width: 1px; height: 22px; background: var(--hair-2); margin: 0 6px; }
#frame { position: fixed; pointer-events: none; z-index: 2; }
#frame.hidden { display: none; }
#frame span { position: absolute; top: -18px; left: 0; font-size: 9.5px; color: var(--ink-2); }
body.clean #frame { display: none; }

/* panel nav + tabs */
.p-nav { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--ink); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.p-nav button { background: var(--surface); border: 1px solid var(--hair-2); height: 26px; min-width: 26px; cursor: pointer; font-size: 13px; }
.p-nav button:hover { border-color: var(--ink); }
.p-nav .crumbs { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }
.p-nav .crumbs a { color: var(--ink-2); cursor: pointer; text-decoration: none; }
.p-nav .crumbs a:hover { color: var(--ink); text-decoration: underline; }
.p-head .p-close { display: none; }
.tabs { display: flex; border-bottom: 1px solid var(--ink); }
.tabs button { flex: 1; background: var(--surface); border: 0; border-right: 1px solid var(--hair); padding: 10px 0; cursor: pointer; font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.tabs button:last-child { border-right: 0; }
.tabs button.on { background: var(--ink); color: var(--on-ink); }
.filters { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; align-items: center; }
.filters button { background: var(--surface); border: 1px solid var(--hair-2); padding: 3px 8px; cursor: pointer; font: 500 10px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.filters button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.filters input { flex: 1; min-width: 120px; border: 0; border-bottom: 1px solid var(--hair-2); font: 13px var(--sans); padding: 4px 0; outline: none; }
.rows .row { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.rows .row:hover { background: var(--soft); }
.row .rn { flex: 1; min-width: 0; font-size: 13px; }
.row .rn small { display: block; color: var(--ink-3); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rv { font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; }
.row .rv small { display: block; color: var(--ink-3); font: 9.5px var(--mono); text-transform: uppercase; }
.more { display: block; width: 100%; padding: 10px; background: var(--surface); border: 0; cursor: pointer; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.more:hover { background: var(--soft); }
a.link { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair-2); cursor: pointer; }
a.link:hover { border-color: var(--ink); }

/* people profile hero with photo cutout */
.ph { position: relative; height: 230px; border-bottom: 1px solid var(--ink); overflow: hidden; background: var(--surface); }
/* a quiet plinth behind the cutout instead of grid lines running through it */
.ph::before { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 46%; background: var(--soft); border-left: 1px solid var(--hair); }
.ph img { position: absolute; right: 2%; bottom: 0; height: 84%; max-width: 42%; object-fit: contain; object-position: bottom right; filter: saturate(1.05) contrast(1.03); }
.ph img.framed { bottom: 18px; right: 18px; height: 70%; border: 1px solid var(--ink); }
.ph .ph-text { position: absolute; left: 18px; top: 16px; right: 18px; bottom: 16px; display: flex; flex-direction: column; }
.ph .p-name { font-size: 30px; max-width: 52%; margin-top: 12px; line-height: 1.05; }
.ph .ph-sub { font-size: 13px; color: var(--ink-2); max-width: 52%; margin-top: 4px; }
.ph .ph-big { margin-top: auto; }
.ph .ph-big .hs-v { font-size: 30px; }
.ph .no-photo { position: absolute; right: 18px; bottom: 18px; color: var(--ink-3); }
.credit { padding: 6px 18px; color: var(--ink-3); font-size: 9.5px; border-bottom: 1px solid var(--hair); }
.credit a { color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv .k { color: var(--ink-3); font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.path { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11.5px; }
.path span { border: 1px solid var(--hair-2); padding: 2px 6px; }
.path span:last-child { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.dia { display: flex; flex-wrap: wrap; gap: 4px; }
.dia span { font-size: 11.5px; border: 1px solid var(--hair-2); padding: 2px 6px; }

/* scripture milestones */
.miles { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); }
.miles > div { padding: 10px; border-right: 1px solid var(--hair); }
.miles > div:last-child { border-right: 0; }
.miles .m-l { font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.miles .m-v { font-size: 18px; font-weight: 600; margin-top: 4px; }
.miles .done { background: var(--good-bg); }
.miles .done .m-v::before { content: "✓ "; color: #18b96b; }
.res { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.res a, .res span { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--ink); padding: 3px 7px; color: var(--ink); text-decoration: none; }
.res span.off { border-color: var(--hair-2); color: var(--ink-3); text-decoration: line-through; }

/* tabs: label over count so three fit */
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; font-size: 9.5px; }
.tabs button b { font: 600 14px var(--sans); letter-spacing: 0; text-transform: none; }

/* timeline bar */
#timeline {
  position: fixed; left: 300px; right: 20px; bottom: 20px; height: 64px; z-index: 6; display: flex; align-items: center; gap: 12px;
  padding: 0 12px; background: var(--surface); border: 1px solid var(--ink);
}
#timeline.hidden { display: none; }
body.has-profile #timeline { right: 440px; }
.tl-play { width: 40px; height: 40px; flex: none; border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink); font-size: 14px; cursor: pointer; }
.tl-year { font: 700 26px var(--sans); letter-spacing: -0.03em; min-width: 108px; font-variant-numeric: tabular-nums; }
.tl-track { position: relative; flex: 1; height: 44px; cursor: ew-resize; touch-action: none; }
.tl-track canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#tl-head { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); pointer-events: none; }
#tl-head::before { content: ""; position: absolute; top: -2px; left: -4px; width: 10px; height: 10px; background: var(--accent); }
.tl-follow { font-size: 11.5px; white-space: nowrap; }
.tl-stats { margin-top: 10px; display: grid; grid-template-columns: 1fr; gap: 4px; font-size: 12px; }
.tl-stats b { font-variant-numeric: tabular-nums; }
body.timeline #readout { display: none; }

/* people-group "About" */
.about .summary { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.excerpt { margin: 12px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--ink); font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.excerpt-src { margin-top: 6px; font-size: 9.5px; }
.about-head { width: 100%; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.about-head:hover { color: var(--ink); }
.about-toggle::after { content: "Show +"; }
.about.open .about-toggle::after { content: "Hide −"; }
/* closed: a two-line preview of the summary, the Joshua Project excerpt hidden */
.about:not(.open) .summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); }
.about:not(.open) #jp-about { display: none; }
.ai-sum { margin-top: 12px; padding: 10px 12px; background: var(--soft); border-left: 2px solid var(--ink); font-size: 13px; line-height: 1.55; }
.cmp td { font-size: 12px; }
.world-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: 11.5px; line-height: 1.6; }
.world-note b { font-variant-numeric: tabular-nums; }
#proj + .theme-btn, .theme-btn + #studio-btn { margin-left: -14px; }
input, textarea, select { color: inherit; }
textarea { background: transparent; }
.jp-full { margin-top: 14px; }
.jp-full h4 { margin: 16px 0 6px; font-size: 10px; color: var(--ink-3); font-weight: 500; }
.jp-full h4:first-child { margin-top: 0; }
.jp-full p { margin: 0 0 9px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
@media (max-width: 1100px) { body.has-profile #readout { display: none; } }

/* journey bar */
#journey { position: fixed; left: 300px; right: 20px; bottom: 20px; height: 64px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface); border: 1px solid var(--ink); }
#journey.hidden { display: none; }
body.journey #timeline, body.journey #readout { display: none; }
.jr-text { min-width: 0; flex: 0 1 260px; }
.jr-name { font: 700 17px var(--sans); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#jr-stop { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-dots { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.jr-dots button { flex: 1; max-width: 60px; height: 8px; border: 1px solid var(--ink); background: var(--surface); padding: 0; cursor: pointer; }
.jr-dots button.seen { background: var(--ink); }
.jr-dots button.on { background: var(--accent); border-color: var(--accent); }
@media (max-width: 900px) { #journey { left: 16px; right: 16px; } .jr-dots { display: none; } }

/* how Christianity came here */
.ch-hist p { font-size: 13.5px; line-height: 1.6; margin: 0 0 10px; }
.ch-head { font-size: 15px !important; font-weight: 600; line-height: 1.45 !important; }
.ch-arr { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; padding: 8px 10px; margin-bottom: 12px; background: var(--soft); border-left: 3px solid var(--accent); }
.ch-arr b { font: 700 18px var(--sans); letter-spacing: -0.02em; white-space: nowrap; }
.ch-arr span { font-size: 12.5px; line-height: 1.45; }
.ch-waves { margin: 6px 0 12px; border-left: 1px solid var(--ink); padding-left: 12px; }
.ch-waves > div { position: relative; padding: 4px 0 8px; }
.ch-waves > div::before { content: ""; position: absolute; left: -16px; top: 9px; width: 7px; height: 7px; background: var(--ink); }
.ch-waves .mono { font-size: 9.5px; color: var(--ink-3); display: block; }
.ch-waves b { font-size: 13.5px; display: block; }
.ch-waves p { margin: 2px 0 0 !important; font-size: 12.5px !important; color: var(--ink-2); }
.ch-sub { font-size: 9.5px; margin: 12px 0 6px; }
.ch-figs > div { display: grid; grid-template-columns: 1fr; padding: 5px 0; border-top: 1px solid var(--hair); font-size: 13px; }
.ch-figs span { font-size: 12px; color: var(--ink-2); }
.ch-hooks { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.ch-jr { padding: 2px 7px; font-size: 10px; white-space: nowrap; }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* phones: the Globe's chrome rearranged so the globe stays visible */
#left-toggle { display: none; }
@media (max-width: 760px) {
  #topbar { gap: 8px; padding: 0 12px; }
  #topbar .brand { min-width: 0; flex: 1 1 auto; }
  #topbar .brand-name { display: none; }
  #studio-btn { display: none; }
  #modes { position: fixed; top: 56px; left: 0; right: 0; margin: 0; border-width: 0 0 1px; background: var(--surface); overflow-x: auto; scrollbar-width: none; z-index: 9; }
  #modes::-webkit-scrollbar { display: none; }
  .mode-btn { white-space: nowrap; flex: none; }
  #left { display: none; top: 112px; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 190px); }
  body.left-open #left { display: block; }
  #left-toggle { display: block; position: fixed; left: 12px; bottom: 16px; z-index: 6; background: var(--surface); }
  body.left-open #left-toggle { background: var(--ink); color: var(--on-ink); }
  #profile { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh; border-width: 1px 0 0; }
  #profile.hidden { transform: translateY(40px); }
  #readout { display: none; }
  #timeline, #journey { left: 12px; right: 12px; bottom: 12px; }
  body.journey #left-toggle, body.timeline #left-toggle { bottom: 88px; }
  body.has-profile #left-toggle, body.has-profile #left { display: none; }
  .tl-follow, #tl-speed { display: none; }
}

/* in-page messages */
#toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; display: grid; gap: 6px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--ink); border-left: 4px solid var(--accent); padding: 10px 14px; font: 500 13px var(--sans); color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.12); transition: opacity .35s, transform .35s; }
.toast.info { border-left-color: var(--ink); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* keyboard shortcut sheet */
.modal-keys { position: fixed; inset: 0; z-index: 40; background: rgba(14, 16, 19, .35); display: grid; place-items: center; padding: 16px; }
.modal-keys.hidden { display: none; }
.keys-box { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--ink); padding: 14px 18px 18px; }
.keys-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.keys-h .tool { padding: 2px 8px; }
.keys-grid { display: grid; grid-template-columns: auto auto auto 1fr; gap: 7px 6px; align-items: center; }
.keys-grid kbd { font: 600 11px var(--mono); border: 1px solid var(--ink); border-bottom-width: 2px; padding: 2px 7px; min-width: 22px; text-align: center; background: var(--surface); }
.keys-grid > span:not(.kd) { font-size: 11px; color: var(--ink-3); text-align: center; }
.kd { font-size: 13px; padding-left: 8px; }
.keys-link { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--hair); cursor: pointer; color: var(--ink-3); }
.keys-link:hover { color: var(--ink); }

/* tool switcher: one button showing the current tool, opening a menu of all five */
.toolmenu { position: relative; margin-left: 10px; }
.toolmenu-btn { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); padding: 6px 10px; font: 500 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.toolmenu-btn i { font-style: normal; font-size: 9px; transition: transform .2s; }
.toolmenu.open .toolmenu-btn i { transform: rotate(180deg); }
.toolmenu-list { white-space: normal; position: absolute; top: calc(100% + 6px); left: 0; width: 330px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--ink); box-shadow: 0 14px 34px rgba(0, 0, 0, .14); z-index: 50; display: none; }
.toolmenu.open .toolmenu-list { display: block; }
.toolmenu-list a { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; padding: 10px 12px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--hair); }
.toolmenu-list a:first-child { border-top: 0; }
.toolmenu-list a:hover { background: var(--soft); }
.toolmenu-list a.on { background: var(--soft); box-shadow: inset 3px 0 0 var(--accent); }
.toolmenu-list .n { font: 500 11px var(--mono); color: var(--ink-3); grid-row: span 2; padding-top: 2px; }
.toolmenu-list b { font: 600 14px var(--sans); letter-spacing: -0.01em; }
.toolmenu-list small { font-size: 12px; line-height: 1.4; color: var(--ink-2); }

/* in-page confirmation */
.ask { position: fixed; inset: 0; z-index: 70; background: rgba(14, 16, 19, .35); display: grid; place-items: center; padding: 16px; }
.ask-box { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--ink); padding: 18px 18px 14px; }
.ask-box p { margin: 0 0 16px; font-size: 15px; line-height: 1.45; font-weight: 500; }
.ask-btns { display: flex; justify-content: flex-end; gap: 6px; }
.ask-ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.ask-ok:hover { background: #d42f14; border-color: #d42f14; }

/* country dropdowns: closed shows the summary line, open shows the rest (same pattern as About) */
.ch-hist:not(.open) .fold-more, .ch-arch:not(.open) .fold-more { display: none; }
.ch-hist.open .summary.ch-head { display: block; }
.ch-arch.open > div > .summary { display: none; }
.ch-arch .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: default; padding: 7px 0; border-top: 1px solid var(--hair); }
.ch-arch .row .rn small { display: block; }

/* Bible mode: dialect layer setting */
.lyr-dia { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; margin: 2px 0 6px 22px; }
.lyr-dia[hidden] { display: none; }
.lyr-dia select { border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink); font: 500 10.5px var(--mono); padding: 3px 4px; }
.dia-note { margin-top: 8px; font-size: 12px !important; line-height: 1.5; }
.dia .dia-own { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--ink); padding: 2px 7px; font-size: 12px; cursor: pointer; color: var(--ink); text-decoration: none; }
.dia .dia-own small { font: 500 9px var(--mono); text-transform: uppercase; color: var(--ink-3); }
.dia .dia-own .sq { margin-right: 0; }
