/* The shared shell supplies the header, stage tabs and primary controls. */
:root{--paper:#fcfbf6;--ink:#354d43;--green:#35745c;--orange:#a4582e}
body{color:var(--ink)}
.sketch-tools{background:#fbfcf7;padding:6px 16px;min-height:45px}
.scene-select-label{gap:5px}.scene-select-label select{max-width:236px;height:34px;color:#344f43}
.camera-tools{margin-left:auto;width:auto}.camera-tools .shell-action[aria-pressed=true]{background:#e6eee2;border-color:#8da990}
.workbench{display:flex;flex:1;min-height:0;min-width:0}
.science-viewport{flex:1 1 0;min-width:0;background:var(--paper)}
.science-plane{width:1300px;height:650px;z-index:1}
.science-plane .ph-label{font-family:'Microsoft YaHei','Segoe UI',system-ui,sans-serif;fill:var(--ink);paint-order:stroke}
.ph-label.branch-title{font-size:32px;font-weight:710;letter-spacing:1px}
.ph-label.branch-sub{font-size:15px;fill:#657568}
.ph-label.warm{fill:var(--orange)}.ph-label.cool{fill:var(--green)}
.ph-label.organ-name{font-size:16px;font-weight:660}
.ph-label.node-title,.ph-label.compact-title{font-size:16px;font-weight:650}
.ph-label.node-small{font-size:12px;fill:#4c6856}
.ph-label.route-caption{font-size:15px;font-weight:650;stroke:var(--paper);stroke-width:5px;stroke-linejoin:round}
.ph-label.fine{font-size:13px;stroke:var(--paper);stroke-width:3px;stroke-linejoin:round}
.ph-label.transport-caption{font-size:13px;fill:#96572e}
.ph-label.gas-text,.ph-label.reaction-chip{font-size:16px;font-weight:650}
.ph-label.chem-symbol,.ph-label.cofactor-label{font-size:13px;font-weight:620;fill:#806827;stroke:var(--paper);stroke-width:4px}
.ph-label.enzyme-name{font-size:20px;fill:#fffdf1!important;font-weight:650;letter-spacing:.3px}
.ph-label.enzyme-place{font-size:12px;fill:#e1ecdc!important}
.ph-label.ring-title{font-size:29px;font-weight:680;fill:#416d54}
.ph-label.ring-line{font-size:15px;fill:#55765f}
.ph-label.sum-title{font-size:19px;font-weight:650}
.ph-label.map-legend{font-size:13px;fill:#657468}
.ph-carbon .carbon-dot,.ph-carbon[data-carbon-count] .carbon-dot{fill:var(--dots)}
.atlas-node .ph-carbon{opacity:.68}.atlas-node.now>rect{stroke-width:2.2}.atlas-node:focus-visible>rect,.enzyme-button:focus-visible>rect{stroke:#4c8d7a;stroke-width:4}
.ph-label.plate-place{font-size:17px;font-weight:650;fill:#526d5a}
.ph-label.well-title{font-size:20px;font-weight:680}
.ph-label.well-sub{font-size:14px;fill:#5e7266}
.ph-label.plate-note{font-size:17px;font-weight:550;fill:#546e63}
.ph-label.compare-line{font-size:19px;font-weight:620}
#insight{width:clamp(215px,22%,318px);align-self:center;padding:16px 22px 20px;border-left:1px solid #d6dfcf;max-height:95%;overflow:auto}
#insight h2{font-size:22px;line-height:1.35;margin:6px 0 12px;color:#3f604f}
#insight p{line-height:1.8;margin:0 0 12px;font-size:14px}
#insight .side-kicker{font-size:12px;color:#916a45}#side-stats{margin:14px 0;display:grid;gap:9px}
#side-stats div{display:flex;justify-content:space-between;border-bottom:1px solid #e1e6d7;padding:0 0 6px;font-size:13px;gap:6px}
#side-stats b{color:#37644b;font-variant-numeric:tabular-nums}
.reading-line{padding:8px 14px;min-height:48px;gap:10px}.reading-state{display:flex;flex:1;align-items:baseline;gap:10px}.reading-state strong{color:#3b6653;white-space:nowrap;font-size:13px}.reading-state p{font-size:13px}
.timeline-wrap label{min-width:0;width:auto!important;text-align:left}.timeline-wrap output{color:#3d6e59}
.ph-dialog{line-height:1.75;font-size:14px}.ph-dialog p{margin:5px 0 12px}.ph-dialog a{color:#366e59}
.model-area[data-shell-static=true] .shell-focus-progress{display:none!important}
.model-area [hidden],.shell-focus-rail [hidden],.control-dock [hidden]{display:none!important}
@media(max-width:860px),(max-height:520px){#insight{display:none!important}.sketch-tools{padding:4px 7px;gap:5px;min-height:36px}.scene-select-label select{max-width:185px}.reading-state{display:block}.reading-state p{font-size:12px;line-height:1.4}.reading-state strong{font-size:12px}.reading-line{padding:4px 8px;gap:5px;min-height:39px}.reading-line #details{display:inline-flex}.reading-line .shell-action{font-size:11px;min-height:28px}}
@media(max-width:635px) and (orientation:portrait){.sketch-tools{display:grid;grid-template-columns:1.28fr 1fr;gap:4px}.scene-select-label{width:100%}.scene-select-label select{width:100%;max-width:none}.camera-tools{width:100%;grid-column:1/-1;display:flex;gap:4px}.camera-tools #current,.camera-tools #fit,.camera-tools #zoom-in,.camera-tools #zoom-out{display:inline-flex}.camera-tools .shell-action{justify-content:center;min-height:26px;flex:1}.reading-line #details{display:none}.reading-state strong{display:block}.reading-line{min-height:58px}.sketch-tools .shell-action{min-height:27px}}
.model-area[data-short=true] .sketch-tools{flex-wrap:nowrap}.model-area[data-short=true] .camera-tools{width:auto;margin-left:auto}.model-area[data-short=true] .reading-state{display:flex}.model-area[data-short=true] .reading-state strong{display:none}.model-area[data-short=true] .reading-line{min-height:25px;padding:2px 8px}.model-area[data-short=true] #details{display:none}
.model-area[data-focus=true] .reading-state p,.model-area[data-focus=true] .sketch-tools{display:none}
.model-area[data-immersive=true] .reading-line{pointer-events:none}
.model-area[data-immersive=true] .reading-line button{pointer-events:auto}
@media(max-width:340px){.sketch-tools .scene-select-label select{max-width:none}.sketch-tools{min-height:40px}.reading-state p{font-size:11px}}
@media(max-width:359px) and (orientation:portrait){.model-stage>.sketch-tools{display:grid}.model-area[data-immersive=true] .sketch-tools,.model-area[data-focus=true] .sketch-tools{display:none}}
.model-area[data-short=true] .sketch-tools select{height:28px;line-height:normal;padding-block:0;font-size:12px}
.science-plane [data-shape=compact] .well-sub{font-size:12px}.science-plane [data-shape=compact] .plate-place,.science-plane [data-shape=compact] .plate-note{font-size:14px}
@media(max-width:359px) and (max-height:580px) and (orientation:portrait){
 .model-area .model-stage>.sketch-tools{grid-template-columns:minmax(90px,1.25fr) minmax(68px,1fr) auto;padding:3px 4px;gap:3px}
 .model-area .sketch-tools .camera-tools{grid-column:auto}
 .model-area .sketch-tools #zoom-in,.model-area .sketch-tools #zoom-out,.model-area[data-view=all] #fit,.model-area[data-view=current] #current{display:none}
 .model-area .reading-line{min-height:32px;padding:2px 5px}.model-area .reading-state p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .model-area .reading-state{min-width:0}.model-area .reading-state strong{font-size:10px}
}

/* Full map and reduced-scale readings share the same polar coordinates. */
#pathway-atlas .map-trace{stroke-width:4.2;stroke-linecap:round;stroke-linejoin:round}
#pathway-atlas .map-trace.transport{stroke-dasharray:8 7}
#pathway-atlas .map-trace.calvin-ring{stroke-dasharray:4 5}
#pathway-atlas .map-trace.side-trace,#pathway-atlas .map-trace.cofactor-trace{stroke-width:2.15}
#pathway-atlas .map-tag-bg{stroke-width:.9}
#pathway-atlas .map-trace.inlet{stroke-width:2.7}
#pathway-atlas .map-trace.bridge{stroke-width:3}
#pathway-atlas .map-card-bg{stroke-width:1.1}
#pathway-atlas .map-card.now .map-card-bg{stroke-width:2.2}
#pathway-atlas .map-card,#pathway-atlas .map-gas,#pathway-atlas .enzyme-button{cursor:pointer}
#pathway-atlas [role=button]:focus-visible>rect,#pathway-atlas .map-card:hover>rect,#pathway-atlas .map-gas:hover>rect{stroke-width:2.4;stroke:#508471}
#pathway-atlas .map-node-name{font-size:18px;font-weight:690;fill:#324d41}
#pathway-atlas .map-card.left .map-node-name{fill:#71442e}
#pathway-atlas .map-card.junction .map-node-name{fill:#265c62}
#pathway-atlas .map-node-detail{font-size:12px;font-weight:440;fill:#536158}
#pathway-atlas .map-card.left .map-node-detail{fill:#715e4e}
#pathway-atlas .map-card .ph-carbon{opacity:.74}
#pathway-atlas .map-branch{font-size:34px;font-weight:730;letter-spacing:1px}
#pathway-atlas .map-kind{font-size:15px;font-weight:600;letter-spacing:.8px}
#pathway-atlas .map-balance{font-size:15px;font-weight:460}
#pathway-atlas .map-balance.warm{fill:#77543b}
#pathway-atlas .map-balance.cool{fill:#466853}
#pathway-atlas .map-enzyme{font-size:24px;font-weight:680;fill:#fffaf7;letter-spacing:.2px}
#pathway-atlas .enzyme-place{fill:#f5ebf8!important}
#pathway-atlas .map-gas-name{font-size:21px;font-weight:690}
#pathway-atlas .map-caption{font-size:14px;font-weight:590}
#pathway-atlas .map-bridge-caption,#pathway-atlas .map-release{fill:#326c73;font-size:16px;font-weight:680}
#pathway-atlas .map-ammonia,#pathway-atlas .map-key{font-size:14px;fill:#56675d}
#pathway-atlas .map-cofactor{font-size:14px;font-weight:630}
#pathway-atlas .map-cofactor.gold{fill:#896a2e}
#pathway-atlas .map-cofactor.purple{fill:#805b80}
#pathway-atlas .map-cofactor.muted{fill:#68766c;font-weight:500}
#pathway-atlas .map-place{font-size:16px;font-weight:550;fill:#50634e}
#pathway-atlas .mini-only{display:none}
#pathway-atlas.map-compact .mini-only{display:inline}
#pathway-atlas.map-compact .full-only,#pathway-atlas.map-compact .map-balance,#pathway-atlas.map-compact .map-legend-bar{display:none}
#pathway-atlas.map-compact .map-card[data-compact=short] .map-abbr{font-size:23px}
#pathway-atlas.map-compact .map-card[data-key=hydroxy] .map-abbr{font-size:22px}
#pathway-atlas.map-compact .map-abbr{font-size:29px;font-weight:660}
#pathway-atlas.map-compact .map-card.junction .map-abbr{fill:#286c70}
#pathway-atlas.map-compact .map-branch{font-size:43px;letter-spacing:0;transform:translateY(27px)}
#pathway-atlas.map-compact .map-kind{font-size:23px}
#pathway-atlas.map-compact .map-card .ph-carbon{opacity:.85}
#pathway-atlas.map-compact .map-gas-name{font-size:27px}
#pathway-atlas.map-compact .map-enzyme{font-size:29px;transform:translateY(9px)}
#pathway-atlas.map-compact .map-release{font-size:24px}
#pathway-atlas.map-compact .map-mini-note{font-size:26px;fill:#536c60}
#pathway-atlas.map-compact .map-trace.main-ring{stroke-width:5.2}
#pathway-atlas.map-compact .map-trace.side-trace{stroke-width:2.6}
#pathway-atlas.map-compact .map-card-bg{stroke-width:2}

.workbench{position:relative}
.map-pocket{display:none}
@media (max-width:635px) and (orientation:portrait){
 .model-area[data-pocket=true] .map-pocket{position:absolute;z-index:2;left:6%;right:6%;top:calc(50% + 27vw);display:grid;gap:7px;color:#456456;font-size:13px;line-height:1.35}
 .map-pocket>div{display:grid;grid-template-columns:72px 1fr;align-items:baseline;gap:7px}
 .map-pocket strong{font-weight:650;color:#36775e}.map-pocket>div:first-child strong{color:#9d532d}


 .model-area[data-pocket=true] #pathway-atlas.map-compact .map-mini-note{display:none}
}
#pathway-atlas.map-compact .map-abbr{font-size:32px}
#pathway-atlas.map-compact .map-ammonia{font-size:23px}

/* Filled moving dots carry the batch, pale outlines inside cards are stoichiometric references. */
#pathway-atlas .map-card .ph-carbon .carbon-dot,#pathway-atlas .map-gas .ph-carbon .carbon-dot,#pathway-atlas [data-port-label=co2Out] .carbon-dot{fill:none;stroke:var(--dots);stroke-width:.9;opacity:.65}
#pathway-atlas .map-trace.participating{stroke-width:4.8}
#pathway-atlas .side-trace.participating,#pathway-atlas .inlet.participating,#pathway-atlas .cofactor-trace.participating{stroke-width:2.9}
#pathway-atlas .map-card.now .map-card-bg{stroke-width:1.8}
#elapsed{min-width:61px;font-variant-numeric:tabular-nums;white-space:nowrap}
.timeline-wrap{min-width:0}
@media(max-width:635px) and (orientation:portrait){.camera-tools #follow{display:inline-flex}}
@media(max-width:359px) and (max-height:580px) and (orientation:portrait){.model-area .sketch-tools .camera-tools{grid-column:1/-1}.model-area .model-stage>.sketch-tools{grid-template-columns:1.1fr 1fr}.model-area .sketch-tools #fit,.model-area .sketch-tools #current,.model-area .sketch-tools #follow{display:inline-flex}.model-area .scene-select-label{max-width:none}}

#pathway-atlas .carbon-text-front .ph-label{paint-order:stroke fill;stroke:var(--plate-paper);stroke-width:1.4px;stroke-linejoin:round}

.science-plane [data-shape=pocket] .well-title{font-size:18px}
.science-plane [data-shape=pocket] .well-sub,.science-plane [data-shape=pocket] .cofactor-label{font-size:12px}
.science-plane [data-shape=pocket] .plate-place{font-size:13px}


.science-column{display:flex;flex-direction:column;flex:1 1 0;min-width:0;min-height:0}
.compartment-strip{
  display:flex;align-items:center;justify-content:center;gap:14px;flex:none;
  min-width:0;min-height:42px;padding:2px 8px 3px;
  background:var(--paper,#fcfbf6);border-top:1px solid #e2e5da;color:#435b51;
}
.compartment-mode{font-size:12px;font-weight:600;white-space:nowrap}
.compartment-sites{display:flex;align-items:center;justify-content:center;min-width:0}
.compartment-sites button{
  --tone:#42704e;--wash:#e1eddd;--weight:0;
  appearance:none;position:relative;isolation:isolate;display:inline-flex;align-items:center;justify-content:center;
  gap:6px;padding:3px 10px;min-height:34px;border:0;border-radius:6px;background:transparent;
  color:#44554d;font:inherit;font-size:14px;font-weight:550;white-space:nowrap;touch-action:manipulation;
}
.compartment-sites [data-organelle="per"]{--tone:#886b31;--wash:#f2ead6}
.compartment-sites [data-organelle="mito"]{--tone:#985b3f;--wash:#f6e4da}
.compartment-sites button::before{content:'';position:absolute;z-index:-1;inset:0;border-radius:inherit;background:var(--wash);opacity:var(--weight)}
.compartment-sites button::after{content:'';position:absolute;bottom:0;left:9px;right:9px;height:2px;border-radius:2px;background:var(--tone);opacity:var(--weight)}
.compartment-sites button:focus-visible{outline:2px solid var(--tone);outline-offset:1px}
.compartment-sites button svg{flex:none;width:40px;height:28px;opacity:calc(.30 + .70 * var(--weight))}
.compartment-sites [aria-current="location"] span{font-weight:700;color:#263d32}
.compartment-strip[data-mode="summary"] button::before,.compartment-strip[data-mode="summary"] button::after{opacity:0}
.compartment-arrow{width:20px;text-align:center;color:#4d6b60;font:600 16px/1 system-ui;flex:none}
.compartment-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.model-area[data-immersive=true] .compartment-strip{margin-bottom:var(--photo-controls-height,62px)}
@media (max-width:860px),(max-height:520px){
 .compartment-strip{min-height:32px;gap:6px;padding:1px 4px}
 .compartment-sites button{min-height:28px;gap:3px;padding:1px 6px;font-size:12px}
 .compartment-sites button svg{width:30px;height:22px}
 .compartment-arrow{width:14px;font-size:13px}
}
@media(max-width:520px){
 .compartment-mode{display:none}
 .compartment-strip{gap:0}
}
@media(max-width:359px){
 .compartment-sites button{padding:1px 3px;font-size:11.5px}
 .compartment-sites button svg{width:25px;height:20px}
 .compartment-arrow{width:12px}
}

.model-area:not([data-view="all"]) #pathway-atlas .map-legend-bar{display:none}
body[data-model-shell] .model-area .compartment-sites button:focus-visible{outline:2px dashed #426479!important;outline-offset:-2px}
