:root {
  /* Filmora-style dark charcoal + teal accent */
  --bg: #141416;
  --panel: #1c1c1f;
  --panel-2: #232327;
  --panel-3: #2a2a2f;
  --border: #323238;
  --border-soft: #2a2a30;
  --text: #e9e9ec;
  --text-dim: #8b8b93;
  --text-mute: #6a6a72;
  --accent: #33d19e;       /* teal-green */
  --accent-2: #3ddc84;     /* export green */
  --play: #ff4b4b;         /* red playhead, like an editor scrubber */

  /* section colours (books) */
  --tick: #3a3a42;
  --tick-major: #55555f;
  --grid: #ffffff07;
  --grid-major: #ffffff10;

  /* layout */
  --left-w: 250px;
  --right-w: 400px;
  --timeline-h: 320px;
  --axis-size: 84px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 14px;
}
body { display: flex; flex-direction: column; overflow: hidden; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a3a42; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #4a4a54; background-clip: padding-box; }

/* ---------- Beta access gate / landing ---------- */
.auth-gate {
  position: fixed; inset: 0; z-index: 2000; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1100px 700px at 50% -10%, #1a2440 0%, transparent 60%),
    radial-gradient(900px 600px at 50% 40%, #14213d55 0%, transparent 70%),
    linear-gradient(180deg, #070b16, #04060c 60%, #020306);
  color: #eaf0ff;
}
body.authed .auth-gate { display: none; }
.starfield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.gate-aurora {
  position: absolute; left: 50%; top: 34%; width: 720px; height: 720px; transform: translate(-50%,-50%);
  background: radial-gradient(circle, #e9c46a22 0%, #33d19e14 34%, transparent 66%);
  filter: blur(8px); z-index: 0; pointer-events: none; animation: auroraPulse 7s ease-in-out infinite;
}
@keyframes auroraPulse { 0%,100% { opacity: .8; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.08); } }
.gate-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background:
    linear-gradient(#ffffff08 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, #ffffff08 1px, transparent 1px) 0 0 / 46px 100%;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
}

.music-toggle {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: #ffffff10; border: 1px solid #ffffff22; color: #e9c46a; font-size: 16px;
  backdrop-filter: blur(6px); transition: all .16s;
}
.music-toggle:hover { background: #ffffff1c; color: #fff8e2; }
.music-toggle.muted { color: #7787a3; }
.music-toggle.muted::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%;
  height: 1.5px; background: currentColor; transform: rotate(-45deg);
}

/* Landing */
.landing { position: relative; z-index: 2; text-align: center; padding: 24px; max-width: 660px; }
.liahona { display: flex; justify-content: center; margin-bottom: 6px; }
.liahona-svg { width: 190px; height: 190px; overflow: visible; filter: drop-shadow(0 0 26px #e9c46a55); animation: lhFloat 6s ease-in-out infinite; }
.lh-ring-rot, .lh-ring-rev, .lh-orb-grp { transform-box: fill-box; transform-origin: center; }
.lh-ring-rot { animation: lhSpin 26s linear infinite; }
.lh-ring-rev { animation: lhSpin 17s linear infinite reverse; }
.lh-orb-grp { animation: lhBreathe 4.5s ease-in-out infinite; }
@keyframes lhSpin { to { transform: rotate(360deg); } }
@keyframes lhFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes lhBreathe { 0%,100% { opacity: .96; } 50% { opacity: 1; } }

.landing-tag {
  font-size: 12px; text-transform: uppercase; letter-spacing: 3px; color: #e9c46a;
  margin-bottom: 10px; text-shadow: 0 0 18px #e9c46a55;
}
.landing-title {
  font-size: clamp(42px, 8vw, 84px); font-weight: 800; letter-spacing: -1.5px; margin: 0 0 14px; line-height: 1;
  background: linear-gradient(100deg, #fff8e6, #e9c46a 38%, #7fe6c8 74%, #33d19e);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 8s linear infinite; text-shadow: 0 0 60px rgba(233,196,106,.12);
}
@keyframes shimmer { to { background-position: 200% center; } }
.landing-sub { font-size: clamp(15px, 2.2vw, 18px); color: #b9c4dc; line-height: 1.6; max-width: 540px; margin: 0 auto 20px; }
.landing-stats {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: #9fb0cf; margin-bottom: 26px;
}
.landing-stats b { color: #fff; font-weight: 700; margin-right: 4px; }
.landing-stats i { width: 4px; height: 4px; border-radius: 50%; background: #e9c46a; opacity: .6; }
.enter-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 14px 30px; border-radius: 999px; border: 1px solid #e9c46a66;
  background: linear-gradient(100deg, #e9c46a, #33d19e); color: #04140f;
  font-size: 15px; font-weight: 800; letter-spacing: .4px;
  box-shadow: 0 0 0 0 #33d19e66, 0 14px 40px #0008; transition: transform .16s, box-shadow .3s;
  animation: ctaGlow 3.2s ease-in-out infinite;
}
.enter-btn:hover { transform: translateY(-2px) scale(1.02); }
@keyframes ctaGlow { 0%,100% { box-shadow: 0 0 0 0 #33d19e44, 0 14px 40px #0008; } 50% { box-shadow: 0 0 34px 4px #33d19e55, 0 14px 40px #0008; } }
.landing-verse { margin-top: 28px; font-size: 13px; font-style: italic; color: #8ea0bf; line-height: 1.6; }
.landing-verse span { display: block; font-style: normal; color: #e9c46a; letter-spacing: 1.4px; font-size: 11px; text-transform: uppercase; margin-top: 6px; }

/* Sign-in panel (revealed on Enter) */
.signin-panel {
  position: relative; z-index: 2; display: none;
  width: min(420px, 92vw); padding: 26px 26px 24px; text-align: center;
  background: #10141ecc; border: 1px solid #ffffff18; border-radius: 18px;
  backdrop-filter: blur(14px); box-shadow: 0 30px 80px #000a, inset 0 1px 0 #ffffff12;
}
.auth-gate.signin-mode .landing { display: none; }
.auth-gate.signin-mode .signin-panel { display: block; }
.back-btn {
  position: absolute; top: 14px; left: 14px; background: none; border: none;
  color: #9fb0cf; font-size: 13px; cursor: pointer;
}
.back-btn:hover { color: #fff; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 18px; font-weight: 700; margin-top: 4px; }
.auth-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 1.8px; color: var(--accent); margin: 7px 0 20px; }
#clerk-signin { display: flex; justify-content: center; }
.auth-status { color: #9fb0cf; font-size: 13px; margin-top: 14px; }
.auth-status code { background: #ffffff14; padding: 1px 5px; border-radius: 4px; }
.auth-note { color: #7787a3; font-size: 12px; margin-top: 16px; line-height: 1.55; }
.clerk-user { display: flex; align-items: center; margin-left: 6px; }
body:not(.authed) .clerk-user { display: none; }

/* ---------- Title bar ---------- */
.topbar {
  flex: none; height: 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: #101012; border-bottom: 1px solid var(--border);
}
.tb-left { display: flex; align-items: center; gap: 10px; }
.logo-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.app-name { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.app-pill {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent);
  border: 1px solid #2c4b42; background: #14211d; padding: 3px 8px; border-radius: 999px;
}
.tb-center { font-size: 13px; color: var(--text-dim); font-weight: 600; letter-spacing: .4px; }
.tb-right { display: flex; gap: 6px; }
.pane-toggle {
  background: var(--panel-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 7px;
  height: 30px; padding: 0 11px; font-size: 12px; cursor: pointer; transition: all .14s;
}
.pane-toggle:hover { color: var(--text); }
.pane-toggle.active { color: var(--accent); border-color: #2c4b42; background: #16211d; }

/* ---------- Main area ---------- */
.main-area { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.content-row { flex: 1 1 auto; display: flex; min-height: 130px; }

.pane { flex: none; display: flex; flex-direction: column; background: var(--panel); overflow: hidden; transition: width .18s ease; }
.pane-left { width: var(--left-w); border-right: 1px solid var(--border); }
.pane-right, .pane-context { width: var(--right-w); border-left: 1px solid var(--border); }
body.left-collapsed .pane-left { width: 0; }
body.right-collapsed .pane-right, body.right-collapsed .pane-context { width: 0; }
body.left-collapsed .vsplit-left, body.right-collapsed .vsplit-right { display: none; }

/* Context pane: Details / Atlas / Kings / Lineage */
.ctx-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--border); }
.ctx-tab { background: none; border: none; color: var(--text-mute); padding: 7px 8px 9px; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.ctx-tab:hover { color: var(--text-dim); }
.ctx-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.ctx-body { flex: 1; min-height: 0; display: flex; }
.ctx-view { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ctx-view[hidden] { display: none; }

.reader-pane { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
body.reader-collapsed .reader-pane, body.reader-collapsed .vsplit-left, body.reader-collapsed .vsplit-right { display: none; }

.pane-body { flex: 1; overflow: auto; padding: 12px 14px; }

/* splitters */
.vsplit { flex: none; width: 5px; cursor: col-resize; background: var(--border-soft); }
.hsplit { flex: none; height: 6px; cursor: row-resize; background: var(--border-soft); }
.vsplit:hover, .hsplit:hover { background: var(--accent); }

/* ---------- Library ---------- */
.lib-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--border); }
.lib-tab {
  background: none; border: none; color: var(--text-mute);
  padding: 6px 7px 8px; font-size: 11.5px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.lib-tab:hover { color: var(--text-dim); }
.lib-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.lib-search { flex: none; padding: 10px 10px 6px; }
.lib-search input {
  width: 100%; height: 30px; padding: 0 10px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-size: 13px;
}
.lib-search input:focus { outline: none; border-color: var(--accent); }
.lib-grid { flex: 1; overflow: auto; padding: 6px 8px 12px; }

.lib-card {
  display: flex; align-items: stretch; gap: 0; margin-bottom: 6px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; cursor: pointer; transition: border-color .14s, background .14s;
}
.lib-card:hover { background: var(--panel-3); }
.lib-card.selected { border-color: var(--accent); background: #16211d; }
.card-bar { width: 4px; flex: none; background: var(--c, #888); }
.card-body { flex: 1; min-width: 0; padding: 8px 10px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.card-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-badge { align-self: center; font-size: 10px; color: var(--text-mute); padding: 0 10px; white-space: nowrap; }
.lib-empty { color: var(--text-mute); font-size: 12px; line-height: 1.6; padding: 16px 8px; }

/* ---------- Reader / Player ---------- */
.player-head {
  flex: none; height: 42px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.ph-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--text-dim); }
.ph-source { display: flex; align-items: center; gap: 8px; }
.ph-source select {
  height: 28px; padding: 0 8px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px; cursor: pointer; max-width: 160px;
}
.ph-source select:disabled { opacity: .5; }
.ph-ver { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--accent); border: 1px solid #2c4b42; border-radius: 4px; padding: 2px 6px; }

.reader-body { flex: 1; overflow: auto; padding: 30px 8%; }
.reader-empty { color: var(--text-mute); font-size: 14px; line-height: 1.7; max-width: 520px; margin: 20px auto; text-align: center; }
.reader-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--accent); margin-bottom: 6px; }
.reader-title { font-size: 26px; font-weight: 700; margin: 0 0 22px; letter-spacing: .2px; }
.reader-verse { font-size: 16px; line-height: 1.8; color: #dcdce2; margin: 0 0 12px; max-width: 640px; }
.reader-verse .vnum { font-size: 11px; font-weight: 700; color: var(--accent); vertical-align: super; margin-right: 6px; }
.reader-verse.verse-hl {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: 4px; padding: 6px 10px 6px 12px; margin-left: -15px;
}
.reader-loading, .reader-error { color: var(--text-dim); font-size: 14px; margin-top: 14px; }
.reader-error { color: #ff8a8a; }

.transport {
  flex: none; height: 52px; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: var(--panel); border-top: 1px solid var(--border);
}
.tp-btns { display: flex; gap: 4px; }
.tp-btns button {
  width: 34px; height: 30px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; font-size: 13px; cursor: pointer;
}
.tp-btns button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tp-btns button:disabled { opacity: .35; cursor: default; }
#tp-play.playing { color: var(--accent); border-color: var(--accent); }
.tp-pos { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; min-width: 150px; }
.tp-scrub { flex: 1; accent-color: var(--play); }

/* ---------- Inspector ---------- */
.insp-tabs { flex: none; display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); }
.insp-tab {
  background: none; border: none; color: var(--text-mute);
  padding: 7px 10px 9px; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent;
}
.insp-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.detail-empty { font-size: 13px; color: var(--text-mute); line-height: 1.6; }
.detail-summary { font-size: 13.5px; line-height: 1.65; color: #c8cdd8; margin: 0 0 16px; }
.ref-count { font-size: 11px; color: var(--text-mute); margin: 2px 0 6px; }
.ref-more { font-size: 11px; color: var(--text-mute); margin-top: 6px; }
.ref-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 4px; max-height: 260px; overflow: auto; padding-right: 2px; }
.ref-item {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 11px; padding: 4px 8px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.ref-item:hover { border-color: var(--accent); color: var(--accent); }

/* hover preview card */
.entity-pop {
  position: fixed; z-index: 2500; width: 268px; max-width: 82vw;
  background: #12141c; border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 14px; box-shadow: 0 18px 48px #000c; pointer-events: auto;
}
.ep-cat { font-size: 10px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--accent); margin-bottom: 3px; }
.ep-title { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.ep-sum { font-size: 12.5px; line-height: 1.5; color: #c8cdd8; }
.ep-hint { font-size: 10.5px; color: var(--text-mute); margin-top: 9px; }

/* clickable objects inside the scripture text */
.entity-link {
  cursor: pointer; border-bottom: 1px dotted color-mix(in srgb, var(--accent) 50%, transparent);
  transition: color .12s, background .12s;
}
.entity-link:hover { color: var(--accent); border-bottom-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 3px; }
.detail-accent { height: 4px; border-radius: 3px; background: var(--c, #888); margin-bottom: 14px; }
.detail-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); margin-bottom: 4px; }
.detail-title { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.detail-row .k { color: var(--text-dim); }
.detail-row .v { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.ctx-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); margin: 16px 0 8px; }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 6px 0;
  padding: 5px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text); cursor: pointer;
}
.ctx-chip:hover { border-color: var(--accent); }
.ctx-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #888); }
.detail-btn {
  margin-top: 16px; width: 100%; height: 34px; background: var(--accent); color: #06231b;
  border: none; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.detail-btn:hover { background: var(--accent-2); }

/* ---------- Timeline pane (collapsible) ---------- */
.timeline-pane { flex: none; height: var(--timeline-h); min-height: 130px; display: flex; flex-direction: column; }
body.timeline-collapsed .timeline-pane { height: 41px !important; min-height: 41px; }
body.timeline-collapsed .timeline-pane #viewport { display: none; }
body.timeline-collapsed .hsplit { display: none; }
#timeline-collapse { min-width: 26px; }
.timeline-bar {
  flex: none; height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--border); gap: 12px;
}
.tlb-left, .tlb-right { display: flex; align-items: center; gap: 8px; }
.view-tabs { display: flex; gap: 4px; }
.view-tab {
  background: none; border: 1px solid transparent; color: var(--text-mute);
  height: 27px; padding: 0 11px; border-radius: 7px; font-size: 12px; cursor: pointer; transition: all .14s;
}
.view-tab:hover { color: var(--text-dim); }
.view-tab.on { color: var(--text); background: var(--panel-2); border-color: var(--border); }

/* switchable stages */
.view-stage { flex: 1; min-height: 0; }
.view-stage[hidden] { display: none; }
.view-stub { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-mute); font-size: 14px; line-height: 1.7; }
.view-stub b { color: var(--text); }

/* ---------- Atlas (3D) ---------- */
.atlas-view { display: flex; flex-direction: column; background: #0a0e14; position: relative; }
.atlas3d { flex: 1; min-height: 0; position: relative; overflow: hidden; }
#atlas-gl { width: 100%; height: 100%; display: block; }

/* fullscreen: Atlas breaks out of the pane and covers everything */
body.atlas-full #atlas { position: fixed; inset: 0; z-index: 1600; }

.atlas-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.map3-label {
  position: absolute; transform: translate(-50%, -100%); white-space: nowrap;
  font-size: 11px; color: #cdd5e2; opacity: .25; transition: opacity .3s, color .3s;
  text-shadow: 0 1px 3px #000, 0 0 3px #000; will-change: left, top;
}
.map3-label.on { opacity: .95; font-weight: 600; }
.map3-label.sel { color: var(--accent); opacity: 1; }

.atlas-hint { position: absolute; right: 14px; bottom: 12px; z-index: 3; font-size: 11px; color: var(--text-mute); pointer-events: none; }
.atlas-loading { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 14px; background: #070b12; pointer-events: none; }
.atlas-filters { position: absolute; left: 14px; top: 12px; z-index: 3; display: flex; gap: 4px; padding: 4px; background: #0a0f18cc; border: 1px solid var(--border); border-radius: 9px; backdrop-filter: blur(4px); }
.atlas-filter { background: none; border: none; color: var(--text-mute); font-size: 12px; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.atlas-filter:hover { color: var(--text); }
.atlas-filter.on { background: var(--accent); color: #04140f; font-weight: 700; }
.atlas-caption { top: 56px; }
.atlas3d.tactical .map3-label { color: #7ff0ff; text-shadow: 0 0 6px #39d6ff, 0 1px 3px #000; }
.atlas3d.tactical .map3-label.sel { color: #eafcff; }

/* nation banners + faction toggle + legend */
.af-sep { width: 1px; align-self: stretch; margin: 2px 3px; background: var(--border); }
.atlas-filter.nat.on { background: #e9c46a; color: #241a05; }
.nation-label {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; z-index: 2;
  font-size: 12px; font-weight: 800; letter-spacing: .4px; color: #fff;
  padding: 2px 9px; border-radius: 6px; pointer-events: none;
  background: color-mix(in srgb, var(--c) 78%, #05070b);
  border: 1px solid color-mix(in srgb, var(--c) 60%, #fff);
  box-shadow: 0 2px 8px #000a, inset 0 1px 0 #ffffff44;
  text-shadow: 0 1px 2px #000b; text-transform: uppercase;
}
.atlas-legend {
  position: absolute; right: 14px; top: 54px; z-index: 3; max-width: 150px;
  display: flex; flex-direction: column; gap: 3px; padding: 8px 10px;
  background: #0a0f18cc; border: 1px solid var(--border); border-radius: 9px; backdrop-filter: blur(4px);
  max-height: 60%; overflow: auto; pointer-events: none;
}
.atlas-legend:empty { display: none; }
.leg-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text); }
.leg-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px #ffffff33; }

.atlas-caption { position: absolute; left: 14px; top: 12px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; z-index: 3; }
.atlas-caption span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); background: #0a0d10bb; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(3px); }
.atlas-caption i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

.atlas-tools { position: absolute; right: 14px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.atlas-tools button {
  width: 34px; height: 34px; border-radius: 8px; background: #12151dcc; color: var(--text);
  border: 1px solid var(--border); font-size: 16px; cursor: pointer; backdrop-filter: blur(4px);
}
.atlas-tools button:hover { border-color: var(--accent); color: var(--accent); }

.atlas-info {
  position: absolute; left: 14px; bottom: 14px; z-index: 3; width: 280px; max-width: 70vw;
  background: #10141ecc; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; backdrop-filter: blur(8px);
}
.ai-kind { font-size: 10px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--accent); }
.ai-title { font-size: 17px; font-weight: 700; margin: 2px 0 6px; }
.ai-sum { font-size: 12.5px; line-height: 1.5; color: #c8cdd8; }
.ai-read { margin-top: 10px; background: var(--accent); color: #06231b; border: none; border-radius: 7px; font-weight: 700; font-size: 12px; padding: 7px 12px; cursor: pointer; }

.atlas-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel); border-top: 1px solid var(--border); z-index: 3; }
#atlas-scrub { flex: 1; accent-color: var(--accent); }
#atlas-play.playing { color: var(--accent); border-color: var(--accent); }
.atlas-readout { font-size: 13px; color: var(--text); min-width: 150px; text-align: right; }
.atlas-readout b { font-variant-numeric: tabular-nums; }
.atlas-readout span { color: var(--text-dim); }
.tl-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); }
.chrono-pills { display: flex; gap: 6px; }
.tlb-btn {
  height: 27px; min-width: 28px; padding: 0 8px; background: var(--panel-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px; cursor: pointer;
}
.tlb-btn.wide { padding: 0 12px; }
.tlb-btn:hover { color: var(--text); border-color: var(--tick-major); }
.tlb-sep { width: 1px; height: 18px; background: var(--border); }
.zoom-range { width: 120px; accent-color: var(--accent); }
.readout { font-size: 11px; color: var(--text-mute); min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }

.viewport { flex: 1; min-width: 0; overflow: auto; position: relative; background: var(--bg); cursor: grab; user-select: none; }
body.panning, body.panning .viewport, body.panning .span-bar, body.panning .story-mark { cursor: grabbing !important; }
.stage { position: relative; display: flex; }
body.mode-vertical .stage { flex-direction: row; }
body.mode-horizontal .stage { flex-direction: column; }

/* time ruler */
.axis { position: sticky; z-index: 15; background: #17171a; flex: none; }
body.mode-vertical .axis { left: 0; width: var(--axis-size); border-right: 1px solid var(--border); }
body.mode-horizontal .axis { top: 0; height: 38px; border-bottom: 1px solid var(--border); }
.tick { position: absolute; }
body.mode-vertical .tick { left: 0; right: 0; height: 0; border-top: 1px solid var(--tick); }
body.mode-horizontal .tick { top: 0; bottom: 0; width: 0; border-left: 1px solid var(--tick); }
.tick.major { border-color: var(--tick-major); }
.tick .label { position: absolute; font-size: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tick.major .label { color: var(--text); font-weight: 600; }
body.mode-vertical .tick .label { right: 8px; top: -7px; }
body.mode-horizontal .tick .label { left: 5px; top: 6px; }

.threads { position: relative; flex: 1 1 auto; }
.gridline { position: absolute; pointer-events: none; }
body.mode-vertical .gridline { left: 0; right: 0; height: 0; border-top: 1px solid var(--grid); }
body.mode-horizontal .gridline { top: 0; bottom: 0; width: 0; border-left: 1px solid var(--grid); }
.gridline.major { border-color: var(--grid-major); }
.threads-empty { position: sticky; top: 30%; margin: 20px 28px; max-width: 340px; color: var(--text-mute); font-size: 13px; line-height: 1.6; }
.threads-empty strong { color: var(--text); }

/* ---------- Tracks (lanes) ---------- */
.thread-lane { position: absolute; background: #ffffff04; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border-soft); }
.thread-lane.lane-hidden { background: #ffffff02; }

/* frozen track-header column (horizontal) */
.lane-label-col { position: sticky; left: 0; top: 0; z-index: 20; background: #16161a; border-right: 1px solid var(--border); }
.lane-title {
  z-index: 8; display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text);
}
body.mode-vertical .lane-title { position: sticky; top: 6px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
.lane-title-side { position: absolute; left: 0; width: 100%; padding: 0 12px; }
.th-eye {
  flex: none; width: 24px; height: 22px; background: var(--panel-2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 5px; font-size: 11px; cursor: pointer; line-height: 1;
}
.th-eye:hover { color: var(--text); }
.th-eye.off { color: var(--text-mute); opacity: .8; }
.th-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-hidden .th-name { color: var(--text-mute); }

/* ---------- Bars ---------- */
.span-bar {
  position: absolute; border-radius: 6px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 20%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--c) 65%, var(--border)); cursor: pointer;
}
.span-bar:hover { border-color: color-mix(in srgb, var(--c) 90%, #fff); }
.span-bar.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 10px #33d19e55; }
.span-bar .bar-fill { position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 12%, transparent)); }
.span-bar .bar-caption { position: relative; z-index: 1; display: block; font-size: 10px; line-height: 1.25; color: var(--text); padding: 3px 5px; text-shadow: 0 1px 2px #000a; overflow: hidden; }
.span-bar .bar-caption .name { font-weight: 600; }
.span-bar .bar-caption .yr { opacity: .72; font-variant-numeric: tabular-nums; }
.span-bar .bar-caption .chip { display: inline-block; font-size: 9px; padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--cc, #888) 30%, #0006); color: #fff; margin-right: 4px; }
body.mode-vertical .span-bar .bar-caption { position: sticky; top: 40px; }
body.mode-horizontal .span-bar .bar-caption { white-space: nowrap; }
.span-bar.fuzzy-start { border-top-style: dashed; }
.span-bar.fuzzy-end { border-bottom-style: dashed; }

/* era band */
.era-bar { background: var(--c); border: 1px solid #0006; border-radius: 5px; display: flex; overflow: visible; }
body.mode-vertical .era-bar { justify-content: center; align-items: flex-start; }
body.mode-horizontal .era-bar { justify-content: center; align-items: center; }
.era-label { z-index: 2; font-size: 11px; font-weight: 700; line-height: 1.15; text-align: center; padding: 4px 6px; color: var(--et, #14181d); }
body.mode-vertical .era-label { position: sticky; top: 44px; }
body.mode-horizontal .era-label { position: static; white-space: nowrap; }

/* ---------- Story markers (point events) ---------- */
.story-mark { position: absolute; display: flex; align-items: center; gap: 5px; cursor: pointer; z-index: 3; height: 22px; }
.story-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
}
.story-label {
  font-size: 11px; line-height: 1; color: var(--text); white-space: nowrap;
  background: color-mix(in srgb, var(--c) 16%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--border));
  border-radius: 5px; padding: 3px 7px;
}
.story-mark:hover .story-label { border-color: color-mix(in srgb, var(--c) 85%, #fff); }
.story-mark.selected .story-label { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: #fff; }
.story-mark.selected .story-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
/* major events: bolder gold flag-markers to read as the historical backbone */
.event-mark .story-dot { border-radius: 2px; width: 10px; height: 10px; transform: rotate(45deg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 28%, transparent); }
.event-mark .story-label { font-weight: 700; letter-spacing: .2px; color: #fff5da; background: color-mix(in srgb, var(--c) 26%, var(--panel)); border-color: color-mix(in srgb, var(--c) 60%, var(--border)); }

/* ---------- Playhead (red scrubber) ---------- */
.playhead { position: absolute; z-index: 16; pointer-events: none; }
body.mode-horizontal .playhead { width: 0; border-left: 2px solid var(--play); box-shadow: 0 0 10px 1px color-mix(in srgb, var(--play) 55%, transparent); }
body.mode-vertical .playhead { height: 0; border-top: 2px solid var(--play); box-shadow: 0 0 10px 1px color-mix(in srgb, var(--play) 55%, transparent); }
.playhead-flag {
  position: absolute; z-index: 1; background: var(--play); color: #fff;
  font-size: 10px; font-weight: 700; white-space: nowrap; padding: 2px 7px; box-shadow: 0 2px 6px #0007;
}
body.mode-horizontal .playhead-flag { top: 0; left: 0; border-radius: 0 4px 4px 0; }
body.mode-vertical .playhead-flag { top: 0; left: 0; transform: translateY(-100%); border-radius: 4px 4px 0 0; }

/* ---------- Chronology pills ---------- */
.chrono-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-mute);
  font-size: 11px; cursor: pointer; transition: all .14s;
}
.chrono-toggle .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #888); opacity: .4; }
.chrono-toggle.on { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--panel-2)); }
.chrono-toggle.on .swatch { opacity: 1; }

/* ---------- Kings board ---------- */
#kings.view-stub { /* stub styles overridden once rendered */ }
.kings-view, #kings:not([hidden]) { display: flex; flex-direction: column; background: #0a0e14; position: relative; min-height: 0; }
body.kings-full #kings { position: fixed; inset: 0; z-index: 1600; }
.kings-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.kings-title { font-weight: 700; font-size: 13px; color: var(--text); }
.kings-legend { display: flex; gap: 12px; margin-left: auto; }
.kings-legend span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.kings-legend i { width: 10px; height: 10px; border-radius: 3px; }
.k-fullbtn { flex: none; width: 28px; height: 26px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim); border-radius: 7px; cursor: pointer; }
.k-fullbtn:hover { border-color: var(--accent); color: var(--accent); }

.kings-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
.kings-cheads { position: sticky; top: 0; z-index: 6; display: flex; padding: 6px 6px 6px 52px; gap: 8px; background: linear-gradient(#0a0e14, #0a0e14ee); backdrop-filter: blur(3px); border-bottom: 1px solid var(--border); }
.k-chead { flex: 1; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .6px; padding: 4px; border-radius: 6px; }
.k-chead.israel { color: #bcd2f4; background: #2f7bd622; border: 1px solid #2f7bd655; }
.k-chead.judah { color: #f4c0cf; background: #d64b6b22; border: 1px solid #d64b6b55; }

.kings-board { position: relative; margin-top: 6px; }
.k-axis { position: absolute; left: 0; top: 0; bottom: 0; width: 50px; }
.k-tick { position: absolute; left: 0; width: 100%; border-top: 1px dashed #ffffff12; }
.k-tick span { position: absolute; left: 4px; top: -7px; font-size: 9px; color: var(--text-mute); background: #0a0e14; padding: 0 2px; }

.k-united { position: absolute; left: 52px; right: 6px; top: 0; }
.k-uhead { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #cbb892; opacity: .8; }
.k-split { position: absolute; left: 52px; right: 6px; height: 0; border-top: 2px dotted #e9c46a99; z-index: 4; }
.k-split span { position: absolute; right: 0; top: 3px; font-size: 9.5px; color: #e9c46a; letter-spacing: .3px; }

.k-col { position: absolute; top: 0; bottom: 0; }
.k-col.israel { left: 52px; width: calc((100% - 58px) / 2 - 4px); }
.k-col.judah  { right: 6px;  width: calc((100% - 58px) / 2 - 4px); }

.k-dyn { position: absolute; left: -4px; width: 3px; border-radius: 2px; }
.k-dyn.d0 { background: #ffffff26; }
.k-dyn.d1 { background: #ffffff12; }

.k-card {
  position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 2px 7px; border: none; border-left: 3px solid var(--vc, #888); border-radius: 5px;
  background: color-mix(in srgb, var(--vc, #888) 20%, #0d1420); color: var(--text);
  cursor: pointer; overflow: hidden; text-align: left; transition: background .12s, transform .12s;
}
.k-card:hover { background: color-mix(in srgb, var(--vc) 34%, #0d1420); z-index: 5; }
.k-card.sel { outline: 2px solid #fff; z-index: 7; box-shadow: 0 4px 14px #000a; }
.k-card.v-good  { --vc: #4bb06a; }
.k-card.v-mixed { --vc: #d9a441; }
.k-card.v-evil  { --vc: #c0504d; }
.kc-name { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-yrs { font-size: 9px; color: var(--text-dim); white-space: nowrap; }

.k-seam { position: absolute; left: 50%; width: 0; top: 0; bottom: 0; z-index: 3; }
.k-proph { position: absolute; display: flex; align-items: center; gap: 4px; white-space: nowrap; pointer-events: none; }
.k-proph i { width: 6px; height: 100%; min-height: 16px; border-radius: 3px; background: linear-gradient(#a678e6, #6f4bd6); box-shadow: 0 0 6px #8a5bd680; flex: none; }
.k-proph span { font-size: 9.5px; color: #cbb6ef; text-shadow: 0 1px 2px #000; }
.k-proph.l { transform: translateX(calc(-100% - 5px)); flex-direction: row-reverse; }
.k-proph.r { transform: translateX(5px); }

.kings-detail { flex: none; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.kd-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.kd-verdict { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #08110b; }
.kd-verdict.v-good { background: #4bb06a; } .kd-verdict.v-mixed { background: #d9a441; } .kd-verdict.v-evil { background: #c0504d; color: #fff; }
.kd-realm { font-size: 11px; color: var(--text-dim); }
.kd-x { margin-left: auto; background: none; border: none; color: var(--text-mute); font-size: 18px; cursor: pointer; line-height: 1; }
.kd-x:hover { color: var(--text); }
.kd-name { font-size: 16px; font-weight: 700; color: var(--text); }
.kd-name span { font-size: 11px; font-weight: 500; color: var(--text-mute); margin-left: 6px; }
.kd-note { font-size: 12.5px; line-height: 1.55; color: var(--text-dim); margin: 6px 0 8px; }
.kd-read { background: var(--accent); color: #04140f; border: none; font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.kd-read:hover { filter: brightness(1.08); }

/* ---------- Lineage tree ---------- */
.lineage-view, #lineage:not([hidden]) { display: flex; flex-direction: column; background: #0a0e14; position: relative; min-height: 0; }
body.lineage-full #lineage { position: fixed; inset: 0; z-index: 1600; }
.lin-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.lin-title { font-weight: 700; font-size: 13px; color: var(--text); }
.lin-legend { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.lin-legend span { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-dim); }
.lin-legend i { width: 9px; height: 9px; border-radius: 3px; }

.lin-scroll { flex: 1; min-height: 0; overflow: auto; }
.lin-tree { display: flex; flex-direction: column; align-items: center; padding: 18px 10px 40px; }

.lin-row { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; padding: 9px 0; }
/* the covenant spine: a colored connector rising to each node */
.lin-row::before { content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 3px; height: 20px; background: var(--c); z-index: 0; }
.lin-row.first::before { display: none; }

.lin-node {
  position: relative; z-index: 1; min-width: 128px; max-width: 190px; text-align: center;
  padding: 7px 16px; border: 2px solid var(--c); border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 26%, #0c1320); color: #fff; transition: transform .12s, background .12s;
}
.lin-node:hover { background: color-mix(in srgb, var(--c) 42%, #0c1320); transform: translateY(-1px); }
.lin-node.sel { outline: 2px solid #fff; box-shadow: 0 0 14px var(--c); }
.ln-name { font-size: 13px; font-weight: 700; white-space: nowrap; }
.lin-node.msg { background: linear-gradient(120deg, #6f4bd6, #a678e6); border-color: #cbb6ef; box-shadow: 0 0 18px #8a5bd688; }
.lin-node.msg .ln-name { letter-spacing: .3px; }

/* branches peel off to the right of the spine */
.lin-branch { position: absolute; left: calc(50% + 108px); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 46%; }
.lin-branch::before { content: ""; position: absolute; left: -14px; top: 50%; width: 14px; height: 2px; background: var(--c); opacity: .7; }
.lb-node { font-size: 11px; padding: 4px 10px; border-radius: 999px; cursor: pointer; color: #dfe6f2;
  background: #141c28; border: 1px dashed color-mix(in srgb, var(--c) 60%, #566); }
.lb-node:hover { background: #1c2636; border-style: solid; }
.lin-branch.tribes { flex-direction: row; gap: 4px; }
.lb-cap { font-size: 9.5px; font-weight: 800; letter-spacing: .4px; color: color-mix(in srgb, var(--c) 70%, #fff); width: 100%; text-transform: uppercase; }
.lb-tribe { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: #141c28; border: 1px solid #ffffff14; color: var(--text-dim); }

.lin-detail { flex: none; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.lin-refs { font-size: 11px; color: var(--text-mute); margin: 2px 0 8px; }

/* ---------- Dev Mode: data-model inspector ---------- */
.dev-btn { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 1px; }
.dev-overlay { position: fixed; inset: 0; z-index: 2400; display: none; flex-direction: column;
  background: #060910ee; backdrop-filter: blur(6px); }
body.dev-open .dev-overlay { display: flex; }
.dev-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #0d1119; border-bottom: 1px solid var(--border); }
.dev-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: .3px; }
.dev-title em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: #04140f; background: var(--accent); padding: 2px 6px; border-radius: 5px; margin-left: 6px; }
.dev-search { flex: 1; max-width: 380px; background: #060910; border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 7px 11px; font-size: 13px; }
.dev-search:focus { outline: none; border-color: var(--accent); }
.dev-modes { display: flex; gap: 3px; margin-left: auto; background: #060910; border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.dev-mode { background: none; border: none; color: var(--text-dim); font-size: 12px; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.dev-mode.on { background: var(--accent); color: #04140f; font-weight: 700; }
.dev-copy, .dev-x { background: #060910; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 8px; padding: 6px 11px; font-size: 13px; cursor: pointer; }
.dev-copy:hover, .dev-x:hover { border-color: var(--accent); color: var(--accent); }
.dev-x { font-size: 18px; line-height: 1; padding: 4px 11px; }

.dev-main { flex: 1; min-height: 0; display: flex; }
.dev-side { flex: none; width: 210px; overflow: auto; border-right: 1px solid var(--border); background: #0a0e15; padding: 8px; }
.dev-grp { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-mute); padding: 12px 8px 5px; }
.dev-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: none; color: var(--text-dim); font-size: 12.5px; font-family: ui-monospace, Menlo, monospace;
  padding: 6px 9px; border-radius: 7px; cursor: pointer; text-align: left; }
.dev-item:hover { background: #131a26; color: var(--text); }
.dev-item.on { background: color-mix(in srgb, var(--accent) 18%, #131a26); color: var(--text); }
.dev-count { font-size: 10.5px; color: var(--text-mute); background: #060910; border-radius: 999px; padding: 1px 7px; }
.dev-item.on .dev-count { color: var(--accent); }

.dev-content { flex: 1; min-width: 0; overflow: auto; padding: 12px 16px; }
.dev-empty { color: var(--text-mute); font-size: 14px; padding: 40px; text-align: center; }
.dev-meta { font-size: 12px; color: var(--text-dim); font-family: ui-monospace, Menlo, monospace; margin-bottom: 10px; }
.dev-json { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.55;
  color: #cfe3d8; white-space: pre; }
.dev-tablewrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.dev-table { border-collapse: collapse; width: 100%; font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.dev-table th { position: sticky; top: 0; background: #10151f; color: var(--text); text-align: left;
  padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
.dev-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim);
  vertical-align: top; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-table tr:hover td { background: #0d1119; }
.dv-key { color: var(--accent); font-weight: 600; }
.dv-num { color: #e0b24b; } .dv-bool { color: #c78ce0; } .dv-null { color: var(--text-mute); }
.dv-obj { color: #6fb6d6; } .dev-json { max-width: 100%; }

/* Come, Follow Me cards: dim weeks with no KJV-OT chapter to open */
.cfm-card.cfm-noread { opacity: .55; cursor: default; }
.cfm-card.cfm-noread:hover { transform: none; }

/* ---------- Come, Follow Me lens ---------- */
.cfm-lens, #cfm:not([hidden]) { display: flex; flex-direction: column; background: #0a0e14; position: relative; min-height: 0; }
body.cfm-full #cfm { position: fixed; inset: 0; z-index: 1600; }
.cfm-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.cfm-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cfm-title em { font-style: normal; font-size: 10.5px; color: var(--text-dim); font-weight: 500; margin-left: 4px; }
.cfm-jump { margin-left: auto; background: color-mix(in srgb, #e9c46a 18%, var(--panel-2)); border: 1px solid #e9c46a55; color: #e9c46a; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.cfm-jump:hover { background: color-mix(in srgb, #e9c46a 30%, var(--panel-2)); }
.cfm-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.cfm-row {
  display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  color: var(--text); transition: border-color .12s, background .12s;
}
.cfm-row:hover { border-color: #e9c46a88; background: var(--panel-2); }
.cfm-row.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cfm-row.now { border-color: #e9c46a; background: color-mix(in srgb, #e9c46a 12%, var(--panel)); }
.cfm-row.noread { cursor: default; opacity: .6; }
.cfm-row.noread:hover { border-color: var(--border); background: var(--panel); }
.cfm-wnum { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: #11161f; color: var(--text-dim); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cfm-row.now .cfm-wnum { background: #e9c46a; color: #241a05; }
.cfm-wbody { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cfm-wref { font-size: 13px; font-weight: 700; color: var(--text); }
.cfm-wmeta { font-size: 11px; color: var(--text-dim); }
.cfm-nowtag { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: #241a05; background: #e9c46a; padding: 3px 7px; border-radius: 999px; }

/* Come, Follow Me — lesson reader (embedded official page) */
.cfm-row .cfm-go { flex: none; margin-left: auto; color: var(--text-mute); font-size: 16px; font-weight: 700; }
.cfm-row .cfm-nowtag + .cfm-go { margin-left: 8px; }
.cfm-lesson-head { gap: 8px; }
.cfm-back { flex: none; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); font-size: 12px; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.cfm-back:hover { border-color: var(--accent); color: var(--accent); }
.cfm-lhead { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.cfm-lweek { font-size: 10.5px; color: var(--text-mute); }
.cfm-lref { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfm-open { flex: none; text-decoration: none; background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); font-size: 11px; font-weight: 700; padding: 6px 10px; border-radius: 999px; }
.cfm-open:hover { background: color-mix(in srgb, var(--accent) 30%, var(--panel-2)); }
.cfm-frame-note { flex: none; font-size: 10.5px; color: var(--text-mute); padding: 6px 12px; border-bottom: 1px solid var(--border); background: #0b1017; }
.cfm-frame-note b { color: var(--text-dim); font-weight: 700; }
.cfm-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }
