body{--replay-paper:#fbfcf8}
.replay-page{padding-top:20px;padding-bottom:64px}
.replay-breadcrumb{color:#577269;font-size:.84rem;margin:0 0 12px}.replay-breadcrumb a:hover{text-decoration:underline}
.replay-heading{margin:18px 0 24px}.replay-heading h1{font-size:clamp(1.5rem,3vw,2.8rem);font-weight:660;line-height:1.2;letter-spacing:-.03em;max-width:36em}.replay-heading p{margin-top:9px;color:#53685e;max-width:88ch}
.replay-meta{color:#45685a;font-size:.82rem;font-weight:640;margin-bottom:6px}
.replay-filters,.mode-switch,.source-links,.play-row,.flow-list,.unmapped{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.replay-filters{margin-bottom:18px}.replay-filters button,.mode-switch button,.play-row button,.play-row select,.step-index button{border:1px solid #cfded4;background:white;border-radius:6px;padding:6px 11px;color:#38564a}
.replay-filters button[aria-pressed=true],.mode-switch button[aria-pressed=true],.play-row #play{background:#21584b;color:white;border-color:#21584b}
.replay-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,255px),1fr));gap:16px}
.replay-card{background:white;border:1px solid #d7e2d8;border-radius:10px;overflow:hidden;display:flex;flex-direction:column}
.replay-card:hover{border-color:#658d78;box-shadow:0 3px 14px #29473512}.replay-card>img{width:100%;height:150px;object-fit:contain;background:#fcfcf8}.replay-card>div{padding:14px 16px;display:flex;align-items:flex-start;flex-direction:column;gap:8px;flex:1}.replay-card small,.step-info>small{color:#56725f;font-weight:620}.replay-card h2{font-size:1.03rem}.replay-card span{color:#226b53;font-size:.84rem;margin-top:auto}
.replay-layout{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(245px,1fr);gap:18px;align-items:start}
.replay-console,.replay-detail,.replay-bottom,.step-index{border:1px solid #d3dfd5;border-radius:10px;background:#fff;min-width:0}
.replay-console{overflow:hidden}.board-head{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:5px;padding:12px 16px;border-bottom:1px solid #dae5dc}
.mode-switch button{font-size:.8rem;padding:4px 8px}.board-head strong{color:#244d3c;font-size:1.05rem}
#layout-note{padding:8px 16px;color:#53685b;font-size:.8rem;line-height:1.45;background:#f3f7ef}
#stage{overflow:auto;max-height:min(61vh,680px);min-height:225px;background:var(--replay-paper);position:relative}
.field{position:relative;isolation:isolate}.lane-field{padding:12px;display:grid;align-content:start;gap:12px;min-height:220px}
.lane{padding:8px 10px 11px;border:1px solid #e0e8de;border-radius:8px;background:#f1f5eb66}
.lane-title{font-size:.74rem;color:#5d7263;letter-spacing:.04em;margin-bottom:7px}.lane-items{display:flex;gap:8px 11px;flex-wrap:wrap;align-items:center}
.actor{position:relative;z-index:2;display:inline-flex;align-items:center;gap:5px;border-radius:7px;border:1px solid #d4dfd3;padding:5px 8px;line-height:1.4;font-size:.84rem;color:#697b71;background:#fcfcf9;overflow-wrap:anywhere}
.actor-dot{width:8px;height:8px;flex:none;border-radius:100%;background:var(--actor)}.actor.active{color:#20382b;background:var(--tint);border-color:var(--actor);box-shadow:0 0 0 1px var(--actor)}
.actor b{font-size:.74rem;font-weight:600;color:var(--actor)}.flow-overlay{position:absolute;inset:0;z-index:1;pointer-events:none}
.map-field{height:clamp(265px,33vw,410px);margin:8px 12px;background-color:#eef4e9;background-image:linear-gradient(#aabfad44 1px,transparent 1px),linear-gradient(90deg,#aabfad44 1px,transparent 1px);background-size:10% 10%;border:1px solid #cdddca;border-radius:8px}
.map-actor{position:absolute;display:block;transform:translate(-50%,-50%);width:12px;height:12px;border:0!important;background:none!important;box-shadow:none!important;padding:0}
.map-actor .actor-dot{display:block;width:12px;height:12px;border:2px solid white;box-shadow:0 0 0 1px var(--actor)}
.map-actor.active .actor-dot{box-shadow:0 0 0 3px var(--actor)}.map-actor>span:nth-child(2){position:absolute;bottom:calc(0px - var(--offset));left:50%;transform:translateX(-50%);background:#ffffffdd;padding:0 3px;font-size:.72rem;color:#395442;white-space:nowrap;max-width:155px;overflow:hidden;text-overflow:ellipsis;border-radius:3px}
.map-actor.active{z-index:4}.map-actor>b{display:none}.unmapped{padding:7px 12px}
.flow-list{padding:5px 12px 12px;color:#3f5e50;font-size:.77rem;max-height:100px;overflow:auto}.flow-list span{border-radius:4px;background:#e8efe6;padding:2px 6px}
.play-controls{padding:12px 16px;background:#fff;border-top:1px solid #d7e3d9}.play-row button{min-width:38px}.play-row #play{min-width:82px;font-weight:650}.play-row button:disabled{opacity:.4;cursor:default}.play-row select{padding:5px}.play-row #step-count{margin-left:auto;font:600 .9rem Consolas,monospace;color:#425c4e}
#scrub{width:100%;margin:11px 0 0;accent-color:#297658;cursor:pointer}
.replay-detail{overflow:hidden}.scene-thumb{background:#f7f8f2;border-bottom:1px solid #d9e3d8}.scene-thumb img{display:block;object-fit:contain;width:100%;height:clamp(106px,13vw,174px);background:white}.step-info{padding:14px 18px 18px}.step-info h2{font-size:1.13rem;margin:4px 0 7px;color:#234c39}.step-info p{font-size:.9rem;color:#475e50;line-height:1.65}.step-info small{font-size:.76rem}.step-info dl{margin:13px 0 0;display:grid;gap:2px}.step-info dl>div{display:flex;gap:8px;justify-content:space-between;align-items:baseline;border-top:1px solid #e6ece4;padding:4px 0}.step-info dt{font-size:.78rem;color:#5b6f60}.step-info dd{font-size:.87rem;font-weight:650;text-align:right;margin:0;overflow-wrap:anywhere}
.replay-bottom{margin-top:16px;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.replay-bottom strong{font-size:.82rem;color:#53705d}.replay-bottom p{font-size:.93rem}.source-links a{color:#286448;font-size:.83rem;padding:3px 7px;text-decoration:underline;text-underline-offset:3px}
.step-index{margin-top:12px;padding:11px 16px}.step-index summary{color:#365847;font-weight:600}.step-index>div{display:flex;gap:6px;flex-wrap:wrap;padding-top:10px}.step-index button{text-align:left;font-size:.8rem}.step-index button small{color:#568367}.step-index button[aria-current=true]{background:#e4ede0;border-color:#78997c}
.gantt{padding:14px;min-width:350px}.g-row,.g-axis{display:grid;grid-template-columns:minmax(64px,20%) 1fr;align-items:stretch;min-height:36px}.g-axis>div{display:flex;justify-content:space-between}.gantt strong,.g-axis{font-size:.75rem;color:#5b705f}.g-row>strong{padding:6px;align-self:center;overflow-wrap:anywhere}.g-track{position:relative;border-bottom:1px solid #e1e8de;background:repeating-linear-gradient(90deg,#dce6d9 0 1px,transparent 1px 10%)}
.g-event{position:absolute;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;line-height:25px;height:25px;min-width:2px;border-radius:4px;font-size:.75rem;padding:0 3px;background:#ecf1e6;color:#7b877b;box-shadow:inset 0 0 0 1px #c3d3bf}
.g-event.now{background:#22694b;color:#fff;box-shadow:none}.g-event.past{background:#b6d6bb;color:#2a4c36}
.trend-chart{width:100%;height:auto;min-height:215px}.trend-chart text{font:12px var(--font);fill:#455d4c}
@media(max-width:800px){.replay-layout{grid-template-columns:minmax(0,1fr)}.replay-detail{display:grid;grid-template-columns:minmax(100px,30%) 1fr}.scene-thumb img{height:100%;max-height:190px}.step-info{padding:10px 12px}.replay-heading{margin:12px 0 15px}#stage{max-height:53vh}.replay-cards{gap:10px}}
@media(max-width:480px){.replay-page{padding-top:12px}.replay-layout{gap:11px}.replay-detail{display:block}.scene-thumb{display:none}.replay-card>img{height:126px}.play-controls{padding:9px}.play-row{gap:5px}.gantt{min-width:290px;padding:7px}.lane-field{padding:6px}.lane-items{gap:6px}.actor{font-size:.76rem}.replay-bottom{padding:10px}.board-head{padding:8px 10px}.replay-heading p{font-size:.88rem}}
.replay-page .allocation{padding:16px}.allocation-key,.alloc-row{display:flex;align-items:center;gap:8px}.allocation-key{font-size:.8rem;flex-wrap:wrap;padding-bottom:9px}.allocation-key span{border-bottom:3px solid #377b61}.allocation-key span:nth-child(3){border-color:#ce8550}.allocation-key span:nth-child(4){border-color:#637fa3}.alloc-row{margin:5px 0;background:#f3f6f0;padding:5px 9px;border-radius:5px}.alloc-row.current{box-shadow:inset 0 0 0 2px #4f815e}.alloc-row>b{min-width:48px}.alloc-row>div{display:flex;width:100%;height:26px}.alloc-row span{font-size:.72rem;color:white;text-align:center;line-height:26px;overflow:hidden}.alloc-0{background:#377b61}.alloc-1{background:#ad6534}.alloc-2{background:#637fa3}
.power-stage{display:flex;gap:18px;align-items:center;justify-content:center;padding:25px 15px}.power-machine{flex:1;max-width:245px;padding:14px 8px;background:#e8f1e7;border:1px solid #bdd0be;border-radius:12px;text-align:center}.power-machine strong{display:block}.power-machine>div:last-child{font-size:.86rem;color:#41694e}.machine-figure{font:3rem/1.1 Georgia,serif;color:#41794d}.grid-symbol,.energy-arrow{color:#aa6936}.energy-arrow{font-size:2rem}.stock{margin:0 24px 22px}.stock header{display:flex;justify-content:space-between;font-size:.85rem;margin-bottom:6px}.gauge{height:16px;background:#e3ebe1;border-radius:20px;overflow:hidden}.gauge i{height:100%;display:block;background:#488a67;transition:width .3s}
.sys-network{width:100%;max-height:410px}.sys-network text{font-family:var(--font);font-size:15px;fill:#284f3b}.sys-network .column-label{font-weight:650;fill:#506b56}.sys-network .mark{font-weight:650}.sys-network .value{font-size:13px;paint-order:stroke;stroke:#fbfcf8;stroke-width:3px}
.world-page{width:min(1500px,calc(100% - 64px));padding-top:14px}
.world-page .replay-breadcrumb{margin:0 0 5px}.world-page .replay-heading{margin:7px 0 16px}
.world-page .replay-heading h1{font-size:clamp(1.5rem,2.5vw,2.35rem)}
.world-page .replay-heading p{font-size:.9rem;line-height:1.5;margin-top:5px}
.world-page .replay-layout{display:block}.world-page .replay-console{border:1px solid #becdc3;box-shadow:0 4px 18px #19382912}
.world-page .board-head{padding:9px 16px;background:#183e39;color:#f4f7ef}
.world-page .board-head strong{color:#f4f7ef;font-size:clamp(.94rem,1.6vw,1.15rem)}
.world-page .mode-switch{gap:3px}.world-page .mode-switch button{color:#cce0d3;border:1px solid transparent;background:transparent;min-height:29px}
.world-page .mode-switch button[aria-pressed=true]{color:white;background:#345f52;border-color:#548575}
#world-viewport{width:100%;overflow:auto;overscroll-behavior:contain;position:relative;background:#e4ebe0}
.world-page #stage[data-mode=simulation]{min-height:0;max-height:none;overflow:visible}
.world-page #stage[data-mode=simulation] :is(.care-world,figure>svg,.tr-world canvas,.studio-canvas){width:100%;height:auto;max-height:57vh;display:block;object-fit:contain}
.world-page #stage[data-mode=simulation] :is(.cc-summary,.cc-caption){background:#f1f5ed}
.world-page .play-controls{display:flex;align-items:center;gap:18px;padding:9px 16px}
.world-page .play-row{flex:none;gap:6px}.world-page #scrub{margin:0;min-width:40px}
.world-page .play-row button{padding:5px 10px;font-size:.86rem}.world-page .play-row #step-count{padding-left:6px}
.motion-meter{height:3px;overflow:hidden;background:#d8e3da}.motion-meter i{height:100%;display:block;background:#b87945;transform:scaleX(0);transform-origin:left}
.world-page .replay-detail{display:block;margin:12px 0 0;background:#fbfcf8}.world-page .step-info{display:grid;grid-template-columns:minmax(150px,1fr) minmax(300px,2fr) minmax(140px,1fr);gap:4px 20px;align-items:start}
.world-page .step-info>small{grid-column:1/-1}.world-page .step-info h2,.world-page .step-info dl{margin:0}.world-page .step-info dl:empty{display:none}
.world-source{border-top:1px solid #d8e3da;font-size:.86rem;padding:6px 16px;color:#426352}.world-source summary{cursor:pointer}.world-source a{text-decoration:underline}
.world-source #layout-note{padding:7px 0;background:none}
#world-viewport.closer{max-height:65dvh;cursor:grab;scrollbar-gutter:stable}
#world-viewport.closer #stage{width:170%;max-height:none}
.world-page #world-viewport.closer #stage[data-mode=simulation] :is(.care-world,figure>svg,.tr-world canvas,.studio-canvas){max-height:none}
.world-theater{overflow:hidden}.world-theater .replay-console{position:fixed;inset:0;z-index:50;border:0;border-radius:0;background:#edf3e9;display:flex;flex-direction:column}
.world-theater #world-viewport{min-height:0;flex:1;display:grid;align-items:center;max-height:none}
.world-theater .board-head,.world-theater .play-controls{flex:none}
.world-theater #stage[data-mode=simulation] :is(.care-world,figure>svg,.tr-world canvas,.studio-canvas){max-height:calc(100dvh - 205px)}
@media(max-width:900px){.world-page .play-controls{display:block}.world-page #scrub{margin-top:10px}.world-page .step-info{grid-template-columns:minmax(120px,1fr) 2fr}.world-page .step-info dl{grid-column:1/-1}.world-page{width:calc(100% - 32px)}}
@media(max-width:600px){.world-page{width:calc(100% - 16px);padding-top:8px}.world-page .board-head{padding:8px 10px}.world-page .play-controls{padding:8px}.world-page .play-row button,.world-page .play-row select{padding:4px 6px;min-width:28px;font-size:.8rem}.world-page .play-row #play{min-width:59px}.world-page .play-row{gap:3px}.world-page .step-info{display:block}.world-page .step-info h2{margin:3px 0}.world-page .step-info dl{margin-top:5px}.world-page .replay-heading p{font-size:.83rem}.world-page .replay-heading{margin:5px 5px 9px}.world-page .replay-breadcrumb{margin-left:5px}.world-theater .play-controls{padding-bottom:max(8px,env(safe-area-inset-bottom))}}
.studio-world{margin:0;background:#e7e9de}.studio-world figcaption{padding:6px 12px;color:#506658;background:#f4f5ed;font-size:.77rem}

/* Keep the decision alongside the physical world and in the normal reading order on small displays. */
.world-page .replay-layout{display:grid;grid-template-columns:minmax(0,1.62fr) minmax(320px,1fr);align-items:start;gap:16px}
.world-page .replay-detail{margin:0;background:white}
.world-page .play-controls{display:block}
.world-page #scrub{display:block;margin-top:8px;width:100%}
.decision-card{padding:17px 18px;color:#1e3835;min-width:0}
.decision-heading{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.decision-heading span{font-size:.76rem;font-weight:680;color:#47695b}
.decision-heading h2{font-size:1rem;line-height:1.45;margin:0}
.decision-action{font-size:1.16rem;line-height:1.52;font-weight:660;margin:10px 0 14px;color:#123f34;overflow-wrap:anywhere}
.reason-lines{margin:0;display:grid;gap:7px;line-height:1.6;font-size:.86rem}
.reason-lines>div{display:grid;grid-template-columns:2.5em 1fr;gap:6px}
.reason-lines dt{font-weight:660;color:#4c6b5c}.reason-lines dd{margin:0;overflow-wrap:anywhere}
.choice-box{margin-top:13px;border-top:1px solid #cad9cd;padding-top:12px}
.choice-intro{display:flex;align-items:baseline;gap:9px;justify-content:space-between}
.choice-intro h3{font-size:.91rem;line-height:1.5;margin:0;font-weight:700}
.choice-intro small{color:#516659;font-size:.71rem;flex-shrink:0}
.choice-list{display:grid;gap:4px;margin:7px 0}
.choice-row{display:grid;grid-template-columns:1fr auto;gap:3px 10px;padding:6px 9px;border:1px solid #d7e1d7;border-radius:6px;text-align:left;background:#fbfcfa;color:#314b40;font:inherit;line-height:1.35;cursor:pointer}
.choice-row:hover,.choice-row:focus-visible{border-color:#3e7560}
.choice-row[aria-pressed=true]{border-color:#3e7560;background:#eaf4eb}
.choice-name{font-size:.82rem;font-weight:600}.choice-row b{font-size:.87rem;font-variant-numeric:tabular-nums}
.choice-scale{height:4px;grid-column:1/-1;background:#e0e6dd;position:relative;overflow:hidden;border-radius:2px}
.choice-scale i,.choice-scale em{position:absolute;top:0;bottom:0}.choice-scale i{background:#8aa28b}.choice-scale em{width:1px;background:#5c6c62}
.choice-row[aria-pressed=true] .choice-scale i{background:#397a61}
.choice-note,.jump-choice{font-size:.82rem;line-height:1.55;color:#344e40}
.choice-note{margin:7px 0 0}.choice-delta{display:inline-block;color:#62502f;font-weight:600}
.jump-choice{margin-top:14px;text-align:left;background:#f3f6ee;border:1px solid #cad9c9;border-radius:6px;padding:9px 11px;width:100%;cursor:pointer}
.jump-choice span{display:block;font-weight:650;color:#21543c}
#step-record p{margin-top:8px}#step-record dl{display:flex;flex-wrap:wrap;gap:6px 18px}#step-record dd{margin:0;font-weight:650}
@media(max-width:920px){.world-page .replay-layout{grid-template-columns:1fr;gap:10px}.decision-card{padding:14px 16px}.world-page #stage[data-mode=simulation] :is(.care-world,figure>svg,.tr-world canvas,.studio-canvas){max-height:44dvh}}
.world-theater .world-page #stage[data-mode=simulation] :is(.care-world,figure>svg,.tr-world canvas,.studio-canvas){max-height:calc(100dvh - 205px)}
.lab-shortcut{margin:0 16px 12px;border:1px solid #4b7d68;border-radius:6px;background:#ebf5ed;color:#184735;font:inherit;font-weight:650;padding:8px 13px;cursor:pointer}

/* Direct manipulation needs the full width for equipment and allocation controls. */
.world-page.has-planning-lab .replay-layout{display:block}
.has-planning-lab .replay-detail{margin-top:16px}
.has-planning-lab #world-viewport{background:#f7faf5}
.has-planning-lab .reference-heading{font-size:1rem;margin:14px 18px 0;color:#315343}
.has-planning-lab .decision-card .reason-lines{max-width:95ch}
.has-planning-lab .choice-box{max-width:760px}
.original-plan>summary{padding:10px 16px;font-size:.9rem;cursor:pointer;font-weight:600;color:#345b49}
.world-theater .has-planning-lab #world-viewport{display:block;overflow:auto}
