/* Journey pacing: a scene, one immediate decision, optional detail. */
html { scroll-padding-block-start:88px; }
.game-header { position:sticky; top:0; z-index:100; }
.top-game-menu-panel { max-height:var(--menu-max-height,calc(100dvh - 24px)); overflow-y:auto; }
/* A top-layer list never expands or clips against the containing menu. */
.top-game-menu-panel .language-options { position:fixed; inset:auto; margin:0; min-width:0; box-sizing:border-box; overflow:auto; overscroll-behavior:contain; border-radius:8px; color:var(--text); }
.language-options[popover]:not(:popover-open) { display:none; }
.world-view .journey-scene { min-height:360px; height:clamp(360px,42vw,430px); aspect-ratio:auto; }
.world-view .journey-scene:not(.scene-road) { min-height:360px; height:clamp(360px,42vw,430px); aspect-ratio:auto; }
.world-view .journey-scene:not(.scene-road) .scene-art { inset:112px 0 0; }
.world-view .journey-scene .scene-background.scene-atlas { object-fit:initial; background-repeat:no-repeat; image-rendering:pixelated; }
.scene-speaker { position:absolute; right:5%; bottom:0; width:25%; max-width:280px; z-index:3; }
.scene-speaker img { display:block; width:100%; height:auto; image-rendering:pixelated; }
.scene-speaker span { display:block; width:100%; box-sizing:border-box; max-width:100%; margin:0 auto; padding:4px 9px; background:var(--panel); color:var(--text-bright); border:1px solid var(--accent-border); font:700 12px/1.4 var(--body-font); text-align:center; }
.journey-scene:not(.scene-road) .scene-caption { padding-inline-end:32%; }
.scene-atlas { image-rendering:pixelated; }

.scene-moving .crew-van { animation:van-suspension .28s ease-in-out infinite alternate; left:26%; }
.scene-moving .crew-van img { animation:none; }
.travel-countdown>span { animation-duration:var(--travel-duration,2600ms); }
.scene-moving .crew-van::after { content:""; position:absolute; inset-inline-start:-8%; bottom:8%; width:18%; height:8%; background:linear-gradient(90deg,transparent,#dbcda977); filter:blur(2px); }
.journey-controls,.town-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:14px 24px; background:var(--panel); }
.speed-controls { display:flex; gap:4px; margin-inline-end:auto; }
.speed-controls button { padding:8px 13px; font-size:13px; min-height:40px; }
.speed-controls button[aria-pressed=true] { background:var(--accent); color:var(--primary-ink); border-color:var(--accent); }
.travel-controls { padding:14px 24px; }
.travel-command { margin:0 0 14px; }
.travel-command>button { min-height:48px; }
.leg-summary { display:grid; grid-template-columns:1.5fr 1fr 1fr 1fr; gap:14px; padding:14px 20px; border-block:1px solid var(--border-subtle); background:var(--panel); }
.leg-summary>div { display:grid; align-content:start; gap:3px; min-width:0; }
.leg-summary span { color:var(--text-dim); font-size:12px; }
.leg-summary strong { color:var(--text-bright); font:700 17px/1.4 var(--body-font); }
.leg-summary small { color:var(--text-dim); font-size:12px; }
.critical-stats { grid-template-columns:repeat(7,minmax(0,1fr)); }
.hud-stat:nth-child(3) { border-inline-end:2px solid var(--accent-muted); }
.hud-stat:nth-child(n+5) dd { font-size:20px; color:var(--text); }
.turn-receipt { margin-top:14px; border:1px solid var(--border-subtle); padding:14px 18px; }
.turn-receipt p { font-size:14px; }
.receipt-details { gap:4px 16px; }
.receipt-details>div:first-child { flex-basis:100%; }
.trail-log { max-height:none; overflow:visible; }
.trail-log li { padding:16px 0; }
.trail-log li p { margin:8px 0; }
.town-arrival,.crew-incident,.crew-epilogue { padding:20px 26px; }
.town-arrival>.route-stop { margin:12px 0; padding:16px; }
.town-arrival>.town-actions { padding:8px 0 18px; background:transparent; }
.town-actions>.retro-btn-primary { margin-inline-start:auto; }
.shop-location { padding:14px 24px; color:var(--accent); font-weight:700; margin:0; }
.ending-scorecard { margin:20px 26px; border:1px solid var(--panel-border); padding:16px; }
.ending-scorecard>summary { color:var(--accent); font-weight:700; }
.ending-crew { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; padding:0; list-style:none; }
.ending-crew li { display:flex; gap:12px; align-items:center; border-bottom:1px solid var(--border-subtle); padding:10px 0; }
.ending-crew li>div { display:grid; gap:5px; }
.ending-crew li span:not(.portrait-art) { font-size:13px; color:var(--text-dim); }
.ending-crew .portrait-art { width:66px; height:70px; flex:0 0 66px; }
.ending-crew [data-fate="crew.dead"] .portrait-art,.ending-crew [data-fate="crew.departed"] .portrait-art { filter:grayscale(1); opacity:.65; }
.ending-moments { padding-inline-start:20px; }
.ending-moments p { font-size:14px; }
.vote-strengths { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.vote-strengths>div { display:flex; justify-content:space-between; gap:12px; border-bottom:1px solid var(--border-subtle); padding:10px; }
.vote-strengths dd { margin:0; color:var(--accent); }
.vote-outlook { font-weight:700; font-size:21px; color:var(--accent); }
.mission-copy { font-size:15px; color:var(--paper-ink); border-inline-start:3px solid var(--accent-border); padding-inline-start:12px; }
.persona-preview-card .persona-origin { color:var(--paper-ink); font-weight:700; }
body.high-contrast .persona-preview-card .persona-origin { color:#142c37; }
.map-scene-art { max-height:380px; margin-block:8px; }
.map-scene-art svg { width:100%; max-width:calc(330px * var(--map-ratio)); height:auto; max-height:none; aspect-ratio:var(--map-ratio); margin-inline:auto; overflow:hidden; }
.map-scene-heading { padding-block:14px; }
.map-scene-heading h1 { font-size:28px; }
.map-scene-heading p { margin:5px 0; }
.map-scene-itinerary { padding-block:12px; }
.map-scene-actions { padding-block:12px; }
.map-scene-actions p { max-width:65ch; }
button:disabled { cursor:not-allowed; }
@media(max-width:700px) {
 .critical-stats { grid-template-columns:repeat(12,minmax(0,1fr)); row-gap:8px; }
 .hud-stat { grid-column:span 4; }
 .hud-stat:nth-child(n+4) { grid-column:span 3; }
 .hud-stat dt .context-help { flex-shrink:0; }
 .world-view .journey-scene { min-height:375px; height:375px; }
 .world-view .journey-scene:not(.scene-road) { min-height:375px; height:375px; }
 .world-view .journey-scene:not(.scene-road) .scene-art { inset:165px 0 0; }
 .world-view .crew-van { bottom:27%; width:65%; left:12%; }
 .scene-moving .crew-van { left:12%; }
 .scene-speaker { width:32%; right:3%; bottom:0; }
 .scene-caption { padding:35px 16px 18px; }
 .scene-caption h1 { font-size:24px; }
 .scene-caption .scene-location { font-size:12px; }
 .journey-controls { gap:8px; padding:10px 12px; }
 .journey-controls>button { font-size:12px; padding:8px; min-height:40px; }
 .speed-controls { width:100%; }
 .speed-controls button { flex:1; }
 .travel-controls { padding:14px 12px; }
 .travel-command { align-items:stretch; }
 .travel-command>button { min-width:0; flex:1; }
 .leg-summary { grid-template-columns:1.3fr 1fr; gap:12px; padding:12px; }
 .leg-summary strong { font-size:15px; }
 .daily-settings { grid-template-columns:1fr; }
 .travel-tabs { gap:0; }
 .travel-tabs button { padding:12px 9px; font-size:12px; }
 .town-arrival,.crew-incident,.crew-epilogue { padding:16px; }
 .town-arrival .route-stop .controls { min-width:0; }
 .town-actions { display:grid; grid-template-columns:1fr 1fr; }
 .town-actions>.retro-btn-primary { grid-column:1/-1; margin:0; }
 .ending-crew { grid-template-columns:1fr 1fr; }
 .ending-crew .portrait-art { width:44px; height:50px; flex-basis:44px; }
 .vote-strengths { grid-template-columns:1fr 1fr; font-size:13px; }
 .map-scene-art { max-height:none; }
 .map-scene-art svg { max-width:calc(250px * var(--map-ratio)); }
 .map-scene-itinerary { gap:10px; }
 .map-scene-actions { position:sticky; bottom:0; background:var(--panel); z-index:2; }
 .map-scene-actions p { display:none; }
}
@media(prefers-reduced-motion:reduce) {
 .scene-moving .crew-van,.scene-moving .scene-background,.travel-countdown>span { animation:none; }
 .scene-moving .crew-van::after { display:none; }
}
.abandon-menu-item { grid-column:1/-1; color:var(--negative-text); border-top:1px solid var(--panel-border); margin-top:6px; }
.abandon-backdrop { position:fixed; inset:0; z-index:150; background:var(--modal-backdrop); display:grid; place-items:center; padding:20px; }
.abandon-dialog { width:min(560px,100%); box-sizing:border-box; padding:28px; background:var(--panel-raised); border:2px solid var(--accent); box-shadow:0 20px 80px #0009; }
.abandon-dialog h1 { font-size:26px; }
.abandon-dialog p { line-height:1.6; }
/* The scene owns its HUD. Portrait frames preserve each source image's proportions. */
.crew-name-card { grid-template-columns:72px minmax(0,1fr); }
.crew-portrait { display:block; width:72px; height:80px; object-fit:contain; object-position:center bottom; background:var(--paper); border:2px solid var(--accent-border); box-sizing:border-box; image-rendering:pixelated; }
.crew-name-card .crew-portrait { grid-row:1/3; }
.result-profile .crew-portrait { width:96px; height:104px; }
.crew-name-card input { box-sizing:border-box; }
.survival-hud { padding:8px 14px 6px; }
.critical-stats { margin:0; gap:0; }
.hud-stat { padding:0 9px; }
.hud-stat dt { font-size:11px; }
/* Keep each tip's space so the preference never reflows labels or scenes. */
.context-help-hidden { visibility:hidden; pointer-events:none; }
.hud-stat dd,.hud-stat:nth-child(n+5) dd { font-size:20px; line-height:1.15; margin:2px 0 0; }
.hud-context-row { margin-top:6px; padding-top:5px; }
.hud-context,.hud-conditions { font-size:12px; }
.hud-context-row { align-items:center; min-height:30px; gap:6px 14px; }
.hud-context { flex-shrink:0; white-space:nowrap; }
.hud-conditions { min-width:0; flex-wrap:wrap; justify-content:flex-end; }
.weather-indicator { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:4px 10px; border:1px solid transparent; border-radius:6px; padding:4px 8px; min-height:28px; box-sizing:border-box; }
.weather-name { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; color:var(--text-bright); }
.weather-icon { font-size:20px; line-height:1; }
.weather-impact { color:var(--text-dim); font-size:12px; line-height:1.4; }
.weather-indicator .context-help { margin:0; }
.weather-indicator .help-trigger { width:22px; height:22px; min-width:22px; min-height:22px; font-size:12px; }
.weather-changed { animation:weather-notification 1.2s ease-out 3; border-color:var(--accent); background:var(--panel-selected); }
@keyframes weather-notification { from { box-shadow:0 0 0 3px var(--accent); } to { box-shadow:0 0 0 0 transparent; } }
@media(prefers-reduced-motion:reduce) { .weather-changed { animation:none; } }
@media(max-width:800px) {
 .hud-context-row { align-items:flex-start; flex-wrap:wrap; }
 .hud-conditions { flex:1; }
 .weather-indicator { display:grid; grid-template-columns:1fr auto; text-align:end; gap:2px 6px; }
 .weather-name { justify-content:flex-end; }
 .weather-impact { grid-row:2; grid-column:1/-1; font-size:11px; }
 .weather-indicator .context-help { grid-row:1; grid-column:2; }
}
.world-view .journey-scene:not(.scene-road) .scene-art { inset:86px 0 60px; }
.scene-footer { position:absolute; bottom:0; inset-inline:0; z-index:6; display:grid; }
.scene-footer .scene-caption { position:static; }
.aftermath-panel .receipt-details { justify-content:center; margin-bottom:20px; }
.aftermath-panel .receipt-details>div { justify-content:center; flex-wrap:wrap; }
.leg-summary { display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; padding:9px 16px; border:0; border-top:1px solid var(--border-muted); background:var(--panel-overlay); min-height:52px; box-sizing:border-box; }
.leg-summary>div { display:flex; flex-wrap:wrap; align-items:center; align-content:center; gap:7px; }
.leg-summary strong { font-size:14px; line-height:1.3; }
.leg-summary span,.leg-summary small { font-size:11px; }
.leg-destination { flex:1; }
.leg-destination>span { display:none; }
.outfit-workspace>.leg-summary { margin:0 0 16px; border:1px solid var(--border-subtle); padding:10px 12px; }
.outfit-workspace .leg-destination>span { display:inline; }
.leg-resources { justify-content:flex-end; }
.scene-caption { bottom:55px; padding:35px 20px 14px; }
.scene-caption h1 { font-size:clamp(24px,3vw,34px); }
.scene-caption .context-help { pointer-events:auto; vertical-align:middle; }
.scene-caption .scene-location { margin:0 0 5px; font-size:12px; }
.scene-speaker { width:19%; max-width:175px; right:4%; bottom:0; }
.scene-speaker img { object-fit:contain; background:var(--panel-raised); border:1px solid var(--accent-border); box-sizing:border-box; }
.scene-speaker span { margin:0; border-top:0; font-size:12px; }
.journey-scene:not(.scene-road) .scene-caption { padding-inline-end:26%; }
.world-view .scene-road .crew-van { width:34%; left:30%; bottom:20%; }
.scene-road .scene-art { container-type:size; }
/* Anchor tire contact to road-art y=800/1024, following its 84% cover crop. */
.world-view .scene-road .scene-art > .crew-van {
 bottom:auto;
 top:calc(84cqh - max(3.916667cqw,5.875cqh));
 translate:0 -92%;
}
.road-pan-track { position:absolute; inset:0; width:200%; display:flex; animation:road-scroll 32s linear infinite; animation-play-state:paused; }
.scene-road .road-pan-track .scene-background { position:relative; inset:auto; width:50%; flex:0 0 50%; height:100%; object-fit:cover; object-position:center 84%; animation:none; }
.scene-road .road-pan-track .road-mirrored { transform:scaleX(-1); }
.scene-moving .road-pan-track { animation-play-state:running; }
@keyframes road-scroll { from {transform:translateX(0);} to {transform:translateX(-50%);} }
.route-progress { position:absolute; inset-inline:0; bottom:0; height:3px; background:var(--panel-border); z-index:7; }
.route-progress>span { display:block; height:100%; background:var(--accent); transition:width var(--travel-duration,2600ms) linear; }
.travel-toolbar { min-height:80px; background:var(--panel); }
.transit-caption { min-height:80px; box-sizing:border-box; padding:14px 24px; }
.turn-receipt { display:flex; gap:14px; padding:12px 16px; margin:14px 0; border:0; border-inline-start:3px solid var(--accent); background:var(--panel-raised); animation:none; }
.receipt-mark { color:var(--accent); font-size:24px; }
.receipt-body { flex:1; min-width:0; }
.receipt-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 18px; }
.receipt-heading>strong { font-size:13px; color:var(--text-bright); }
.turn-receipt p { margin:6px 0 0; color:var(--text-dim); font-size:13px; line-height:1.5; }
.turn-receipt .receipt-details { margin-top:6px; }
.receipt-details>div:first-child { flex-basis:auto; }
.roadside-options { padding:18px 26px; border-top:1px solid var(--border-subtle); }
.roadside-options h2 { font:700 18px var(--body-font); margin:0 0 12px; }
.roadside-options p { font-size:14px; color:var(--text-dim); }
.action-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.action-option { display:grid; gap:7px; }
.action-option>button { width:100%; text-align:start; }
.action-option>span { color:var(--text-dim); font-size:12px; }
.clear-loadout { width:auto; margin:0; }
.action-availability { font-size:12px; color:var(--accent); }
.incident-reason { padding:14px 18px; border-inline-start:3px solid var(--accent); background:var(--panel-raised); }
@media(max-width:700px) {
 .crew-name-card { grid-template-columns:54px minmax(0,1fr); }
 .crew-name-card .crew-portrait { width:54px; height:64px; }
 .critical-stats { row-gap:4px; }
 .hud-stat { padding:0 4px; }
 .hud-stat dt { font-size:10px; }
 .hud-stat:nth-child(n+5) { padding-top:3px; }
 .hud-stat dd,.hud-stat:nth-child(n+5) dd { font-size:17px; }
 .hud-context-row { padding-top:4px; margin-top:4px; }
 .world-view .journey-scene { height:400px; min-height:400px; }
 .world-view .journey-scene:not(.scene-road) { height:400px; min-height:400px; }
 .world-view .journey-scene:not(.scene-road) .scene-art { inset:128px 0 82px; }
 .world-view .scene-road .crew-van { width:62%; left:15%; bottom:22%; }
 .scene-speaker { width:27%; right:3%; }
 .scene-speaker span { font-size:10px; padding:3px; }
 .scene-caption { bottom:82px; padding:25px 14px 12px; }
 .scene-caption h1 { font-size:23px; }
 .journey-scene:not(.scene-road) .scene-caption { padding-inline-end:33%; }
 .leg-summary { gap:5px 9px; padding:8px 12px; min-height:80px; }
 .leg-summary strong { font-size:12px; }
 .leg-destination { flex-basis:65%; }
 .leg-resources { flex:1; }
 .leg-resources>span { display:none; }
 .leg-summary .leg-destination>small { font-size:11px; }
 .travel-toolbar { min-height:108px; }
 .transit-caption { min-height:108px; padding:14px; }
 .action-grid { grid-template-columns:1fr; }
 .roadside-options { padding:18px 14px; }
 .turn-receipt { gap:8px; padding:10px 12px; }
 .receipt-heading { gap:6px; }
}
@media(prefers-reduced-motion:reduce) {
 .road-pan-track { animation:none; }
 .route-progress>span { transition:none; }
}
.local-conversation { padding:28px; border-top:1px solid var(--panel-border); }
.conversation-content { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:32px; align-items:start; max-width:1120px; margin-inline:auto; }
.resident-story { padding-block:12px; min-width:0; }
.resident-byline { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 16px; color:var(--text-dim); }
.resident-byline .eyebrow { margin:0; }
.resident-remark { margin:22px 0 0; padding-inline-start:20px; border-inline-start:3px solid var(--accent); }
.resident-remark p { margin:0; font:500 clamp(20px,2.1vw,27px)/1.5 var(--body-font); color:var(--text-bright); max-width:38ch; }
.local-record { background:var(--panel-raised); padding:20px 24px; border:1px solid var(--border-subtle); border-radius:4px; min-width:0; }
.local-record-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-block-end:16px; }
.local-record-heading h2 { margin:0; font:700 16px/1.4 var(--body-font); color:var(--accent); }
.local-conversation .local-fact { margin:0; font:400 16px/1.6 var(--body-font); color:var(--text); max-width:62ch; }
.fact-source { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 20px; margin-block-start:18px; padding-block-start:14px; border-top:1px solid var(--border-subtle); font-size:12px; line-height:1.5; color:var(--text-dim); }
.fact-source a { color:var(--accent); font-weight:700; text-underline-offset:3px; }
.conversation-actions { display:flex; justify-content:flex-end; max-width:1120px; margin:28px auto 0; }
.conversation-actions>button { min-width:180px; max-width:100%; }
.world-conversation .conversation-player { left:4%; right:auto; }
.world-conversation .scene-speaker { width:19%; }
.scene-npc svg { display:block; width:100%; aspect-ratio:1; border:1px solid var(--accent-border); box-sizing:border-box; image-rendering:pixelated; }
.world-conversation .scene-speaker img { aspect-ratio:1; }
.world-conversation .scene-caption { padding-inline:25%; text-align:center; }
.world-conversation .scene-caption h1 { font-size:25px; }
@media(max-width:700px) {
 .local-conversation { padding:18px; }
 .conversation-content { grid-template-columns:minmax(0,1fr); gap:24px; }
 .resident-story { padding:0; }
 .resident-remark { margin-block-start:16px; padding-inline-start:16px; }
 .local-record { padding:18px; }
 .conversation-actions { margin-block-start:24px; }
 .world-conversation .scene-speaker { width:25%; }
 .world-conversation .scene-caption { padding-inline:30%; }
 .world-conversation .scene-caption h1 { font-size:17px; }
 .world-conversation .scene-location { display:none; }
}
.offline-status {grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px 8px;padding-top:12px;border-top:1px solid var(--border-color,var(--border-subtle));font-size:12px;min-width:0;}
.offline-summary {display:flex;align-items:center;gap:8px;line-height:1.4;text-align:start;}
.offline-state-icon {flex:0 0 20px;display:grid;place-items:center;width:20px;height:20px;line-height:1;}
.offline-state-icon .journey-icon {width:20px;height:20px;}
.offline-status[data-offline=ready] .offline-state-icon {color:var(--positive-text);}
.offline-status[data-offline=error] .offline-state-icon,.offline-status[data-offline=unavailable] .offline-state-icon {color:var(--accent);}
.offline-status .context-help {margin:0;}
.offline-status .help-trigger {display:grid;place-items:center;width:28px;height:28px;min-width:28px;min-height:28px;padding:0;line-height:1;font-size:14px;}
.offline-progress,.offline-retry,.pwa-install {grid-column:1/-1;width:100%;}
.offline-progress {height:6px;accent-color:var(--positive-text);}
.pwa-install .context-help {display:flex;width:100%;}
.offline-status button.pwa-install-button,.offline-status .help-trigger-labeled {width:100%;height:auto;min-height:40px;padding:8px 10px;line-height:1.35;font:600 13px/1.35 var(--body-font);border-radius:5px;white-space:normal;}
@media (display-mode: standalone) {.pwa-install {display:none;}}
#launch-gate {position:fixed;inset:0;z-index:2000;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--bg);color:var(--text-bright);padding:24px;text-align:center;}
#launch-gate h1 {color:var(--accent);}
/* Keep the main travel actions together and spend the saved height on the scene. */
.travel-screen .world-view .journey-scene { height:clamp(420px,48vw,490px); min-height:420px; }
.journey-controls { padding:12px 24px; gap:10px 18px; }
.journey-actions { display:flex; align-items:stretch; justify-content:flex-end; gap:8px; }
.journey-actions>button { min-height:44px; padding:8px 14px; font-size:13px; }
.journey-actions>.retro-btn-primary { min-width:154px; }
.travel-toolbar,.transit-caption { min-height:68px; }
.transit-caption { padding:12px 24px; }
.travel-controls { padding:0 24px 14px; }
.travel-controls .travel-tabs { margin-top:0; }
@media(max-width:700px) {
 .travel-screen .world-view .journey-scene { height:440px; min-height:440px; }
 .journey-controls { padding:10px 12px; gap:8px; }
 .journey-actions { width:100%; }
 .journey-actions>button { min-height:40px; padding:8px; font-size:12px; }
 .journey-actions>.retro-btn-primary { min-width:0; flex:1; }
 .travel-toolbar,.transit-caption { min-height:108px; }
 .transit-caption { padding:12px; }
 .travel-controls { padding:0 12px 12px; }
}

/* One toolbar: optional details on the left, travel actions on the right. */
.journey-controls .travel-tabs { margin:0 auto 0 0; border:0; gap:3px; }
.journey-controls .travel-tabs button { position:relative; min-height:44px; padding:8px 12px 10px; font-size:13px; border:0; border-radius:6px; background:transparent; box-shadow:none; }
.journey-controls .travel-tabs button::after { content:""; position:absolute; inset-inline:6px; bottom:0; height:2px; border-radius:2px; background:var(--accent); opacity:0; pointer-events:none; }
.journey-controls .travel-tabs button:is(:hover,:active,:focus,[aria-selected=true]) { background:transparent; box-shadow:none; }
.journey-controls .travel-tabs button[aria-selected=true]::after { opacity:1; }
.journey-actions .fast-mode-toggle { display:flex; align-items:center; gap:7px; }
.fast-mode-toggle[aria-checked=true] { color:var(--accent); background:var(--panel-selected); border-color:var(--accent); }
.camp-toggle[aria-pressed=true] { color:var(--accent); background:var(--panel-selected); border-color:var(--accent); }
.fast-mode-toggle[aria-checked=true] .switch-track span { transform:translateX(12px); }
.fast-mode-toggle:dir(rtl)[aria-checked=true] .switch-track span { transform:translateX(-12px); }
.journey-controls:dir(rtl) .travel-tabs { margin:0 0 0 auto; }
@media(max-width:700px) {
 .journey-controls { gap:6px; }
 .journey-controls .travel-tabs { width:100%; }
 .journey-controls .travel-tabs button { flex:1; min-height:36px; padding:6px; font-size:12px; }
 .journey-actions { gap:5px; }
 .journey-actions>button { padding:7px; font-size:11px; }
 .journey-actions .fast-mode-toggle { gap:4px; }
 .travel-toolbar,.transit-caption { min-height:102px; }
}

/* Automatic map previews share the travel clock; manual reviews stay open. */
.map-buttons { display:flex; flex-wrap:wrap; gap:10px; }
.map-auto-status { flex:1; }
.map-countdown { display:grid; gap:8px; font-size:13px; }
.map-countdown progress { width:min(100%,280px); height:5px; accent-color:var(--accent); }
#launch-gate>div { width:min(100%,480px); }
#launch-gate h1 { font-size:clamp(26px,5vw,44px); }
#launch-gate h2 { font:700 20px var(--body-font); }
#launch-gate p { line-height:1.6; }
#launch-progress { width:100%; height:10px; accent-color:var(--accent); }
#launch-help { color:var(--text-dim); font-size:14px; }
#launch-retry { margin-top:16px; }
@media(max-width:700px) { .map-auto-status p { display:block; } .map-buttons { width:100%; } .map-buttons button { flex:1; } }
.camp-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.camp-action { display:flex; flex-direction:column; gap:8px; padding:14px; border:1px solid var(--border-subtle); border-radius:6px; background:var(--panel-raised); }
.camp-action>button { width:100%; flex:1; }
.camp-action-cost { margin:0; font-size:13px; color:var(--text-dim); }
.camp-action .cooldown-status { display:block; margin-top:auto; }
.camp-action .cooldown-status p { margin:4px 0 6px; }
.camp-action .cooldown-status progress { height:7px; }
@media(max-width:600px) { .camp-actions { grid-template-columns:1fr; } }

.journey-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); flex:0 1 600px; max-width:600px; }
.journey-actions>button, .journey-actions>.retro-btn-primary { width:100%; min-width:0; white-space:normal; line-height:1.25; }
.journey-actions .fast-mode-toggle { justify-content:center; }
.journey-controls .travel-tabs { flex-shrink:0; }
.travel-tabs button[aria-selected=true] { color:var(--accent); }
@media(max-width:700px) { .journey-actions { flex-basis:100%; } }
/* Resource totals and travel context share the two top status rows. */
.world-view>.resource-hud { position:relative; inset:auto; background:var(--panel); padding:8px 16px; }
.world-view .conditions-hud { padding:5px 16px; }
.conditions-hud .hud-context-row { margin:0; padding:0; border:0; }
.world-view .journey-scene:not(.scene-road) .scene-art { inset:0; }
.world-view .scene-footer .scene-caption { padding-block:24px 14px; }
.world-view .journey-scene { margin:0; }
@media(max-width:700px) {
 .world-view>.resource-hud { padding:8px; }
 .world-view .conditions-hud { padding:4px 8px; }
 .world-view .scene-footer .scene-caption { padding-block:20px 12px; }
}
.hud-stat.critical { animation:critical-stat-pulse 1s ease-out 3; }
@keyframes critical-stat-pulse { from { background:#913d40; box-shadow:inset 0 0 0 1px var(--negative-text); } to { background:#5e2528aa; box-shadow:inset 0 0 0 1px transparent; } }
@media(prefers-reduced-motion:reduce) { .hud-stat.critical { animation:none; } }

/* Shared onboarding context and a stable character/action layout. */
.journey-mission { max-width:88ch; margin:0 0 26px; color:var(--text-dim); font-size:15px; line-height:1.6; }
.persona-preview-card { display:flex; flex-direction:column; gap:18px; }
.persona-preview-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; }
.persona-preview-stats .mini-stat { border-color:var(--paper-border); }
.persona-preview-header h3 { margin:0 0 8px; }
.persona-preview-header p { margin:0; min-height:3em; }
.persona-starting { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; margin:0; padding-block:14px; border-block:1px solid var(--paper-border); }
.persona-starting dt { font-size:12px; }
.persona-starting dd { margin:5px 0 0; font-weight:800; }
.persona-mods { margin:0; padding:0; border:0; font-weight:400; min-height:76px; }
.persona-mods h4 { font:700 13px var(--body-font); margin:0 0 8px; }
.persona-mods p { font-size:14px; line-height:1.5; margin:0; }
.persona-scoring { font-size:12px; line-height:1.5; color:var(--paper-muted); margin:0; padding-top:12px; border-top:1px solid var(--paper-border); }
.controls.setup-actions { display:flex; justify-content:space-between; gap:20px; margin-block-start:24px; padding-block-start:18px; border-block-start:1px solid var(--panel-border); }
.controls.setup-actions button { inline-size:auto; min-inline-size:160px; margin:0; }

/* Result identity belongs to the player, and the scorecard is always readable. */
.result-art .journey-scene { aspect-ratio:auto; min-height:380px; }
.result-art .result-art-caption { position:relative; min-height:380px; display:grid; grid-template-columns:minmax(0,1fr); align-items:end; gap:28px; padding:34px; }
.result-art-caption .result-epilogue { margin:0; font-size:16px; line-height:1.6; }
.result-art-caption .result-location { display:grid; gap:4px; margin:16px 0 0; color:var(--text-dim); font-size:14px; }
.result-art-caption .result-location span { font-size:12px; }
.result-art-caption .result-profile { display:flex; gap:14px; margin:0; padding:14px; border:1px solid var(--accent-border); background:var(--panel-overlay); min-width:0; max-width:310px; }
.result-profile strong { overflow-wrap:anywhere; }
.result-profile .crew-portrait { width:76px; height:86px; flex-shrink:0; object-fit:contain; image-rendering:pixelated; }
.ending-scorecard { margin:0 26px 24px; padding:22px; border:1px solid var(--panel-border); border-radius:5px; }
.ending-scorecard>h2 { margin:0 0 18px; font:700 22px var(--body-font); }
.result-screen .ending-scorecard .result-info { padding:0 0 18px; }
.result-screen .ending-scorecard .stats-section { padding:0; }
.ending-scorecard .result-info { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.ending-scorecard .score-display { margin:0; }
.ending-scorecard .stats-section>h2 { font-size:15px; margin:0 0 12px; }
.action-feedback { position:fixed; z-index:110; inset-inline-end:max(20px,env(safe-area-inset-right)); bottom:max(20px,env(safe-area-inset-bottom)); max-width:min(420px,calc(100vw - 40px)); padding:12px 18px; border:1px solid var(--positive-text); border-radius:5px; background:var(--success-panel); color:var(--text-bright); box-shadow:0 4px 20px #0006; font:600 14px/1.5 var(--body-font); pointer-events:none; }
.action-feedback:empty { display:none; }
@media(max-width:700px) {
 .persona-select .persona-actions { position:sticky; bottom:0; z-index:8; gap:12px; margin-inline:-22px; margin-bottom:-22px; padding:12px 22px max(12px,env(safe-area-inset-bottom)); background:var(--panel); box-shadow:0 -6px 18px var(--scene-scrim); }
 .persona-preview-card { gap:14px; padding:18px; }
 .persona-preview-header h3 { font-size:22px; }
 .persona-preview-header p { font-size:14px; line-height:1.5; min-height:0; }
 .persona-mods { min-height:0; }
 .persona-starting { padding-block:10px; }
 .controls.setup-actions button { min-inline-size:112px; }
 .result-art .result-art-caption { grid-template-columns:minmax(0,1fr); gap:22px; padding:24px 20px; min-height:450px; }
 .result-art-caption .result-profile { justify-self:start; max-width:100%; }
 .ending-scorecard { margin-inline:16px; padding:16px; }
 .ending-scorecard .result-info { flex-wrap:wrap; }
}

/* Keep the compact crew grid; only remove portrait framing and transparent padding. */
.crew-portrait-slot { grid-row:1/3; width:72px; height:80px; overflow:hidden; }
.crew-name-card .crew-portrait { width:100%; height:100%; margin:0; background:transparent; border:0; object-fit:contain; transform:scale(1.15); }
@media(max-width:700px) { .crew-portrait-slot { width:54px; height:64px; } }
.header-controls>.offline-status { grid-column:1/-1; }
.offline-readiness { grid-column:1/-1; display:flex; align-items:center; justify-content:center; gap:12px; }
.offline-readiness .offline-summary { flex:0 1 auto; }
.offline-readiness .context-help { flex-shrink:0; }

/* Portrait, name and caption share a layout, above the weather layers. */
.world-view .scene-footer.has-cast { grid-template-columns:minmax(0,1fr) clamp(80px,15vw,150px); align-items:end; gap:20px; padding:16px 20px; background:linear-gradient(transparent,var(--scene-scrim)); }
.world-view .scene-footer.has-cast .scene-caption { padding:0; background:none; min-width:0; }
.world-view .scene-footer .scene-speaker { position:static; width:100%; max-width:none; z-index:auto; min-width:0; }
.world-view .scene-footer .scene-speaker img { aspect-ratio:1; }
.world-view .scene-footer .scene-speaker span { color:var(--text-bright); background:var(--panel); overflow-wrap:anywhere; }
.world-view .scene-footer.has-conversation { grid-template-columns:clamp(80px,15vw,150px) minmax(0,1fr) clamp(80px,15vw,150px); }
.scene-footer.has-conversation .conversation-player { grid-column:1; grid-row:1; }
.scene-footer.has-conversation .scene-caption { grid-column:2; grid-row:1; }
.scene-footer.has-conversation .scene-npc { grid-column:3; grid-row:1; }
.map-scene[data-automatic=true] .map-scene-actions { display:flex; flex-direction:column; align-items:flex-end; gap:12px; }
.map-scene[data-automatic=true] .map-auto-status { flex:none; width:auto; max-width:100%; text-align:end; }
.map-scene[data-automatic=true] .map-countdown { justify-items:end; }
@media(max-width:700px) {
 .world-view .scene-footer.has-cast { gap:12px; padding:12px 14px; }
 .world-view .scene-footer.has-conversation { gap:8px; }
 .map-scene[data-automatic=true] .map-auto-status { width:100%; text-align:start; }
 .map-scene[data-automatic=true] .map-countdown { justify-items:start; }
}
/* Temporary effects use one visual vocabulary for weather and executive orders. */
.hud-conditions { align-items:center; gap:4px 12px; }
.effect-duration { color:var(--text-dim); font-size:11px; }
.journey-reference .travel-controls:empty { display:none; }
.journey-reference .transit-caption { padding:0; margin-inline-start:auto; min-height:44px; }
.town-trading { padding:20px 24px; }
.town-trading>.action-grid { margin-block:16px; }
.action-button { text-align:start; }
.action-button .action-title { display:block; }
.action-button .action-detail { display:block; margin-block-start:6px; color:var(--text-dim); font-size:12px; line-height:1.45; font-weight:400; }
.action-detail s { text-decoration-thickness:1px; }
.encounter-choice { display:block; }
.encounter-choice .action-button { width:100%; display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px .35em; align-content:start; }
.encounter-choice .choice-number { grid-column:1; grid-row:1; }
.encounter-choice .action-title { grid-column:2; grid-row:1; }
.encounter-choice .choice-effects { grid-column:2; grid-row:2; padding:0; margin-block-start:0; }
@media(max-width:620px) {
 .hud-conditions { gap:4px; }
 .policy-indicator .effect-duration { grid-column:1/-1; }
 .town-trading { padding:16px 12px; }
}
.outfit-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.outfit-title-row h1 { min-width:0; margin:0; }
.resupply-workspace { padding-inline:24px; }
.leave-store { width:144px; flex:0 0 144px; }
.route-stop .controls { align-items:stretch; }
.route-stop .controls>button { width:100%; }
html.hc .action-button .action-detail { color:inherit; }
@media(max-width:620px) {
 .resupply-workspace { padding-inline:12px; }
 .leave-store { width:auto; flex:0 1 32%; font-size:12px; padding:8px; }
 .outfit-title-row h1 { font-size:20px; }
}

/* Journal: a dated ledger with distinct stories and actual resource changes. */
.journal .trail-log { display:grid; gap:12px; max-height:580px; overflow-y:auto; padding-block:0 4px; padding-inline:0 6px; scrollbar-gutter:stable; }
.journal .trail-log>.journal-entry { display:grid; grid-template-columns:120px minmax(0,1fr); gap:18px; padding:18px; border:1px solid var(--border-subtle); border-radius:6px; background:var(--panel-raised); }
.journal-stamp { color:var(--text-dim); font-size:12px; line-height:1.6; font-variant-numeric:tabular-nums; }
.journal-story { min-width:0; }
.journal-story h3 { margin:0; color:var(--text-bright); font:700 17px/1.35 var(--body-font); }
.journal-story .journal-place { margin:4px 0 0; font-size:12px; color:var(--text-dim); }
.journal-story .journal-message { margin:12px 0; color:var(--text); font-size:14px; line-height:1.55; }
.journal-impacts { list-style:none; display:flex; flex-wrap:wrap; gap:6px; padding:0; margin:12px 0 0; }
.journal .trail-log .journal-impacts>li { display:flex; gap:7px; align-items:baseline; padding:5px 8px; border:0; border-radius:4px; background:var(--panel-inset); font-size:12px; }
.journal-details { display:flex; flex-wrap:wrap; gap:10px 24px; margin:12px 0 0; padding-top:10px; border-top:1px solid var(--border-subtle); }
.journal-details:empty { display:none; }
.journal-details>div { display:grid; gap:3px; }
.journal-details dt { color:var(--text-dim); font-size:11px; }
.journal-details dd { margin:0; color:var(--text); font-size:12px; font-variant-numeric:tabular-nums; }
html.hc .journal-story,html.hc .journal-stamp,html.hc .journal-story p,html.hc .journal-details dt,html.hc .journal-details dd { color:inherit; }
@media(max-width:620px) {
 .journal .trail-log>.journal-entry { grid-template-columns:minmax(0,1fr); gap:6px; padding:14px; }
 .journal-story h3 { font-size:16px; }
 .journal-stamp { font-size:11px; }
}
.roadside-options>.action-availability { text-align:center; margin:16px auto 0; padding:4px 12px; color:var(--text-dim); font-size:13px; line-height:1.5; }
.map-scene-heading { display:block; }
.map-heading-baseline { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:4px 18px; }
.map-heading-baseline .map-attribution { margin:0; padding:0; font-size:10px; text-align:end; margin-inline-start:auto; }
.map-heading-baseline .map-current-location { margin:0; }
/* All town content shares the same outer gutter and compact service-button stack. */
.town-arrival { padding:20px 24px; }
.town-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.town-heading>div { min-width:0; }
.town-heading .eyebrow { margin:0 0 8px; }
.town-heading p:last-child { margin:0; }
.town-heading>.town-depart { flex:0 0 144px; min-width:144px; min-height:44px; padding:8px 14px; font-size:13px; }
.town-arrival>.route-stop { display:grid; grid-template-columns:minmax(0,1fr) 240px; gap:24px; padding:20px; align-items:center; }
.route-stop .controls { display:grid; gap:8px; padding:0; margin:0; min-width:0; }
.route-stop .controls>button { text-align:start; min-height:58px; padding:12px 16px; }
.route-stop .eyebrow { margin:0 0 8px; }
.route-stop h2 { margin:0 0 12px; }
.town-vitals { display:flex; flex-wrap:wrap; gap:12px 30px; margin:0 0 14px; }
.town-vitals>div { display:grid; gap:3px; }
.town-vitals dt,.town-attraction h3 { font:600 11px/1.4 var(--body-font); color:var(--text-dim); }
.town-vitals dd { margin:0; font-size:15px; font-weight:600; }
.town-vitals a { color:inherit; text-decoration-color:var(--accent-border); text-underline-offset:3px; }
.town-attraction h3 { margin:0 0 4px; }
.town-attraction p { margin:0; font-size:13px; line-height:1.5; max-width:65ch; }
.town-attraction>a { display:inline-block; margin-top:6px; font-size:11px; color:var(--text-dim); }
.town-arrival>.roadside-options { padding:18px 0; }
@media(max-width:700px) {
 .town-arrival { padding:16px 12px; }
 .town-heading { flex-wrap:wrap; gap:12px; }
 .town-heading>div { flex-basis:100%; }
 .town-heading>.town-depart { margin-inline-start:auto; }
 .town-arrival>.route-stop { grid-template-columns:minmax(0,1fr); padding:16px; gap:16px; }
 .route-stop .controls>button { min-height:48px; }
}
.aftermath-panel #aftermath-title.eyebrow { font:700 12px/1.4 var(--body-font); letter-spacing:.12em; text-transform:uppercase; color:var(--accent); margin:0 0 18px; }

/* Departure messages share the outcome layout and stay readable as a single notice. */
.ally-departure .ally-message { max-width:640px; margin:20px auto 24px; padding:22px 24px; text-align:start; background:var(--panel-raised); border:1px solid var(--panel-border); border-inline-start:3px solid var(--accent); border-radius:8px; font-size:clamp(17px,2vw,22px); line-height:1.6; }
.ally-departure .change small { color:var(--text-dim); font-size:13px; }
html.hc .ally-departure .ally-message { background:#000; border-color:#fff; }

/* A single stat card anatomy, including mileage, time and all resource adjustments. */
.stat-card { box-sizing:border-box; gap:6px; width:140px; min-width:0; align-items:center; text-align:center; padding:14px 12px; }
.stat-card>span { font-size:14px; line-height:1.3; }
.stat-card>strong { font-size:30px; line-height:1.2; }
.stat-card>small { color:var(--text-dim); font-size:12px; line-height:1.3; }
.stat-card.neutral { color:var(--text); }
.stat-card.neutral strong { color:var(--text-bright); }
.journal .trail-log .resource-changes { padding:0; margin:16px 0 0; justify-content:flex-start; gap:10px; }
.journal .trail-log .resource-changes>.stat-card { display:flex; flex-direction:column; padding:14px 12px; border:1px solid var(--panel-border); border-radius:5px; background:var(--panel-raised); }
.turn-receipt .resource-changes { justify-content:flex-start; margin:14px 0; gap:10px; }
.journey-icon { width:22px; height:22px; flex:none; display:block; }
.journey-actions>button { display:flex; align-items:center; justify-content:center; gap:8px; }
.leg-summary { min-height:68px; padding:12px 24px; gap:12px 20px; align-items:center; }
.leg-summary .leg-destination { gap:10px; }
.leg-summary .leg-resources { gap:16px; }
.leg-summary .leg-indicator { display:inline-flex; align-items:center; gap:7px; min-height:44px; white-space:nowrap; }
.leg-summary .leg-indicator>span,.leg-summary .leg-indicator>strong,.leg-summary .leg-destination>strong { font-size:13px; line-height:1.3; }
.leg-summary .leg-indicator>.journey-icon { color:var(--accent); }
.weather-details { display:grid; gap:18px; }
.weather-details section { margin:0; padding:0; }
.weather-details h3 { margin:0 0 8px; font:700 13px/1.3 var(--body-font); color:var(--paper-muted); }
.weather-details p { margin:6px 0 0; font-size:13px; line-height:1.45; }
.weather-details .resource-changes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin:0; gap:8px; }
.weather-details .stat-card { width:100%; padding:12px 8px; }
.weather-details .stat-card>span { font-size:12px; }
.weather-details .stat-card>strong { font-size:25px; }
.weather-details .weather-explainer { font-size:12px; color:var(--paper-muted); }
.weather-protection>div { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; font-size:13px; }
.weather-protection>div>strong { margin:0; font-size:13px; }
.gear-carried { color:var(--paper-positive); font-weight:700; }
.gear-missing { color:var(--paper-negative); font-weight:700; }
@media(max-width:700px) {
 .journey-actions>button { gap:5px; }
 .journey-actions .journey-icon { width:19px; height:19px; }
 .leg-summary { padding:8px 12px; gap:0 12px; }
 .leg-summary .leg-destination { flex:1 1 auto; }
 .leg-summary .leg-resources { flex:1 1 100%; justify-content:space-between; gap:8px; }
 .leg-summary .leg-resources>.leg-indicator { display:inline-flex; }
 .leg-summary .leg-indicator>span,.leg-summary .leg-indicator>strong { font-size:12px; }
 .leg-summary .leg-resources>.context-help { margin-inline-start:auto; }
 .stat-card { width:calc((100% - 16px)/2); max-width:160px; }
 .weather-details .resource-changes { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:360px) { .leg-summary .leg-indicator { gap:5px; } .leg-summary .leg-indicator>.journey-icon { width:18px; height:18px; } }
.viewport-help:has(.weather-details) { width:min(440px,calc(100vw - 24px)); padding:20px; }
.turn-receipt .receipt-mark { align-self:start; padding-top:2px; }
.turn-receipt .receipt-mark .journey-icon { width:26px; height:26px; }
.turn-receipt .receipt-heading { display:block; line-height:1.5; }
.turn-receipt .receipt-heading>strong { font-size:15px; }
.turn-receipts { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; padding:0; margin:14px 0; list-style:none; }
.turn-receipts>.turn-receipt { min-width:0; margin:0; }
.scene-caption,.scene-caption h1 { text-shadow:0 0 2px #000,0 0 5px #000,0 2px 9px #000; }
.viewport-help { text-shadow:none; }

/* Keep the completed outcome readable and its exit reachable throughout the screen. */
.outcome-screen .aftermath-panel { display:flex; flex-wrap:wrap; align-items:center; gap:20px 28px; padding:24px; text-align:start; }
.outcome-summary { flex:1 1 320px; min-width:0; }
.outcome-summary #aftermath-title.eyebrow { margin-bottom:8px; }
.outcome-summary .outcome-copy { max-width:70ch; margin:0; font-size:18px; line-height:1.5; text-align:start; }
.outcome-summary .receipt-details { justify-content:flex-start; margin:12px 0 0; }
.outcome-summary .receipt-details>div { justify-content:flex-start; }
.outcome-summary .receipt-details:empty { display:none; }
.outcome-screen .aftermath-panel>.resource-changes { flex:0 1 auto; max-width:100%; justify-content:flex-start; margin:0; gap:12px; }
.outcome-actions { position:relative; display:flex; justify-content:flex-end; padding:12px 24px max(12px,env(safe-area-inset-bottom)); background:var(--panel); border-top:1px solid var(--panel-border); }
.outcome-actions>button { display:flex; justify-content:center; align-items:center; gap:10px; min-width:220px; max-width:100%; min-height:48px; }
.game-shell:has(.outcome-screen)>.game-header { z-index:100; }
@media(max-width:700px) {
 .outcome-screen .aftermath-panel { padding:18px 14px; gap:16px; }
 .outcome-summary .outcome-copy { font-size:16px; }
 .outcome-screen .aftermath-panel>.resource-changes { width:100%; }
 .outcome-actions { padding-inline:14px; }
 .outcome-actions>button { width:100%; min-width:0; }
}
.share-backdrop { position:fixed; inset:0; z-index:1100; background:var(--modal-backdrop); display:grid; place-items:center; padding:24px; }
.share-composer { box-sizing:border-box; width:min(1080px,100%); max-height:calc(100dvh - 48px); overflow:auto; background:var(--panel); border:1px solid var(--button-border); border-radius:10px; padding:24px; box-shadow:0 24px 100px #0008; }
.share-composer>header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:20px; }
.share-composer h2 { margin:4px 0 0; font:700 26px/1.2 var(--title-font); }
.share-composer header .eyebrow { margin:0; }
.share-composer .share-close { min-height:44px; flex:none; }
.share-content { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; }
.share-preview img { display:block; width:100%; height:auto; border:1px solid var(--panel-border); border-radius:5px; }
.share-placeholder { aspect-ratio:1; display:grid; align-content:center; justify-items:center; gap:12px; padding:24px; box-sizing:border-box; border:1px solid var(--panel-border); text-align:center; }
.share-editor { display:flex; flex-direction:column; min-width:0; gap:10px; }
.share-editor>label { font-size:15px; font-weight:700; }
.share-editor textarea { display:block; box-sizing:border-box; width:100%; min-height:190px; resize:vertical; font:14px/1.5 var(--body-font); padding:14px; }
.share-actions { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
.share-actions>button,.share-actions>a { flex:1; min-height:44px; font:700 13px/1.3 var(--body-font); text-align:center; display:flex; align-items:center; justify-content:center; padding:10px 12px; white-space:normal; }
.share-download { color:var(--text-bright); text-decoration:none; background:var(--panel-raised); border:1px solid var(--button-border); border-radius:5px; }
.share-download:hover { background:var(--button-hover); }
.share-status { min-height:1.5em; margin:0; font-size:13px; color:var(--accent); }
.share-platforms { margin-top:auto; padding-top:16px; border-top:1px solid var(--border-subtle); }
.share-platforms h3 { margin:0 0 10px; font-size:14px; }
.share-platforms>div { display:flex; gap:10px; }
.share-platforms a { display:inline-flex; align-items:center; min-height:44px; box-sizing:border-box; border:1px solid var(--button-border); border-radius:5px; padding:8px 18px; color:var(--accent); font-weight:700; }
.share-platforms p { font-size:12px; line-height:1.5; color:var(--text-dim); margin:10px 0 0; }
@media(max-width:700px) { .share-backdrop { padding:12px; } .share-composer { max-height:calc(100dvh - 24px); padding:16px; } .share-content { grid-template-columns:1fr; gap:16px; } .share-composer h2 { font-size:21px; } .share-actions>button,.share-actions>a { flex-basis:40%; } }
.scene-narrative { max-width:76ch; font-size:17px; line-height:1.6; text-align:start; margin:0 0 24px; padding:0; border:0; background:transparent; }
.crew-incident>.scene-narrative { margin-bottom:24px; }

/* Shared pictograms and compact journey settings. */
.help-trigger .info-glyph { font:italic 700 19px/1 Georgia,serif; display:block; }
.hud-journey-settings { display:flex; align-items:center; flex-wrap:wrap; gap:8px 18px; min-width:0; }
.hud-journey-settings .hud-context,.hud-setting { display:inline-flex; align-items:center; gap:7px; margin:0; min-height:28px; font-size:12px; white-space:nowrap; }
.hud-journey-settings .journey-icon { width:20px; height:20px; color:var(--accent); }
.setting-option .setting-title { display:flex; align-items:center; gap:8px; }
.setting-title .journey-icon { color:var(--accent); }

/* Illustrated inventory: stable counts, recognizable equipment and a complete crew. */
.van-inventory { display:grid; gap:24px; }
.van-inventory h2 { font:700 17px/1.4 var(--body-font); margin:0 0 12px; }
.van-inventory .van-overview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:0; margin:0; }
.van-overview .stat-card { display:grid; grid-template-columns:64px minmax(0,1fr); column-gap:14px; align-content:center; justify-items:start; width:auto; max-width:none; text-align:start; padding:14px; }
.van-overview .stat-card-art { grid-row:1/3; width:64px; height:64px; align-self:center; object-fit:contain; image-rendering:pixelated; }
.van-overview .stat-card>span { align-self:end; }
.van-overview .stat-card>strong { align-self:start; }
.van-equipment-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.van-item-grid,.van-crew-grid { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.van-item { display:grid; grid-template-columns:64px minmax(0,1fr) auto; align-items:center; gap:12px; padding:10px 12px; background:var(--panel-raised); border:1px solid var(--border-subtle); border-radius:6px; min-width:0; }
.van-item-art { width:64px; height:64px; object-fit:contain; image-rendering:pixelated; }
.van-item-copy h3,.van-crew-member h3 { margin:0; font:700 15px/1.35 var(--body-font); }
.van-item-copy p,.van-crew-member p { margin:4px 0 0; color:var(--text-dim); font-size:12px; line-height:1.4; }
.van-item-count { font-size:14px; color:var(--positive-text); text-align:end; }
.van-item-missing .van-item-count { color:var(--negative-text); }
.van-item-missing { background:var(--panel-inset); }
.van-crew-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.van-crew-member { display:flex; gap:12px; align-items:center; padding:12px; background:var(--panel-raised); border:1px solid var(--border-subtle); border-radius:6px; min-width:0; }
.van-crew-member img { width:56px; height:64px; object-fit:contain; image-rendering:pixelated; flex:none; }
.van-crew-member h3 { overflow-wrap:anywhere; }
.van-crew-member span { display:block; color:var(--positive-text); font-size:12px; margin-top:5px; }
.van-crew-attention span { color:var(--negative-text); }
html.hc .van-item,html.hc .van-crew-member { color:#fff; background:#000; border-color:#fff; }
@media(max-width:850px) {
 .van-inventory .van-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .van-equipment-grid { grid-template-columns:1fr; gap:20px; }
 .van-crew-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .hud-journey-settings { gap:4px 12px; }
}
@media(max-width:540px) {
 .van-inventory .van-overview { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 .van-overview .stat-card { grid-template-columns:40px minmax(0,1fr); column-gap:8px; padding:10px; }
 .van-overview .stat-card-art { width:40px; height:48px; }
 .van-item { grid-template-columns:52px minmax(0,1fr) auto; gap:10px; padding:9px; }
 .van-item-art { width:52px; height:52px; }
 .van-item-count { font-size:12px; max-width:70px; }
 .van-crew-member { gap:8px; padding:9px; }
 .van-crew-member img { width:40px; height:52px; }
 .van-crew-member h3 { font-size:13px; }
 .van-crew-member p,.van-crew-member span { font-size:12px; }
 .hud-journey-settings .hud-context,.hud-setting { font-size:11px; gap:5px; }
 .hud-journey-settings .journey-icon { width:18px; height:18px; }
}

/* Trail and Journal share compact cards, with narrative first and changes alongside. */
.journal .trail-log { grid-template-columns:minmax(0,1fr); }
.journal .trail-log>.journal-entry { display:block; min-width:0; padding:16px; }
.journal-story,.receipt-body { display:flex; flex-wrap:wrap; align-items:flex-start; gap:14px 24px; }
.journal-narrative,.receipt-narrative { flex:1 1 260px; min-width:0; }
.journal-context { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin-top:8px; color:var(--text-dim); font-size:12px; }
.journal-context>span { display:inline-flex; align-items:center; gap:6px; }
.journal-context .journey-icon { width:16px; height:16px; flex:none; color:var(--accent); }
.journal-story .journal-message { margin:10px 0 0; }
.journal .trail-log .resource-changes,.turn-receipt .resource-changes { flex:0 1 auto; width:max-content; max-width:100%; margin:0; gap:8px; justify-content:flex-start; align-items:stretch; }
.journal .trail-log .resource-changes>.stat-card,.turn-receipt .resource-changes>.stat-card { flex:0 0 110px; width:110px; max-width:none; min-height:108px; padding:10px 8px; gap:4px; }
.journal .stat-card>span,.turn-receipt .stat-card>span { font-size:12px; }
.journal .stat-card>strong,.turn-receipt .stat-card>strong { font-size:24px; }
.journal .stat-card>small,.turn-receipt .stat-card>small { font-size:12px; }
.journal-details { margin:8px 0 0; padding:0; border:0; gap:6px 16px; }
.journal-details>div { display:flex; align-items:baseline; gap:6px; }
.receipt-narrative .receipt-details:empty { display:none; }
@media(max-width:620px) {
 .journal .trail-log { padding:0; }
 .journal .trail-log>.journal-entry { padding:12px; }
 /* Balance the Trail accent border against the Journal border so cards share exact widths. */
 .turn-receipt { display:block; position:relative; padding-block:12px; padding-inline:11px 12px; }
 .turn-receipt .receipt-mark { position:absolute; inset-inline-start:11px; top:12px; }
 .turn-receipt .receipt-narrative { padding-inline-start:34px; }
 .journal-story,.receipt-body { gap:12px; }
 .journal-narrative,.receipt-narrative { flex-basis:100%; }
 .journal .trail-log .resource-changes,.turn-receipt .resource-changes { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(110px,100%),1fr)); width:100%; }
 .journal .trail-log .resource-changes>.stat-card,.turn-receipt .resource-changes>.stat-card { width:auto; min-width:0; min-height:102px; }
 .aftermath-panel .resource-changes>.stat-card>strong { font-size:clamp(17px,4.5vw,22px); white-space:nowrap; }
}

/* One compact lower HUD row; the scene ends directly at the journey controls. */
.conditions-hud .hud-context-row { flex-wrap:wrap; gap:4px 18px; }
.hud-trip-context,.hud-trip-context .leg-resources { display:contents; }
.hud-trip-context .leg-destination,.hud-trip-context .leg-indicator { display:inline-flex; align-items:center; min-height:28px; gap:6px; flex:0 1 auto; margin:0; white-space:nowrap; font-size:12px; line-height:1.3; }
.hud-trip-context .leg-destination small,.hud-trip-context .leg-indicator>span { color:var(--text-dim); font-size:inherit; }
.hud-trip-context .leg-indicator>strong,.hud-trip-context .leg-destination>strong { color:var(--text-bright); font:700 12px/1.3 var(--body-font); }
.hud-trip-context .journey-icon { color:var(--accent); width:20px; height:20px; }
.hud-trip-context .leg-resources>.context-help { margin:0; }
.conditions-hud .hud-conditions { margin-inline-start:auto; }
[data-icon=return] { transform:scaleX(var(--direction-scale,1)); }
[dir=rtl] [data-icon=return] { --direction-scale:-1; }
/* Parked objects share the shoulder, with the near fence painted in front. */
.parked-crew { --standing-height:clamp(50px,10.25vw,132px); position:absolute; inset:0; z-index:1; }
.world-view .scene-road .parked-crew .crew-van { width:34%; left:8%; bottom:10%; }
.standing-crew { position:absolute; left:47%; bottom:15%; width:calc(var(--standing-height) * 2.8); height:calc(var(--standing-height) * 1.5); }
.standing-member { position:absolute; left:calc(var(--standing-height) * var(--crew-x)); bottom:calc(var(--standing-height) * var(--crew-y)); width:calc(var(--standing-height) * .625); height:var(--standing-height); aspect-ratio:320/512; overflow:hidden; transform:scale(var(--crew-scale)) scaleX(var(--crew-facing,1)); transform-origin:center bottom; filter:drop-shadow(0 3px 2px #0008); }
.standing-member:nth-child(1) { --crew-x:.48; --crew-y:.42; --crew-scale:.92; z-index:1; }
.standing-member:nth-child(2) { --crew-x:1.62; --crew-y:.40; --crew-scale:.90; --crew-facing:-1; z-index:1; }
.standing-member:nth-child(3) { --crew-x:0; --crew-y:.18; --crew-scale:1; z-index:2; }
.standing-member:nth-child(4) { --crew-x:2.12; --crew-y:.15; --crew-scale:.98; --crew-facing:-1; z-index:2; }
.standing-member:nth-child(5) { --crew-x:.72; --crew-y:0; --crew-scale:1.04; z-index:3; }
.standing-member:nth-child(6) { --crew-x:1.55; --crew-y:0; --crew-scale:1.04; --crew-facing:-1; z-index:3; }
.road-foreground { position:absolute; inset:0; z-index:2; pointer-events:none; }
/* Follow the shared road artwork's verge and tall posts before responsive cropping. */
.road-foreground .scene-background { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1536 1024'%3E%3Cpath fill='white' d='M0 852H1536V1024H0Z'/%3E%3C/svg%3E"); mask-size:cover; mask-position:center 84%; mask-repeat:no-repeat; }
.journey-scene:is([data-scene=open-pacific-northwest],[data-scene=open-california-hills],[data-scene=open-rustbelt-lakeside],[data-scene=open-heartland-orchard],[data-scene=open-appalachian-ridge],[data-scene=open-heartland-prairie],[data-scene=open-beltway-suburbs]) .road-foreground .scene-background { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1536 1024'%3E%3Cpath fill='white' d='M0 852H1536V1024H0Z M241 829L252 816H279L290 829V852H241Z M1026 829L1039 816H1063L1075 829V852H1026Z'/%3E%3C/svg%3E"); }
.journey-scene[data-scene=open-rustbelt-foundry] .road-foreground .scene-background { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1536 1024'%3E%3Cpath fill='white' d='M0 852H1536V1024H0Z M242 831L254 820H278L289 831V852H242Z M1021 831L1032 819H1055L1067 831V852H1021Z'/%3E%3C/svg%3E"); }
.journey-scene[data-scene=open-beltway-parkway] .road-foreground .scene-background { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1536 1024'%3E%3Cpath fill='white' d='M0 852H1536V1024H0Z M239 837L251 824H278L289 837V852H239Z M1027 851L1039 839H1063L1075 851V852H1027Z'/%3E%3C/svg%3E"); }
.scene-road .scene-light,.scene-road .weather-atmosphere { z-index:3; }
.parked-crew .crew-van::before { content:""; position:absolute; left:10%; right:8%; bottom:7%; height:5%; background:#07151988; border-radius:50%; filter:blur(3px); }
@media(max-width:700px) {
 .conditions-hud .hud-context-row { gap:2px 12px; }
 .hud-trip-context .leg-destination,.hud-trip-context .leg-indicator { font-size:11px; }
 .hud-trip-context .leg-indicator>strong,.hud-trip-context .leg-destination>strong { font-size:11px; }
 .hud-trip-context .journey-icon { width:18px; height:18px; }
 .world-view .scene-road .parked-crew .crew-van { width:40%; left:1%; bottom:12%; }
 .parked-crew { --standing-height:clamp(43px,13vw,64px); }
 .standing-crew { left:47%; bottom:17%; }
}


/* One Journal card per persisted day; original actions stay inside its disclosure. */
.journal .journal-day .journal-story { align-items:flex-start; }
.journal .journal-day .journal-narrative { flex:1 1 280px; }
.journal .journal-events,.journal .journal-raw-list { display:grid; gap:10px; margin:12px 0 0; padding:0; list-style:none; }
.journal .trail-log .journal-event { display:grid; grid-template-columns:20px minmax(0,1fr); align-items:start; gap:8px; margin:0; padding:0; border:0; border-radius:0; background:transparent; }
.journal .journal-event>.journey-icon { width:20px; height:20px; margin-top:1px; color:var(--accent); }
.journal .journal-event-copy { min-width:0; }
.journal .journal-event-copy .journal-event-heading { margin:0; color:var(--text); font-size:13px; line-height:1.45; overflow-wrap:anywhere; }
.journal .journal-event-context { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; margin-top:3px; color:var(--text-dim); font-size:12px; line-height:1.5; font-variant-numeric:tabular-nums; }
.journal .journal-event-context>span { display:inline-flex; align-items:center; gap:5px; }
.journal .journal-event-context .journey-icon { width:15px; height:15px; flex:none; color:var(--accent); }
.journal .journal-event .journal-details { margin-top:4px; }
.journal .journal-raw { margin-top:10px; }
.journal .journal-raw>summary { width:max-content; max-width:100%; min-height:36px; padding:8px 2px; cursor:pointer; color:var(--accent); font-size:12px; line-height:20px; }
.journal .journal-raw>summary>span { display:inline-block; min-width:1.6em; margin-inline-start:8px; padding:0 5px; border-radius:4px; background:var(--panel-inset); color:var(--text-dim); text-align:center; font-variant-numeric:tabular-nums; }
.journal .journal-raw>summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:3px; }
.journal .journal-raw-list { margin-top:4px; gap:12px; }
.journal .trail-log .journal-raw-entry { display:flex; flex-wrap:wrap; align-items:flex-start; gap:12px 20px; margin:0; padding:12px 0 0; border:0; border-top:1px solid var(--border-subtle); background:transparent; }
.journal .journal-raw-story { flex:1 1 260px; min-width:0; }
.journal .journal-raw-story h4 { display:flex; align-items:flex-start; gap:8px; margin:0; color:var(--text-bright); font:700 13px/1.45 var(--body-font); }
.journal .journal-raw-story h4>.journey-icon { width:19px; height:19px; flex:none; color:var(--accent); }
.journal .journal-raw-story .journal-raw-message { margin:5px 0 0; color:var(--text); font-size:12px; line-height:1.5; }
.journal .journal-raw-story .journal-place { margin:4px 0 0; color:var(--text-dim); font-size:11px; }
html.hc .journal .journal-event-heading,html.hc .journal .journal-event-context,html.hc .journal .journal-raw-story h4,html.hc .journal .journal-raw-story .journal-raw-message,html.hc .journal .journal-raw>summary { color:inherit; }
@media(max-width:620px) {
 .journal .journal-day .journal-narrative,.journal .journal-raw-story { flex-basis:100%; }
 .journal .journal-events { gap:12px; }
 .journal .journal-raw>summary { min-height:44px; padding-block:12px; }
}

/* Impact help uses the same readable layout, including narrow visual viewports. */
.viewport-help { overscroll-behavior:contain; scrollbar-gutter:stable; overflow-wrap:anywhere; padding:16px; gap:12px; }
.viewport-help .help-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0; }
.viewport-help .help-heading>strong { min-width:0; font-size:16px; line-height:1.35; }
.viewport-help .help-dismiss { display:inline-flex; align-items:center; justify-content:center; flex:0 0 36px; width:36px; height:36px; min-width:36px; min-height:36px; padding:7px; margin:0; border:1px solid var(--paper-border); border-radius:6px; background:transparent; color:var(--paper-ink); box-shadow:none; }
.viewport-help .help-dismiss svg { width:20px; height:20px; }
.viewport-help .help-dismiss:focus-visible { outline:3px solid var(--paper-ink); outline-offset:2px; }
.viewport-help .help-dismiss:hover:not(:disabled) { background:var(--paper-ink); border-color:var(--paper-ink); color:var(--paper); }
.viewport-help a { color:var(--paper-ink); font-weight:700; text-decoration:underline; text-underline-offset:3px; }
.viewport-help a:hover { color:var(--paper-muted); }
.viewport-help a:focus-visible { outline-color:var(--paper-ink); }
.viewport-help:has(.impact-details) { width:min(440px,calc(100vw - 24px)); padding:16px; }
.impact-details { display:grid; gap:14px; }
.impact-details section { min-width:0; margin:0; padding:0; }
.impact-details h3 { margin:0 0 7px; color:var(--paper-muted); font:700 13px/1.4 var(--body-font); }
.impact-details p { margin:4px 0 0; font-size:13px; line-height:1.45; }
.impact-details .resource-changes { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(110px,100%),1fr)); gap:8px; margin:0; padding:0; }
.impact-details .resource-changes>.stat-card { width:auto; max-width:none; min-width:0; min-height:0; padding:10px; gap:4px; }
.impact-details .stat-card>span { font-size:12px; line-height:1.3; }
.impact-details .stat-card>strong { font-size:24px; line-height:1.2; }
.impact-details .stat-card>small { font-size:12px; line-height:1.4; }
.impact-protected { color:var(--paper-positive); font-weight:700; }
.effect-schedule { display:grid; gap:10px; margin:0; padding-top:12px; border-top:1px solid var(--paper-border); }
.effect-schedule>div { display:grid; grid-template-columns:minmax(85px,1fr) minmax(0,2fr); align-items:baseline; gap:12px; font-size:13px; line-height:1.45; }
.effect-schedule dt { color:var(--paper-muted); font-weight:700; }
.effect-schedule dd { margin:0; }
@media(max-width:700px) {
 .viewport-help .help-dismiss { flex-basis:40px; width:40px; height:40px; min-width:40px; min-height:40px; }
 .viewport-help,.viewport-help:has(.impact-details) { padding:14px; }
}

/* Compact readouts; impact details live in the associated information panels. */
.resource-hud .critical-stats { grid-template-columns:repeat(7,minmax(0,1fr)); gap:0; }
.resource-hud .hud-stat { grid-column:auto; border:0; border-inline-start:1px solid var(--border-muted); padding:2px 8px; }
.resource-hud .hud-stat:first-child { border-inline-start:0; }
.resource-hud .hud-stat dt { min-height:20px; line-height:1.25; }
.conditions-hud .hud-context-row { justify-content:flex-start; }
.hud-primary-row,.hud-dynamic-row { display:contents; }
.conditions-hud .hud-journey-settings .hud-context { max-width:none; }
.conditions-hud .hud-conditions { margin-inline-start:auto; justify-content:flex-end; gap:8px; }
.conditions-hud .weather-indicator { display:flex; flex-wrap:nowrap; align-items:center; gap:8px; text-align:start; }
.conditions-hud .weather-name { font-size:12px; line-height:1.3; }
.conditions-hud .weather-indicator .context-help { margin:0; }
.conditions-hud .leg-cash,.conditions-hud .leg-vehicle { gap:6px; }
.resource-hud .hud-stat dd { font-weight:700; }
.conditions-hud .game-clock,.conditions-hud .weather-name,.conditions-hud .leg-indicator>strong,.conditions-hud .leg-destination>strong { font-weight:600; }
.conditions-hud .hud-trip-context .leg-resources { gap:12px; }
@media(min-width:801px) {
 /* One spacing rhythm, without an empty stop for a disabled optional tip. */
 .conditions-hud .hud-journey-settings { display:contents; }
 .conditions-hud .hud-trip-context .leg-resources>.context-help-hidden { display:none; }
}
@media(max-width:800px) {
 .world-view>.resource-hud { padding:6px 10px; }
 .resource-hud .critical-stats { grid-template-columns:repeat(12,minmax(0,1fr)); row-gap:4px; }
 .resource-hud .hud-stat { grid-column:span 3; padding:2px 4px; }
 .resource-hud .hud-stat:nth-child(n+5) { grid-column:span 4; padding-top:4px; border-block-start:1px solid var(--border-muted); }
 .resource-hud .hud-stat:nth-child(5) { border-inline-start:0; }
 .resource-hud .hud-stat dt { min-height:18px; font-size:11px; gap:2px; }
 .resource-hud .hud-stat dd { font-size:20px; line-height:1.1; margin:2px 0 0; }
 .resource-hud .hud-stat .help-trigger { width:18px; min-width:18px; height:18px; min-height:18px; }
 .conditions-hud .hud-context-row { display:flex; flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:4px; margin:0; padding:0; }
 .conditions-hud .hud-journey-settings,.conditions-hud .hud-trip-context,.conditions-hud .hud-trip-context .leg-resources,.conditions-hud .hud-conditions { display:contents; }
 .conditions-hud .hud-primary-row { width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; }
 .conditions-hud .hud-primary-row .hud-context,.conditions-hud .hud-primary-row .leg-indicator { flex:none; }
 .conditions-hud .hud-setting { min-width:0; flex:0 1 auto; }
 .conditions-hud .hud-setting-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
 .conditions-hud .leg-cash { margin-inline-start:auto; }
 .conditions-hud .hud-journey-settings .hud-context,.conditions-hud .hud-setting,.conditions-hud .hud-trip-context .leg-indicator,.conditions-hud .hud-trip-context .leg-indicator>strong,.conditions-hud .hud-trip-context .leg-destination,.conditions-hud .hud-trip-context .leg-destination>strong { min-height:26px; font-size:12px; line-height:1.3; gap:5px; }
 .conditions-hud .hud-trip-context .leg-indicator>strong,.conditions-hud .hud-trip-context .leg-destination>strong { min-height:0; }
 .conditions-hud .hud-dynamic-row { width:100%; display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; min-width:0; }
 .conditions-hud .hud-trip-context .leg-destination { flex:1 1 auto; min-width:0; white-space:normal; flex-wrap:wrap; gap:3px 5px; }
 .conditions-hud .weather-indicator { flex:0 1 auto; min-width:0; max-width:100%; margin-inline-start:auto; }
 .conditions-hud .journey-icon,.conditions-hud .weather-icon { width:18px; height:18px; flex:none; }
 .conditions-hud .weather-name { gap:5px; min-width:0; white-space:normal; }
 .conditions-hud .weather-name strong { overflow-wrap:anywhere; }
 .conditions-hud .weather-indicator .context-help { flex:none; }
 .conditions-hud .context-help .help-trigger { display:grid; place-items:center; width:24px; min-width:24px; height:24px; min-height:24px; padding:0; }
}

@media(max-width:420px) {
 .conditions-hud .hud-primary-row { gap:6px; }
 .conditions-hud .hud-journey-settings .hud-context,.conditions-hud .hud-setting,.conditions-hud .hud-trip-context .leg-indicator,.conditions-hud .hud-trip-context .leg-indicator>strong { font-size:11px; gap:4px; }
 .conditions-hud .hud-journey-settings .journey-icon,.conditions-hud .leg-indicator .journey-icon { width:16px; height:16px; }
}

/* Source explanations retain their date, evidence and satire context as separate lines. */
.viewport-help .source-explanation { display:grid; gap:12px; }
.viewport-help .source-explanation p { margin:0; }
.viewport-help .source-explanation time { color:var(--paper-muted); font-size:13px; font-weight:700; }
.viewport-help .source-note { color:var(--paper-muted); font-size:13px; border-top:1px solid var(--paper-border); padding-top:10px; }

/* Keep dismissal reachable while long explanations scroll on short phones. */
.viewport-help .help-heading { position:sticky; top:0; z-index:1; background:inherit; padding-bottom:6px; }

/* A single daily event shares the time and settings already shown in its header. */
.journal .journal-events > .journal-event:only-child .journal-event-context { display:none; }

/* Preserve the writers’ paragraph breaks in the shared encounter narrative. */
.encounter-desc p { white-space: pre-line; }

/* Long names and translated copy keep their space on small phones. */
.store-card-body { min-width:0; overflow-wrap:anywhere; }
.store-cart-summary>div:first-child dd { direction:ltr; unicode-bidi:isolate; text-align:start; }
.store-cart-summary:dir(rtl)>div:first-child dd { text-align:right; }
@media(max-width:480px) {
 .crew-name-card { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto; gap:8px; }
 .crew-name-card .crew-portrait-slot { grid-column:1; grid-row:1; justify-self:center; }
 .crew-name-card label { grid-column:1; grid-row:2; min-width:0; font-size:13px; text-align:center; overflow-wrap:anywhere; }
 .crew-name-card input { grid-column:1; grid-row:3; font-size:16px; }
}

/* Required decisions precede optional detail; the tabs keep their stored selection. */
.journey-reference>.encounter-panel { border-block-end:1px solid var(--border-subtle); }
.journey-reference>.encounter-panel+.travel-controls { padding-block-start:20px; }
.encounter-panel .encounter-desc { max-width:78ch; }
@media(max-width:700px) {
 .journey-controls .travel-tabs button { min-height:44px; font-size:13px; }
 .journey-actions>button { font-size:12px; min-height:44px; }
 .setting-option strong { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; max-width:100%; overflow-wrap:anywhere; }
 .setting-option small { font-size:12px; line-height:1.45; }
 .setting-option:disabled { opacity:1; }
 .encounter-panel { padding:20px 16px; }
 .encounter-panel .encounter-desc { font-size:15px; line-height:1.55; }
 .encounter-panel .panel-footer { gap:10px; margin-top:18px; }
 .encounter-panel .action-button { font-size:15px; }
 .encounter-panel .action-detail { font-size:13px; }
}

/* A compact save manager keeps essential actions and dismissal within reach. */
.save-manager { z-index:150; padding:16px; }
.save-manager .drawer-body { width:min(620px,100%); max-height:calc(100dvh - 32px); padding:0; box-sizing:border-box; display:flex; flex-direction:column; overflow:hidden; border-radius:12px; box-shadow:0 24px 72px #0009; }
.save-manager-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 24px; flex:none; }
.save-manager-header h2 { display:flex; align-items:center; gap:12px; font-size:24px; line-height:1.25; margin:0; }
.save-manager-header h2>.journey-icon { width:26px; height:26px; color:var(--accent); }
.save-manager .save-close { display:grid; place-items:center; flex:none; width:40px; min-width:40px; height:40px; min-height:40px; padding:8px; border-radius:8px; }
.save-manager-content { padding:0 24px 24px; overflow:auto; min-height:0; overscroll-behavior:contain; }
.save-section { padding:16px; margin:0 0 14px; background:var(--panel-raised); border:1px solid var(--panel-border); border-radius:8px; }
.save-section h3 { font-size:16px; line-height:1.3; margin:0 0 4px; }
.save-section>p { font-size:13px; line-height:1.5; color:var(--text-dim); margin:0 0 14px; }
.save-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.save-manager .save-action { display:flex; align-items:center; justify-content:center; gap:9px; min-width:0; min-height:48px; padding:11px 12px; font-size:14px; line-height:1.3; border-radius:7px; }
.save-action>.journey-icon { width:21px; height:21px; flex:none; }
.save-action>span { min-width:0; overflow-wrap:anywhere; }
.save-file-input { display:none; }
.save-text-backup { border:1px solid var(--panel-border); border-radius:8px; }
.save-text-backup>summary { cursor:pointer; padding:13px 16px; color:var(--text-dim); font-size:13px; line-height:1.4; }
.save-text-backup[open]>summary { color:var(--text-bright); }
.save-text-content { display:grid; gap:10px; padding:0 16px 16px; }
.save-text-content>label { font-size:13px; }
.save-manager .save-copy { justify-self:start; min-height:40px; font-size:13px; }
.save-manager textarea { box-sizing:border-box; min-height:90px; max-height:180px; resize:vertical; padding:10px; border-radius:6px; font-size:12px; }
.save-manager .save-notice { margin:14px 0 0; padding:10px 12px; font-size:13px; line-height:1.45; background:var(--panel-selected); border-inline-start:3px solid var(--accent); border-radius:4px; }
@media(max-width:480px) {
 .save-manager { padding:10px; }
 .save-manager .drawer-body { max-height:calc(100dvh - 20px); }
 .save-manager-header { padding:16px; gap:10px; }
 .save-manager-header h2 { font-size:21px; gap:9px; }
 .save-manager-content { padding:0 14px 14px; }
 .save-section { padding:12px; margin-bottom:12px; }
 .save-section>p { margin-bottom:12px; }
 .save-actions { gap:8px; }
 .save-manager .save-action { gap:7px; padding:10px 8px; font-size:13px; }
}

/* Crossing layers share a fixed camera; van placement scales with the scene. */
.world-view .journey-scene[data-scene="crossing"] .crew-van { width:44%; left:4%; bottom:15%; }
/* Keep ending captions above the road's foreground and lighting layers. */
.result-art .scene-road .result-art-caption { z-index:4; }

/* Localized text must wrap within its own control, not merely the viewport. */
html { hyphens:auto; overflow-wrap:anywhere; word-break:normal; }
button { hyphens:auto; overflow-wrap:anywhere; }
.journey-actions>button>span:not(.switch-track) { min-width:0; white-space:normal; hyphens:auto; overflow-wrap:anywhere; }
.journey-actions>button>.journey-icon,.journey-actions>button>.switch-track { flex-shrink:0; }
