:root { --copper:#ae4025; --signal:#bd4928; --paper:#fbfaf7; --ink:#232927; }
body {background:var(--paper); color:var(--ink)}
.atlas-header {display:flex;align-items:center;gap:18px;height:54px;padding:0 clamp(14px,2.5vw,40px);background:var(--ink);color:#fcfaf3}
.atlas-brand {display:inline-flex;align-items:center;gap:9px;color:inherit;font:700 22px 'Inter Variable',sans-serif;letter-spacing:-1px;text-decoration:none}
.atlas-brand img {width:29px;height:29px}
.atlas-name {font:14px 'Inter Variable',sans-serif;border-left:1px solid #69726d;padding-left:18px;color:#d4d9d4}
.atlas-header button {margin-left:auto;background:none;border:1px solid #74807a;border-radius:20px;color:#f8faf7;padding:5px 14px;cursor:pointer}
.context-main {height:calc(100dvh - 54px);min-height:680px;padding:15px clamp(12px,2.5vw,40px);gap:10px}
.intro h1 {font-size:clamp(23px,2.25vw,37px);font-weight:630;letter-spacing:-.045em}
.chapters {border-radius:8px;overflow:hidden}
.chapter {transition:background-color .18s ease}
.chapter[aria-pressed=true] {background:#f4e6db;box-shadow:inset 0 -3px var(--copper)}
.player {flex:none;display:flex;align-items:center;gap:20px;padding:12px 15px;border:1px solid #cdd2c7;border-radius:9px;background:#eef1e9;color:#25342c}
.player-controls,.scrubber {display:flex;align-items:center;gap:5px}
.player button,.player select {font:inherit;cursor:pointer;color:inherit}
.player-controls button,.player select {border:1px solid #c6cdc0;background:#fcfdf8;border-radius:6px;height:34px;min-width:34px;font-size:18px}
.player-controls #play {border-color:#2c4036;background:#2c4036;color:white;padding:0 13px;font-size:14px;font-weight:600}
#play::before {content:'▶';font-size:10px;margin-right:6px}
#play[data-playing=true]::before {content:'Ⅱ'}
.player button:disabled,.player input:disabled,.player select:disabled {opacity:.5;cursor:default}
.player select {font-size:13px;padding-inline:3px}
.player-copy {min-width:0;display:grid;gap:2px;flex:1}
#player-date,.scrubber output,.ref-meta {font:12px/1.4 ui-monospace,monospace;font-variant-numeric:tabular-nums;color:#4b5c50}
#player-title {border:0;background:none;border-radius:0;font-size:16px;line-height:1.4;font-weight:600;text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0}
#player-title:hover {text-decoration:underline}
.scrubber {gap:10px}
.scrubber input {width:clamp(70px,11vw,170px);accent-color:var(--copper)}
#canvas .event-dot.play-cue circle:nth-child(2) {fill:#bc411c;stroke:#bc411c;stroke-width:3px}
#canvas .event-dot.play-cue circle:first-child {fill:#dd5d2a40;transform-box:fill-box;transform-origin:center;animation:pulse 1.8s ease-in-out infinite alternate}
@keyframes pulse {from {transform:scale(.72)} to {transform:scale(1.25)}}
#references {width:min(620px,calc(100vw - 28px));max-height:84dvh;padding:24px;border:1px solid #b5bdb5;background:#fbfbf7;color:var(--ink);border-radius:12px;box-shadow:0 18px 90px #18221b42}
#references::backdrop {background:#17231c80}
#references form {float:right}
#references form button {padding:5px 12px;cursor:pointer}
#references h2 {margin:0 0 7px;font-size:26px}
#references p {line-height:1.6;color:#4b564e}
#references ol {list-style:none;padding:0;margin:0}
#references li {padding:13px 0;border-top:1px solid #d6dbd2;display:grid;gap:5px}
.ref-links {display:flex;gap:18px}.ref-links a {color:var(--copper);text-decoration:underline;text-underline-offset:3px}
@media (max-width:760px) {
 .player {flex-wrap:wrap;gap:8px 12px;padding:9px 12px}
 .player-controls {order:1}.scrubber {order:2;margin-left:auto}.player-copy {flex:1 0 100%;order:0}
 .atlas-header {height:44px;gap:10px}.atlas-name {padding-left:10px;font-size:11px}.atlas-brand {font-size:18px}
 .context-main {min-height:0;height:auto}.chapter-process {display:none}
 .scrubber input {width:80px}.player-controls button {min-width:34px}
}
@media (prefers-reduced-motion:reduce) {#canvas .play-cue circle,.chapter {animation:none!important;transition:none!important}}
.atlas-brand {white-space:nowrap;flex-shrink:0}
.filter-panel {flex:none}
.filter-panel summary {display:none}
@media(max-width:650px) {
 .filter-panel summary {display:list-item;padding:9px 12px;font-size:14px;font-weight:600;cursor:pointer}
 #player-title {white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
 .player {display:grid;grid-template-columns:auto minmax(60px,1fr);gap:7px}
 .player-copy {grid-column:1/-1}.player .scrubber {min-width:0;gap:5px}
 .scrubber input {min-width:30px;width:min(65px,13vw)}.scrubber output {white-space:nowrap}
 #canvas .label-rail,#canvas .group-label,#canvas .pinned-labels,.year-ruler .rail-corner,.drawer-open .year-ruler .rail-corner {width:138px}
 #canvas .pinned-labels>.place {width:132px!important}
 .canvas-caption {flex-wrap:wrap}
}
