:root { color-scheme:dark; font:14px/1.45 "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif; }
* { box-sizing:border-box; }
body { margin:0; overflow:hidden; background:#1b3033; color:#f5efdc; }
button { cursor:pointer; font:inherit; color:inherit; }
button:focus-visible { outline:2px solid #ffebac; outline-offset:3px; }
[hidden] { display:none !important; }
dialog { background:#1d3234; color:#f0ead8; border:1px solid #8b927c; border-radius:8px; padding:20px; max-width:min(475px,calc(100vw - 30px)); box-shadow:0 12px 48px #0c191b90; }
dialog::backdrop { background:#101b2079; }
dialog h2 { font-size:18px; margin:0 32px 3px 0; }
dialog p { margin:4px 0 12px; color:#cad3bf; font-size:12px; }
dialog .dialog-close { position:absolute; top:9px; right:10px; border:0; background:transparent; color:#e8e3d4; font-size:23px; padding:2px 7px; }
.road-map #map-screen { display:block; width:min(390px,calc(63dvh * .75),calc(100vw - 74px)); height:auto; border:1px solid #768e88; }
.road-map #map-screen+p { margin:9px 0 0; }
.road-map #map-screen { touch-action:none; }
.road-map #map-screen > * { pointer-events:none; }
#recovery-restart { min-height:44px; padding:8px 18px; border:1px solid #e8cf93; border-radius:6px; background:#ebd7a7; color:#192f2e; }
.loading { position:fixed; inset:0; z-index:12; background:#1b3033; display:grid; place-items:center; color:#e9debc; }
.explorer { position:fixed; inset:0; z-index:10; color:#f5efdc; background:#b5d7d7; }
#explorer-canvas { position:absolute; inset:0; touch-action:none; cursor:grab; }
#explorer-canvas:active { cursor:grabbing; }
#explorer-canvas canvas { display:block; width:100%; height:100%; }
.explorer::after { content:""; position:absolute; inset:0; z-index:0; pointer-events:none; background:linear-gradient(#172f3655, transparent 21%, transparent 77%, #25322d62); }
.exp-top,.exp-location,.exp-bottom,.exp-touch,.exp-notice { position:absolute; z-index:1; }
.exp-top { inset:16px 19px auto; display:flex; justify-content:space-between; align-items:center; pointer-events:none; }
.exp-top b { display:block; font:600 26px/1.1 Georgia,"Songti SC",serif; letter-spacing:.07em; text-shadow:0 1px 6px #152928; }
.exp-top small { font-size:10px; letter-spacing:.10em; text-shadow:0 1px 6px #152928; }
.exp-top-controls { display:flex; gap:6px; pointer-events:auto; }
.explorer button { border:1px solid #d9c79585; border-radius:5px; color:#f3e8ce; background:#203534ef; padding:6px 9px; font-size:11px; }
.explorer button:not(:disabled):hover { background:#496052; }
.explorer button:disabled { opacity:.7; cursor:default; }
.exp-location { top:73px; left:19px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:3px; width:clamp(153px,19vw,183px);
  height:71px; background:#203534ef; border:1px solid #b4a7829c; border-radius:5px; padding:0 12px;
  overflow:hidden; pointer-events:none; }
.exp-location h2 { margin:0; color:#f5ebce; font-size:15px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#exp-weather { color:#d2dbcd; font-size:11px; font-variant-numeric:tabular-nums; }
.explorer .minimap { position:absolute; z-index:2; bottom:32px; left:19px; width:210px; aspect-ratio:420/254;
  padding:0; overflow:hidden; border:1px solid #c4b894af; border-radius:7px; background:#192d30; box-shadow:0 3px 15px #0f1d2250; }
.explorer .minimap:hover { border-color:#f3dc9a; background:#192d30; }
.minimap canvas { display:block; width:100%; height:100%; }
.exp-bottom { inset:auto 19px 17px; display:grid; grid-template-columns:1fr auto 1fr; gap:8px; align-items:end; pointer-events:none; }
.exp-hint { color:#fff1d1; text-shadow:0 1px 5px #162624; font-size:11px; }
#exp-interact { grid-column:2; pointer-events:auto; min-width:112px; padding:8px 10px; }
#exp-interact:enabled { background:#ebd9ac; color:#22352d; border-color:#fff2c9; }
#exp-interact kbd { border:1px solid currentColor; border-radius:3px; padding:1px 4px; }
.exp-speed { grid-column:3; justify-self:end; background:#203534ea; border:1px solid #b4a7829c; border-radius:5px; padding:5px 8px; width:63px; text-align:center; }
.exp-speed strong { display:block; font:600 22px/1 Georgia,serif; }
.exp-speed small { font-size:10px; color:#ebd9ac; }
.exp-notice { inset:auto auto 70px 50%; transform:translateX(-50%); color:#f5e4bb; background:#203534ea; border:1px solid #b4a7829c; border-radius:4px; padding:6px 9px; font-size:11px; pointer-events:none; white-space:nowrap; }
.exp-touch { display:none; }
.exp-touch [data-explore-key="space"] { align-self:flex-start; }
#exp-help .dialog-close { background:transparent; border:0; font-size:20px; }

@media(max-width:720px), (pointer:coarse) {
  .exp-top { inset:12px 12px auto; }
  .exp-location { top:59px; left:12px; }
  .explorer .minimap { width:clamp(128px, 30vw, 173px); left:12px; bottom:50px; }
  .exp-bottom { inset:auto 12px max(12px,env(safe-area-inset-bottom)); }
  .exp-hint { display:none; }
  .exp-touch { display:flex; align-items:flex-end; justify-content:space-between; inset:auto 12px 166px; pointer-events:none; }
  .exp-dpad { display:grid; grid-template-columns:repeat(3,39px); grid-template-rows:repeat(2,38px); gap:3px; }
  .exp-touch button { pointer-events:auto; touch-action:none; }
  .exp-dpad button:first-child { grid-column:2; }
  .exp-dpad button:nth-child(2) { grid-column:1; grid-row:2; }
  .exp-dpad button:nth-child(3) { grid-column:2; grid-row:2; }
  .exp-dpad button:last-child { grid-column:3; grid-row:2; }
  .exp-notice { bottom:111px; }
}

.drive-panel { position:absolute; right:18px; bottom:86px; z-index:2; display:grid; gap:5px; width:230px;
  padding:8px; border:1px solid #c4b89495; background:#16292aec; border-radius:7px; }
.drive-status { display:flex; align-items:center; justify-content:space-between; gap:5px; color:#eee1bf; font-size:10px; }
.drive-status > b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.drive-status > span { white-space:nowrap; }
.drive-row { display:grid; grid-template-columns:repeat(4,1fr); gap:4px; }
.drive-row button { padding:4px 2px; min-width:0; }
.gear-row button { font-weight:700; font-family:system-ui,sans-serif; }
.drive-row button[aria-pressed=true] { background:#eddbab; color:#22342e; border-color:#efdeaf; }
.drive-cameras { position:absolute; left:18px; right:18px; top:23%; z-index:3; display:grid;
  grid-template-columns:minmax(138px,235px) 1fr minmax(100px,165px); grid-template-rows:auto; gap:4px; pointer-events:none; }
.drive-cameras figure { position:relative; margin:0; aspect-ratio:1.55; border:1px solid #e1d1a2a3; box-shadow:0 3px 10px #04101050; }
.drive-cameras figcaption { position:absolute; inset:auto 0 0; padding:3px 5px; background:#142525db; color:#f6e6be; font-size:10px; }
.drive-cameras figure:nth-child(2) { grid-column:3; aspect-ratio:1.15; }
.drive-cameras[data-mode=surround] { grid-template-columns:minmax(130px,235px) 1fr repeat(2,minmax(74px,132px)); }
.drive-cameras[data-mode=surround] figure:first-child { grid-row:1/3; align-self:start; }
.drive-cameras[data-mode=surround] figure:nth-child(3),.drive-cameras[data-mode=surround] figure:nth-child(5) { grid-column:3; }
.drive-cameras[data-mode=surround] figure:nth-child(4),.drive-cameras[data-mode=surround] figure:nth-child(6) { grid-column:4; }
.drive-touch { display:none; }
@media(max-width:720px), (pointer:coarse) {
  .drive-panel { right:12px; bottom:86px; width:clamp(172px,40vw,222px); }
  .drive-status { font-size:9px; }
  .drive-status > b { font-size:10px; }
  .explorer[data-driving=true] .exp-touch { display:none; }
  .explorer[data-driving=true] .drive-touch { display:flex; position:absolute; left:12px; right:12px; bottom:247px;
    justify-content:space-between; align-items:center; pointer-events:none; z-index:4; }
  .drive-touch button { pointer-events:auto; touch-action:none; min-height:40px; }
  #drive-stick { width:67px; height:67px; border-radius:50%; display:grid; place-items:center; }
  #drive-stick i { width:26px; height:26px; border-radius:50%; background:#e2cc9f; border:2px solid #28362c; }
  .explorer[data-novice=true] .drive-accelerator { display:none; }
  .drive-cameras { left:12px; right:12px; top:21%; grid-template-columns:minmax(96px,28vw) 1fr minmax(80px,22vw); }
  .drive-cameras[data-mode=surround] { grid-template-columns:minmax(96px,26vw) 1fr repeat(2,minmax(55px,15vw)); }
}

.drive-row:last-child { grid-template-columns:repeat(5,1fr); }

.game-dialog { width:min(386px,calc(100vw - 24px)); }
.game-dialog h2 { margin:0 36px 16px 0; }
.settings-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.settings-row+label,.settings-row+ p { margin:10px 0 18px; }
.settings-row select { min-width:135px; border:1px solid #a49c7d; border-radius:5px; background:#203534; color:#f3e8ce; padding:7px 10px; font:inherit; }
#empire-book .settings-row select { max-width:70%; }
.settings-row input[type=range] { width:135px; accent-color:#e7c378; }
#world-time-value { margin-left:4px; color:#e7d5a5; font-variant-numeric:tabular-nums; }
#graphics-detail,#graphics-fps { color:#c2d1c6; font-size:12px; }
.aircraft-list { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.aircraft-list button { display:grid; gap:5px; text-align:left; padding:12px 9px; }
.aircraft-list small { color:#c7d2c7; }
.route-panel,.flight-panel { position:absolute; z-index:1; color:#f2ead0; border:1px solid #cab88977; border-radius:7px; background:#142a2ae9; padding:8px 10px; font-size:12px; }
.route-panel { right:18px; bottom:240px; width:220px; }
.route-panel div,.flight-panel div { display:flex; justify-content:space-between; gap:10px; }
.route-panel label { display:flex; justify-content:space-between; align-items:center; margin-top:7px; }
.route-panel input { width:100%; accent-color:#e7c378; margin:5px 0; }
.route-panel button { width:100%; }
.flight-panel { right:18px; bottom:78px; width:min(300px,calc(100vw - 30px)); }
.flight-panel p { margin:7px 0; line-height:1.35; }
.flight-panel .flight-touch { display:none; }
.map-tools { display:flex; gap:6px; margin:9px 0; flex-wrap:wrap; }
.map-tools button { border:1px solid #758b81; border-radius:5px; background:#243938; color:#f5e8c8; padding:6px 9px; font-size:12px; }
.map-tools button:disabled { opacity:.50; }
#map-navigate { margin-left:auto; color:#a6efd7; }
#map-route-status { display:block; min-height:1.4em; font-size:12px; color:#ead9b4; }
#map-screen { cursor:crosshair; touch-action:none; }
#map-screen:active { cursor:grabbing; }
.explorer[data-flying=true] .exp-hint,
.explorer[data-flying=true] .exp-touch > [data-explore-key="space"] { visibility:hidden; }
@media (pointer:coarse) {
  .flight-panel .flight-touch { display:grid; grid-template-columns:repeat(4,1fr); margin-top:6px; }
  .flight-touch button { touch-action:none; min-height:35px; }
}
@media (max-width:580px) {
  .exp-top { align-items:start; }
  .exp-top-controls { justify-content:end; flex-wrap:wrap; max-width:245px; }
  .route-panel { right:9px; bottom:218px; width:166px; }
  .flight-panel { right:9px; bottom:155px; width:min(237px,calc(100vw - 25px)); }
  .exp-top small { display:none; }
}

.pulse-panel { position:absolute; right:18px; bottom:93px; z-index:3; width:226px; border:1px solid #a5cdb18d; border-radius:6px; background:#192f31ec; padding:8px 11px; }
.pulse-panel div { display:flex; justify-content:space-between; font-size:12px; gap:8px; }
.pulse-panel p { margin:5px 0 7px; font-size:11px; color:#d6e4d4; }
.pulse-reticle { position:absolute; z-index:2; top:50%; left:50%; width:19px; height:19px; transform:translate(-50%,-50%);
  background:linear-gradient(#fff5e5,#fff5e5) top center/1.4px 5px no-repeat,
    linear-gradient(#fff5e5,#fff5e5) bottom center/1.4px 5px no-repeat,
    linear-gradient(90deg,#fff5e5,#fff5e5) center left/5px 1.4px no-repeat,
    linear-gradient(90deg,#fff5e5,#fff5e5) center right/5px 1.4px no-repeat;
  filter:drop-shadow(0 1px 1px #162322); pointer-events:none; }
.pulse-reticle i { position:absolute; opacity:0; inset:-3px; transform:scale(1);
  background:linear-gradient(45deg,transparent 47%,var(--hit-color,#fff5e5) 48% 53%,transparent 54%),
    linear-gradient(-45deg,transparent 47%,var(--hit-color,#fff5e5) 48% 53%,transparent 54%); }
.pulse-reticle i[data-kind=robot] { --hit-color:#ffb48b; }
.shot-surface { display:block; min-height:1.25em; color:#f5e0b0; font-size:11px; margin-top:4px; }
.explorer[data-pulse=true] #explorer-canvas { cursor:crosshair; }
.explorer #exp-pulse[aria-pressed=true] { background:#e4dfb6; color:#203735; }
@media (max-width:580px) {
  .pulse-panel { right:10px; bottom:167px; width:195px; }
}

.rail-panel,.rail-waypoint {
  position:absolute;z-index:1;color:#f6efdf;
  background:#132c39f2;border:1px solid #77939b;border-radius:7px;
  font-size:12px;
}
.rail-panel { right:19px;top:75px;max-width:min(290px,calc(100% - 40px));padding:9px 11px;border-top:3px solid var(--rail-accent,#36c3bf); }
.rail-panel h2 { margin:0 0 3px;font-size:15px;line-height:1.3; }
.rail-panel output { display:block;line-height:1.45;color:#e5ecdc; }
.rail-panel ul { margin:6px 0 0;padding:0;list-style:none; }
.rail-panel li { display:flex;justify-content:space-between;gap:18px;padding:4px 0;border-top:1px solid #839fa153; }
.rail-panel li strong { color:#f4cd8e;white-space:nowrap; }
.rail-panel dl { margin:7px 0;display:grid;grid-template-columns:repeat(4,minmax(43px,1fr));gap:7px; }
.rail-panel dt { color:#b8ccd0;font-size:10px; }
.rail-panel dd { margin:2px 0 0;font:650 12px/1.25 system-ui;color:#e7f4ee;font-variant-numeric:tabular-nums; }
#rail-driver[data-signal="red"] #rail-distance,#hsr-driver[data-signal="red"] #hsr-distance { color:#ff9079; }
#rail-driver[data-signal="amber"] #rail-limit { color:#f4bb62; }
.rail-keys { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px; }
.rail-keys button,.map-rail-tools button,.map-rail-tools select {
  color:#f5eddf;background:#203c48;border:1px solid #81999f;border-radius:4px;padding:5px 6px;font:inherit;
}
.rail-keys button:disabled { opacity:.47; }
.rail-waypoint { bottom:182px;left:19px;padding:5px 9px;border-color:#5caeac; }
.map-rail-tools { display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:4px 0 8px;font-size:12px; }
.map-rail-tools[hidden],.rail-panel[hidden],.rail-waypoint[hidden],.rail-panel [hidden] { display:none; }
#map-rail-toggle[aria-pressed=true] { background:#f1dcc0;color:#16352e; }
[data-rail=true] #exp-drones,[data-rail=true] #exp-pulse,
[data-rail-driver=true] .exp-touch,[data-hsr-driver=true] .exp-touch { display:none; }
[data-rail=true] .exp-hint { visibility:hidden; }

@media (max-width:720px),(pointer:coarse) {
  .rail-panel { top:124px;right:12px;max-width:min(250px,calc(100% - 24px)); }
  .rail-waypoint { left:12px;bottom:225px; }
}
@media (max-height:510px) {
  .rail-panel { top:61px; }
}

.rail-pa {
  position:absolute;z-index:2;left:50%;bottom:115px;transform:translateX(-50%);
  width:max-content;max-width:calc(100% - 32px);padding:6px 11px;border-radius:5px;
  color:#e8f8f6;background:#142a39e8;font:550 12px system-ui;text-align:center;pointer-events:none;
}
.rail-pa[hidden],.mobility-panel[hidden],.mobility-panel [hidden] { display:none; }
.game-phone {
  box-sizing:border-box;width:min(322px,calc(100vw - 28px));padding:23px 17px 20px;
  border:5px solid #293b3e;border-radius:30px;color:#e8f9f3;
  background:radial-gradient(ellipse at 60% -10%,#426774,#152731 54%,#12242d);
  box-shadow:0 16px 35px #08171bc4;margin:auto max(16px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) auto;
}
.game-phone::backdrop { background:#07191d65; }
.game-phone h2 { margin:10px 0 15px;font:650 25px system-ui; }
.phone-clock { display:flex;align-items:center;gap:10px;color:#b8d8da;font:650 12px system-ui; }
.game-phone .dialog-close { right:10px;top:9px; }
.phone-actions { display:grid;gap:8px; }
.phone-actions button {
  display:grid;grid-template-columns:37px auto;grid-template-rows:auto auto;gap:2px 11px;
  align-items:center;text-align:left;width:100%;padding:8px;color:#ecfbf9;
  background:#203c48;border:1px solid #547581;border-radius:11px;
}
.phone-actions button:hover,.phone-actions button:focus-visible { background:#315362; }
.phone-actions small { color:#bed3d0;font:500 11px system-ui; }
#phone-status { display:block;margin-top:10px;color:#f5ce9c;font-size:12px; }
#phone-cancel,.mobility-panel button {
  background:#203845;border:1px solid #6f919d;color:#eff6ed;border-radius:5px;
  font:inherit;padding:5px 8px;
}
#phone-cancel { margin-top:8px; }
.mobility-panel {
  position:absolute;z-index:2;right:19px;top:75px;max-width:min(305px,calc(100vw - 32px));
  padding:9px 11px;border-radius:7px;border:1px solid #8fa4a8;background:#152f3cf5;
  color:#edf3e8;font:560 12px system-ui;
}
.mobility-panel>div:first-child { display:flex;justify-content:space-between;gap:14px; }
.mobility-panel output { color:#f4d49b; }
.mobility-panel p { margin:6px 0 3px;color:#ccddd9; }
.mobility-panel p:empty { display:none; }
.mobility-touch { display:none; }
[data-ride=true] .exp-touch { display:none; }
[data-ride=true] .exp-hint { visibility:hidden; }
@media(max-width:720px),(pointer:coarse) {
  .mobility-panel { top:151px;right:12px; }
  [data-air-manual=true] .mobility-touch {
    display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin-top:5px;
  }
}

.hsr-panel { --rail-accent:#efd486; }
#hsr-waypoint { border-color:#d3b66f; }
[data-hsr=true] #exp-drones,[data-hsr=true] #exp-pulse { display:none; }
[data-hsr=true] .exp-hint { visibility:hidden; }
@media (max-width:580px) {
  .exp-top-controls { max-width:min(360px,calc(100vw - 83px)); }
  .exp-top-controls button { padding-inline:7px; }
}

.wanted-line { display:flex;align-items:center;gap:7px;margin-top:3px;min-height:15px;font-size:10px;color:#f6e3bb; }
#wanted-stars { letter-spacing:.07em;font-size:13px;color:#b6b4a1; }
#wanted-stars:not([data-level="0"]) { color:#ffd184;text-shadow:0 0 8px #f28e4a50; }
#wanted-stars[data-level="6"] { color:#ff9a69; }

.location-info { display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;white-space:nowrap; }
#country-balance { color:#ffdc9a;font-size:10px;font-weight:700; }
.job-beacon { border-color:#d8ba82;bottom:214px;max-width:min(380px,81vw); }
.job-brief { display:block;min-height:16px;margin:8px 0;color:#f2d7a1;font-size:12px; }
.country-row { display:flex;flex-wrap:wrap;gap:7px;margin-top:8px; }
.ledger-rows { list-style:none;margin:7px 0;padding:0;min-width:min(270px,60vw);font-size:12px; }
.ledger-rows li { display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid #839f9870; }
.ledger-rows b { white-space:nowrap;color:#efce8f; }
@media(max-width:720px),(pointer:coarse){.job-beacon{bottom:246px;}}

.venue-dialog {width:min(430px,calc(100vw - 34px));}
.venue-dialog[data-fitting], #country-trade[data-rest] {margin:auto max(18px,3vw) auto auto;width:min(355px,calc(100vw - 34px));}
@media (max-width:680px) {
  .venue-dialog[data-fitting], #country-trade[data-rest] {margin:auto auto 14px;}
}
.venue-dialog h2 {padding-right:34px;}
.venue-dialog #shelf-info {color:#d7d2b7;}
.venue-items img {display:block;width:100%;height:auto;max-height:220px;object-fit:contain;border-radius:5px;margin-top:6px;}
.photo-panel {position:absolute;z-index:2;bottom:max(58px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:8px;}
.photo-panel[hidden] {display:none;}
.venue-items {display:grid;gap:8px;margin:16px 0 4px;}
.venue-items button {display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:14px;text-align:left;padding:10px 12px;}
.venue-items strong,.venue-items small {grid-column:1;}
.venue-items small {font-weight:400;color:#e1dbc3;}
.venue-items output {grid-column:2;grid-row:1 / span 2;align-self:center;white-space:nowrap;color:#f2d48d;}
.venue-items button:disabled {cursor:default;opacity:.62;}

.civic-status {position:absolute;z-index:2;left:50%;top:58px;transform:translateX(-50%);padding:7px 11px;border-radius:5px;background:#203534e8;color:#f5e4bb;}
.park-edit {position:absolute;z-index:3;right:16px;bottom:87px;width:min(326px,calc(100vw - 32px));padding:12px;border:1px solid #a8a285;border-radius:7px;background:#182f31ee;color:#f1e6cd;}
.park-edit strong {font-size:17px;}
.park-edit output {display:block;margin:6px 0;font-size:13px;color:#d9ebbc;}
.park-edit small {display:block;line-height:1.4;color:#e8dcc0;}
.block-palette {display:flex;gap:5px;margin:8px 0;flex-wrap:wrap;}
.block-palette button {padding:5px 7px;}
.block-palette button[aria-pressed="true"] {background:#f0deb2;color:#233637;}

.staff-dialog {inset:auto 0 86px;width:min(540px,calc(100vw - 32px));}
.staff-dialog h2 {margin-top:0;}
#staff-role {color:#e8ce91;margin:0 0 4px;}
#staff-line {line-height:1.55;min-height:3.1em;}
.staff-dialog::backdrop,.auto-menu::backdrop {background:#12232536;}
.auto-menu {inset:60px 18px auto auto;width:min(380px,calc(100vw - 36px));max-height:calc(100vh - 84px);overflow:auto;}
.auto-controls {display:grid;gap:9px;margin:12px 0;}
.auto-controls label {display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,1fr);gap:9px;align-items:center;}
.auto-controls input[type=color] {height:30px;width:100%;padding:0;border:1px solid #a69c7f;background:#274140;border-radius:4px;}
#auto-metrics {display:block;margin:14px 0;color:#efdbad;line-height:1.4;}
.driver-program {position:absolute;z-index:2;top:84px;left:50%;transform:translateX(-50%);width:min(430px,calc(100vw - 30px));padding:10px 13px;border:1px solid #958c72;border-radius:6px;background:#1d3337ed;color:#f5e5c0;}
.driver-program strong,.driver-program output,.driver-program small {display:block;margin-bottom:5px;}
.driver-program output {color:#fbdfa0;}
.driver-program small {line-height:1.4;}
.driver-program button {padding:5px 8px;}
@media(max-width:620px){.auto-menu{inset:64px 8px auto auto;width:min(320px,calc(100vw - 16px));}.staff-dialog{bottom:130px;}.driver-program{top:116px;}}

.ledger-filters { justify-content:space-between; gap:8px; margin-bottom:10px; }
.ledger-filters select { max-width:130px; padding:4px; background:#24403c; color:#f4e4bb; }
.ledger-rows li small { display:block; color:#c3cbb5; font-size:11px; line-height:1.4; margin-top:3px; }

#map-place-query{flex:1 1 7em;min-width:7em;width:10em;padding:.45em .6em;color:#fff1d5;border:1px solid #827d63;background:#263d3d;border-radius:5px}
#map-place-query::placeholder{color:#c2c9ba} #map-landmark-select{max-width:100%} #map-found{color:#dfd3ad}

.gift-entry { background:#59421d!important; }
.gift-dialog .gift-symbol { font-size:32px; }
.gift-dialog p { font-size:14px;line-height:1.5; }
.gift-dialog #gift-status { display:block;margin-top:12px;min-height:1.25em;color:#ffd694; }
#walk-stick { width:79px;height:79px;border-radius:50%;position:relative;padding:0;background:#193638ad;border:1px solid #ccba86; }
#walk-stick i { display:block;position:absolute;inset:20px;border:1px solid #e5d6a6;background:#e6da9dad;border-radius:50%;pointer-events:none; }
@media (pointer:coarse) and (orientation:landscape) {
  .exp-top { left:max(7px,env(safe-area-inset-left));right:max(7px,env(safe-area-inset-right));top:max(6px,env(safe-area-inset-top));gap:6px; }
  .exp-top small,.exp-top #exp-controls,.exp-hint { display:none; }
  .exp-top-controls { gap:4px; }
  .exp-top button { padding:4px 6px;min-height:34px;font-size:12px; }
  .exp-location { top:49px;left:max(8px,env(safe-area-inset-left)); }
  .explorer .minimap { left:max(9px,env(safe-area-inset-left));bottom:max(8px,env(safe-area-inset-bottom));width:104px; }
  .exp-touch { bottom:max(34px,calc(env(safe-area-inset-bottom) + 24px));left:max(124px,calc(env(safe-area-inset-left) + 115px)); }
  .drive-touch { z-index:4; }
  .explorer[data-driving=true] .drive-touch { bottom:18px;left:max(124px,calc(env(safe-area-inset-left) + 115px));right:104px; }
  .explorer[data-driving=true] .drive-panel { top:51px;bottom:auto;max-width:min(260px,39vw); }
  .drive-panel button { padding:4px;font-size:11px; }
  .exp-bottom { bottom:max(7px,env(safe-area-inset-bottom)); }
  #exp-interact { max-width:40vw; font-size:12px;min-height:41px; }
  .exp-speed { transform:scale(.82);transform-origin:bottom right; }
  .game-phone { max-height:calc(100dvh - max(24px,env(safe-area-inset-top) + env(safe-area-inset-bottom)));overflow:auto; }
}
@media (pointer:coarse) and (orientation:landscape) {
  .road-map { width:min(770px,calc(100vw - 26px));max-width:none;max-height:calc(100dvh - 16px);overflow:auto; }
  .road-map #map-screen { float:left;margin:0 13px 3px 0;width:min(29dvh,28vw); }
  .road-map .map-tools { margin-block:5px; }
  .road-map button,.road-map select { min-height:31px; }
  .road-map .map-rail-tools { margin-block:3px; }
  .exp-top b { font-size:19px;white-space:nowrap; }
  .explorer .exp-touch > [data-explore-key="space"] { min-height:42px; }
  .route-panel { right:10px;left:auto;bottom:82px;width:min(184px,30vw); }
  .rail-panel { top:54px;right:max(8px,env(safe-area-inset-right));max-width:min(250px,36vw); }
}

/* Two real device surfaces. The shell, wallpapers and icon atlas are offline game assets. */
.fold-phone,.fold-app-screen {
  --shell:var(--phone-cover);--ratio:.60;--screen-x:5.3%;--screen-y:2.5%;
  --device-height:min(620px,calc(100dvh - 22px));
  --device-width:calc(var(--device-height) * var(--ratio));
  width:min(var(--device-width),calc(100vw - 20px));height:var(--device-height);
  max-width:none;max-height:none;margin:auto;border:0;padding:0;border-radius:8%;
  color:#f8fbf9;background:transparent;overflow:visible;
  background-image:var(--shell);background-size:100% 100%;background-repeat:no-repeat;
  font:500 12px/1.4 system-ui,-apple-system,sans-serif;
  box-shadow:none;filter:drop-shadow(0 17px 23px #0009);isolation:isolate;
}
[data-phone-fold=inner] :is(.fold-phone,.fold-app-screen) {
  --shell:var(--phone-inner);--ratio:1.22;--screen-x:2.8%;--screen-y:2.45%;border-radius:5%;
}
#phone-dialog::backdrop,.fold-app-screen::backdrop { background:#06131367; }
#phone-dialog[open],.fold-app-screen[open] { animation:phone-appear .2s ease-out both; }
@keyframes phone-appear { from { opacity:0;transform:translateY(12px) scale(.98); } }
.fold-surface {
  position:absolute;inset:var(--screen-y) var(--screen-x);border-radius:5.8% / 3.6%;
  background:#122734;overflow:hidden;display:grid;grid-template-rows:24px 1fr auto 36px;
  container-type:size;
}
[data-phone-fold=inner] .fold-surface { border-radius:3.1% / 3.6%; }
.fold-status { grid-row:1;grid-column:1/-1;z-index:2; display:flex;align-items:center;gap:8px;
  padding:4px 12px 0;font-size:11px;font-weight:640;font-variant-numeric:tabular-nums;
  text-shadow:0 0 5px #0d1f2c; }
.fold-status output { margin-right:auto; }
.fold-battery { position:relative;width:14px;height:7px;border:1px solid #f0faf0;border-radius:2px; }
.fold-battery:before { content:"";position:absolute;inset:1px 2px 1px 1px;background:#f0faf0;border-radius:1px; }
.fold-battery:after { content:"";position:absolute;right:-3px;top:1px;width:1px;height:3px;background:#f0faf0; }
.fold-wallpaper { position:absolute;inset:0;background:var(--phone-wallpaper) center/cover no-repeat;touch-action:pan-y; }
.fold-launcher { overflow:auto;scrollbar-width:thin; z-index:1;grid-row:2; align-self:end;
  --app-row:68px;min-height:0;max-height:min(68%,calc(var(--app-row) * 2 + 12px));padding:5px 8px 3px;
  background:linear-gradient(#15213824,#152138a8 36%,#101a2ce0 100%);
  border-top:1px solid #fff3; }
.phone-apps { display:grid;grid-template-columns:repeat(var(--app-columns,3),minmax(0,1fr));gap:0 2px;padding:2px 0; }
#phone-dialog .phone-apps button,#phone-dialog .fold-dock button {
  padding:0;min-width:0;background:transparent;border:0;display:grid;justify-items:center;gap:3px;
  color:#fff;line-height:1.17;text-shadow:0 1px 3px #000a;font-size:clamp(9px,3.5cqw,12px);
}
#phone-dialog .phone-apps button { height:var(--app-row);align-content:start; }
#phone-dialog .phone-apps strong,#phone-dialog .fold-dock strong { white-space:nowrap; }
.phone-icon {
  display:block;width:clamp(28px,15cqw,49px);height:auto;aspect-ratio:1;border-radius:23%;
  background-image:var(--phone-icons);background-size:500% 400%;
  background-position:calc(var(--col) * 25%) calc(var(--row) * 100% / 3);
  box-shadow:0 2px 4px #040e1d80;
}
#phone-dialog .phone-apps button:active .phone-icon,#phone-dialog .fold-dock button:active .phone-icon { transform:scale(.92); }
.fold-dock { position:relative;z-index:2;grid-row:4;display:flex;justify-content:space-evenly;align-items:center;
  background:#162335e6;box-shadow:0 -1px 0 #ffffff24;padding:0 7px 5px; }
#phone-dialog .fold-dock button { display:flex;align-items:center;gap:5px;min-height:27px; }
#phone-dialog .fold-dock .phone-icon { width:20px; }
#phone-dialog .phone-close { padding:1px 3px; }
#phone-dialog #phone-status { z-index:2;grid-row:3;margin:0;padding:3px 8px;background:#121d26eb;font-size:10px; }
#phone-dialog #phone-status:empty { display:none; }
#phone-dialog #phone-cancel { position:absolute;top:29px;right:6px;margin:0;z-index:3; }
.fold-gesture { position:absolute;bottom:3px;left:36%;width:28%;height:2px;background:#fff9;border-radius:1px;z-index:3;pointer-events:none; }
[data-phone-fold=inner] #phone-dialog { --app-columns:9; }
[data-phone-fold=inner] #phone-dialog .phone-apps button { font-size:clamp(8px,2.3cqw,12px); }
[data-phone-fold=inner] #phone-dialog .phone-apps .phone-icon { width:clamp(24px,8cqw,49px); }
.fold-app-screen {
  --device-height:min(626px,calc(100dvh - 16px));
  --ratio:.68;
}
.fold-page-body { display:contents; }
.fold-app-screen .fold-page-body {
  display:block;position:absolute;inset:var(--screen-y) var(--screen-x);overflow:auto;
  padding:9px 11px 12px;border-radius:6% / 4%;background:#122630;color:#f1f5ed;
}
.fold-app-screen .dialog-close { top:5px;right:8px; }
.fold-app-toolbar { display:flex;align-items:center;gap:6px;padding-right:29px;margin-bottom:8px; }
.fold-app-toolbar button { min-height:32px; }
.fold-app-screen h2 { font-size:16px;margin:5px 24px 6px 0; }
.fold-app-screen p { font-size:11px; }
.fold-app-screen .phone-actions { gap:4px; }
.fold-app-screen .phone-actions button { padding:5px 7px; }
#road-map.fold-app-screen { --ratio:.79; }
[data-phone-fold=inner] #road-map.fold-app-screen { --ratio:1.37; }
.phone-camera-view { position:absolute;inset:0;z-index:8;display:grid;place-items:center;background:#04151c50; }
.camera-phone { position:relative;margin:0;--ratio:.74;--device-height:min(646px,calc(100dvh - 20px)); }
.camera-phone .fold-surface { grid-template-rows:28px minmax(0,1fr) 64px; background:#10151b; }
.camera-phone .fold-status { justify-content:space-between; }
#phone-viewfinder { grid-row:2;width:100%;height:100%;display:block;touch-action:none;cursor:grab;background:#10171b; }
#phone-viewfinder:active { cursor:grabbing; }
#phone-viewfinder.capture-flash { animation:phone-flash .22s ease-out; }
@keyframes phone-flash { from { filter:brightness(2.4); } to { filter:brightness(1); } }
.phone-camera-controls { display:grid;grid-template-columns:auto auto auto auto;align-items:center;justify-content:space-evenly;gap:4px; }
.phone-camera-controls button { border:0;background:transparent;padding:4px; }
.phone-camera-controls .phone-icon { width:29px; }
#phone-shutter { width:42px;height:42px;border-radius:50%;border:3px solid #ecefee;background:#f9fbf4;box-shadow:inset 0 0 0 2px #121a20; }
#phone-shutter:active { background:#ffda91; }
#phone-shutter:disabled { opacity:.55; }
@media (pointer:coarse) and (orientation:landscape) {
  .fold-phone,.fold-app-screen { --device-height:calc(100dvh - 14px); }
  .fold-surface { grid-template-rows:21px 1fr auto 35px; }
}
@media (prefers-reduced-motion:reduce) { #phone-dialog[open],.fold-app-screen[open] { animation:none; } }
@media (max-height:515px) {
  .fold-launcher { --app-row:52px; }
}
@media (max-width:465px) {
  [data-phone-fold=inner] #phone-dialog { --app-columns:6; }
}
#shelf-items[data-layout=album] { grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:9px; }
[data-phone-fold=inner] #shelf-items[data-layout=album] { grid-template-columns:repeat(3,minmax(0,1fr)); }
#shelf-items[data-layout=album] button { display:flex;flex-direction:column;padding:4px;gap:4px;text-align:left; }
#shelf-items[data-layout=album] img { order:-1;aspect-ratio:1.29;object-fit:cover;margin-top:0; }
#shelf-items[data-layout=album] strong { overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:11px; }
#shelf-items[data-layout=album] small { font-size:9px; }
#shelf-items[data-layout=picture] button:has(img) { padding:2px;border:0;opacity:1;background:transparent; }
#shelf-items[data-layout=picture] img { max-height:calc(100dvh - 145px);order:-1;grid-column:1/-1;margin:0 0 9px; }
