:root{color-scheme:light;--page:#eef0e7;--paper:#f9faf3;--ink:#283f3b;--muted:#65796f;--line:#bac8b6;--green:#376552;--soft:#e0e7d9;--warn:#8a4b2c;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--page)}*{box-sizing:border-box}body{margin:0;padding:0 max(24px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(24px,env(safe-area-inset-left));min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}button,select,input{font:inherit}button,a,select,summary,.file-button{-webkit-tap-highlight-color:transparent}button,select,.file-button{min-height:44px;border:1px solid #8fa791;border-radius:11px;padding:10px 15px;background:var(--paper);color:var(--ink)}button{cursor:pointer}button:hover:not(:disabled),.file-button:hover{background:#e1e9dc}button:disabled{opacity:.48;cursor:default}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible,.file-button:focus-within{outline:3px solid #ad682d;outline-offset:3px}button.primary{background:var(--green);border-color:var(--green);color:white;font-weight:700;min-height:50px;width:100%;font-size:1.05rem}button.primary:hover:not(:disabled){background:#294e3e}button.text-button{background:transparent;border-color:transparent;padding:8px 5px;text-decoration:underline;text-underline-offset:4px;font-size:.9rem}button.text-button:hover:not(:disabled){background:var(--soft)}[hidden]{display:none!important}h1,h2,h3,p{margin-top:0}p{line-height:1.6}#game{width:100%;max-width:1600px;margin:0 auto;flex:1;display:grid;grid-template-columns:minmax(0,1fr) clamp(260px,21vw,300px);gap:20px;align-items:start;align-content:center;padding:12px 0}#game.scaled{max-width:none;grid-template-columns:max-content 280px;gap:16px;justify-content:center}#game.scaled .dispatch-panel{margin-bottom:-300px}.scene-wrap.s1,.scene-wrap.s2,.scene-wrap.s3{width:max-content;padding:5px}.scene-wrap.s1 canvas{width:768px;height:448px}.scene-wrap.s2 canvas{width:1536px;height:896px}.scene-wrap.s3 canvas{width:2304px;height:1344px}.railway,.dispatch-panel{min-width:0}.stage-heading{min-height:44px;display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:8px}.stage-heading h2{font-size:1.2rem;margin:5px 0 0;line-height:1.3}.eyebrow{font-size:.68rem;text-transform:uppercase;letter-spacing:.12em;color:var(--muted)}.stage-tools{display:flex;gap:12px;align-items:center;flex-shrink:0}.stage-tools button{padding:8px 12px;font-size:.8rem;min-height:44px}#delivery-count{font-size:.84rem;white-space:nowrap}.scene-wrap{border:1px solid #a8baa5;border-radius:18px;padding:9px;background:#d7e0d1;overflow:hidden;line-height:0}canvas{width:100%;height:auto;display:block;aspect-ratio:12/7;border-radius:9px;image-rendering:pixelated;touch-action:manipulation}.scene-caption{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-top:4px;color:var(--muted);font-size:.85rem}.scene-caption p{margin:0;padding:6px 0}.scene-caption button{flex-shrink:0}.caption-actions{display:flex;gap:10px;flex-shrink:0;flex-wrap:wrap}.dispatch-panel{margin-top:60px;border:1px solid var(--line);border-radius:18px;background:var(--paper);padding:20px}.job-heading{display:flex;gap:15px;justify-content:space-between}.job-heading h2{font-size:1.5rem;line-height:1.15;margin:7px 0}.job-heading p{font-size:.86rem;color:var(--muted);margin-bottom:8px}#job-mark{align-self:center;font-size:1.9rem}#route-description{font-size:.83rem;margin:7px 0;color:var(--muted)}#message:empty{display:none}#message{font-size:.85rem;margin:8px 0 14px;min-height:1.5em;color:var(--warn)}.switches{display:grid;gap:12px;margin-top:20px}.switch-card{border:0;margin:0;padding:0;min-width:0}.switch-card legend{font-size:.82rem;font-weight:650;margin-bottom:6px;display:block;width:100%}.switch-card legend span{float:right;color:var(--muted);font-size:.75rem;font-weight:400}.switch-options{display:grid;grid-template-columns:1fr 1fr;gap:6px}.switch-options button{font-size:.78rem;min-height:44px;padding:8px 4px;line-height:1.25}.switch-options button[aria-pressed="true"]{background:var(--soft);border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green);font-weight:700}.switch-card.selected legend{color:#995b25}.secondary-actions{display:flex;align-items:center;gap:8px;margin-top:16px}.secondary-actions button.primary{flex:1;min-width:0;width:auto}.secondary-actions .text-button{flex-shrink:0;min-height:44px}#result-details{margin-top:15px;font-size:.9rem;text-align:center;line-height:1.8}#result-details strong{font-size:1.65rem;display:block;letter-spacing:.1em;color:#927230}#storage-notice{max-width:1600px;margin:12px auto}.save-line{display:flex;justify-content:space-between;gap:10px;font-size:.75rem;color:var(--muted);border-top:1px solid var(--line);padding-top:12px}#game-feedback{margin:18px 0 0!important;width:100%!important;max-width:none!important}#game-feedback summary{min-height:44px;display:flex;align-items:center}#storage-notice{padding:15px 18px;background:#fff0d9;border:1px solid #b59465;border-radius:14px}#storage-notice p{margin-bottom:10px}#storage-notice>div{display:flex;gap:8px;flex-wrap:wrap}dialog{background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:20px;width:min(580px,calc(100% - 28px));max-height:calc(100dvh - 32px);padding:22px;overflow:auto;overscroll-behavior:contain}dialog::backdrop{background:#273c3394;backdrop-filter:blur(3px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:18px}.dialog-heading h2{font-size:1.3rem;margin:0;overflow-wrap:anywhere}.dialog-heading button{font-size:.8rem;flex-shrink:0}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}#confirm-message{font-size:1.15rem;line-height:1.5}#level-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:20px 0}#level-list button{padding:13px 9px;text-align:left;display:flex;flex-direction:column;gap:7px;font-size:.83rem;line-height:1.35}#level-list button span{color:var(--muted);font-size:.75rem}#level-list button[aria-current="true"]{border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}#level-list button strong{font-size:1.15rem}.muted{color:var(--muted);font-size:.86rem}.help-steps{padding-left:23px;line-height:1.65}.help-steps li{padding:0 0 12px 5px}.check{display:flex;align-items:center;gap:10px;margin:20px 0}.check input{width:20px;height:20px;flex-shrink:0;accent-color:var(--green)}.save-details{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:14px 0}.save-details summary{cursor:pointer;padding:6px 0}.save-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:15px 0}.save-actions button,.file-button{font-size:.82rem;text-align:center;display:flex;align-items:center;justify-content:center}.file-button{position:relative;overflow:hidden;cursor:pointer}.file-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}#settings-message{color:var(--warn);font-size:.85rem}#settings-message:empty{display:none}.game-expanded #game{max-width:1800px}
@media(max-width:1060px){#game{grid-template-columns:minmax(0,1fr) 270px;gap:18px}.dispatch-panel{padding:16px}.stage-heading{flex-wrap:wrap}}
@media(max-width:760px){body{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}#game{display:flex;flex-direction:column;align-items:stretch;align-content:normal;gap:6px;padding:6px 0 8px;max-width:760px}.stage-heading{min-height:44px;margin-bottom:0;flex-wrap:nowrap}.stage-heading h2{font-size:1rem;margin-top:2px}.eyebrow{font-size:.6rem}.stage-tools{gap:8px}#delivery-count{font-size:.75rem}.scene-wrap{padding:4px;border-radius:12px}.scene-caption{display:none}.dispatch-panel{margin-top:auto;padding:10px 10px 12px}.job-heading>div{display:grid;grid-template-columns:1fr auto;align-items:center;gap:0 8px;width:100%}.job-heading h2{font-size:1.15rem;margin:0;grid-column:2;grid-row:1;text-align:right}.job-heading .eyebrow{font-size:.6rem}.job-heading p{grid-column:1/-1;font-size:.78rem;margin:2px 0}#job-mark{display:none}#route-description{margin:4px 0;font-size:.78rem;line-height:1.4}#message{margin:4px 0 6px;font-size:.8rem;line-height:1.4;min-height:0}#job-description{margin:2px 0}.switches{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:8px}.switch-options{grid-template-columns:1fr}.switch-card legend{font-size:.72rem;min-height:30px;line-height:1.25;margin-bottom:4px}.switch-card legend span{display:block;float:none;font-size:.66rem}.switch-options button{font-size:.75rem;min-height:44px}.secondary-actions{margin-top:8px}.save-actions{grid-template-columns:1fr 1fr}dialog{padding:18px}#level-list{gap:8px}}
@media(max-width:360px){body{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}.stage-tools{gap:5px}.stage-heading h2{font-size:.95rem}.eyebrow{font-size:.58rem;letter-spacing:.08em}#delivery-count{font-size:.7rem}.switches{gap:6px}.switch-card legend{font-size:.66rem}.switch-options button{font-size:.68rem;padding:6px 3px}#level-list{grid-template-columns:1fr 1fr}.save-actions{grid-template-columns:1fr}dialog{padding:16px}}
@media(orientation:landscape) and (max-height:600px) and (max-width:1060px){body{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}#game{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:14px;align-content:start;padding:6px 0}.stage-heading{margin-bottom:4px;min-height:44px}.stage-heading h2{font-size:.9rem}.scene-wrap{width:min(100%,calc((100dvh - 140px)*12/7));margin-inline:auto}.scene-caption{display:none}.dispatch-panel{margin:0;padding:10px;max-height:calc(100dvh - 60px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.job-heading h2{font-size:1.05rem}.job-heading p{font-size:.75rem}#route-description{font-size:.73rem}#message{font-size:.72rem;margin:4px 0}.switches{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:8px}.switch-options{grid-template-columns:1fr}.switch-options button{font-size:.67rem;min-height:44px}.switch-card legend{font-size:.65rem;min-height:29px}.switch-card legend span{float:none;display:block;font-size:.6rem}.secondary-actions{margin-top:6px}}
