/* A finite adventure, presented as a game board rather than a task list. */
/* 2026-10-19 responsive audit: CSS px targets are a web design choice,
   informed by Apple 44pt / Android 48dp, not a native-device certification. */
/* Director pass: a visible decision, an explicit commit, then a readable payoff. */
/* Coordinates inside #journey-shell are relative to the safe screen rectangle.
   Dialogs share that rectangle; do not center them on the raw, asymmetric screen. */
#j-delivery-reaction{position:absolute;top:36%;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:7px;padding:9px 14px;background:#fff6d6ed;border:2px solid #b7a060;border-radius:18px;box-shadow:0 4px 0 #a2915433;opacity:0;pointer-events:none;color:#59613d;white-space:nowrap;font-size:12px}#j-delivery-reaction>.pictogram{width:28px;height:28px}#j-delivery-reaction>b{font-size:17px}#j-delivery-reaction.show{animation:j-delivery 1.6s ease-out both}.j-first-action{outline:3px solid #e3bc59;outline-offset:3px;animation:j-first 1.5s 3}.j-orders:has(>span:nth-child(4))>span{font-size:9px;padding:5px 4px;gap:3px}.j-orders:has(>span:nth-child(4)) .pictogram{width:17px;height:17px}
@keyframes j-delivery{0%{opacity:0;translate:0 8px}15%,72%{opacity:1;translate:0 0}100%{opacity:0;translate:0 -8px}}@keyframes j-first{50%{outline-color:#fff0a0}}
@media(orientation:landscape){#j-delivery-reaction{left:calc((100% - 310px)/2);top:44%;font-size:11px}.j-orders:has(>span:nth-child(4))>span{font-size:8px;padding:4px 3px;gap:2px}.j-orders:has(>span:nth-child(4)) .pictogram{width:15px;height:15px}}
@media(prefers-reduced-motion:reduce){.j-first-action{animation:none!important}#j-delivery-reaction.show{animation:j-delivery-still 1.6s both}@keyframes j-delivery-still{0%,85%{opacity:1}100%{opacity:0}}}
dialog[data-kind^="journey-"]{width:min(560px,calc(var(--safe-width) - 24px));max-width:none;height:min(780px,calc(var(--safe-height) - 24px));max-height:calc(var(--safe-height) - 24px);padding:20px;border:3px solid #7e9a7f;border-radius:30px;background:#fffbed;color:#355c50;overflow:auto;box-sizing:border-box}
dialog[data-kind^="journey-"] #dialog-content{height:100%;min-height:0;display:block;overflow:visible;padding:0;box-sizing:border-box}
dialog[data-kind^="journey-"] .dialog-footer{display:none}dialog[data-kind^="journey-"] #dialog-x{right:11px;top:11px;width:36px;height:36px;z-index:3;background:#edf1d9}
dialog[data-kind^="journey-"] h2{font-size:25px;line-height:1.25;margin:5px 0 12px}dialog[data-kind^="journey-"] h3{font-size:20px;line-height:1.3;margin:4px 0}
dialog[data-kind^="journey-"] button{font-family:inherit;touch-action:manipulation}dialog[data-kind^="journey-"] button:disabled{opacity:.45;filter:saturate(.4)}
.j-map-head{display:flex;align-items:center;justify-content:space-between;padding-right:40px;min-height:50px}.j-map-head small{font-size:10px;letter-spacing:.08em}.j-map-head h2{margin:2px 0!important}.j-map-head>strong{display:flex;align-items:center;gap:5px;font-size:22px}.j-map-head>strong>.pictogram{width:27px;height:27px}.j-map-head>strong>small{font-size:11px;letter-spacing:0}
.j-chapter{display:flex;align-items:center;justify-content:space-between;text-align:center;margin-top:13px}.j-chapter>div>small{font-size:11px}.j-chapter>button{width:44px;height:44px;border-radius:16px;border:2px solid #c6d3b5;background:#edf1d9;color:#456c5b;font-size:27px;line-height:1}.j-chapter h3{font-size:22px!important}
.j-map-scene{position:relative;height:210px;background:radial-gradient(ellipse at center,#e9f0d6,transparent 70%);margin:0 -10px}.j-island-art{width:100%;height:100%;filter:drop-shadow(0 10px 8px #6d8a6022)}.j-chapter-icon{position:absolute;left:42%;top:32%;width:62px;height:62px;display:grid;place-items:center;background:#fff6cf;border:3px solid var(--chapter);border-radius:22px;box-shadow:0 5px 0 #9aaf7944;transform:rotate(-7deg)}.j-chapter-icon>.pictogram{width:43px;height:43px}.j-map-scene>p{position:absolute;bottom:3px;left:0;right:0;text-align:center;font-size:12px;font-weight:750;margin:0;background:#fffbeda8;border-radius:12px;padding:5px}
.j-jobs{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:8px}.j-job{display:grid;grid-template-columns:32px 1fr;grid-template-rows:1fr auto;position:relative;min-height:92px;background:#f4f2dc;border:2px solid #c3d0ae;box-shadow:0 4px 0 #b3c39b;border-radius:19px;text-align:left;padding:11px 9px;align-items:center;color:#365d4f;gap:5px 8px}.j-job>.pictogram{width:32px;height:32px;grid-row:1/3}.j-job>b{font-size:12px;line-height:1.35}.j-job.done{background:#e9f1d8;border-color:#86ac88}.j-job-number{position:absolute;left:5px;top:-9px;border-radius:9px;background:#fff7d6;border:1px solid #d1bb7e;font-size:10px;min-width:20px;text-align:center}.j-stars{display:inline-flex;gap:4px;align-items:center;justify-content:center}.j-stars>span{display:inline-flex;opacity:.24;filter:grayscale(1)}.j-stars>span.earned{opacity:1;filter:none}.j-stars .pictogram{width:19px;height:19px}.j-job>.j-stars{justify-content:flex-start}
.j-map-foot>p{text-align:center;font-size:11px;margin:15px 0 10px}.j-menu-buttons{display:flex;gap:7px}.j-menu-buttons>button{flex:1;min-width:0;background:#e6eed5;border:1px solid #a4bd96;border-radius:15px;padding:10px 4px;font-size:11px;font-weight:800;color:#365d4f;display:flex;align-items:center;justify-content:center;gap:4px;min-height:45px}.j-menu-buttons .pictogram{width:23px;height:23px}.j-map-bottom{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:10px;font-size:10px}.j-map-bottom button{border:0;background:none;color:#52705b;font-size:10px;min-height:38px}.j-map-bottom button.j-resume{background:#f8d278;border:1px solid #cba656;border-radius:13px;padding:7px 12px;font-size:12px;font-weight:800;display:flex;align-items:center;gap:7px}.j-resume .pictogram{width:18px;height:18px}
.j-brief{text-align:center;height:100%;display:flex;flex-direction:column;justify-content:center;gap:10px}.j-brief>small,.j-garage>small{font-size:11px;letter-spacing:.05em}.j-brief-hero{display:flex;align-items:center;justify-content:center;gap:14px;height:125px;border-radius:26px;background:linear-gradient(145deg,#d9e7be,#e9e7bd)}.j-brief-hero>.pictogram{width:70px;height:70px;filter:drop-shadow(0 6px 0 #8aa77933)}.j-brief-hero>.pictogram:nth-child(2){width:100px;height:100px}.j-brief-targets{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.j-brief-targets>span{display:flex;align-items:center;gap:5px;font-size:14px;background:#f0eed7;border-radius:12px;padding:7px}.j-brief-targets .pictogram{width:28px;height:28px}.j-brief-targets .pictogram:nth-last-child(2){width:13px}.j-brief>p{font-size:12px;line-height:1.65;margin:2px 0}.j-brief>.j-soft-note{font-size:11px}.j-medal-rules{display:grid;gap:7px;text-align:left;background:#f3f1dc;border-radius:18px;padding:13px}.j-medal-rules>span{display:flex;align-items:center;gap:10px;font-size:12px}.j-medal-rules .pictogram{width:25px;height:25px}.j-brief>.primary{min-height:52px;margin-top:7px}.j-brief>.subtle{min-height:36px}
body.journey-playing .header,body.journey-playing .dock,body.journey-playing .time-controls,body.journey-playing .mission,body.journey-playing .expand-button,body.journey-playing .lab-button,body.journey-playing .region-views,body.journey-playing .camera-tools,body.journey-playing .guide-card,body.journey-playing .fallback-picker,body.journey-playing .operations,body.journey-playing .free-hint{visibility:hidden!important;pointer-events:none!important}
#journey-shell{position:absolute;inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);container-type:size;pointer-events:none;z-index:28;color:#355c50}#journey-shell[hidden]{display:none}#journey-shell button{font-family:inherit;cursor:pointer;touch-action:manipulation}#journey-shell button:disabled{opacity:.43;cursor:default}#journey-shell button:focus-visible{outline:4px solid #dc9d30;outline-offset:2px}.j-hud{position:absolute;top:10px;left:12px;right:12px;display:flex;align-items:center;gap:9px;pointer-events:auto;background:#fffbeded;border:2px solid #93ad8a;border-radius:20px;box-shadow:0 4px 0 #81966f44;padding:6px}.j-hud>div{flex:1;min-width:0}.j-hud h2{font-size:15px;line-height:1.3;margin:2px 0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.j-hud small{font-size:9px;letter-spacing:.04em}.j-round{width:40px;height:40px;flex:0 0 40px;border:0;background:#e2ecd0;border-radius:14px;color:#365b50;font-size:18px}.j-round .pictogram{width:27px;height:27px}.j-audio{font-size:13px}.j-orders{position:absolute;top:84px;left:15px;right:15px;display:flex;gap:6px;justify-content:center;pointer-events:auto}.j-orders>span{display:flex;align-items:center;gap:4px;background:#fffae9e8;border:1px solid #b0c29b;border-radius:13px;padding:5px 8px;min-height:32px;font-size:12px;transition:background .2s}.j-orders>span.done{background:#e1edbc;border-color:#76a16c}.j-orders .pictogram{width:23px;height:23px}.j-top-hint{position:absolute;top:132px;left:15px;right:15px;text-align:center;font-size:11px;font-weight:750;background:#fffbe3ce;border-radius:14px;padding:6px 9px;pointer-events:none}.j-camera{position:absolute;right:10px;top:180px;display:grid;gap:6px;pointer-events:auto}.j-camera>button{width:40px;height:40px;border-radius:14px;background:#fffbe7e8;border:2px solid #a6bd94;color:#426858;font-size:22px}.j-camera .pictogram{width:24px;height:24px}
.j-console{position:absolute;bottom:10px;left:10px;right:10px;background:#fffbeaef;border:3px solid #86a27e;border-radius:25px;box-shadow:0 7px 0 #5d815d33,0 12px 30px #456a5326;padding:10px 12px 7px;pointer-events:auto;box-sizing:border-box;max-width:560px;margin:auto}.j-route-nav{display:flex;align-items:center;gap:8px;justify-content:space-between}.j-route-nav>button{width:38px;height:42px;background:#e7eed4;border:1px solid #aabf98;border-radius:12px;font-size:24px;color:#426558;flex:0 0 38px}.j-route-nav>div{display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:7px;flex:1;min-width:0}.j-pair{display:flex;align-items:center;justify-content:center;gap:1px}.j-pair>.pictogram{width:32px;height:32px}.j-pair>.pictogram:nth-child(2){width:14px;height:17px}.j-route-nav .j-pair{grid-row:1/3}.j-route-nav b{font-size:12px;line-height:1.4}.j-route-nav small{font-size:10px}.j-engine-choices{display:flex;gap:8px;margin:9px 0}.j-engine-choices>button{flex:1;display:flex;align-items:center;justify-content:center;gap:12px;background:#f1eed6;border:2px solid #c8c9a5;border-radius:14px;min-height:51px;padding:4px;color:#476653}.j-engine-choices>button[aria-pressed=true]{background:#dceac5;border-color:#729e73;box-shadow:0 3px 0 #c5d7ae}.j-engine-choices .pictogram{width:33px;height:33px}.j-engine-choices span{display:grid;text-align:left;gap:2px}.j-engine-choices b{font-size:17px}.j-engine-choices small{font-size:10px}.j-plan-options{display:flex;gap:8px;margin:8px 0}.j-plan-options>button{flex:0 0 88px;display:flex;align-items:center;justify-content:center;gap:4px;border:1px solid #b1c49a;border-radius:12px;background:#f1f1dc;color:#44614e;font-size:11px;min-height:40px}.j-plan-options .pictogram{width:25px;height:25px}.j-load-toggle{flex:1;display:flex;border:1px solid #b6c89d;background:#eeefd8;border-radius:12px;overflow:hidden}.j-load-toggle>button{flex:1;min-height:40px;border:0;background:transparent;color:#4b6e54;font-size:11px;font-weight:700}.j-load-toggle>button[aria-pressed=true]{background:#d6e7bd;box-shadow:inset 0 -3px #9dbb80}
.j-build-row{display:flex;gap:7px}.j-build-row>button{min-height:43px;display:flex;align-items:center;justify-content:center;gap:7px;border:2px solid #84a576;border-radius:13px;background:#dfecc7;box-shadow:0 3px 0 #bbd29e;color:#335b45;font-size:12px;font-weight:800;flex:1}.j-build-row .pictogram{width:25px;height:25px}.j-build-row>button+button{flex:0 0 55px;background:#f4efd8;box-shadow:none;font-size:10px;border:1px solid #bdc99f}.j-budget{font-size:10px;margin:7px 0 6px;text-align:center;min-height:14px}.j-launch{display:flex;align-items:center;justify-content:center;gap:12px;min-height:47px;width:100%;border:2px solid #c79e47;border-radius:15px;background:linear-gradient(#ffdd8a,#f1c464);box-shadow:0 4px 0 #d2aa54;color:#5c592d;font-size:16px;font-weight:900}.j-launch>.pictogram{width:27px;height:27px}.j-console-foot{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:9px;color:#768166;margin-top:5px}.j-console-foot button{border:0;background:none;display:flex;align-items:center;gap:3px;font-size:10px;color:#546c55;min-height:28px}.j-console-foot .pictogram{width:16px;height:16px}.j-live-status{min-height:48px;background:#edf1d8;border-radius:13px;margin:8px 0;padding:5px 9px;display:flex;flex-direction:column;justify-content:center;gap:4px}.j-live-status>span{display:flex;gap:8px;align-items:center;font-size:11px}.j-live-status .pictogram{width:22px;height:22px}.j-run-meters{display:flex;gap:6px;justify-content:center;margin:8px 0}.j-run-meters>span{display:flex;align-items:center;gap:4px;font-size:15px;flex:1;justify-content:center;flex-wrap:wrap}.j-run-meters .pictogram{width:24px;height:24px}.j-run-meters small{font-size:9px;width:100%;text-align:center;color:#738267}.j-run-buttons{display:flex;gap:6px}.j-run-buttons>button{min-height:41px;border:1px solid #a5bc90;border-radius:12px;background:#e9efd5;color:#48674f;flex:1;font-size:11px;font-weight:750}.j-arrival .j-orders .done{animation:j-success .5s ease-out}
.j-help,.j-garage,.j-parent,.j-passport{display:flex;flex-direction:column;justify-content:center;height:100%;gap:10px;text-align:center;box-sizing:border-box}.j-help>small{font-size:11px}.j-help p,.j-parent p{font-size:13px;line-height:1.8;margin:2px 0}.j-help-flow .j-pair>.pictogram{width:70px;height:70px}.j-help-flow .j-pair>.pictogram:nth-child(2){width:30px}.j-tip-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.j-tip-grid>div{background:#eef1d8;border-radius:18px;padding:12px;display:grid;justify-items:center;gap:4px}.j-tip-grid .pictogram{width:40px;height:40px}.j-tip-grid b{font-size:14px}.j-tip-grid p{font-size:11px;line-height:1.5}.j-help>.primary{margin-top:8px}.j-train-art{width:100%;height:auto}.j-steam{animation:j-steam 2.5s ease-in-out infinite}.j-garage-hero{display:flex;align-items:center;justify-content:center;flex-direction:column;background:linear-gradient(#cde5d4,#e4edc8);border:2px solid #aec29b;border-radius:25px;padding:8px 15px}.j-garage-hero>.j-train-art{width:230px;height:105px}.j-garage-hero>b{font-size:15px}.j-liveries{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.j-liveries>button{background:#f0f0db;border:2px solid #c4d1ae;border-radius:15px;min-height:90px;display:grid;justify-items:center;align-content:center;gap:4px;color:#3c604e;padding:8px 4px}.j-liveries>button[aria-pressed=true]{background:#dfedc9;border-color:#6c9d6f}.j-liveries>button>span{background:var(--swatch);border:2px solid #fff3cf;border-radius:13px;padding:4px}.j-liveries .pictogram{width:26px;height:26px}.j-liveries b{font-size:11px}.j-liveries small{font-size:9px}.j-garage>p{font-size:11px}.j-garage>.mini-action{min-height:40px}.j-result{height:100%;display:flex;flex-direction:column;justify-content:center;gap:12px;text-align:center}.j-result-title{display:flex;align-items:center;justify-content:center;gap:15px;padding:0 10px}.j-result-friend{width:95px;height:95px;object-fit:contain;flex:0 0 95px;filter:drop-shadow(0 7px 4px #7a97672a)}.j-result-title>div{text-align:left}.j-result-title small{font-size:12px}.j-result-title h2{font-size:21px!important;margin:5px 0!important}.j-result>.j-stars{gap:13px}.j-result>.j-stars .pictogram{width:47px;height:47px}.j-result>.j-stars>span.earned{animation:j-star .7s both}.j-result>.j-stars>span:nth-child(2){animation-delay:.18s}.j-result>.j-stars>span:nth-child(3){animation-delay:.36s}.j-result-goods{display:flex;justify-content:center;gap:5px;flex-wrap:wrap}.j-result-goods>span{display:flex;align-items:center;gap:3px;border:1px solid #afc49a;background:#e9efcf;border-radius:12px;padding:6px}.j-result-goods .pictogram{width:26px;height:26px}.j-result-goods .pictogram:last-child{width:18px;height:18px}.j-result-goods b{font-size:13px}.j-result-metrics{display:flex;justify-content:space-around;background:#f0efd8;border-radius:17px;padding:12px 8px}.j-result-metrics>span{font-size:22px;font-weight:850;display:grid;gap:4px}.j-result-metrics small{font-size:9px;font-weight:500}.j-result-learn{font-size:12px;line-height:1.7;margin:0;background:#e8efda;border-radius:16px;padding:12px}.j-question{font-size:11px;line-height:1.7;margin:0}.j-new-train{display:flex;align-items:center;gap:9px;background:#fff0bd;border:2px solid #d0b064;border-radius:18px;padding:3px 10px;color:#776033;justify-content:center}.j-new-train>.j-train-art{width:125px;height:65px}.j-new-train>span{font-size:11px;display:grid;gap:4px;text-align:left}.j-new-train b{font-size:16px}.j-result-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:4px}.j-result-actions>.primary{grid-column:1/3;min-height:48px}.j-result-actions>.subtle,.j-result-actions>.mini-action{font-size:11px;min-height:38px}.j-passport>.pictogram{width:110px;height:110px;align-self:center}.j-passport>p{font-size:15px;line-height:1.8;margin:8px 0}.j-passport .j-stars .pictogram{width:31px;height:31px}.j-notebook-record{display:grid;gap:7px;background:#ebefd7;border-radius:20px;padding:17px;font-size:13px}.j-notebook-record small{font-size:11px}.j-parent{text-align:left;padding:10px}.j-parent>h3{text-align:center;margin-bottom:12px!important}
dialog[data-kind=journey-passport] #dialog-content,dialog[data-kind=journey-parent] #dialog-content{height:calc(100% - 52px)}dialog[data-kind=journey-passport] .book-pages,dialog[data-kind=journey-parent] .book-pages{height:calc(100% - 40px)}dialog[data-kind=journey-passport] .book-page,dialog[data-kind=journey-parent] .book-page{height:100%}dialog[data-kind=journey-passport] .page-controls,dialog[data-kind=journey-parent] .page-controls{height:40px;margin:10px 0 0}
.journey-hub-entry{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;background:linear-gradient(140deg,#c6dfc5,#edf0c6);border:2px solid #87ab83;border-radius:23px;box-shadow:0 4px 0 #bbcf9f;padding:10px 15px;color:#365d4d;text-align:left;min-height:91px;margin:10px 0}.journey-hub-entry>.pictogram{width:69px;height:69px}.journey-hub-entry>span{display:grid;gap:4px;flex:1}.journey-hub-entry b{font-size:20px}.journey-hub-entry small{font-size:11px}.journey-hub-entry>strong{font-size:26px}.welcome-journey-button{min-height:46px!important}.welcome-journey-button small{font-size:9px;font-weight:500;margin-left:5px}
@keyframes j-star{0%{transform:scale(.2) rotate(-25deg)}65%{transform:scale(1.2) rotate(8deg)}100%{transform:scale(1) rotate(0)}}@keyframes j-steam{0%,100%{opacity:.6;transform:translateY(0)}50%{opacity:1;transform:translateY(-5px)}}@keyframes j-success{50%{transform:scale(1.12)}}
@media(orientation:portrait) and (max-height:740px){dialog[data-kind^="journey-"]{padding:15px;border-radius:24px}.j-map-head{min-height:39px}.j-map-head h2{font-size:21px!important}.j-chapter{margin-top:5px}.j-chapter h3{font-size:18px!important}.j-map-scene{height:145px}.j-chapter-icon{width:47px;height:47px;top:24%}.j-chapter-icon>.pictogram{width:33px;height:33px}.j-map-scene>p{font-size:10px}.j-job{min-height:75px;padding:8px 7px;gap:2px 6px}.j-job>b{font-size:11px}.j-job>.pictogram{width:27px;height:27px}.j-job .j-stars .pictogram{width:16px;height:16px}.j-map-foot>p{font-size:10px;margin:11px 0 6px}.j-menu-buttons>button{padding:6px 3px;min-height:40px;font-size:10px}.j-map-bottom{margin-top:5px}.j-map-bottom button{min-height:31px;font-size:9px}.j-brief{gap:6px}.j-brief h2{font-size:22px!important;margin-bottom:5px!important}.j-brief-hero{height:85px}.j-brief-hero>.pictogram{width:55px;height:55px}.j-brief-hero>.pictogram:nth-child(2){width:80px;height:80px}.j-brief-targets{gap:5px}.j-brief-targets>span{font-size:11px;padding:4px}.j-brief-targets .pictogram{width:23px;height:23px}.j-brief>p{font-size:11px}.j-medal-rules{gap:4px;padding:9px}.j-medal-rules>span{font-size:11px}.j-medal-rules .pictogram{width:20px;height:20px}.j-brief>.primary{min-height:44px}.j-result{gap:8px}.j-result-title{gap:9px}.j-result-friend{width:68px;height:68px;flex-basis:68px}.j-result-title h2{font-size:17px!important}.j-result>.j-stars .pictogram{width:34px;height:34px}.j-result-metrics{padding:8px}.j-result-metrics>span{font-size:18px}.j-result-learn{font-size:11px;padding:8px}.j-result-actions>.primary{min-height:43px}.j-new-train>.j-train-art{height:48px;width:100px}.j-question{font-size:10px}.j-help p{font-size:11px}.j-tip-grid>div{padding:8px}.j-garage{gap:6px}.j-garage-hero>.j-train-art{height:75px;width:180px}.j-liveries>button{min-height:73px;padding:5px 3px}.j-liveries .pictogram{width:23px;height:23px}.j-passport>.pictogram{width:75px;height:75px}.j-passport>p{font-size:13px}.j-console{padding:7px 9px 4px}.j-route-nav>button{height:36px;width:34px;flex-basis:34px}.j-route-nav b{font-size:11px}.j-route-nav .j-pair>.pictogram{width:25px;height:25px}.j-route-nav .j-pair>.pictogram:nth-child(2){width:12px}.j-engine-choices{margin:6px 0}.j-engine-choices>button{min-height:43px}.j-engine-choices .pictogram{width:29px;height:29px}.j-engine-choices b{font-size:15px}.j-plan-options{margin:6px 0}.j-plan-options>button,.j-load-toggle>button{min-height:36px}.j-build-row>button{min-height:38px}.j-launch{min-height:42px;font-size:14px}.j-budget{margin:5px 0;font-size:9px}.j-console-foot{margin-top:3px}.j-console-foot button{min-height:25px}.j-top-hint{top:124px;font-size:10px}.j-orders{top:79px}.j-hud{top:8px}.j-hud h2{font-size:13px}.j-camera{top:165px}.j-camera>button{height:34px;width:34px}.j-run-buttons>button{min-height:37px}.j-live-status{min-height:39px;margin:6px 0}.j-run-meters{margin:6px 0}}
@media(orientation:landscape){.j-hud{right:calc(310px + 12px);max-width:740px}.j-orders{top:82px;right:330px;left:12px;flex-wrap:wrap;justify-content:flex-start}.j-top-hint{top:132px;right:330px;left:15px;text-align:left}.j-camera{right:auto;left:12px;top:auto;bottom:12px;display:flex}.j-console{top:10px;bottom:10px;left:auto;right:10px;width:292px;margin:0;display:flex;flex-direction:column;justify-content:center;max-height:none}.j-console-foot{margin-top:10px}.j-route-nav>div{column-gap:5px}.j-route-nav .j-pair{display:none}.j-route-nav b{font-size:12px}.j-engine-choices>button{gap:8px}.j-engine-choices b{font-size:15px}.j-plan-options>button{flex-basis:74px}.j-run-buttons{flex-wrap:wrap}.j-run-buttons>button{flex:1 1 30%}.j-orders>span{font-size:11px;padding:4px 7px}.j-top-hint{max-width:450px;font-size:10px}dialog[data-kind^="journey-"]{width:min(980px,calc(var(--safe-width) - 24px));height:min(720px,calc(var(--safe-height) - 24px))}}
@media(orientation:landscape) and (max-height:600px){dialog[data-kind^="journey-"]{padding:14px 18px;border-radius:24px}.j-map-head{position:absolute;left:20px;top:12px;width:41%;padding:0}.j-map-head h2{font-size:19px!important}.j-map-head>strong{font-size:18px}.j-chapter{position:absolute;left:20px;top:66px;width:41%;margin:0}.j-chapter h3{font-size:17px!important}.j-chapter>button{width:35px;height:35px}.j-map-scene{position:absolute;left:10px;top:110px;bottom:55px;height:auto;width:44%;margin:0}.j-chapter-icon{width:43px;height:43px;top:28%}.j-chapter-icon>.pictogram{width:30px;height:30px}.j-map-scene>p{font-size:9px;padding:4px}.j-jobs{position:absolute;left:49%;right:18px;top:23px;bottom:124px;grid-template-rows:1fr 1fr;gap:8px;margin:0}.j-job{min-height:0;padding:8px 6px;grid-template-columns:27px 1fr}.j-job>b{font-size:11px}.j-job>.pictogram{width:27px;height:27px}.j-stars .pictogram{width:17px;height:17px}.j-map-foot{position:absolute;left:49%;right:18px;bottom:14px}.j-map-foot>p{font-size:9px;margin:0 0 8px}.j-menu-buttons>button{min-height:37px;font-size:10px;padding:5px 3px}.j-menu-buttons .pictogram{width:19px;height:19px}.j-map-bottom{margin-top:4px}.j-map-bottom button{min-height:30px;font-size:8px}.j-map-bottom>span{font-size:9px}.j-map-bottom button.j-resume{font-size:10px;padding:5px 8px}.j-brief{display:grid;grid-template-columns:42% 1fr;gap:6px 24px;align-content:center}.j-brief>small,.j-brief>h2,.j-brief-hero{grid-column:1}.j-brief>h2{font-size:23px!important;margin:2px!important}.j-brief-hero{grid-row:3/7;height:125px}.j-brief-hero>.pictogram{width:48px;height:48px}.j-brief-hero>.pictogram:nth-child(2){width:70px;height:70px}.j-brief-targets{grid-column:2;grid-row:1/3;gap:4px}.j-brief-targets>span{font-size:11px;padding:4px}.j-brief-targets .pictogram{width:21px;height:21px}.j-brief>p,.j-medal-rules,.j-brief>.primary,.j-brief>.subtle{grid-column:2}.j-brief>p{font-size:10px}.j-medal-rules{padding:7px 10px;gap:3px}.j-medal-rules>span{font-size:10px}.j-medal-rules .pictogram{width:19px;height:19px}.j-brief>.j-soft-note{font-size:9px}.j-brief>.primary{min-height:40px;font-size:12px;margin:0}.j-brief>.subtle{min-height:25px;font-size:10px}.j-hud{right:310px;top:8px;left:10px;padding:4px;gap:7px}.j-hud h2{font-size:13px}.j-round{width:34px;height:34px;flex-basis:34px}.j-round>.pictogram{width:23px;height:23px}.j-orders{top:70px;right:315px;gap:4px}.j-orders>span{min-height:25px;font-size:10px;padding:4px 6px}.j-orders .pictogram{width:20px;height:20px}.j-top-hint{top:119px;right:315px;font-size:9px;padding:5px}.j-camera>button{width:35px;height:35px}.j-console{padding:8px 10px 5px;top:8px;bottom:8px;border-radius:21px}.j-route-nav>button{height:32px;flex-basis:32px;width:32px}.j-route-nav small{font-size:9px}.j-route-nav b{font-size:11px}.j-engine-choices{margin:6px 0}.j-engine-choices>button{min-height:40px}.j-engine-choices b{font-size:14px}.j-engine-choices .pictogram{width:27px;height:27px}.j-engine-choices small{font-size:9px}.j-plan-options{margin:6px 0}.j-plan-options>button,.j-load-toggle>button{min-height:34px;font-size:10px}.j-build-row>button{min-height:36px;font-size:11px}.j-budget{font-size:9px;margin:5px 0}.j-launch{min-height:40px;font-size:14px}.j-console-foot{margin-top:4px}.j-console-foot button{min-height:25px;font-size:9px}.j-live-status{min-height:45px}.j-result{display:grid;grid-template-columns:42% 1fr;column-gap:24px;row-gap:8px;align-content:center}.j-result-title{grid-column:1;grid-row:1/3;padding:0;gap:6px}.j-result-friend{width:85px;height:85px;flex-basis:85px}.j-result-title h2{font-size:18px!important}.j-result-title small{font-size:10px}.j-result>.j-stars{grid-column:1;grid-row:3}.j-result>.j-stars .pictogram{width:37px;height:37px}.j-result-goods{grid-column:1;grid-row:4;gap:4px}.j-result-goods>span{padding:4px}.j-result-goods .pictogram{width:23px;height:23px}.j-result-metrics{grid-column:2;grid-row:1;padding:8px}.j-result-metrics>span{font-size:18px}.j-result-learn{grid-column:2;grid-row:2;font-size:11px;padding:8px}.j-question,.j-new-train{grid-column:2;grid-row:3;font-size:10px}.j-new-train>.j-train-art{height:47px;width:110px}.j-result-actions{grid-column:2;grid-row:4;gap:6px;margin:0}.j-result-actions>.primary{min-height:38px;font-size:12px}.j-result-actions>.subtle,.j-result-actions>.mini-action{min-height:28px;font-size:10px}.j-garage{position:relative;display:block;text-align:center}.j-garage>small,.j-garage>h2,.j-garage-hero,.j-garage>p,.j-garage>.mini-action{position:absolute;left:0;width:39%;box-sizing:border-box}.j-garage>small{top:5px;font-size:10px}.j-garage>h2{top:24px;font-size:23px!important}.j-garage-hero{top:72px;height:125px;padding:5px}.j-garage-hero>.j-train-art{width:210px;height:90px}.j-garage>p{top:203px;font-size:10px}.j-garage>.mini-action{bottom:0;min-height:33px}.j-liveries{position:absolute;top:5px;bottom:4px;left:43%;right:25px;grid-auto-rows:1fr;gap:6px}.j-liveries>button{min-height:0;padding:4px;gap:2px}.j-liveries .pictogram{width:21px;height:21px}.j-liveries b{font-size:10px}.j-liveries small{font-size:8px}.j-help{display:grid;grid-template-columns:42% 1fr;gap:5px 24px;align-content:center}.j-help>small,.j-help>h2,.j-help-flow{grid-column:1}.j-help>h2{font-size:22px!important}.j-help-flow{grid-row:3/6}.j-help-flow .j-pair>.pictogram{width:60px;height:60px}.j-help>p,.j-tip-grid,.j-help>.primary,.j-help>.mini-action{grid-column:2;font-size:11px}.j-tip-grid{grid-row:2/5;gap:7px}.j-tip-grid>div{padding:8px}.j-tip-grid b{font-size:11px}.j-tip-grid p{font-size:10px}.j-tip-grid .pictogram{width:30px;height:30px}.j-help>.primary{min-height:38px;font-size:12px}.j-help>.mini-action{min-height:32px}.j-parent{padding:0 20px;gap:5px}.j-parent>h3{margin:0!important}.j-parent p{font-size:12px;line-height:1.65}.j-passport{display:grid;grid-template-columns:35% 1fr;gap:6px 24px;align-content:center}.j-passport>small,.j-passport>.pictogram,.j-passport>h3,.j-passport>.j-stars{grid-column:1}.j-passport>.pictogram{width:70px;height:70px;justify-self:center}.j-passport>h3{font-size:17px!important}.j-passport>p,.j-notebook-record,.j-passport>.mini-action{grid-column:2;font-size:12px;line-height:1.6}.j-passport>p{grid-row:1/3;margin:0}.j-notebook-record{grid-row:3/4;padding:10px;font-size:11px}.j-passport>.mini-action{grid-row:4;min-height:34px}dialog[data-kind=journey-passport] #dialog-content,dialog[data-kind=journey-parent] #dialog-content{height:calc(100% - 45px)}dialog[data-kind=journey-passport] h2,dialog[data-kind=journey-parent] h2{font-size:18px;margin-bottom:7px}.journey-hub-entry{min-height:68px;padding:6px 12px;margin:6px 0}.journey-hub-entry>.pictogram{width:48px;height:48px}.journey-hub-entry b{font-size:17px}.journey-hub-entry small{font-size:10px}}
@media(orientation:landscape) and (max-height:350px){.j-console{padding:6px 9px 3px}.j-engine-choices{margin:4px 0}.j-engine-choices>button{min-height:35px}.j-plan-options{margin:4px 0}.j-plan-options>button,.j-load-toggle>button{min-height:31px}.j-build-row>button{min-height:32px}.j-budget{font-size:8px;margin:4px 0}.j-launch{min-height:35px}.j-console-foot{margin-top:2px}.j-console-foot button{min-height:22px}.j-orders{top:64px}.j-top-hint{top:112px}.j-jobs{bottom:111px;top:18px}.j-job>b{font-size:10px}.j-job>.pictogram{width:24px;height:24px}.j-map-foot{bottom:8px}.j-map-foot>p{margin-bottom:5px}.j-menu-buttons>button{min-height:32px}.j-chapter{top:58px}.j-map-scene{top:96px;bottom:40px}.j-map-bottom button{min-height:26px}.j-brief-hero{height:100px}.j-brief{gap:4px 18px}.j-brief>p{font-size:9px}.j-brief-targets>span{font-size:10px}.j-medal-rules{padding:5px 8px}.j-result{row-gap:5px}.j-result-friend{width:65px;height:65px;flex-basis:65px}.j-result-title h2{font-size:15px!important}.j-result>.j-stars .pictogram{width:29px;height:29px}.j-result-learn{font-size:10px}.j-result-metrics>span{font-size:16px}.j-new-train>.j-train-art{height:38px}.j-result-actions>.primary{min-height:34px}.j-garage-hero{top:60px;height:100px}.j-garage>p{top:164px}.j-liveries{right:19px}.j-garage>.mini-action{min-height:28px}.j-help>h2{font-size:18px!important}.j-help p{font-size:10px}.j-tip-grid p{font-size:9px}.j-tip-grid>div{padding:6px}.j-tip-grid .pictogram{width:25px;height:25px}}
@media(prefers-reduced-motion:reduce){.j-steam,.j-result>.j-stars>span.earned,.j-arrival .j-orders .done{animation:none!important}.j-orders>span{transition:none}}
.j-transfer-actions{display:flex;gap:10px;justify-content:center}.j-transfer-actions>button{min-height:45px;font-size:12px;flex:1}.j-transfer>p{font-size:12px}.j-transfer>.subtle{min-height:40px}.j-transfer input[hidden]{display:none}
.j-job>b{word-break:keep-all;overflow-wrap:anywhere}.j-finale{height:100%;display:flex;flex-direction:column;justify-content:center;gap:9px;text-align:center}.j-finale>small{font-size:11px;letter-spacing:.09em}.j-finale h2{font-size:29px!important;line-height:1.45!important;margin:3px!important}.j-finale-medal{position:relative;display:grid;justify-items:center;align-items:center;gap:3px}.j-finale-medal>.pictogram{width:70px;height:70px;filter:drop-shadow(0 5px 0 #d2ac5240)}.j-finale-medal>b{font-size:18px;color:#9f7c33}.j-finale-medal>span{font-size:10px}.j-finale-world{height:135px;margin:-10px -5px -14px}.j-finale-friends{display:flex;justify-content:center;gap:0}.j-finale-friends>img{width:44px;height:49px;object-fit:contain;filter:drop-shadow(0 4px 2px #7c985e33)}.j-finale>p{font-size:12px;line-height:1.7;margin:5px 0}.j-finale>.primary{min-height:49px}.j-finale-links{display:flex;justify-content:center;gap:20px}.j-finale-links>button{font-size:11px;min-height:35px}
@media(orientation:portrait) and (max-height:740px){.j-finale{gap:6px}.j-finale h2{font-size:23px!important}.j-finale-medal>.pictogram{width:48px;height:48px}.j-finale-world{height:95px}.j-finale-friends>img{width:35px;height:40px}.j-finale>p{font-size:11px}.j-finale>.primary{min-height:43px;font-size:13px}}
@media(orientation:landscape) and (max-height:600px){.j-finale{display:grid;grid-template-columns:42% 1fr;align-content:center;column-gap:22px;row-gap:7px}.j-finale>small,.j-finale>h2,.j-finale-medal{grid-column:1}.j-finale h2{font-size:24px!important}.j-finale-medal>.pictogram{width:57px;height:57px}.j-finale-world{grid-column:2;grid-row:1/4;height:125px;margin:-8px 0}.j-finale-friends{grid-column:2;grid-row:4}.j-finale-friends>img{width:33px;height:37px}.j-finale>p{grid-column:1;grid-row:4;font-size:10px}.j-finale>.primary{grid-column:2;grid-row:5;min-height:40px;font-size:12px}.j-finale-links{grid-column:1;grid-row:5;gap:6px}.j-finale-links>button{font-size:10px;min-height:30px}}
@media(orientation:landscape) and (max-height:350px){.j-finale{grid-template-rows:12px 49px 70px 34px 37px;gap:4px 18px}.j-finale>small{font-size:9px}.j-finale h2{font-size:19px!important;line-height:1.25!important}.j-finale-medal{gap:2px}.j-finale-medal>.pictogram{width:38px;height:38px}.j-finale-medal>b{font-size:16px}.j-finale-medal>span{font-size:8px}.j-finale-world{height:100px}.j-finale-friends>img{width:27px;height:31px}.j-finale>p{font-size:9px;line-height:1.5}.j-finale>.primary{min-height:35px;font-size:11px}.j-finale-links>button{font-size:9px;min-height:30px}}
.j-map-bottom>[data-j=finale]{display:flex;align-items:center;gap:3px;font-weight:800}.j-map-bottom>[data-j=finale]>.pictogram{width:17px;height:17px}
.j-complete-label{display:grid;grid-template-columns:24px 1fr;align-items:center;gap:0 3px;border:1px solid #d6ba6b;border-radius:13px;padding:5px 7px;background:#fff0bc;color:#836934}.j-complete-label>.pictogram{width:23px;height:23px;grid-row:1/3}.j-complete-label>b{font-size:14px}.j-complete-label>small{font-size:8px!important;letter-spacing:0!important}
@media(orientation:landscape) and (max-height:350px){dialog[data-kind=lab-hub] .journey-hub-entry{min-height:48px;margin:3px 0;padding:4px 9px;border-radius:17px}dialog[data-kind=lab-hub] .journey-hub-entry>.pictogram{width:34px;height:34px}dialog[data-kind=lab-hub] .journey-hub-entry b{font-size:15px}dialog[data-kind=lab-hub] .journey-hub-entry small{font-size:8px}dialog[data-kind=lab-hub] .play-heading h2{font-size:16px;margin:2px 0 5px}dialog[data-kind=lab-hub] .play-hub-art{height:70px}dialog[data-kind=lab-hub] .play-hub-card{padding:7px 8px}dialog[data-kind=lab-hub] .play-map-footer{padding-top:5px}}
@media(orientation:landscape) and (max-height:350px){dialog[data-kind=welcome] .dialog-actions{grid-template-columns:1fr 1fr;gap:5px}dialog[data-kind=welcome] .welcome-journey-button{grid-column:1/-1;min-height:36px!important;font-size:12px!important}dialog[data-kind=welcome] .welcome-journey-button small{font-size:8px}dialog[data-kind=welcome] #guide-start,dialog[data-kind=welcome] #welcome-skip{font-size:9px;min-height:32px;margin:0;padding:5px}}
@media(orientation:portrait) and (max-height:600px){.j-map-scene{height:115px}.j-garage-hero>.j-train-art{height:55px;width:155px}.j-garage{gap:4px}.j-garage h2{font-size:21px!important;margin-bottom:5px!important}.j-liveries>button{min-height:67px}.j-camera{grid-template-columns:repeat(2,34px);top:163px;right:10px}}
@media(orientation:landscape) and (min-height:601px){.j-console{top:50%;bottom:auto;transform:translateY(-50%);min-height:380px}}
@media(orientation:landscape) and (max-height:600px){.j-transfer-actions>button{min-height:37px;font-size:11px}.j-transfer>p{font-size:11px}.j-transfer>.subtle{min-height:30px}}

/* Keep the world visible beside the panel even on short, notched phones. */
@container (max-width:620px) and (min-aspect-ratio:1){
 .j-console{width:248px;padding-inline:8px}
 .j-hud{right:266px;gap:4px}.j-hud h2{font-size:11px}.j-hud small{font-size:8px}
 .j-orders,.j-top-hint{right:266px}.j-orders{gap:3px}.j-orders>span{padding:3px;font-size:9px}
 .j-round{width:32px;height:34px;flex-basis:32px}.j-top-hint{font-size:9px}
 .j-route-nav b{font-size:10px}.j-camera{gap:4px}
}

dialog[data-kind^="journey-"]{container-type:size}
/* Compact based on usable height, including the top camera and home indicator. */
@container (max-height:490px) and (max-aspect-ratio:1){
 .j-map-scene{height:36px;margin-block:5px}.j-map-scene>.j-island-art,.j-chapter-icon{display:none}.j-map-scene>p{position:static;margin:0;padding:7px;font-size:10px}
 .j-chapter{margin-top:3px}.j-jobs{gap:7px}.j-map-foot>p{margin-top:6px;font-size:9px}
 .j-garage{gap:3px}.j-garage-hero>.j-train-art{height:40px}.j-garage>p{font-size:10px;margin:3px}.j-liveries{gap:5px}.j-liveries>button{min-height:50px;padding:3px}.j-liveries .pictogram{width:20px;height:20px}
 .j-brief{gap:4px}.j-brief-hero{height:47px}.j-brief-hero>.pictogram{width:36px;height:36px}.j-brief-hero>.pictogram:nth-child(2){width:48px;height:48px}.j-brief>p{font-size:10px;line-height:1.4;margin:3px 0}.j-medal-rules{padding:6px;gap:3px}
 .j-help{gap:5px}.j-help-flow .j-pair>.pictogram{width:39px;height:39px}.j-help p{font-size:10px;line-height:1.45;margin:3px}.j-tip-grid>div{padding:5px}.j-tip-grid .pictogram{width:25px;height:25px}
 .j-result{gap:5px}.j-result-friend{width:45px;height:45px;flex-basis:45px}.j-result>.j-stars .pictogram{width:27px;height:27px}.j-result-title h2{font-size:15px!important}.j-result-learn{font-size:10px;line-height:1.45;padding:6px}.j-result-metrics{padding:5px}.j-new-train{padding:4px}.j-result-actions{gap:4px}
 .j-finale{gap:4px}.j-finale-world{height:50px}.j-finale h2{font-size:21px!important}.j-finale-medal>.pictogram{width:34px;height:34px}.j-finale>p{font-size:10px;margin:3px 0}.j-finale-friends>img{height:32px;width:29px}
}

@container (max-height:540px) and (max-aspect-ratio:1){
 .j-hud{top:7px;padding:4px;gap:6px}.j-hud h2{font-size:12px}.j-round{width:34px;height:36px;flex-basis:34px}.j-orders{top:65px}.j-orders>span{min-height:26px;padding:3px 6px}.j-top-hint{top:103px;font-size:9px;padding:5px}
 .j-camera{top:141px;right:10px;grid-template-columns:repeat(2,32px);gap:4px}.j-camera>button{width:32px;height:32px}
 .j-console.planning{display:grid;grid-template-columns:1fr 1fr;column-gap:6px;padding:6px 8px 3px}
 .j-console.planning>.j-route-nav,.j-console.planning>.j-build-row,.j-console.planning>.j-budget,.j-console.planning>.j-launch,.j-console.planning>.j-console-foot{grid-column:1/-1}
 .j-route-nav .j-pair{display:none}.j-route-nav>button{height:32px}.j-route-nav b{font-size:11px}.j-route-nav small{font-size:8px}
 .j-engine-choices{display:grid;grid-template-columns:1fr;margin:4px 0;gap:3px}.j-engine-choices>button{min-height:32px;padding:2px 5px;justify-content:center}.j-engine-choices>button>span{display:flex;align-items:center;gap:5px}.j-engine-choices b{font-size:12px}.j-engine-choices small{font-size:8px}.j-engine-choices .pictogram{width:24px;height:24px}
 .j-plan-options{display:flex;flex-direction:column;margin:4px 0;gap:3px}.j-plan-options>button,.j-load-toggle>button{min-height:32px;font-size:9px}.j-load-toggle{width:100%}.j-build-row>button{min-height:34px;font-size:11px}.j-budget{font-size:8px;margin:4px 0}.j-launch{min-height:36px;font-size:13px}.j-console-foot{margin-top:0}.j-console-foot button{min-height:23px}
}

@container (max-height:540px) and (max-aspect-ratio:1){.j-plan-options>button{flex:0 0 32px}.j-load-toggle{flex:0 0 32px}.j-engine-choices{grid-auto-rows:32px;align-content:center}}

@container (max-height:540px) and (max-aspect-ratio:1){
 #journey-shell:has(.j-orders>span:only-child>b) .j-orders{top:64px;left:14px;right:auto}
 #journey-shell:has(.j-orders>span:only-child>b) .j-top-hint{top:64px;left:84px;right:14px}
}

@media(orientation:landscape) and (max-height:600px){.j-jobs{top:54px;grid-template-columns:repeat(2,minmax(0,1fr))}.j-job{min-width:0;grid-template-columns:24px minmax(0,1fr);gap:3px 5px}.j-job>.j-stars{gap:2px}.j-job>.j-stars .pictogram{width:14px;height:14px}}
@container (max-width:520px) and (min-aspect-ratio:1){.j-job{padding:4px;grid-template-columns:20px minmax(0,1fr);gap:2px 4px}.j-job>.pictogram{width:20px;height:20px}.j-job>b{font-size:9px}.j-job>.j-stars .pictogram{width:12px;height:12px}.j-map-foot>p{font-size:8px}.j-map-bottom{gap:3px}.j-map-bottom button.j-resume{font-size:8px;padding:4px}.j-map-head h2{font-size:16px!important}.j-chapter h3{font-size:14px!important}}

@container (max-height:490px) and (max-aspect-ratio:1){.j-liveries>button>span{width:24px;height:24px}.j-garage-hero{padding:3px}.j-garage-hero>b{font-size:11px}}
@container (max-height:280px) and (min-aspect-ratio:1){.j-result{row-gap:3px}.j-result-goods{gap:2px}.j-result-actions{gap:3px}.j-result-title small{font-size:9px}}

@media(orientation:landscape) and (max-height:350px){dialog[data-kind=lab-hub] .play-hub-art{height:54px}}

@media(orientation:portrait) and (max-height:700px){
 dialog[data-kind=lab-hub] .play-hub-art{height:clamp(35px,calc(var(--safe-height) - 430px),85px)}
 dialog[data-kind=lab-hub] .play-hub-card{gap:5px;padding:8px 5px}
 dialog[data-kind=lab-hub] .play-hub-card>b{font-size:14px}
 dialog[data-kind=lab-hub] .play-map-footer{padding-top:8px}
}

@media(orientation:portrait) and (max-height:700px){dialog[data-kind=welcome] .welcome-friend{height:100%;width:40%;bottom:0;right:0;object-fit:contain}dialog[data-kind=welcome] .welcome-toy-train{bottom:10px}dialog[data-kind=welcome] .welcome-toy-rail{bottom:10px}}

/* A changed draft must be applied before departure. */
.j-more-options{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:40px;margin:5px 0;border:1px solid #a6b995;border-radius:12px;background:#eef0d6;color:#456653;font:inherit;font-size:11px}.j-more-options .pictogram{width:23px;height:23px}
.j-single-route .j-route-nav>button{display:none}.j-single-route .j-route-nav{justify-content:center}
.j-budget>small{display:block;font-size:10px;line-height:1.4;color:#866134}.j-over-budget{color:#854b24}.j-over-budget strong{font-weight:900}.j-choice-notice{background:#fff0bd;border:1px solid #d0a451;color:#6b542c}
.j-build-row>button,.j-launch{min-height:44px}.j-console-foot .j-see-result{background:#ffda79;border:1px solid #c9a34d;border-radius:12px;padding:5px 9px;min-height:40px;color:#5d542b;font-weight:850}.j-arrived .j-run-buttons{display:none}.j-arrived .j-live-status{color:#3f7049}.j-arrived .j-orders>span.done{box-shadow:0 0 0 3px #fff0b2}
.j-result>.j-result-stars{gap:10px;align-items:flex-start}.j-result-stars>span{display:flex;flex-direction:column;align-items:center;gap:5px;opacity:1;filter:none;flex:1;max-width:125px}.j-result-stars>span:not(.earned)>.pictogram{opacity:.35;filter:grayscale(1)}.j-result-stars small{display:block;text-align:center;font-size:10px;font-weight:800;line-height:1.4;color:#657052;white-space:nowrap}.j-result-stars em{display:block;font-size:9px;font-style:normal;color:#8c7136}.j-result-stars>span:not(.earned) em{color:#77775e}.j-next-experiment{display:block;color:#536b41;font-size:12px;margin-bottom:5px}.j-result-learn>span{display:block}
@media(orientation:landscape) and (max-height:600px){.j-more-options{min-height:36px;font-size:10px;margin:4px 0}.j-budget>small{font-size:8px}.j-result-stars small{font-size:9px}.j-result-stars em{font-size:8px}.j-next-experiment{font-size:10px;margin-bottom:3px}.j-console-foot .j-see-result{min-height:36px}.j-result>.j-result-stars{gap:5px}}
@container (max-height:540px) and (max-aspect-ratio:1){.j-console.planning>.j-more-options{grid-column:1/-1;min-height:36px;margin:3px 0}.j-simple-planning>.j-engine-choices{grid-column:1/-1;display:flex}.j-simple-planning>.j-engine-choices>button{min-height:44px}.j-console.planning .j-build-row>button,.j-console.planning .j-launch{min-height:44px}.j-budget>small{font-size:8px}.j-more-options .pictogram{width:19px;height:19px}}
@container (max-height:490px) and (max-aspect-ratio:1){.j-result-stars small{font-size:8px}.j-result-stars em{font-size:8px}.j-result-stars>span{gap:2px}.j-next-experiment{font-size:10px;line-height:1.4;margin-bottom:3px}.j-result{gap:4px}}
@container (max-height:280px) and (min-aspect-ratio:1){.j-result-stars small{font-size:8px;white-space:normal}.j-result-stars em{font-size:8px}.j-result-stars>span{gap:2px}.j-next-experiment{font-size:9px;line-height:1.3;margin-bottom:2px}.j-result-learn{padding:5px;font-size:9px}.j-result-title small{font-size:9px}.j-result-friend{width:56px;height:56px;flex-basis:56px}.j-result>.j-result-stars .pictogram{width:25px;height:25px}}

.j-run-buttons>button{min-height:44px}

/* Short, first-use lessons are a separate dialog: the game screen stays intact. */
#lesson-dialog{position:fixed;inset:auto;left:calc((var(--safe-left) + 100vw - var(--safe-right))/2);top:calc((var(--safe-top) + 100dvh - var(--safe-bottom))/2);transform:translate(-50%,-50%);margin:0;box-sizing:border-box;width:min(560px,calc(var(--safe-width) - 24px));height:min(580px,calc(var(--safe-height) - 24px));max-width:none;max-height:none;padding:20px;border:3px solid #a1b88f;border-radius:27px;background:#fffbed;color:#3f604f;box-shadow:0 10px 0 #365b4730;overflow:hidden;container-type:size}
#lesson-dialog[open]{display:flex;flex-direction:column;gap:12px}#lesson-dialog::backdrop{background:#244c4966;backdrop-filter:blur(3px)}#lesson-dialog h2{font-size:23px;line-height:1.4;margin:0;color:#355d4b}#lesson-dialog p{margin:0;line-height:1.65}
.lesson-head{display:flex;align-items:center;gap:10px;flex-shrink:0}.lesson-head small{display:block;font-size:11px;margin-bottom:4px}.lesson-friend{width:58px;height:62px;object-fit:contain;flex-shrink:0}.lesson-art{display:flex;align-items:center;justify-content:center;gap:7px;flex:1;min-height:40px;max-height:110px}.lesson-art>.pictogram{width:clamp(40px,13vw,62px);height:clamp(40px,13vw,62px)}
#lesson-text{font-size:16px}.lesson-note{font-size:12px;background:#eaf0d5;border-radius:13px;padding:9px 11px;color:#526845}.lesson-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;flex-shrink:0}.lesson-nav>button{min-height:44px;min-width:75px;border:1px solid #a3b58d;border-radius:13px;background:#edf0d5;color:#45654e;padding:6px 12px;font:inherit;font-size:13px}.lesson-nav>button:last-child{flex:1;max-width:230px;background:#f4d584;font-weight:850}.lesson-nav>button:disabled{opacity:.4}.lesson-nav>b{white-space:nowrap;font-size:12px}.lesson-nav .pictogram{width:19px;height:19px;vertical-align:middle}#lesson-dialog .lesson-later{align-self:center;min-height:32px;margin:0;font-size:12px}
.lesson-compare{display:flex;gap:10px;justify-content:center}.lesson-compare>span{display:flex;flex:1;align-items:center;justify-content:center;flex-wrap:wrap;gap:5px;padding:10px;background:#f0edcc;border-radius:14px}.lesson-compare .pictogram{width:36px;height:36px}.lesson-compare b{font-size:15px}.lesson-slots{display:grid;grid-template-columns:repeat(6,12px);gap:3px}.lesson-slots>i{width:12px;height:11px;border:1px solid #aebc98;border-radius:2px;background:#fffbea}.lesson-slots>i.filled{background:#d9b56b;border-color:#ab8544}.lesson-count,.lesson-goal{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;min-height:65px;padding:6px;background:#f0edcc;border-radius:13px}.lesson-count>.pictogram,.lesson-goal>.pictogram{width:40px;height:40px}.lesson-count b{font-size:14px}.lesson-goal b{font-size:22px}#lesson-dialog:has(.lesson-compare,.lesson-count,.lesson-goal) .lesson-art{display:none}
.lesson-library{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(44px,1fr);gap:8px;flex:1;min-height:0}.lesson-library>button{display:flex;align-items:center;gap:7px;min-width:0;padding:8px;border:1px solid #adbf97;border-radius:13px;background:#f0f1d7;color:#45634f;text-align:left;font:inherit;font-size:13px;line-height:1.35}.lesson-library .pictogram{width:31px;height:31px;flex-shrink:0}.lesson-library-note{font-size:12px;text-align:center}#lesson-dialog .lesson-current{min-height:40px;margin:0}#lesson-dialog>.primary{min-height:44px;margin:0}
.j-practice-hint{background:#fff0c0;border:2px solid #ceb063;font-size:11px!important;line-height:1.5!important}.j-practice-hint>b{display:inline-block;padding:2px 6px;border-radius:8px;background:#e5bd5e;color:#4b5337;margin-right:4px}.j-practice-target{outline:3px solid #fff5bb;box-shadow:0 0 0 6px #bd974c,0 4px 0 #a68b47!important}.j-practice-choice{font-size:11px;text-align:center;margin:6px 0}
@container (max-height:500px){#lesson-dialog[open]{gap:8px}#lesson-dialog h2{font-size:19px}.lesson-friend{width:43px;height:47px}.lesson-head{gap:7px}.lesson-head small{font-size:10px}.lesson-art{max-height:60px}.lesson-art>.pictogram{width:40px;height:40px}#lesson-text{font-size:14px;line-height:1.55}.lesson-note{font-size:11px;padding:7px 9px}.lesson-compare>span{padding:5px}.lesson-compare .pictogram{width:28px;height:28px}.lesson-compare b{font-size:13px}.lesson-slots{grid-template-columns:repeat(6,10px);gap:2px}.lesson-slots>i{width:10px;height:9px}.lesson-library>button{font-size:12px;padding:5px}.lesson-library-note{display:none}}
@container (max-height:410px) and (max-aspect-ratio:1){.lesson-friend{display:none}.lesson-head small{font-size:9px}.lesson-art{max-height:45px}#lesson-text{font-size:13px}.lesson-note{font-size:10px;padding:6px}.lesson-compare>span{padding:4px}.lesson-compare .pictogram{width:24px;height:24px}.lesson-compare b{font-size:12px}.lesson-count,.lesson-goal{min-height:43px}.lesson-nav{gap:5px}.lesson-nav>button{font-size:12px;min-width:58px;padding:4px 6px}.lesson-library{gap:5px}.lesson-library .pictogram{width:25px;height:25px}}
@media(orientation:landscape) and (max-height:600px){#lesson-dialog{width:min(650px,calc(var(--safe-width) - 24px));padding:14px}#lesson-dialog[open]{display:grid;grid-template-columns:42% 1fr;grid-template-rows:auto 1fr auto 44px 27px;gap:7px 14px}.lesson-head{grid-column:1;grid-row:1}.lesson-friend{display:none}.lesson-head small{font-size:9px}#lesson-dialog h2{font-size:18px}.lesson-art,.lesson-compare,.lesson-count,.lesson-goal{grid-column:1;grid-row:2/4;align-self:center}.lesson-art{flex-wrap:wrap}.lesson-art>.pictogram{width:35px;height:35px}#lesson-text{grid-column:2;grid-row:1/3;align-self:center;font-size:13px;line-height:1.55}.lesson-note{grid-column:2;grid-row:3;font-size:10px;padding:6px}.lesson-nav{grid-column:1/-1;grid-row:4;margin:0}.lesson-later{grid-column:1/-1;grid-row:5}.lesson-compare{flex-direction:column;gap:5px}.lesson-compare>span{padding:4px}.lesson-compare .pictogram{width:25px;height:25px}.lesson-compare b{font-size:12px}.lesson-count{gap:5px}.lesson-count b{font-size:11px}.lesson-goal{gap:5px}.lesson-goal>.pictogram{width:29px;height:29px}#lesson-dialog.lesson-library-view{grid-template-columns:1fr 1fr;grid-template-rows:44px 1fr 44px;gap:8px}.lesson-library-view .lesson-head{grid-column:1;grid-row:1}.lesson-library-view .lesson-current{grid-column:2;grid-row:1}.lesson-library-view .lesson-library{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.lesson-library-view .lesson-library-note{display:none}.lesson-library-view .lesson-library>button{font-size:11px;padding:4px}.lesson-library-view .lesson-library .pictogram{width:23px;height:23px}.lesson-library-view .lesson-nav{grid-column:1;grid-row:3;gap:4px}.lesson-library-view .lesson-nav>button{min-width:42px;font-size:11px;padding:3px}.lesson-library-view>.primary{grid-column:2;grid-row:3;font-size:12px}}
@media(orientation:landscape) and (max-height:350px){#lesson-dialog{padding:10px}#lesson-dialog[open]{gap:5px 9px}#lesson-dialog h2{font-size:15px}#lesson-text{font-size:12px;line-height:1.45}.lesson-note{font-size:9px;line-height:1.4!important;padding:4px}.lesson-head small{font-size:8px}.lesson-art>.pictogram{width:29px;height:29px}.lesson-count .lesson-slots{grid-template-columns:repeat(3,10px)}.lesson-count>.pictogram{width:28px;height:28px}.lesson-goal b{font-size:18px}.lesson-compare .lesson-slots{display:none}.lesson-compare b{font-size:11px}}
@media(prefers-reduced-motion:reduce){.j-practice-target{animation:none!important}#lesson-dialog{animation:none!important}}

/* Route choice stays on one screen; six cards per page use the shared book controls. */
.j-route-nav>.j-route-picker{display:flex;flex:1;min-width:0;width:auto;height:auto;min-height:44px;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:1px solid #a7b994;background:#eef2d9;border-radius:13px;padding:4px;color:#49644d}
.j-route-picker>.j-pair{height:26px}.j-route-picker .j-pair>.pictogram{width:25px;height:25px}
.j-route-map{height:100%;display:flex;flex-direction:column;gap:10px}.j-route-map>p{font-size:12px;margin:0}.j-route-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;flex:1;min-height:0;align-content:center}.j-route-grid>button{display:flex;align-items:center;gap:5px;min-width:0;min-height:72px;padding:8px 6px;border:2px solid #c5d0af;border-radius:15px;background:#f7f5df;color:#44614d;font:inherit;text-align:left}.j-route-grid>button[aria-pressed=true]{border-color:#759b68;background:#e3edc9}.j-route-grid>button>.pictogram{width:30px;height:30px;flex-shrink:0}.j-route-grid>button>.pictogram:last-child{width:18px;height:18px;margin-left:auto}.j-route-grid>button>span{display:flex;min-width:0;flex-direction:column;gap:4px}.j-route-grid b{font-size:12px;line-height:1.35;overflow-wrap:anywhere}.j-route-grid small{font-size:10px;line-height:1.35}.j-route-map>.mini-action{min-height:44px;align-self:center}
dialog[data-kind=journey-routes] #dialog-content{height:calc(100% - 45px);display:flex;flex-direction:column}dialog[data-kind=journey-routes] .book-pages{align-items:stretch}dialog[data-kind=journey-routes] .book-page{flex:1;min-height:0;height:100%}
.j-live-status>.j-train-feedback{display:flex;flex-direction:column;gap:3px;width:100%;align-items:center}.j-train-feedback>span:first-child{display:flex;align-items:center;gap:4px}.j-train-feedback small{font-size:10px}.j-train-feedback .j-load-mini{display:flex;align-items:center;justify-content:center;gap:5px}.j-load-mini>.pictogram{width:24px;height:24px}.j-load-mini strong{font-size:11px;white-space:nowrap}.j-load-slots{display:grid;grid-template-columns:repeat(6,9px);gap:3px}.j-load-slots>i{width:9px;height:8px;border:1px solid #bac5a4;border-radius:2px;background:#f5f2db}.j-load-slots>i.filled{background:#d9ad58;border-color:#ae873f}
@media(orientation:landscape) and (max-height:600px){.j-route-picker>.j-pair{display:none}.j-route-grid{gap:6px}.j-route-grid>button{min-height:48px;padding:4px 6px}.j-route-grid b{font-size:11px}.j-route-grid small{font-size:9px}.j-route-map{gap:5px}.j-route-map>p{font-size:10px}.j-route-map>.mini-action{min-height:32px}.j-train-feedback small{font-size:9px}.j-load-slots{grid-template-columns:repeat(6,8px);gap:2px}.j-load-slots>i{width:8px;height:7px}.j-live-status>.j-train-feedback{gap:1px}}
@container (max-width:520px){.j-route-grid>button>.pictogram:last-child{display:none}.j-route-grid b{font-size:11px}.j-route-grid small{font-size:9px}}
@container (max-height:490px) and (max-aspect-ratio:1){.j-route-grid>button{min-height:68px}.j-route-map{gap:6px}.j-route-map>p{font-size:10px}}
@container (max-height:280px) and (min-aspect-ratio:1){.j-route-grid{gap:4px}.j-route-grid>button{min-height:44px;padding:3px}.j-route-grid>button>.pictogram{width:24px;height:24px}.j-route-grid b{font-size:10px}.j-route-grid small{font-size:8px}.j-route-map>p{display:none}.j-route-map>.mini-action{min-height:28px}.j-route-map{gap:3px}dialog[data-kind=journey-routes] h2{font-size:17px!important;margin-bottom:5px}}
@media(orientation:portrait){.j-route-grid{grid-auto-rows:minmax(76px,1fr)}.j-route-grid b{font-size:13px}.j-route-grid small{font-size:11px}.j-route-grid>button>.pictogram{width:34px;height:34px}.j-route-grid>button{padding:8px}.j-route-map>p{text-align:center}}
@media(orientation:portrait){.j-route-grid:not(:has(>button:nth-child(5))){flex:0 1 auto;grid-auto-rows:auto;margin-block:auto}.j-route-grid:not(:has(>button:nth-child(5)))>button{min-height:88px}.j-route-grid:not(:has(>button:nth-child(3))){grid-template-columns:1fr}.j-route-grid:not(:has(>button:nth-child(3))) b{font-size:15px}}

.j-result-goods{align-self:center;align-items:center}
@media(orientation:landscape) and (max-height:600px){.j-result-metrics{padding-right:36px}}

.j-route-nav>.j-priority-choice{flex:1;width:auto;min-width:0;min-height:44px;height:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:3px;background:#fff2c5;border:2px solid #c7ab59;border-radius:13px;color:#645a2f}.j-route-nav>.j-priority-choice b{font-size:12px}.j-route-nav>.j-priority-choice small{font-size:9px}.j-route-nav>.j-priority-choice[aria-pressed=true]{background:#e2eccb;border-color:#91ac77;color:#466346}
@media(orientation:landscape) and (max-height:350px){.j-route-nav>.j-priority-choice{min-height:44px}.j-route-nav>.j-priority-choice b{font-size:10px}.j-route-nav>.j-priority-choice small{font-size:8px}}

/* Short notched landscape: keep the result inside its own card as well as the safe area. */
@container (max-height:280px) and (min-aspect-ratio:1){
 .j-result{grid-template-columns:48% 1fr;column-gap:14px;row-gap:2px}
 .j-new-train{padding:3px;gap:3px}.j-new-train>.j-train-art{width:68px;height:30px;flex-shrink:0}.j-new-train>span{font-size:8px}.j-new-train b{font-size:11px}
 .j-result-learn:has(.j-next-experiment)>span{display:none}
 .j-result-actions{gap:2px}.j-result-actions>.primary{min-height:44px;padding:4px;margin:0}.j-result-actions>.mini-action,.j-result-actions>.subtle{min-height:30px;padding:3px 2px;line-height:1.2;white-space:nowrap}
}


/* Responsive audit: reserve room for actions instead of clipping the content. */
dialog[data-kind=welcome] .dialog-actions>button{min-height:48px!important;margin:0;padding:6px 8px}
dialog[data-kind=welcome] .dialog-actions{gap:8px}
dialog[data-kind^=journey-] #dialog-x{width:48px;height:48px;padding:0;line-height:1;display:grid;place-items:center}
.j-chapter>button{width:48px;height:48px;min-width:48px;min-height:48px;padding:0;line-height:1}
.j-menu-buttons>button,.j-map-bottom>button{min-height:48px}
dialog[data-kind=journey-map] #dialog-content{display:flex;flex-direction:column;gap:8px;overflow:hidden}
dialog[data-kind=journey-map] .j-map-head{flex-shrink:0;min-height:48px;padding-right:54px}
dialog[data-kind=journey-map] .j-chapter{flex-shrink:0;margin:0}
dialog[data-kind=journey-map] .j-map-scene{flex:1;min-height:0;height:auto;margin:0;overflow:hidden}
dialog[data-kind=journey-map] .j-jobs{flex-shrink:0;margin:0}
dialog[data-kind=journey-map] .j-map-foot{flex-shrink:0}
dialog[data-kind=journey-map] .j-map-foot>p{margin:0 0 6px}
.j-map-bottom{margin-top:6px}.j-map-bottom>span{flex:1}
.lesson-nav>button,#lesson-dialog .lesson-later,#lesson-dialog .lesson-current{min-height:48px;min-width:48px}
#lesson-dialog .lesson-later{padding:4px 12px;line-height:1.3}
.lesson-library>button{min-height:48px}
@media(orientation:portrait) and (max-height:650px){
 #lesson-dialog[open]{gap:7px;padding:14px}
 dialog[data-kind=journey-map]{padding:14px}
 dialog[data-kind=journey-map] #dialog-content{gap:6px}
 dialog[data-kind=journey-map] .j-map-scene{display:none}
 dialog[data-kind=journey-map] .j-jobs{flex:1;grid-auto-rows:minmax(48px,1fr);min-height:0}
 dialog[data-kind=journey-map] .j-job{min-height:48px;padding:6px}
 dialog[data-kind=journey-map] .j-map-bottom>span{display:none}
 dialog[data-kind=journey-map] .j-map-bottom>button{flex:1;font-size:10px}
}
@media(orientation:landscape) and (max-height:600px){
 dialog[data-kind=welcome]{height:calc(var(--safe-height) - 24px);box-sizing:border-box;padding:12px}
 dialog[data-kind=welcome] #dialog-content{min-height:0;height:100%;grid-template-columns:37% minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:6px 14px}
 dialog[data-kind=welcome] .welcome-scene{height:100%;min-height:0;grid-row:1/-1}
 dialog[data-kind=welcome] .welcome-copy{min-width:0;align-self:center}
 dialog[data-kind=welcome] .welcome-copy h2{font-size:20px;margin:2px 0 4px}
 dialog[data-kind=welcome] .welcome-copy p{font-size:11px;line-height:1.4}
 dialog[data-kind=welcome] .welcome-picture{min-height:0;margin:0;padding:2px;overflow:hidden}
 dialog[data-kind=welcome] .dialog-actions{display:grid;grid-template-columns:1fr 1fr;grid-row:3;align-self:stretch;gap:6px}
 dialog[data-kind=welcome] .welcome-journey-button{grid-column:1/-1;font-size:12px!important}
 dialog[data-kind=welcome] #guide-start,dialog[data-kind=welcome] #welcome-skip{font-size:11px}
 dialog[data-kind=journey-map] #dialog-content{display:grid;grid-template-columns:44% minmax(0,1fr);grid-template-rows:48px 48px minmax(0,1fr) auto;gap:8px 16px}
 dialog[data-kind=journey-map] .j-map-head{grid-column:1;grid-row:1;padding-right:0;min-width:0;position:static}
 dialog[data-kind=journey-map] .j-map-head h2{font-size:19px}
 dialog[data-kind=journey-map] .j-chapter{grid-column:1;grid-row:2;position:static;width:auto;min-width:0}
 dialog[data-kind=journey-map] .j-chapter h3{font-size:16px!important}
 dialog[data-kind=journey-map] .j-map-scene{grid-column:1;grid-row:3/5;position:relative;width:auto;inset:auto}
 dialog[data-kind=journey-map] .j-jobs{grid-column:2;grid-row:1/4;position:static;inset:auto;min-width:0;min-height:0;grid-auto-rows:minmax(48px,1fr)}
 dialog[data-kind=journey-map] .j-map-foot{grid-column:2;grid-row:4;position:static;min-width:0;inset:auto}
 dialog[data-kind=journey-map] .j-map-foot>p{display:none}
 dialog[data-kind=journey-map] .j-map-bottom>span{display:none}
 dialog[data-kind=journey-map] .j-map-bottom{gap:4px}
 dialog[data-kind=journey-map] .j-map-bottom>button{flex:1;min-width:0;padding:2px;font-size:9px;line-height:1.3}
 dialog[data-kind=journey-map] .j-menu-buttons{gap:5px}
 dialog[data-kind=journey-map] .j-menu-buttons>button{flex-direction:column;gap:2px;padding:3px;font-size:10px;line-height:1.2}
 dialog[data-kind=journey-map] .j-menu-buttons .pictogram{width:20px;height:20px}
 dialog[data-kind=journey-map] .j-job{min-height:48px;padding:6px;grid-template-columns:22px 1fr;gap:2px 4px}
 dialog[data-kind=journey-map] .j-job>.pictogram{width:22px;height:22px}
 dialog[data-kind=journey-map] .j-job>b{font-size:11px}
 #lesson-dialog[open]{grid-template-rows:auto 1fr auto 48px 48px;gap:6px 12px}
 #lesson-dialog.lesson-library-view{grid-template-rows:48px 1fr 48px;gap:6px}
 .lesson-library-view .lesson-nav>button{min-width:48px;min-height:48px}
}
@media(orientation:landscape) and (max-height:350px){
 dialog[data-kind=welcome] .welcome-picture{display:none}
 dialog[data-kind=welcome] #dialog-content{grid-template-rows:minmax(0,1fr) 0 auto;row-gap:4px}
 dialog[data-kind=welcome] .welcome-journey-button small{display:block;font-size:9px;margin:0}
 dialog[data-kind=welcome] .welcome-copy h2{font-size:18px}
 dialog[data-kind=welcome] .welcome-copy p{font-size:10px}
 dialog[data-kind=journey-map]{padding:12px}
 dialog[data-kind=journey-map] #dialog-content{grid-template-columns:42% minmax(0,1fr);gap:6px 12px}
 dialog[data-kind=journey-map] .j-map-head>strong{font-size:15px;gap:2px}
 dialog[data-kind=journey-map] .j-map-head>strong>.pictogram{width:20px;height:20px}
 dialog[data-kind=journey-map] .j-map-head>strong>small{font-size:9px}
 dialog[data-kind=journey-map] .j-map-head h2{font-size:16px}
 dialog[data-kind=journey-map] .j-map-head small{font-size:8px}
 dialog[data-kind=journey-map] .j-chapter h3{font-size:13px!important}
 dialog[data-kind=journey-map] .j-chapter>div>small{font-size:9px}
 dialog[data-kind=journey-map] .j-job>b{font-size:10px}
 dialog[data-kind=journey-map] .j-job>.j-stars .pictogram{width:14px;height:14px}
 dialog[data-kind=journey-map] .j-job>.j-stars{gap:2px}
 #lesson-dialog[open]{gap:4px 9px}
}

@media(orientation:landscape) and (max-height:600px){
 dialog[data-kind=journey-map] #dialog-content{grid-template-rows:48px minmax(100px,1fr) 48px 48px;gap:6px 14px}
 dialog[data-kind=journey-map] .j-map-head{grid-column:1/-1;grid-row:1;width:auto;inset:auto;padding-right:54px;justify-content:flex-start;gap:15px}
 dialog[data-kind=journey-map] .j-map-head h2{font-size:20px;white-space:nowrap}
 dialog[data-kind=journey-map] .j-chapter{grid-column:1;grid-row:2;display:grid;grid-template-columns:48px 1fr 48px;grid-template-rows:1fr 48px;gap:4px;align-items:center}
 dialog[data-kind=journey-map] .j-chapter>div{grid-column:1/-1;grid-row:1}
 dialog[data-kind=journey-map] .j-chapter>button:first-child{grid-column:1;grid-row:2}
 dialog[data-kind=journey-map] .j-chapter>button:last-child{grid-column:3;grid-row:2}
 dialog[data-kind=journey-map] .j-map-scene{grid-row:3/5}
 dialog[data-kind=journey-map] .j-jobs{grid-row:2;gap:4px}
 dialog[data-kind=journey-map] .j-map-foot{display:contents}
 dialog[data-kind=journey-map] .j-menu-buttons{grid-column:2;grid-row:3}
 dialog[data-kind=journey-map] .j-map-bottom{grid-column:2;grid-row:4;margin:0}
}
@media(orientation:landscape) and (max-height:350px){
 dialog[data-kind=journey-map]{padding:6px 10px}
 dialog[data-kind=journey-map] #dialog-content{gap:4px 12px}
 dialog[data-kind=journey-map] .j-map-head h2{font-size:18px}
 dialog[data-kind=journey-map] .j-chapter h3{font-size:15px!important}
 dialog[data-kind=journey-map] .j-map-scene>p{font-size:9px}
}

.j-brief>.primary,.j-brief>.subtle{min-height:48px;flex-shrink:0}
@media(orientation:landscape) and (max-height:600px){
 .j-brief{grid-template-columns:40% minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) 48px 48px;gap:4px 14px;align-content:stretch}
 .j-brief>small{grid-column:1;grid-row:1}
 .j-brief>h2{grid-column:1;grid-row:2;font-size:18px!important}
 .j-brief-hero{grid-column:1;grid-row:3;min-height:0;height:100%;max-height:125px;align-self:center}
 .j-brief>.j-soft-note{grid-column:1;grid-row:4/6;align-self:center;font-size:10px}
 .j-brief-targets{grid-column:2;grid-row:1}
 .j-brief>p:not(.j-soft-note){grid-column:2;grid-row:2}
 .j-medal-rules{grid-column:2;grid-row:3;align-self:center;gap:3px;padding:5px}
 .j-brief>.primary{grid-column:2;grid-row:4;min-height:48px;margin:0}
 .j-brief>.subtle{grid-column:2;grid-row:5;min-height:48px;margin:0}
}
@media(orientation:landscape) and (max-height:350px){
 dialog[data-kind=journey-map] .j-job{padding:3px 4px;row-gap:0}
 dialog[data-kind=journey-map] .j-job>b{line-height:1.15}
 dialog[data-kind=journey-map] .j-job>.j-stars .pictogram{width:12px;height:12px}
 .j-brief-hero>.pictogram{width:37px;height:37px}.j-brief-hero>.pictogram:nth-child(2){width:50px;height:50px}
 .j-medal-rules .pictogram{width:16px;height:16px}
}

/* Primary actions use 48px; compact camera/time utilities retain 44px. */
.j-round{width:44px;height:44px;min-width:44px;min-height:44px;flex-basis:44px;padding:0;display:grid;place-items:center;line-height:1}
.j-camera>button{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;line-height:1;display:grid;place-items:center}
.j-route-nav>button{width:48px;min-height:48px;flex-basis:48px;line-height:1;padding:2px}
.j-engine-choices>button,.j-build-row>button,.j-launch,.j-run-buttons>button{min-height:48px}
.j-plan-options>button,.j-load-toggle>button{min-height:44px}
.j-console-foot button{min-height:44px;padding:4px 6px}
@container(max-height:500px) and (max-aspect-ratio:1){
 .j-orders{top:80px}.j-top-hint{top:80px}
 .j-camera{left:14px;right:auto;top:130px;grid-template-columns:repeat(4,44px);gap:6px}
 .j-console{padding-top:7px;padding-bottom:5px}
 .j-engine-choices{margin:5px 0}
 .j-console-foot{margin-top:2px}
}
@media(orientation:landscape) and (max-height:600px){
 .j-plan-options>button{flex-basis:62px}
 .j-console-foot{margin-top:2px}
 .j-hud{padding:4px;min-height:56px;box-sizing:border-box}
 .j-orders{top:74px}.j-top-hint{top:119px}
}

#journey-shell .j-console .j-engine-choices>button,#journey-shell .j-console .j-build-row>button,#journey-shell .j-console .j-launch,#journey-shell .j-console .j-run-buttons>button{min-height:48px}
#journey-shell .j-console .j-practice-choice{grid-column:1/-1;width:100%;margin:4px 0}

.j-result-actions>.primary{min-height:48px}
.j-result-actions>.mini-action,.j-result-actions>.subtle{min-height:44px}
.j-garage>.mini-action,.j-passport>.mini-action,.j-help>.mini-action,.j-finale-links>button{min-height:44px}
.j-transfer-actions>button,.j-transfer>.subtle{min-height:48px}
.j-help>.primary,.j-finale>.primary{min-height:48px}

dialog[data-kind=journey-passport] #dialog-content,dialog[data-kind=journey-parent] #dialog-content{height:calc(100% - 60px)}
@media(orientation:landscape) and (max-height:350px){
 .j-liveries>button{padding:3px 2px;gap:2px}
 .j-liveries>button>span{padding:2px}
 .j-liveries b{font-size:9px;line-height:1.2}
 .j-liveries small{font-size:8px;line-height:1.15}
}

.j-compact-settings{display:none}
.j-settings{height:100%;display:grid;grid-template-rows:auto 1fr auto auto auto;gap:12px;align-content:center;text-align:center}
.j-settings>header{padding-right:40px}.j-settings h2{font-size:20px!important}.j-settings>p{font-size:12px;margin:0}
.j-settings .j-engine-choices>button,.j-settings .j-plan-options>button,.j-settings .j-load-toggle>button,.j-settings>.primary{min-height:48px}
.j-settings .j-plan-options{margin:0}.j-settings .j-engine-choices{margin:0;align-self:center}
@container(max-height:540px) and (max-aspect-ratio:1){
 #journey-shell .j-console:has(.j-compact-settings) .j-engine-choices,#journey-shell .j-console .j-plan-options,#journey-shell .j-console .j-more-options{display:none}
 #journey-shell .j-console .j-compact-settings{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:48px;grid-column:1/-1;border:2px solid #adc19a;border-radius:13px;background:#e8efd5;color:#3f624f;padding:4px;font-size:11px}
 .j-compact-settings>.pictogram{display:none}.j-compact-settings>span{font-size:10px}
 #journey-shell .j-camera{left:80px;right:auto;top:auto;bottom:18px;grid-template-columns:repeat(4,44px);gap:6px;z-index:2}
 #journey-shell .j-console-foot>span{display:none}
}
@media(orientation:portrait) and (max-height:650px){
 .j-brief{gap:6px}.j-brief-hero{height:65px;min-height:40px;flex-shrink:1}.j-brief>h2{font-size:20px!important}
 .j-brief-hero>.pictogram{width:40px;height:40px}.j-brief-hero>.pictogram:nth-child(2){width:55px;height:55px}
}
@media(orientation:landscape) and (max-height:600px){
 #journey-shell .j-console:has(.j-compact-settings) .j-engine-choices,#journey-shell .j-console .j-plan-options,#journey-shell .j-console .j-more-options{display:none}
 #journey-shell .j-console .j-compact-settings{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:48px;border:2px solid #adc19a;border-radius:13px;background:#e8efd5;color:#3f624f;padding:4px;font-size:11px}
 .j-compact-settings>.pictogram{display:none}.j-compact-settings>span{font-size:10px}
 #journey-shell .j-camera{left:14px;right:auto;top:auto;bottom:14px;grid-template-columns:repeat(2,44px);gap:6px}
 .j-settings{grid-template-columns:40% minmax(0,1fr);grid-template-rows:auto 1fr auto;gap:8px 16px}
 .j-settings>header{grid-column:1;grid-row:1;padding:0}
 .j-settings>.j-engine-choices{grid-column:1;grid-row:2/4;flex-direction:column;align-self:stretch;justify-content:center;gap:8px}
 .j-settings>.j-plan-options{grid-column:2;grid-row:1;display:grid;grid-template-columns:1fr;gap:6px}
 .j-settings>.j-plan-options>button{flex-basis:auto}
 .j-settings>p{grid-column:2;grid-row:2;align-self:center;font-size:11px}
 .j-settings>.primary{grid-column:2;grid-row:3;margin:0;font-size:12px}
 .j-settings h2{font-size:18px!important;margin:4px 0!important}
}

#lesson-dialog>.primary{min-height:48px}
.j-route-map>.mini-action{min-height:44px}
@media(orientation:landscape) and (max-height:600px){
 dialog[data-kind=journey-routes] .j-route-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

#dialog .book-page .mini-action{min-height:44px}
#dialog .j-transfer .j-transfer-actions>button{min-height:48px}
@media(orientation:landscape) and (max-height:600px){
 .j-transfer{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto minmax(48px,1fr);gap:6px 16px;align-content:center}
 .j-transfer>h3{grid-column:1;grid-row:1;font-size:14px!important}
 .j-transfer>p{grid-column:1;font-size:10px!important;line-height:1.45!important}
 .j-transfer>p:first-of-type{grid-row:2}.j-transfer>p:last-child{grid-row:3}
 .j-transfer-actions{grid-column:2;grid-row:1/3;flex-direction:column;gap:6px}
 .j-transfer>.subtle{grid-column:2;grid-row:3;margin:0;align-self:center}
}

#journey-shell .j-console .j-more-options,#journey-shell .j-console .j-plan-options>button,#journey-shell .j-console .j-load-toggle>button{min-height:44px}
.j-complete-label{min-height:44px}
.j-transfer-status:empty{display:none}
.j-transfer-status:not(:empty){padding:10px;border:2px solid #9a7643;border-radius:12px;background:#fff4d7;color:#554124;overflow-wrap:anywhere}

.j-help.free-finish>p{font-size:14px!important;line-height:1.55!important}.j-help.free-finish>button{font-size:14px!important;min-height:48px}

/* The delivery itself takes place on the map. The plan and controls open on demand. */
.j-map-top {
 position:absolute;
 inset:10px 10px auto;
 display:grid;
 grid-template-columns:48px minmax(0,1fr) 48px;
 align-items:start;
 gap:6px;
}
.j-map-top button,.j-map-bottom-bar button {
 pointer-events:auto;
 min-height:48px;
 min-width:48px;
 padding:7px;
 border:2px solid #9bb699;
 border-radius:17px;
 background:#fffbe8;
 color:#365e4b;
 box-shadow:0 3px 0 #64835946;
 font-weight:800;
}
.j-map-top button .pictogram {width:28px;height:28px;display:block;margin:auto}
.j-map-top [data-j=details] {font-size:19px;letter-spacing:2px}
.j-map-goals {display:flex;flex-wrap:wrap;justify-content:center;gap:4px;padding-top:4px}
.j-map-goals>span {
 display:flex;align-items:center;gap:4px;min-height:34px;
 border:1px solid #bfd2a9;border-radius:13px;background:#fffbe8;
 padding:4px 8px;font-size:14px;font-variant-numeric:tabular-nums;
}
.j-map-goals>span.done {background:#e1efcf;border-color:#8faf7c}
.j-map-goals>span.done::after {content:none}
.j-map-goals .pictogram {width:22px;height:22px}
.j-map-bottom-bar {position:absolute;inset:auto 12px 12px;display:flex;justify-content:center}
.j-map-bottom-bar p {
 margin:0;padding:7px 14px;border-radius:16px;
 background:#fffbe8ed;color:#395846;font-size:14px;font-weight:800;
}
#world .station-map-play .station-marker {visibility:hidden}
#world .station-map-play.station-map-target,#world .station-map-play.selected,
#world .station-map-play:has(.station-map-arrival) {z-index:8;opacity:1}
#world .station-map-play.station-map-target .station-marker,
#world .station-map-play.selected .station-marker {visibility:visible;inset:0;width:44px;height:44px}
#world .station-map-play.station-map-target .station-marker {
 background:#fff6cc;border:3px solid #b97922;
 outline:4px solid #ffec8e;outline-offset:2px;
 animation:j-station-pulse 1.6s ease-in-out infinite;
}
#world .station-map-play.selected .station-marker {background:#fffbe8;border-color:#52785b}
.station-map-arrival {
 position:absolute;left:50%;bottom:42px;transform:translateX(-50%);
 display:flex;align-items:center;gap:5px;padding:5px 10px;
 border:2px solid #a5762e;border-radius:18px;background:#fff2bf;color:#634a26;
 box-shadow:0 4px 0 #94744138;pointer-events:none;white-space:nowrap;
 animation:j-map-arrival 1.6s ease-out both;
}
.station-map-arrival .pictogram {width:27px;height:27px}
@keyframes j-station-pulse {50%{outline-offset:7px;box-shadow:0 0 0 8px #fff1a480}}
@keyframes j-map-arrival {0%{opacity:0;translate:0 8px}18%,75%{opacity:1;translate:0 -4px}100%{opacity:0;translate:0 -18px}}
.j-map-result {height:100%;display:grid;align-content:center;justify-items:center;gap:9px;text-align:center}
.j-map-result>.j-result-friend {width:clamp(76px,21cqh,160px);height:clamp(76px,21cqh,160px);object-fit:contain}
.j-map-result>h2 {margin:0}
.j-map-result>.j-stars .pictogram {width:34px;height:34px}
.j-map-result>.primary {width:min(260px,100%);margin:0}
.j-map-result-links {display:flex;justify-content:center;gap:12px}
.j-map-result-links button {min-height:44px}
@media(orientation:landscape) and (max-height:440px){
 .j-map-result {gap:5px}
 .j-map-result>.j-result-friend {width:65px;height:65px}
 .j-map-result>.j-stars .pictogram {width:26px;height:26px}
}
@media(prefers-reduced-motion:reduce){
 #world .station-map-play.station-map-target .station-marker,.station-map-arrival {animation:none}
}
.reduce-motion #world .station-map-play.station-map-target .station-marker,
.reduce-motion .station-map-arrival {animation:none}
