/* Anima Mundi — six ways to see the whole atlas: the river, the wheel of the gods, the case sunburst,
   the calendar of cases, the filmstrip and the time tunnel (engine/dataviz.js and the files it loads). */
html.dv-loading, html.dv-loading * { cursor: progress !important; }
.dv-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 4000; background: #0a0d17; color: var(--ink-text, #e9e4d6); border: 1px solid var(--line, #26304a); border-radius: 10px; padding: 10px 14px; font: 500 13px Manrope, sans-serif; }
.dv-modal .th-box.dv-box { width: min(1080px, 100%); }
.dv-body { position: relative; }
.dv-chart { width: 100%; position: relative; }
.dv-svg { display: block; max-width: 100%; height: auto; margin: 0 auto; overflow: visible; font-family: Manrope, sans-serif; }
.dv-h3 { font: 600 17px 'Fraunces', Georgia, serif; color: var(--ink-text, #e9e4d6); margin: 18px 0 8px; }
.dv-h3 span { font: 500 12px Manrope, sans-serif; color: var(--ink-faint, #8a93a8); margin-left: 6px; }
/* legend keys and toggles */
.dv-legend, .dv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.dv-key { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line, #26304a); background: transparent; color: var(--ink-dim, #c3c9d6); font: 500 12px Manrope, sans-serif; cursor: pointer; transition: border-color .2s, color .2s, opacity .2s; }
span.dv-key { cursor: default; }
.dv-key i, .dv-chip i, .dv-row i, .dv-dh i, .dv-heat th i { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; box-shadow: 0 0 6px currentColor; }
.dv-key em { font-style: normal; color: var(--ink-faint, #8a93a8); }
button.dv-key:hover, .dv-key.on { border-color: var(--gold, #c9a24b); color: var(--ink-text, #e9e4d6); }
.dv-tog:not(.on) { opacity: .5; }
.dv-tog:not(.on) i { box-shadow: none; filter: grayscale(.8); }
.dv-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 10px; border: 1px solid var(--line, #26304a); background: rgba(255, 255, 255, .02); color: var(--ink-text, #e9e4d6); font: 500 12.5px Manrope, sans-serif; cursor: pointer; text-align: left; transition: border-color .2s, transform .2s; }
.dv-chip em { font-style: normal; color: var(--ink-faint, #8a93a8); font-size: 11.5px; }
.dv-chip:hover, .dv-chip:focus-visible { border-color: var(--gold, #c9a24b); }
.dv-chip.live { border-color: color-mix(in srgb, var(--gold, #c9a24b) 55%, transparent); }
.dv-detail { margin-top: 10px; }
.dv-dh { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.dv-dh b { font: 600 18px 'Fraunces', Georgia, serif; color: var(--ink-text, #e9e4d6); }
.dv-dh span { color: var(--ink-faint, #8a93a8); font-size: 12.5px; }
.dv-dh .sky-look { margin-left: auto; }
.dv-link-b { background: none; border: 0; padding: 0; color: var(--gold, #c9a24b); font: inherit; text-decoration: underline; cursor: pointer; }
/* tooltip */
.dv-tip { position: fixed; z-index: 4000; pointer-events: none; max-width: 280px; padding: 8px 11px; border-radius: 10px; background: rgba(8, 11, 20, .95); border: 1px solid var(--line, #26304a); color: var(--ink-text, #e9e4d6); font: 500 12.5px/1.45 Manrope, sans-serif; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.dv-tip em { color: var(--ink-faint, #8a93a8); font-style: normal; font-size: 11.5px; }
.dv-tip[hidden] { display: none; }

/* 1. the river */
.dv-grid line { stroke: var(--line, #26304a); stroke-width: 1; stroke-dasharray: 2 4; }
.dv-grid text { fill: var(--ink-faint, #8a93a8); font-size: 10.5px; }
.dv-band { stroke: rgba(5, 7, 13, .55); stroke-width: .6; cursor: pointer; opacity: .9; transition: opacity .25s; }
.dv-band:hover, .dv-band:focus-visible { opacity: 1; outline: none; }
.dv-band.dim { opacity: .28; }
.dv-band.on { opacity: 1; stroke: var(--ink-text, #e9e4d6); stroke-width: 1; }
.dv-hover { stroke: var(--ink-text, #e9e4d6); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; transition: opacity .15s; }
.dv-marker line { stroke: var(--gold, #c9a24b); stroke-width: 1.6; }
.dv-marker text { fill: var(--gold, #c9a24b); font: 600 11px Manrope, sans-serif; }
.dv-marker { pointer-events: none; transition: transform .5s ease; }
.dv-axis-hit { fill: transparent; cursor: pointer; }

/* 2. the wheel of the gods */
.dv-wheel-chart { max-width: 820px; margin: 0 auto; }
.dv-link { fill: none; stroke-width: 1.1; stroke-opacity: .42; transition: stroke-opacity .2s, stroke-width .2s; }
.dv-wheel.lit .dv-link { stroke-opacity: .06; }
.dv-wheel.lit .dv-link.on { stroke-opacity: .95; stroke-width: 2; }
.dv-god { cursor: pointer; outline: none; }
.dv-god circle:not(.dv-hit) { stroke: #05070d; stroke-width: 1; transition: r .2s; }
.dv-god .dv-hit { fill: transparent; }
.dv-god-l { fill: var(--ink-dim, #c3c9d6); font-size: 10px; transition: fill .2s, opacity .2s; }
.dv-wheel.lit .dv-god:not(.on) { opacity: .35; }
.dv-god.on .dv-god-l { fill: var(--ink-text, #e9e4d6); }
.dv-god.me .dv-god-l { fill: var(--gold, #c9a24b); font-weight: 700; }
.dv-god:focus-visible circle:not(.dv-hit) { stroke: var(--gold, #c9a24b); stroke-width: 2; }
.dv-pan-l { font: 600 11px Manrope, sans-serif; letter-spacing: .04em; text-transform: uppercase; }

/* 3. the sunburst */
.dv-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-faint, #8a93a8); margin: 0 0 8px; }
.dv-crumbs b { color: var(--ink-text, #e9e4d6); font-weight: 600; }
.dv-crumb { background: none; border: 0; padding: 0; color: var(--gold, #c9a24b); font: inherit; cursor: pointer; }
.dv-sun-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dv-arc { cursor: pointer; stroke: #0a0d17; stroke-width: .5; transition: fill-opacity .2s; outline: none; }
.dv-arc:hover, .dv-arc:focus-visible { fill-opacity: 1 !important; }
.dv-sun.anim .dv-arc, .dv-sun.anim .dv-arc-l { animation: dvIn .45s ease both; transform-origin: 0 0; }
.dv-sun.anim .dv-arc.d2 { animation-delay: .08s; }
@keyframes dvIn { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
.dv-arc-l text { fill: #0a0d17; font: 600 10.5px Manrope, sans-serif; pointer-events: none; }
.dv-sun-c { cursor: pointer; outline: none; }
.dv-sun-c circle { fill: #0a0d17; stroke: var(--line, #26304a); }
.dv-sun-c:hover circle, .dv-sun-c:focus-visible circle { stroke: var(--gold, #c9a24b); }
.dv-sun-n { fill: var(--ink-text, #e9e4d6); font: 600 22px 'Fraunces', Georgia, serif; text-anchor: middle; }
.dv-sun-t { fill: var(--ink-faint, #8a93a8); font: 500 11px Manrope, sans-serif; text-anchor: middle; }
.dv-sun-list { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.dv-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-text, #e9e4d6); font: 500 13px Manrope, sans-serif; text-align: left; cursor: pointer; }
.dv-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-row em { font-style: normal; color: var(--ink-faint, #8a93a8); font-size: 12px; flex: none; }
.dv-row:hover, .dv-row:focus-visible { background: rgba(255, 255, 255, .05); }

/* 4. the calendar */
.dv-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 6px; font-size: 13px; color: var(--ink-dim, #c3c9d6); }
.dv-ctl label { display: inline-flex; align-items: center; gap: 8px; }
.dv-sel { width: auto; min-width: 180px; padding: 6px 10px; }
.dv-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.dv-heat { border-collapse: separate; border-spacing: 2px; font: 500 11px Manrope, sans-serif; color: var(--ink-faint, #8a93a8); }
.dv-heat th { font-weight: 600; white-space: nowrap; padding: 0 4px; }
.dv-heat thead th { text-align: center; }
.dv-heat tbody th { text-align: right; color: var(--ink-dim, #c3c9d6); }
.dv-heat tbody th i { margin-right: 6px; vertical-align: middle; box-shadow: none; }
.dv-heat td { padding: 0; }
.dv-cell { display: block; width: 38px; height: 22px; border: 1px solid rgba(255, 255, 255, .04); border-radius: 4px; background: rgba(255, 255, 255, .025); color: #0a0d17; font: 700 10px Manrope, sans-serif; cursor: pointer; padding: 0; transition: transform .15s, border-color .15s; }
.dv-cell:disabled { cursor: default; color: transparent; }
.dv-cell:not(:disabled):hover, .dv-cell:focus-visible, .dv-cell.on { border-color: var(--ink-text, #e9e4d6); transform: scale(1.08); }
.dv-heat-d .dv-cell { width: 26px; height: 20px; font-size: 9px; }
.dv-heat-d .dv-cell.dv-before { width: 40px; color: var(--ink-text, #e9e4d6); }
.dv-heat .dv-rs { padding-left: 6px; color: var(--ink-faint, #8a93a8); }
.dv-tot td { vertical-align: bottom; height: 58px; }
.dv-bar { position: relative; display: block; width: 38px; height: 56px; border: 0; background: transparent; cursor: pointer; padding: 0; }
.dv-bar::before { content: ''; position: absolute; left: 4px; right: 4px; bottom: 0; height: calc(var(--h) * .72); background: var(--gold, #c9a24b); border-radius: 3px 3px 0 0; opacity: .8; }
.dv-bar span { position: absolute; left: 0; right: 0; bottom: calc(var(--h) * .72 + 1px); font: 600 9.5px Manrope, sans-serif; color: var(--ink-dim, #c3c9d6); }
.dv-bar:hover::before { opacity: 1; }

/* 5. the filmstrip */
.fs-host { --fs-h: 300px; }
.fs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.fs-bar .dv-chips { margin: 0; }
.fs-only { font-size: 12.5px; color: var(--ink-dim, #c3c9d6); display: inline-flex; gap: 6px; align-items: center; }
.fs-range { margin-left: auto; font: 600 13px 'Fraunces', Georgia, serif; color: var(--gold, #c9a24b); }
.fs-scrub { position: relative; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line, #26304a); cursor: pointer; touch-action: none; margin-bottom: 8px; overflow: hidden; }
.fs-ticks span { position: absolute; top: 8px; font: 500 10px Manrope, sans-serif; color: var(--ink-faint, #8a93a8); padding-left: 3px; border-left: 1px solid var(--line, #26304a); white-space: nowrap; }
.fs-win { position: absolute; top: 0; bottom: 0; border: 1px solid var(--gold, #c9a24b); background: color-mix(in srgb, var(--gold, #c9a24b) 14%, transparent); border-radius: 6px; pointer-events: none; }
.fs-strip { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; cursor: grab; border-radius: 10px; background: #05070d; padding: 18px 0; position: relative; outline: none; -webkit-overflow-scrolling: touch;
  /* the film's sprocket holes */
  background-image: radial-gradient(circle at 8px 7px, #1a2032 3px, transparent 3.5px), radial-gradient(circle at 8px calc(100% - 7px), #1a2032 3px, transparent 3.5px); background-size: 16px 100%; background-repeat: repeat-x; background-attachment: local; }
.fs-strip.drag { cursor: grabbing; user-select: none; }
.fs-strip:focus-visible { box-shadow: 0 0 0 2px var(--gold, #c9a24b); }
.fs-track { display: flex; align-items: stretch; gap: 8px; padding: 0 12px; width: max-content; }
.fs-era { flex: none; width: 34px; display: flex; align-items: center; justify-content: center; }
.fs-era span { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 13px 'Fraunces', Georgia, serif; color: var(--gold, #c9a24b); white-space: nowrap; }
.fs-f { flex: none; width: calc(var(--fs-h) * .62); margin: 0; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; background: #0d111c; border: 1px solid #1a2032; transition: border-color .2s, transform .2s; }
.fs-f:hover { border-color: var(--c); transform: translateY(-2px); }
.fs-pic { position: relative; display: block; width: 100%; height: calc(var(--fs-h) * .62); padding: 0; border: 0; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); color: var(--c); cursor: pointer; overflow: hidden; }
.fs-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.05); animation: fsIn .5s ease both; -webkit-user-drag: none; user-select: none; pointer-events: none; }
@keyframes fsIn { from { opacity: 0; } to { opacity: 1; } }
.fs-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: .75; }
.fs-has .fs-ph { display: none; }
.fs-f figcaption { padding: 7px 9px 8px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.fs-f figcaption b { font: 600 13px 'Fraunces', Georgia, serif; color: var(--c); }
.fs-f figcaption > span { font: 500 12px/1.3 Manrope, sans-serif; color: var(--ink-text, #e9e4d6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fs-cr { font: 500 10px Manrope, sans-serif; font-style: normal; color: var(--ink-faint, #8a93a8); }
.fs-cr a { color: var(--ink-faint, #8a93a8); }
.fs-cr a:hover { color: var(--gold, #c9a24b); }
.fs-only-on .fs-f:not(.fs-has) { display: none; }
.fs-credit { margin-top: 8px; }

/* 6. the time tunnel */
.tn-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #05070d; }
.tn-canvas { display: block; width: 100%; touch-action: none; cursor: grab; outline: none; }
.tn-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--gold, #c9a24b); }
.tn-hud { position: absolute; left: 14px; top: 12px; pointer-events: none; text-shadow: 0 1px 8px #000; }
.tn-year { font: 600 28px 'Fraunces', Georgia, serif; color: var(--gold, #c9a24b); line-height: 1.1; }
.tn-era-n { font: 500 13px Manrope, sans-serif; color: var(--ink-text, #e9e4d6); opacity: .85; }
.tn-help { position: absolute; right: 12px; top: 12px; font: 500 11.5px Manrope, sans-serif; color: var(--ink-faint, #8a93a8); pointer-events: none; }
.tn-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; background: linear-gradient(transparent, rgba(4, 6, 12, .75)); }
.tn-slider { display: block; width: 100%; margin: 0 0 6px; accent-color: var(--gold, #c9a24b); }
.tn-jump { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tn-jump .dv-key { flex: none; background: rgba(5, 7, 13, .7); padding: 4px 9px; font-size: 11px; }
.tn-tools { position: absolute; right: 12px; top: 38px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tn-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold, #c9a24b) 55%, transparent); background: rgba(5, 7, 13, .72); color: var(--ink-text, #e9e4d6); font: 600 12px Manrope, sans-serif; cursor: pointer; backdrop-filter: blur(4px); }
.tn-btn:hover, .tn-btn:focus-visible { border-color: var(--gold, #c9a24b); color: var(--gold, #c9a24b); }
.tn-labs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tn-lab { position: absolute; left: 0; top: 0; font: 600 11.5px Manrope, sans-serif; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px #000, 0 0 2px #000; opacity: 0; transition: opacity .3s; will-change: transform; }
.tn-lab.trad { font: 600 13px 'Fraunces', Georgia, serif; }
.tn-tip { position: absolute; z-index: 3; pointer-events: none; max-width: 270px; padding: 8px 11px; border-radius: 10px; background: rgba(8, 11, 20, .94); border: 1px solid var(--line, #26304a); color: var(--ink-text, #e9e4d6); font: 500 12.5px/1.45 Manrope, sans-serif; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.tn-tip em { color: var(--ink-faint, #8a93a8); font-style: normal; font-size: 11.5px; }
.tn-tip[hidden] { display: none; }
.tn-streak { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(160, 180, 255, .10) 75%, rgba(4, 6, 12, .55) 100%); transition: opacity .2s; }
.tn-wrap:fullscreen, .tn-wrap:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }
.tn-wrap:fullscreen .tn-canvas, .tn-wrap:-webkit-full-screen .tn-canvas { width: 100vw !important; height: 100vh !important; }
.tn-legend { margin-top: 10px; }
.tn-lh { font: 600 12px Manrope, sans-serif; color: var(--ink-dim, #c3c9d6); align-self: center; margin-right: 4px; }
.tn-flat { display: flex; flex-direction: column; gap: 4px; }
.tn-era { border-left: 2px solid var(--gold, #c9a24b); padding: 6px 0 10px 14px; }
.tn-era h3 { font: 600 18px 'Fraunces', Georgia, serif; color: var(--ink-text, #e9e4d6); margin: 0; }
.tn-era h3 span { display: block; font: 600 11px Manrope, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--gold, #c9a24b); }
.tn-cases .dv-chip { font-size: 12px; padding: 4px 9px; }

/* light theme */
html[data-theme=light] .dv-tip { background: rgba(255, 252, 244, .97); }
html[data-theme=light] .dv-sun-c circle, html[data-theme=light] .dv-arc { stroke: #fbf7ee; }
html[data-theme=light] .dv-sun-c circle { fill: #fbf7ee; }
html[data-theme=light] .dv-god circle:not(.dv-hit), html[data-theme=light] .dv-band { stroke: #fbf7ee; }

/* phones */
@media (max-width: 700px) {
  .dv-sun-wrap { grid-template-columns: 1fr; }
  .dv-sun-list { max-height: 340px; }
  .fs-host { --fs-h: 240px; }
  .fs-range { margin-left: 0; width: 100%; }
  .dv-cell { width: 30px; }
  .dv-bar { width: 30px; }
  .tn-year { font-size: 22px; }
  .tn-tools { top: 12px; }
  .tn-btn span { display: none; }
  .tn-btn { padding: 7px; }
  .tn-help { display: none; }
  .dv-dh .sky-look { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dv-band, .dv-link, .dv-marker, .dv-cell, .fs-f, .dv-chip { transition: none !important; }
  .fs-pic img, .dv-sun.anim .dv-arc, .dv-sun.anim .dv-arc-l { animation: none !important; }
}

/* how each view is made, and approximate values */
.dv-how { margin: 14px 0 2px; border: 1px solid var(--line, #26304a); border-radius: 10px; padding: 8px 12px; background: rgba(255, 255, 255, .015); font-size: 12.5px; line-height: 1.55; color: var(--ink-dim, #c3c9d6); }
.dv-how summary { cursor: pointer; font: 600 13px Manrope, sans-serif; color: var(--gold, #c9a24b); display: flex; align-items: center; gap: 6px; list-style: none; }
.dv-how summary::-webkit-details-marker { display: none; }
.dv-how summary::after { content: '▾'; margin-left: 4px; font-size: 11px; transition: transform .2s; }
.dv-how[open] summary::after { transform: rotate(180deg); }
.dv-how ul { margin: 8px 0 2px; padding-left: 18px; }
.dv-how li { margin: 4px 0; }
.dv-how b { color: var(--ink-text, #e9e4d6); }
.dv-approx { color: var(--ink-faint, #8a93a8); font-weight: 600; cursor: help; }
.fs-f figcaption b .dv-approx { color: inherit; opacity: .75; }
