/* ============================================================
   0. Tokens
   ============================================================ */
:root{
  --ink:#263b42;--ink-2:#3b5357;--muted:#87938f;--line:#e6ebe7;--paper:#fff;--accent:#c56544;
  --bg:#f5f6ee;--chip:#f1f4ef;--chip-hover:#e6ece2;--gold:#7e6848;--warm:#fffdf6;--warm-line:#dddfce;
  --shadow:0 8px 40px #293e4214;--shadow-sm:0 2px 10px #263b420d;
  --safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);
  --safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);
  --gutter:24px;            /* side margin of HUD */
  --hud-h:80px;             /* header height (without safe area) */
  --ctl:38px;               /* control button size */
  --dock-btn-h:48px;        /* bottom action button height */
  --dock-bottom:calc(18px + var(--safe-b));
}

/* ============================================================
   1. Base
   ============================================================ */
*{box-sizing:border-box}
body{margin:0;overflow:hidden;background:var(--bg);color:var(--ink);font:13px 'Noto Sans SC',system-ui,sans-serif;user-select:none;-webkit-tap-highlight-color:transparent}
button,input{font:inherit}
button{cursor:pointer;border:0;background:none;color:inherit;border-radius:7px;touch-action:manipulation;transition:background-color .15s,border-color .15s,color .15s,transform .1s}
button:hover{background:#eef2ed}
button:active:not(:disabled){transform:scale(.97)}
button:disabled{opacity:.35;cursor:default}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
[hidden]{display:none!important}
small{font-size:10px;color:var(--muted);font-weight:400}
a{color:#8b7450}
canvas{display:block;width:100vw;height:100dvh;touch-action:none}
.ctl svg,.dock-btn svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ============================================================
   2. Header HUD
   ============================================================ */
header{position:absolute;top:0;left:0;right:0;z-index:5;height:calc(var(--hud-h) + var(--safe-t));
  display:flex;align-items:center;gap:32px;
  padding:var(--safe-t) calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
  background:linear-gradient(#fffef9 78%,#fffef900);pointer-events:none}
header>*{pointer-events:auto}

.brand{display:flex;gap:12px;align-items:center;flex-shrink:0}
.brand-symbol{width:36px;height:36px;border:2px solid var(--ink);border-radius:50%;display:grid;place-items:center;font-size:26px}
.brand b{display:block;font-size:20px;letter-spacing:3px;white-space:nowrap}
.brand b span{font-size:13px;margin-left:12px;letter-spacing:2px;color:var(--muted)}
.brand small{display:block;letter-spacing:1.1px;font-size:8px;color:#9b8061}

.calendar{border-left:1px solid var(--line);padding-left:24px;min-width:140px;flex-shrink:0}
.calendar small{display:block;letter-spacing:1px}
.calendar #date{display:block;font-size:20px;white-space:nowrap;font-variant-numeric:tabular-nums}
.calendar #date span{font-size:11px;color:var(--muted);margin-left:8px;font-weight:400}
.calendar #calendar-tag{font-size:9px;color:#a0926e;margin-top:2px;white-space:nowrap}

.stats{display:flex;gap:28px;margin-left:auto;align-items:flex-start}
.stat small{display:block;white-space:nowrap}
.stat b{display:block;font-size:23px;font-weight:500;line-height:1.25;color:var(--gold);font-variant-numeric:tabular-nums;white-space:nowrap}
.stat-delivered b{color:var(--ink)}
.stat-money{padding:0;text-align:left;cursor:pointer}
#finance small>span{color:#997c54;font-size:11px}
#finance:hover{background:#9f79480f}
.stat-lives b{color:var(--accent);font-size:17px;letter-spacing:2px;line-height:1.7}

.controls{display:flex;align-items:center;gap:8px;flex-shrink:0}
.ctl,.playback{height:var(--ctl);background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow-sm)}
.ctl{min-width:var(--ctl);display:inline-grid;place-items:center;font-size:15px;padding:0}
.ctl:hover{background:var(--chip)}
.ctl svg{width:17px;height:17px}
.ctl-text{padding:0 14px;font-size:13px;font-weight:500}
.playback{display:inline-flex;padding:2px;gap:2px}
.playback button{height:100%;min-width:calc(var(--ctl) - 4px);border-radius:8px;font-size:14px;padding:0 6px}
#speed{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;min-width:40px}
#pause.is-paused{background:var(--accent);color:#fff}

/* ============================================================
   3. Map overlays: caption, notice, orientation hint, toast
   ============================================================ */
.map-caption{position:absolute;top:calc(var(--hud-h) + var(--safe-t) + 26px);left:calc(var(--gutter) + var(--safe-l) + 8px);display:flex;flex-direction:column;gap:7px;color:#a7aea5;font-size:10px;pointer-events:none}
.eyebrow{font-size:13px;letter-spacing:6px;color:#8d9990}
.map-caption .eyebrow{letter-spacing:7px}

.top-stack{position:absolute;z-index:4;top:calc(var(--hud-h) + var(--safe-t) + 4px);left:50%;transform:translateX(-50%);width:min(560px,calc(100vw - 24px));display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.notice-wrap{pointer-events:auto;display:flex;align-items:center;gap:2px;max-width:100%;background:#f8f5e9f0;border:1px solid #eee7d6;border-radius:20px;padding:3px 3px 3px 16px;box-shadow:var(--shadow-sm)}
.notice-wrap:has(#notice:empty){display:none}
.notice{font-size:11px;color:#8b774f;text-align:center;line-height:1.5;padding:4px 0}
#notice-close{flex-shrink:0;width:30px;height:30px;border-radius:15px;color:#a8977a;font-size:15px}
#notice-close:hover{background:#efe8d6}
#orientation-hint{pointer-events:auto;display:flex;align-items:center;gap:6px;background:#fffef9f2;color:#8c815e;border:1px solid #ece5d1;border-radius:22px;padding:4px 4px 4px 14px;font-size:11px;box-shadow:var(--shadow-sm)}
#orientation-hint span{flex:1}
#orientation-hint button{height:32px;padding:0 12px;background:var(--chip);white-space:nowrap;border-radius:16px}
#orientation-hint #dismiss-orientation{width:32px;padding:0;font-size:16px;background:none}

#toast{position:absolute;z-index:9;left:50%;bottom:calc(var(--dock-bottom) + var(--dock-btn-h) + 18px);transform:translate(-50%,6px);background:#263b42f0;color:#fff;border-radius:10px;padding:11px 20px;font-size:12px;line-height:1.6;opacity:0;transition:opacity .2s,transform .2s;pointer-events:none;max-width:min(520px,calc(100vw - 32px));text-align:center;box-shadow:0 8px 30px #263b4230}
#toast.show{opacity:1;transform:translate(-50%,0)}
#toast.undo-enabled{pointer-events:auto;display:flex;align-items:center;gap:16px}
#undo-stop{padding:7px 13px;background:#fff;color:#36504a;border-radius:6px;font-size:12px;white-space:nowrap;flex-shrink:0}

/* ============================================================
   4. Panels: route list, details, junction picker
   ============================================================ */
.panel{background:#fffffff5;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:14px}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;font-weight:600}
.panel-heading small{margin-left:6px}
.panel-heading button{width:32px;height:32px;font-size:16px;flex-shrink:0}

.route-panel{position:absolute;z-index:3;left:calc(var(--gutter) + var(--safe-l));bottom:calc(var(--dock-bottom) + 52px);width:244px;padding:14px;max-height:calc(100dvh - var(--hud-h) - var(--safe-t) - 160px);overflow:auto;overscroll-behavior:contain}
.route-panel.collapsed #route-list,.route-panel.collapsed .route-foot{display:none}
.route-row{display:flex;align-items:center;gap:10px;padding:10px 7px;min-height:40px;border-radius:8px;cursor:pointer;border:1px solid transparent;margin-top:4px}
.route-row:hover,.route-row.active{background:#f5f7f3;border-color:var(--line)}
.swatch{width:28px;height:0;border-top:4px solid;flex-shrink:0;border-radius:2px}
.route-row .name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.route-row small{white-space:nowrap}
.add-route{width:100%;min-height:42px;padding:10px;border:1px dashed #cbd5cc;margin-top:10px;font-size:12px;font-weight:500}
.add-route:hover{border-color:var(--ink);background:#f5f7f3}
.route-foot{border-top:1px solid var(--line);margin-top:12px;padding-top:8px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#8a958d;font-size:9px}
.route-foot button{font-size:20px;width:32px;height:32px;flex-shrink:0}

.detail-panel{position:absolute;z-index:4;right:calc(var(--gutter) + var(--safe-r));top:calc(var(--hud-h) + var(--safe-t) + 20px);width:290px;padding:20px;max-height:calc(100dvh - var(--hud-h) - var(--safe-t) - var(--dock-btn-h) - var(--dock-bottom) - 40px);overflow:auto;overscroll-behavior:contain}
.detail-panel h3{margin:0 0 5px;font-size:18px;padding-right:36px}
.close{float:right;width:32px;height:32px;font-size:20px;margin:-6px -8px 0 0}
.detail-sub{color:var(--muted);font-size:11px;margin-bottom:18px}
.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.metric-grid b{display:block;font-size:20px;font-weight:500}
.detail-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.detail-actions button{min-height:36px;padding:8px 11px;background:var(--chip);border:1px solid #e3e8de;font-size:11px}
.detail-actions button:hover{background:var(--chip-hover)}
/* Destructive actions read as destructive. */
.detail-actions button[onclick^="deleteLine"],.detail-actions button[onclick^="demolish"],.detail-actions button[onclick^="confirmDemolish"],.detail-actions button[onclick^="remove"]{background:#fff;color:#b5573f;border-color:#efcfc4}
.detail-actions button[onclick^="deleteLine"]:hover{background:#fbeee9}
.vehicle-row{display:flex;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid var(--line);font-size:11px}
.vehicle-row button{border:1px solid var(--line);padding:6px 8px;margin-left:auto;min-height:32px}
.passenger-row{display:flex;justify-content:space-between;padding:9px 0;font-size:12px;border-bottom:1px solid var(--line)}
.danger{color:#c95f48}
.bar{height:5px;background:#eef0eb;border-radius:3px;margin:10px 0}
.bar>i{display:block;height:100%;background:var(--accent);border-radius:3px}

#junction-picker{position:absolute;z-index:8;padding:12px;box-shadow:0 10px 45px #263b4225}
.junction-heading{display:flex;align-items:center;justify-content:space-between;padding:2px 3px 9px;border-bottom:1px solid var(--line)}
.junction-heading b{display:block;font-size:14px}
.junction-heading small{display:block;font-size:9px;margin-top:4px}
.junction-heading>button{font-size:20px;padding:5px 8px;min-width:36px;min-height:36px}
.junction-lines{max-height:38dvh;overflow:auto}
.junction-line{display:flex;gap:6px;align-items:stretch;margin-top:6px;border-radius:7px}
.junction-line.chosen{background:#f0f4eb}
.junction-line>button:first-child{display:flex;align-items:center;gap:9px;flex:1;padding:10px 6px;text-align:left;min-width:0}
.junction-line i{width:23px;height:4px;border-radius:2px;flex-shrink:0}
.junction-line span{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.junction-line small{display:block;font-size:9px;margin-top:3px}
.junction-drag{touch-action:none;background:#f1f4ed;padding:8px 10px;font-size:11px;white-space:nowrap}
.junction-drag:hover{background:#dfe8d8}
.junction-city-task{width:100%;padding:10px;background:#f3f5e8;margin-top:8px;text-align:left;color:#657d52;font-size:12px}

.stop-edit{border:1px solid #ded6c1;border-radius:8px;padding:12px;margin-top:12px;background:#fcfaf2}
.stop-edit b{display:block;font-size:11px;margin-bottom:8px}
.stop-edit button{padding:9px 12px;background:#bd6950;color:#fff;font-size:12px}
.stop-list{margin:16px 0 12px;border-top:1px solid var(--line);padding-top:10px}
.stop-list p{margin:0 0 5px}
.stop-list-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:43px;border-bottom:1px solid #edf0e9;font-size:12px}
.stop-list-row small{display:inline-block;width:14px}
.stop-list-row button{padding:9px 10px;font-size:11px;background:#f5f1e8;color:#946f43;white-space:nowrap}
.stop-list-row button:hover{background:#eee3ce}
.growth-caption{display:none}

/* ============================================================
   5. Bottom dock (legend + primary actions)
   ============================================================ */
footer{position:absolute;z-index:3;bottom:var(--dock-bottom);left:calc(var(--gutter) + var(--safe-l) + 8px);right:calc(var(--gutter) + var(--safe-r));display:flex;align-items:center;justify-content:space-between;gap:16px;pointer-events:none;transition:opacity .2s}
footer>*{pointer-events:auto}
.legend{display:flex;gap:18px;font-size:10px;color:#95a097}
.legend span{display:flex;gap:6px;align-items:center;white-space:nowrap}
.legend i{width:10px;height:10px;display:inline-block}
.hill-dot{background:#ece7d3;border-radius:50%}
.mount-dot{background:#8b9f79;clip-path:polygon(50% 0,100% 100%,0 100%)}
.river-dot{background:#bfdae1;border-radius:2px}

.dock{display:flex;gap:10px;margin-left:auto}
.dock-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:var(--dock-btn-h);padding:0 18px;border-radius:12px;background:var(--warm);border:1px solid var(--warm-line);color:#7c6544;font-size:13px;font-weight:500;white-space:nowrap;box-shadow:0 3px 14px #263b420d}
.dock-btn:hover{background:#f7f3e4;border-color:#cfd2bd}
.dock-btn svg{width:19px;height:19px;flex-shrink:0}
.dock-btn.is-primary{background:var(--ink);border-color:var(--ink);color:#fff;box-shadow:0 6px 20px #263b4228;padding:0 16px 0 20px}
.dock-btn.is-primary:hover{background:var(--ink-2)}
.dock-btn #next-supply{margin-left:6px;padding:3px 8px;border-radius:10px;background:#ffffff1c;color:#d3ddd8;font-size:10px}

/* While drawing a route or dragging a stop to delete, get the dock out of the way. */
body:has(#drawbar:not([hidden])) footer,
body:has(#delete-drop:not([hidden])) footer{opacity:0;pointer-events:none}
body:has(#drawbar:not([hidden])) footer *{pointer-events:none}

#drawbar{position:absolute;z-index:9;bottom:var(--dock-bottom);left:50%;transform:translateX(-50%);max-width:calc(100vw - 24px);background:#fff;border:1px solid var(--line);padding:8px 8px 8px 16px;display:flex;align-items:center;gap:10px;border-radius:14px;box-shadow:0 6px 30px #263b4222;font-size:12px}
#drawtext{min-width:0;overflow-wrap:anywhere;line-height:1.5}
#drawbar button{flex-shrink:0;white-space:nowrap;min-height:44px;padding:0 18px;background:var(--chip)}
.primary{background:var(--ink)!important;color:#fff!important}
.primary:hover{background:var(--ink-2)!important}

#delete-drop{position:absolute;z-index:9;left:50%;bottom:calc(var(--dock-bottom) + 6px);transform:translateX(-50%);padding:16px 28px;border:2px dashed #c37761;border-radius:12px;color:#b55d45;background:#fff7f0f5;font-size:12px;pointer-events:none;box-shadow:0 6px 25px #824e2420;white-space:nowrap}
#delete-drop.armed{background:#b85e48;color:#fff;border-style:solid;transform:translateX(-50%) scale(1.05)}

/* ============================================================
   6. Sheets (modals): flat lists and dividers, no cards inside cards
   ============================================================ */
.overlay{position:fixed;inset:0;background:#233a4238;backdrop-filter:blur(4px);display:grid;place-items:center;z-index:10;padding:max(20px,var(--safe-t)) 20px max(20px,var(--safe-b))}
.modal{position:relative;background:#fff;border-radius:16px;padding:0 26px 24px;width:min(620px,94vw);max-height:88dvh;overflow:auto;overscroll-behavior:contain;box-shadow:0 30px 100px #233a4225;transition:transform .2s ease}
.modal>:first-child:not(.modal-head){margin-top:26px}
.modal .eyebrow{font-size:10px;letter-spacing:3px;color:var(--accent)}
.modal h1{font-size:28px;margin:10px 0;letter-spacing:1px;line-height:1.3}
.modal h2{margin:0;font-size:20px;line-height:1.35}
.modal h3{font-size:13px;margin:20px 0 6px;letter-spacing:.5px}
.modal p{line-height:1.8;color:#7c8879;font-size:12px}
.modal .primary{padding:0 24px;margin-top:16px;min-height:46px;border-radius:12px;font-weight:600}
.modal-head{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin:0 -26px 6px;padding:22px 26px 12px;background:#fffffff2;backdrop-filter:blur(6px)}
.modal-head small{display:block;margin-top:4px;font-size:11px}
.modal-head .eyebrow{display:none}
.modal-head .close,.ux-sheet-head .close{float:none;margin:-4px -6px 0 0;flex-shrink:0;width:40px;height:40px;border-radius:20px;background:var(--chip);font-size:20px}
.modal-head>div:last-child:not(:first-child){display:flex;align-items:center;gap:8px}

/* Shared buttons inside sheets: one quiet pill style. */
.tabs{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.tabs button,.secondary,.construction-actions button:not(.primary),.quote-row button,.infra-card button:not(.primary),.task-cities button,.service-list button{min-height:40px;padding:0 16px;border-radius:20px;background:var(--chip);border:0;color:var(--ink);font-size:12px;font-weight:500}
.tabs button:hover,.secondary:hover,.quote-row button:hover,.infra-card button:not(.primary):hover,.task-cities button:hover{background:var(--chip-hover)}
.tabs .selected{background:var(--ink);color:#fff}
.tabs .selected:hover{background:var(--ink-2)}
.construction-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:18px}
.construction-actions button{padding:0 20px;min-height:46px;border-radius:12px}
.construction-actions .primary{margin-top:0}
.construction-label{font-size:12px;color:#b58243}

/* Legacy blocks, flattened into list sections. */
.intro-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0 16px;margin:16px 0}
.intro-card{border-top:1px solid var(--line);padding:12px 0}
.intro-card b{display:block;font-size:12px;margin:6px 0 4px}
.intro-card span{font-size:20px;color:var(--accent)}
.intro-card small{line-height:1.7;display:block}
.shop-grid,.fleet-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:0 20px;margin:10px 0}
.product,.reward{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:14px 4px;background:none}
.product b,.reward b{display:block;font-size:13px}
.product small,.reward small{display:block;margin-top:4px;line-height:1.7}
.reward strong{font-size:20px;display:block;margin-bottom:8px}
.reward:hover{background:#f7f8f4}
.product button{margin-top:8px;min-height:38px;padding:0 14px;border-radius:19px;background:var(--chip)}
.transport-icon{width:56px;height:42px;color:#bd7659}
.fleet-grid .transport-icon{width:48px;height:36px}
.reward-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0 16px}
.help-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.help-grid p{margin:5px 0}
.infra-card{border:0;border-top:1px solid var(--line);background:none;border-radius:0;padding:16px 0 6px;margin:6px 0 0}
.infra-card p{margin:6px 0 12px}
.infra-card h3{margin:0 0 8px;font-size:15px}
.task-cities{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
.task-cities>section{border:0;border-bottom:1px solid var(--line);border-radius:0;padding:14px 0}
.task-cities h3{margin:0;font-size:14px}
.task-cities p{margin:4px 0 10px}
.task-cities .city-mission{padding:0 0 0 12px}
.ops-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
.service-list{margin-top:14px;padding-top:10px;border-top:1px solid var(--line)}

.city-mission{margin:12px 0;padding:2px 0 2px 14px;background:none;border:0;border-left:3px solid #cfdcbf;border-radius:0}
.city-mission h4{font-size:15px;margin:6px 0 4px}
.city-mission p{font-size:11px;color:#7b8779;line-height:1.7;margin:4px 0 8px}
.city-mission .eyebrow{font-size:9px;letter-spacing:1px}
.city-mission button{margin-top:6px;min-height:38px;padding:0 14px;border-radius:19px;background:var(--chip);font-size:12px}
.mission-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px}
.mission-heading>b{color:#9f7948}
.mission-progress{height:6px;border-radius:3px;background:#e9ede2;overflow:hidden;margin:8px 0}
.mission-progress i{display:block;height:100%;background:#88a46e;border-radius:3px}

.quote-row{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:12px 0;border-bottom:1px solid var(--line);font-size:12px}
.quote-row.total{font-size:15px}
.finance-summary{display:grid;grid-template-columns:1fr 1fr;gap:0 24px;margin:6px 0 14px}
.finance-summary span{display:flex;justify-content:space-between;align-items:baseline;gap:8px;padding:11px 0;border-bottom:1px solid var(--line);color:#85917f;font-size:12px}
.finance-summary b{font-size:15px;color:#344d44;font-variant-numeric:tabular-nums}
.ledger-list{margin-top:6px}
.income{color:#64894f}
.destination-row{width:100%;text-align:left;border-radius:0}

input{width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;color:var(--ink)}
select{font:inherit;color:var(--ink);border:1px solid #dce3d3;background:#fff;padding:9px;border-radius:10px;max-width:100%;min-height:42px}
.colors{display:flex;flex-wrap:wrap;gap:12px;margin:14px 0}
.colors button{width:34px;height:34px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px #ddd}
.form-row{display:flex;gap:16px;margin:15px 0}
.form-row label{display:flex;flex:1;flex-direction:column;gap:8px}
.skip-label{display:flex;align-items:center;gap:10px;padding:8px;min-height:44px}
.skip-label input{width:auto;min-height:0}
.modal a[href="updates/"]{display:none}

/* ============================================================
   6b. UX layer components (ux.js)
   ============================================================ */
.ux-hero{padding-top:2px}
.modal .ux-lead{font-size:13px;color:#5f6f68}
.ux-points{list-style:none;margin:16px 0 6px;padding:0}
.ux-points li{display:flex;gap:14px;align-items:center;padding:12px 0;border-top:1px solid var(--line)}
.ux-points i{flex-shrink:0;width:36px;height:36px;border-radius:18px;display:grid;place-items:center;background:#f6efe9;color:var(--accent);font-style:normal;font-size:16px;font-weight:600}
.ux-points span{font-size:12px;color:var(--muted);line-height:1.5}
.ux-points b{display:block;color:var(--ink);font-size:13px;font-weight:600}
.ux-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:8px}
.ux-wide{flex:1 1 200px}
.ux-ghost{min-height:46px;margin-top:16px;padding:0 18px;border-radius:12px;color:var(--muted)}
.ux-danger{color:#b5573f!important;background:#fbeee9!important}
.ux-danger:hover{background:#f6e0d7!important}
.modal .ux-foot{font-size:11px;text-align:center;margin:16px 0 0}

.ux-help{border-top:1px solid var(--line)}
.ux-help summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;align-items:center;min-height:52px;font-weight:600;font-size:14px}
.ux-help summary::-webkit-details-marker{display:none}
.ux-help summary::after{content:'+';font-weight:400;font-size:20px;color:var(--muted)}
.ux-help[open] summary::after{content:'−'}
.ux-help ul{margin:0 0 14px;padding-left:18px;color:#5f6f68;font-size:12px;line-height:1.8}
.ux-help li{margin:4px 0}

/* Line sheet */
.ux-sheet-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.ux-swatch{width:6px;align-self:stretch;border-radius:3px;flex-shrink:0}
.ux-title{flex:1;min-width:0}
.ux-title h3{margin:0;font-size:17px;padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ux-title small{font-size:11px}
.ux-icon{width:40px;height:40px;border-radius:20px;background:var(--chip);font-size:16px;flex-shrink:0}
.ux-sheet-head .close{margin:0}
.ux-alert{margin:0 0 10px;padding:9px 12px;border-radius:10px;background:#fbf1ea;color:#a5583f;font-size:12px;line-height:1.5}
.ux-fleet{display:flex;align-items:center;gap:18px;padding:10px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ux-fleet>div:not(.ux-stepper) small{display:block}
.ux-fleet b{font-size:20px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}
.ux-fleet b span{font-size:11px;color:var(--muted);font-weight:400}
.ux-stepper{margin-left:auto;display:flex;gap:6px}
.ux-stepper button{height:44px;min-width:44px;border-radius:12px;background:var(--chip);font-size:18px}
.ux-stepper .primary{padding:0 14px;font-size:13px;font-weight:600;white-space:nowrap}
.ux-route{display:flex;flex-wrap:wrap;align-items:center;gap:6px 4px;margin:12px 0 4px}
.ux-route>i{color:#b6beb7;font-style:normal;font-size:11px}
.ux-stop{display:inline-flex;align-items:center;gap:2px;height:34px;padding:0 12px;border-radius:17px;background:#f3f5ef;font-size:12px;font-weight:500}
.ux-stop:has(button){padding-right:3px}
.ux-stop button{width:28px;height:28px;border-radius:14px;color:#a39a8a;font-size:14px}
.ux-stop button:hover{background:#ece3d6;color:#a5583f}
.ux-hint{margin:6px 0 10px;font-size:11px;color:var(--muted)}
.ux-list-title{font-size:11px;color:var(--muted);margin:12px 0 2px}
.ux-row{display:flex;align-items:center;gap:10px;min-height:52px;border-bottom:1px solid var(--line);font-size:12px}
.ux-row>span:first-child{flex:1;min-width:0}
.ux-row small{display:block;margin-top:2px}
.ux-row em{font-style:normal}
.ux-row-actions{display:flex;gap:6px;flex-shrink:0}
.ux-row-actions button{min-height:36px;padding:0 12px;border-radius:18px;background:var(--chip);font-size:11px}
.ux-actions-row{display:flex;gap:8px;margin-top:14px}
.ux-actions-row button{flex:1;min-height:44px;border-radius:12px;background:var(--chip);font-size:12px;font-weight:500}

/* Tasks */
.ux-tasks{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
.ux-task{display:block;width:100%;text-align:left;padding:14px 4px;border-bottom:1px solid var(--line);border-radius:0}
.ux-task:hover{background:#f7f8f4}
.ux-task-top{display:flex;align-items:baseline;gap:8px}
.ux-task-top b{font-size:14px}
.ux-task-top em{margin-left:auto;font-style:normal;color:#9f7948;font-weight:600;font-size:12px}
.ux-task-title{display:block;margin:4px 0 8px;font-size:12px;color:#4d5f57}
.ux-bar{display:block;height:6px;border-radius:3px;background:#e9ede2;overflow:hidden}
.ux-bar i{display:block;height:100%;background:#88a46e;border-radius:3px}
.ux-task-meta{display:block;margin-top:6px}
.ux-task.is-dormant{opacity:.6}

/* Shop */
.ux-product{display:flex;align-items:center;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
.ux-product .transport-icon{width:48px;height:36px;margin:0;flex-shrink:0}
.ux-product>div{flex:1;min-width:0}
.ux-product b{font-size:14px}
.ux-product small{display:block;margin-top:2px;line-height:1.5}
.ux-product>button{min-width:84px;min-height:44px;border-radius:12px;background:var(--chip);font-weight:600}
.ux-product.is-locked .transport-icon{color:#c9cfc6}
.ux-lock{color:#a58a63!important}
.car-shop{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
.car-shop h3{margin:0 0 8px;font-size:15px}
.car-shop-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.car-shop-grid .infra-card{margin:0}
.car-shop-grid button{width:100%}
.ux-links{margin-top:10px}
.ux-links button{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:4px 12px;width:100%;min-height:56px;text-align:left;border-bottom:1px solid var(--line);border-radius:0;padding:0 4px}
.ux-links button span{font-weight:600;font-size:13px}
.ux-links button i{font-style:normal;font-size:20px;color:var(--muted)}

/* Drawing bar: type chips · route · quote · actions */
.dock-tasks{display:none}
#drawbar.db-line{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;padding:10px 10px 10px 16px;width:min(580px,calc(100vw - 24px))}
#drawbar.db-line .db-types{grid-column:1/-1}
.db-types{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
#drawbar .db-types button{flex:1 0 auto;min-height:40px;padding:0 12px;border-radius:20px;background:var(--chip);font-size:12px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:6px}
#drawbar .db-types button small{font-weight:400}
#drawbar .db-types button.on{background:var(--ink);color:#fff}
#drawbar .db-types button.on small{color:#c7d3cf}
.db-info{min-width:0}
#drawtext{font-size:13px}
#drawtext i{font-style:normal;color:#b6beb7}
.db-cost{display:flex;flex-wrap:wrap;gap:2px 10px;margin-top:4px;font-size:11px;color:#6f7d76}
.db-cost .bad{color:#b5573f;font-weight:600}
.db-cost .muted{color:var(--muted)}
.db-actions{display:flex;gap:6px;align-items:center}
#drawbar #drawundo{min-width:44px;padding:0;font-size:18px}
#drawdone{font-weight:600}

/* ============================================================
   7. Responsive
   ============================================================ */

/* Touch devices: comfortable hit areas everywhere. */
@media (pointer:coarse){
  :root{--ctl:40px}
  .detail-actions button,.tabs button{min-height:40px}
  .panel-heading button,.route-foot button,.close{width:40px;height:40px}
}

/* Medium widths (small laptops, tablets, phones in landscape). */
@media (max-width:1100px){
  :root{--gutter:16px;--hud-h:66px}
  header{gap:18px}
  .brand{gap:8px}
  .brand-symbol{width:28px;height:28px;font-size:20px}
  .brand b{font-size:16px;letter-spacing:2px}
  .brand b span{font-size:11px;margin-left:7px}
  .brand small{display:none}
  .calendar{padding-left:14px;min-width:118px}
  .calendar #date{font-size:17px}
  .stats{gap:18px}
  .stat b{font-size:19px}
  .stat-lives b{font-size:15px}
  .controls{gap:6px}
  .ctl-text{padding:0 11px}
  .route-panel{width:216px;padding:12px}
  .detail-panel{width:270px;padding:16px}
  .legend{gap:12px}
  .modal{padding:0 22px 22px}
  .modal-head{margin:0 -22px 6px;padding:20px 22px 10px}
  .modal h1{font-size:26px}
}

@media (max-width:900px){
  .legend{display:none}
  .map-caption{display:none}
}

@media (max-width:760px){
  .brand-symbol,.brand b span{display:none}
  .brand b{font-size:14px;letter-spacing:1px}
  .stat-delivered{display:none}
  .finance-summary{grid-template-columns:1fr 1fr}
  .task-cities,.ops-grid{grid-template-columns:1fr}
  .fleet-grid{grid-template-columns:1fr 1fr}
  .fleet-grid .reward{padding:12px}
  .dock-btn{padding:0 13px;font-size:12px}
  .dock-btn #next-supply{display:none}
}

/* Phones in landscape: short screens. */
@media (orientation:landscape) and (max-height:500px){
  :root{--hud-h:54px;--dock-btn-h:42px;--dock-bottom:calc(10px + var(--safe-b));--ctl:36px}
  .calendar #year{display:none}
  .stat small:not(#maintenance-estimate){font-size:9px}
  #maintenance-estimate{display:none}
  .route-panel{bottom:calc(var(--dock-bottom) + 4px);width:200px;padding:10px;max-height:calc(100dvh - var(--hud-h) - var(--safe-t) - 24px)}
  .route-row{padding:6px 4px;min-height:36px}
  .add-route{min-height:38px;margin-top:6px;padding:6px}
  .route-foot{margin-top:6px;padding-top:4px}
  footer{left:calc(220px + var(--gutter) + var(--safe-l))}
  .detail-panel{top:calc(var(--hud-h) + var(--safe-t) + 6px);max-height:calc(100dvh - var(--hud-h) - var(--safe-t) - var(--dock-btn-h) - var(--dock-bottom) - 18px)}
  #toast{bottom:calc(var(--dock-bottom) + var(--dock-btn-h) + 10px)}
  .modal{max-height:94dvh;padding:0 20px 16px}
  .modal-head{margin:0 -20px 4px;padding:14px 20px 8px}
  .modal>:first-child:not(.modal-head){margin-top:16px}
  .modal h1{font-size:22px;margin:6px 0}
  .modal p{margin:6px 0}
  .ux-points{display:grid;grid-template-columns:repeat(3,1fr);gap:0 14px;margin:8px 0 0}
  .ux-points li{padding:8px 0}
  .modal .primary,.ux-ghost{margin-top:8px}
  .fleet-grid{grid-template-columns:repeat(4,1fr)}
}

/* Phones in portrait: single-row header (tasks live in the dock; balance shows whole yuan),
   full-width bottom sheets and a four-button dock in the thumb zone. */
@media (orientation:portrait) and (max-width:820px){
  :root{--gutter:12px;--hud-h:62px;--dock-btn-h:50px;--dock-bottom:calc(8px + var(--safe-b));--ctl:42px}
  header{gap:10px;background:linear-gradient(#fffef9 82%,#fffef900)}
  .brand{display:none}
  .calendar{border-left:0;padding-left:0;min-width:0}
  .calendar #year{display:none}
  .calendar #date{font-size:16px}
  .calendar #date span{display:none}
  .stats{gap:12px;align-items:center}
  .stat b{font-size:18px}
  .stat-money small:first-child{font-size:9px}
  #maintenance-estimate,#orientation-hint{display:none!important}
  .stat-lives small{display:none}
  .stat-lives b{font-size:13px;letter-spacing:0;line-height:1;margin-top:0}
  .stats{margin-left:auto}
  .controls{gap:6px}
  .playback button{min-width:40px;padding:0 4px}
  #speed{min-width:40px}
  #tasks,#fullscreen{display:none}

  /* Dock: four equal buttons spanning the width. */
  footer{left:calc(var(--gutter) + var(--safe-l));right:calc(var(--gutter) + var(--safe-r))}
  .dock{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;width:100%;margin:0}
  .dock-btn{flex-direction:column;gap:2px;padding:0 4px;font-size:11px;border-radius:14px}
  .dock-btn svg{width:18px;height:18px}
  .dock-tasks{display:inline-flex}
  .dock-more{display:none}
  .dock-btn.is-primary{padding:0 6px}
  .dock-btn #next-supply{display:none}

  /* Route list and details become bottom sheets above the dock. */
  .route-panel,.detail-panel{left:calc(var(--gutter) + var(--safe-l));right:calc(var(--gutter) + var(--safe-r));width:auto;bottom:calc(var(--dock-bottom) + var(--dock-btn-h) + 10px);top:auto}
  /* One swipeable strip: [line chips …][＋][⌖] — about 52px instead of a 150px sheet. */
  .route-panel{display:flex;align-items:center;gap:6px;padding:5px;max-height:none;overflow:visible;border-radius:16px}
  .route-panel .panel-heading{display:none}
  .route-panel #route-list,.route-panel.collapsed #route-list{display:flex;flex:1;min-width:0;gap:6px;overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain;scroll-snap-type:x proximity}
  .route-panel #route-list::-webkit-scrollbar{display:none}
  .route-panel #route-list:empty{display:none}
  .route-row{flex:0 0 auto;margin:0;min-height:40px;padding:0 12px 0 10px;gap:7px;border-radius:20px;background:#f3f5ef;border:1px solid transparent;scroll-snap-align:start}
  .route-row.active{background:#fff;border-color:currentColor}
  .route-row .swatch{width:14px;border-top-width:4px}
  .route-row .name{flex:none;max-width:7.5em;font-size:12px;font-weight:600}
  .route-row small{font-size:10px}
  .add-route,.route-panel.collapsed .add-route{flex:0 0 auto;width:auto;min-height:40px;margin:0;padding:0 16px;border:0;border-radius:20px;background:var(--ink);color:#fff;font-size:13px;font-weight:600}
  .add-route:hover{background:var(--ink-2)}
  .route-panel:has(.route-row) .add-route{width:40px;padding:0;font-size:0}
  .route-panel:has(.route-row) .add-route::before{content:'＋';font-size:20px;font-weight:400}
  .route-panel:not(:has(.route-row)) .add-route{flex:1}
  .route-foot,.route-panel.collapsed .route-foot{display:contents}
  .route-foot #stock{display:none}
  .route-foot button{flex:0 0 auto;width:40px;height:40px;border-radius:20px;background:#f3f5ef;font-size:18px}
  .detail-panel{max-height:50dvh;padding:18px 16px 16px;border-radius:18px;box-shadow:0 -6px 40px #263b4220}
  .detail-panel::before{content:'';position:sticky;top:-10px;display:block;width:40px;height:4px;margin:-10px auto 8px;border-radius:2px;background:#dfe4dc}
  .detail-panel h3{font-size:17px}
  .detail-sub{margin-bottom:12px}
  .metric-grid{padding:8px 0}
  .metric-grid b{font-size:18px}
  .detail-actions button{flex:1 1 auto}
  body:has(#details:not([hidden])) #routes{display:none}
  body:has(#drawbar:not([hidden])) #routes{display:none}
  #drawbar,#drawbar.db-line{width:calc(100vw - 24px);gap:8px;padding:10px 10px 10px 14px}
  .db-info{flex:1}
  #drawbar button{padding:0 14px}

  /* Transient messages show near the top, away from the sheets. */
  #toast{top:calc(var(--hud-h) + var(--safe-t) + 4px);bottom:auto;transform:translate(-50%,-6px);width:max-content}
  #toast.show{transform:translate(-50%,0)}
  #toast.undo-enabled{white-space:normal;text-align:left}

  .shop-grid{grid-template-columns:1fr 1fr}
  .intro-grid,.reward-grid{grid-template-columns:1fr}
  .intro-card{display:none}
  .intro-card:first-child{display:block}
  .help-grid{grid-template-columns:1fr}
  .overlay{place-items:end stretch;padding:var(--safe-t) 0 0}
  .modal{width:100%;max-height:92dvh;border-radius:22px 22px 0 0;padding:0 18px calc(22px + var(--safe-b));animation:ux-sheet-up .22s ease-out}
  .modal>:first-child:not(.modal-head){margin-top:28px}
  .modal-head{margin:0 -18px 4px;padding:26px 18px 10px}
  .modal-head::before{content:'';position:absolute;top:9px;left:50%;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:#dfe4dc}
  .ux-tasks,.task-cities,.ops-grid,.reward-grid,.finance-summary{grid-template-columns:1fr}
  .modal h1{font-size:25px}
}

@media (orientation:portrait) and (max-width:370px){
  :root{--ctl:38px}
  header{gap:7px}
  .stats{gap:7px}
  .stat b{font-size:15px}
  .ctl-text{padding:0 8px;font-size:12px}
  .dock-btn{font-size:11px}
}

@keyframes ux-sheet-up{from{transform:translateY(48px);opacity:.5}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.modal{animation:none}}

.undo-build{position:fixed;z-index:45;right:16px;top:90px;padding:10px 14px;background:#fff5dd;border:1px solid #d3b78b;border-radius:10px;color:#70562f;box-shadow:0 3px 12px #243d4420}@media(max-width:600px){.undo-build{top:72px;right:12px;font-size:11px;max-width:85vw}}

.activity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.activity-card{padding:18px;border:1px solid #c2cbbb;border-radius:12px;background:#f8f8ef}.activity-card small{color:#94713c}.activity-card h3{margin:8px 0}.activity-card p{font-size:13px;line-height:1.7}.activity-prize{color:#477263;font-weight:600}.stars-6{border-color:#b5904c;background:#faf3e2}@media(max-width:700px){.activity-grid{grid-template-columns:1fr}.activity-card{padding:14px}}

.modal:has(.activity-grid){width:min(960px,calc(100vw - 40px));max-width:960px}@media(max-width:700px){.modal:has(.activity-grid){width:100%;max-width:100%}}
/* Activity invitations: tactile folded maps, one shared card back, restrained rarity reveals. */
.modal:has(.activity-grid){background:#f3f4ec;padding:28px;width:min(1080px,calc(100vw - 48px));max-width:1080px;overflow-x:hidden}
.activity-deck-intro{text-align:center;margin:12px 0 24px}.activity-deck-intro .eyebrow{font-size:9px;letter-spacing:3px;color:#8e917b}.activity-deck-intro h3{font-size:26px;font-weight:500;margin:10px 0;color:#314f48}.activity-deck-intro p{font-size:12px;color:#79877b;line-height:1.8}.card-swipe-hint{display:none}
.activity-grid{gap:18px;align-items:stretch;padding:10px 6px 26px;isolation:isolate}.activity-slot{position:relative;perspective:1400px;min-width:0;animation:card-deal .5s both;animation-delay:calc(var(--deal)*.09s)}.activity-flipper{display:grid;position:relative;transform-style:preserve-3d;transition:transform .8s cubic-bezier(.22,.75,.2,1);height:100%}.activity-slot.is-revealed .activity-flipper{transform:rotateY(180deg)}
.activity-back,.activity-front{grid-area:1/1;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:17px;min-height:460px;box-sizing:border-box}.activity-back{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;padding:28px 16px;border:1px solid #80928a!important;overflow:hidden;cursor:pointer;color:#e7e4c9!important;background:radial-gradient(ellipse at 50% 40%,#42685f,transparent 72%),repeating-linear-gradient(135deg,#ffffff03 0 1px,transparent 1px 13px),#264b43!important;box-shadow:0 12px 25px #263e4320;transform:rotateY(0);transition:box-shadow .25s}
.activity-back:before,.activity-back:after{content:'';position:absolute;inset:11px;border:1px solid #c5c5a34d;border-radius:11px;pointer-events:none}.activity-back:after{inset:17px;border-style:dashed;border-color:#c5c5a325}.activity-back:hover{box-shadow:0 18px 32px #263e4338}.activity-back:focus-visible,.card-accept:focus-visible{outline:3px solid #bf9347;outline-offset:5px}.card-back-top{position:absolute;top:37px;font-size:8px;letter-spacing:2px;color:#ccd1b8}.card-sigil{width:115px;height:115px;margin:20px 0 28px;position:relative}.card-sigil:before{content:'';position:absolute;inset:-25px;border:1px solid #bfcaaf24;transform:rotate(45deg);border-radius:20px}.card-sigil svg{width:100%;fill:none;stroke:#cbd3ae;stroke-width:1.3}.card-back-title{font-size:18px;font-weight:500;letter-spacing:1px}.card-back-sub{margin-top:14px;color:#b1c0ac;font-size:11px;letter-spacing:2px}.card-back-number{position:absolute;bottom:33px;color:#9eae98;font-size:10px;letter-spacing:4px}
.activity-card.activity-front{display:flex;flex-direction:column;position:relative;transform:rotateY(180deg);padding:23px 20px;background:linear-gradient(155deg,#fffef7,#eff2e6);border:1px solid #c7cebb;box-shadow:0 12px 25px #263e4317;visibility:hidden}.is-revealed .activity-front{visibility:visible}.card-rarity{display:flex;justify-content:space-between;align-items:center;gap:5px;border-bottom:1px solid #c8cfbd88;padding-bottom:14px;margin-bottom:20px}.card-rarity>span{font-size:13px;letter-spacing:1px;color:#8b9976}.card-rarity small{font-size:10px!important;color:#7f8b78!important;white-space:nowrap}.card-feature{font-size:10px;letter-spacing:1px;color:#8b937c}.activity-front h3{font-size:23px;line-height:1.3;margin:8px 0 4px;font-weight:600;color:#304e45}.card-city{font-size:13px;color:#6c7e6a;font-weight:500}.card-stats{display:grid;grid-template-columns:repeat(3,1fr);margin:21px 0 8px;padding:12px 0;border-top:1px solid #d9dece;border-bottom:1px solid #d9dece}.card-stats>span{font-size:10px;color:#8a927e;display:flex;flex-direction:column;gap:3px;align-items:center}.card-stats b{font-size:20px;font-weight:500;color:#435b4a}.activity-front .card-sources{font-size:11px;line-height:1.9;color:#7e8a76;margin:8px 0 15px}.card-reward{background:#dde6d455;border-left:2px solid #9ead86;padding:10px 12px}.card-reward>small{letter-spacing:2px;font-size:9px;color:#829270}.card-reward p{font-size:12px;line-height:1.8;margin:4px 0 0;color:#466445;font-weight:600}.activity-front .card-risk{font-size:11px;line-height:1.8;color:#947a67;margin:14px 0 18px}.card-risk small{font-size:10px;color:#9e9988}.card-accept{margin-top:auto;width:100%;display:flex;justify-content:space-between;align-items:center;background:#36594d!important;color:#fffdf2!important;border-radius:9px;padding:12px 14px!important;font-size:12px}.card-accept span{font-size:18px}.activity-deck-actions{display:flex;justify-content:center;gap:12px;margin:0 0 20px}.activity-deck-actions button{font-size:12px;border:1px solid #ccd3c1;border-radius:8px;padding:10px 16px;color:#73816c;background:transparent}
.is-revealed.stars-5 .activity-front{background:linear-gradient(145deg,#fff7da,#f1e5c3);border-color:#c7a052;box-shadow:0 0 0 1px #ecd69d,0 12px 30px #9f7b3e24}.is-revealed.stars-6 .activity-front{background:radial-gradient(ellipse at 90% 0%,#b7914140,transparent 60%),linear-gradient(155deg,#263e43,#192f36);border-color:#dbb766;box-shadow:0 0 0 1px #f5d79488,0 16px 35px #1c394c40}.stars-5 .card-rarity>span{color:#bd8c26}.stars-6 .card-rarity>span{color:#f4d58a}.stars-6 .activity-front h3,.stars-6 .card-stats b{color:#f3e9c9}.stars-6 .card-feature,.stars-6 .card-city,.stars-6 .card-sources,.stars-6 .card-stats>span,.stars-6 .card-rarity small{color:#b3c6bb!important}.stars-6 .card-reward{background:#c5a56115;border-color:#ddbd76}.stars-6 .card-reward p,.stars-6 .card-reward>small{color:#ead29a}.stars-6 .card-risk,.stars-6 .card-risk small{color:#c0ad91}.stars-6 .card-accept{background:#d7b572!important;color:#263b3b!important}.stars-6 .card-stats,.stars-6 .card-rarity{border-color:#adbead33}
.card-reveal-fx{position:absolute;inset:0;pointer-events:none;z-index:2;visibility:hidden}.is-revealing:is(.stars-5,.stars-6) .card-reveal-fx{visibility:visible}.card-halo{position:absolute;inset:-12px;border:1px solid transparent;border-radius:24px;opacity:0}.is-revealing:is(.stars-5,.stars-6) .card-halo{animation:card-halo 1.5s .32s ease-out both}.is-revealing.stars-6 .card-halo{animation-duration:2s}.card-spark{position:absolute;left:var(--sx);top:var(--sy);width:4px;height:4px;opacity:0;background:#e6bf62;box-shadow:0 0 7px #e6bf62;border-radius:1px}.is-revealing:is(.stars-5,.stars-6) .card-spark{animation:card-spark 1.8s ease-out both;animation-delay:calc(.3s + var(--spark)*.035s)}.stars-6 .card-spark{background:#fff3c1;width:5px;height:5px}.is-revealing.stars-6 .activity-front:after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(110deg,transparent 20%,#fff3ca33 48%,transparent 75%);background-size:250% 100%;animation:card-shine 1.6s .3s ease-out both}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes card-deal{from{opacity:0;transform:translateY(18px) rotate(-2deg)}to{opacity:1;transform:translateY(0) rotate(0)}}@keyframes card-halo{0%{opacity:0;box-shadow:0 0 0 #e8c37400}25%{opacity:1;border-color:#ebc66c;box-shadow:0 0 35px #e8c37488}100%{opacity:0;transform:scale(1.09);box-shadow:0 0 50px #e8c37400}}@keyframes card-spark{0%{opacity:0;transform:translateY(16px) scale(0) rotate(0)}30%{opacity:1}100%{opacity:0;transform:translateY(-75px) scale(.2) rotate(150deg)}}@keyframes card-shine{from{background-position:140% 0;opacity:0}30%{opacity:1}to{background-position:-140% 0;opacity:0}}
@media(max-width:700px){.modal:has(.activity-grid){width:100%;max-width:100%;padding:24px 18px}.activity-deck-intro h3{font-size:22px}.card-swipe-hint{display:block;margin-top:6px;color:#8d997e}.activity-grid{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:88%;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;gap:14px;padding:10px 5px 25px;margin:0 -5px;scrollbar-width:thin}.activity-slot{scroll-snap-align:center}.activity-back,.activity-front{min-height:460px}.activity-card.activity-front{padding:22px}.activity-deck-actions{flex-wrap:wrap}.card-reveal-fx{inset:5px}.activity-back{touch-action:pan-x pan-y}}
@media(prefers-reduced-motion:reduce){.activity-slot,.card-halo,.card-spark,.is-revealing.stars-6 .activity-front:after{animation:none!important}.activity-flipper{transition:none}.is-revealed.stars-5 .activity-front{outline:2px solid #c7a052}.is-revealed.stars-6 .activity-front{outline:2px solid #e8cb87}.card-reveal-fx{display:none}}

/* Off-screen pointers to new or struggling towns (ux.js edgePointers). */
#ux-edge{position:absolute;inset:0;z-index:6;pointer-events:none}
.ux-edge-pill{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;touch-action:none;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px 0 8px;border-radius:17px;background:#fffdf5f2;border:1px solid #e3d6b3;color:#7c6544;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 4px 16px #263b421f;animation:ux-pill-in .25s ease-out}
.ux-edge-pill i{font-style:normal;display:inline-block;width:18px;height:18px;line-height:18px;text-align:center;border-radius:9px;background:#f1e7cf;font-size:11px}
.ux-edge-pill small{font-variant-numeric:tabular-nums;color:#a58a63;font-weight:500}
.ux-edge-pill.is-urgent{background:#fff1ecf2;border-color:#e7b4a5;color:#b5573f}
.ux-edge-pill.is-urgent i{background:#f7d9cf}
.ux-edge-pill.is-urgent small{color:#b5573f}
@keyframes ux-pill-in{from{opacity:0;transform:translate(-50%,-50%) scale(.85)}to{opacity:1;transform:translate(-50%,-50%)}}

/* Portrait: the construction-undo pill sits centred under the notices, clear of the bottom sheets. */
@media (orientation:portrait) and (max-width:820px){
  .undo-build{top:calc(var(--hud-h) + var(--safe-t) + 50px);right:auto;left:50%;transform:translateX(-50%);max-width:calc(100vw - 24px);padding:9px 16px;border-radius:20px;font-size:12px;white-space:nowrap}
}

/* The construction-undo pill never covers an open sheet. */
body:has(#modal:not([hidden])) .undo-build{display:none!important}
.ux-help-body{padding:0 0 12px}
.ux-help-body .infra-card{border-top:0;padding-top:0}
.ux-help-body p{font-size:12px;line-height:1.8;color:#5f6f68}

/* Portrait detail sheet: peek (short, map stays usable) ↔ full (scrolls). See ux.js sheetStates. */
@media (orientation:portrait) and (max-width:820px){
  .detail-panel{transition:max-height .22s ease;overscroll-behavior:contain}
  .detail-panel.is-peek{max-height:min(36dvh,300px);overflow:hidden;padding-bottom:30px}
  .detail-panel.is-peek::after{content:'上滑或轻点顶部 · 查看全部';position:absolute;left:0;right:0;bottom:0;padding:26px 0 9px;border-radius:0 0 18px 18px;text-align:center;font-size:11px;color:var(--muted);background:linear-gradient(#fff0,#fffffff2 45%);pointer-events:none}
  .detail-panel.is-full{max-height:calc(100dvh - var(--hud-h) - var(--safe-t) - var(--dock-btn-h) - var(--dock-bottom) - 96px)}
  .detail-panel::before{width:44px;height:5px;background:#d4dbd1;cursor:pointer}
}
@media (orientation:portrait) and (max-width:820px){
  body:has(#details.is-full:not([hidden])) .undo-build{display:none!important}
}

/* Landscape/desktop: when the side details panel is open, the construction-undo pill moves to its left. */
@media not ((orientation:portrait) and (max-width:820px)){
  body:has(#details:not([hidden])) .undo-build{right:calc(var(--gutter) + var(--safe-r) + 306px)}
}
@media (max-width:1100px) and (not ((orientation:portrait) and (max-width:820px))){
  body:has(#details:not([hidden])) .undo-build{right:calc(var(--gutter) + var(--safe-r) + 284px)}
}

/* Portrait: notices stay one quiet line so they do not eat the map; ⌖ shows when the overview is on. */
@media (orientation:portrait) and (max-width:820px){
  .top-stack{width:calc(100vw - 32px)}
  .notice-wrap{max-width:100%;padding:2px 2px 2px 12px;box-shadow:none}
  .notice{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:3px 0;text-align:left}
  #notice-close{width:28px;height:28px}
}
#overview.is-on{background:var(--ink);color:#fff}

/* Portrait, details fully expanded: the strip above the sheet belongs to the selected city, so notices and
   off-screen pointers step aside until the sheet is collapsed or closed. */
@media (orientation:portrait) and (max-width:820px){
  body:has(#details.is-full:not([hidden])) .top-stack,
  body:has(#details.is-full:not([hidden])) #ux-edge{opacity:0;visibility:hidden}
}

/* ============================================================
   UX: city sheet as numbers + goal + demand + facilities; how-to-play help; folded rules
   ============================================================ */
.ux-demand{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:10px 0 4px}
.ux-demand-label{font-size:11px;color:var(--muted);margin-right:2px}
.ux-chip{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 10px;border-radius:15px;background:#f3f5ef;font-size:12px;width:auto;text-align:left;border:0}
.ux-chip b{font-variant-numeric:tabular-nums}
.ux-chip small{color:#b5573f}
.ux-chip.is-late{background:#fbf1ea}
.ux-fac{display:grid;grid-template-columns:1fr;gap:6px;margin-top:10px}
.ux-fac .ux-list-title{grid-column:1/-1;margin:4px 0 0}
.ux-fac-tile{display:grid;grid-template-columns:22px 1fr auto;align-items:center;gap:8px;min-height:52px;padding:8px 10px;border-radius:12px;background:#f6f7f2;text-align:left;border:1px solid transparent}
.ux-fac-tile:hover{border-color:var(--line)}
.ux-fac-tile svg{width:20px;height:20px;fill:none;stroke:#6f8a7c;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ux-fac-tile span{min-width:0}
.ux-fac-tile b{display:block;font-size:12px}
.ux-fac-tile small{display:block;font-size:10px;line-height:1.35;color:var(--muted)}
.ux-fac-tile em{font-style:normal;font-size:11px;font-weight:600;color:#8a6d45;white-space:nowrap}
.ux-fac-tile:disabled{opacity:.5}
.ux-steps{list-style:none;margin:6px 0 10px;padding:0;display:grid;gap:8px}
.ux-steps li{display:flex;gap:12px;align-items:flex-start;padding:10px 12px;border-radius:12px;background:#f6f7f2}
.ux-steps i{flex-shrink:0;width:26px;height:26px;border-radius:13px;display:grid;place-items:center;background:var(--ink);color:#fff;font-style:normal;font-weight:600;font-size:13px}
.ux-steps span{font-size:12px;line-height:1.55;color:#5f6f68}
.ux-steps b{display:block;color:var(--ink);font-size:13px}
.ux-help-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.ux-help-links button,.ux-help-links a{min-height:38px;padding:0 14px;border-radius:19px;background:var(--chip);display:inline-flex;align-items:center;font-size:12px}
.ux-rules{margin-top:10px;border-top:1px solid var(--line)}
.ux-rules summary{list-style:none;cursor:pointer;min-height:42px;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--muted)}
.ux-rules summary::-webkit-details-marker{display:none}
.ux-rules summary::after{content:'+';font-size:18px}
.ux-rules[open] summary::after{content:'−'}
.ux-rules p{font-size:12px;line-height:1.7;color:#6f7d76;margin:4px 0 10px}

/* Portrait: fewer captions, shorter sheets. Rules live in help and behind "规则说明". */
@media (orientation:portrait) and (max-width:820px){
  .modal-head small,.modal .eyebrow:not(.ux-hero .eyebrow){display:none}
  .detail-panel.is-peek::after{content:'';padding:18px 0 0}
  .detail-panel .detail-sub{margin-bottom:8px}
  .detail-panel .metric-grid{grid-template-columns:repeat(2,auto);justify-content:start;gap:4px 28px;padding:6px 0;border:0}
  .detail-panel .metric-grid small{font-size:10px}
  .detail-panel .metric-grid b{font-size:16px;display:inline}
  .detail-panel .bar{margin:2px 0 8px}
  .detail-panel .city-mission{margin:8px 0;padding:2px 0 2px 12px}
  .detail-panel .city-mission > small,.detail-panel .city-mission .mission-heading small{display:none}
  .detail-panel .city-mission h4{font-size:14px;margin:4px 0 2px}
  .detail-panel .city-mission p{margin:2px 0 6px}
  .detail-panel .mission-progress{margin:6px 0}
  .ux-fac{grid-template-columns:1fr 1fr}   /* full-width sheet: two tiles per row; side panels stay single column */
}

/* Portrait finance market: one-line headline, flat sections instead of cards inside the sheet. */
@media (orientation:portrait) and (max-width:820px){
  .financial-market .market-headline{grid-template-columns:auto auto 1fr;gap:4px 18px;padding:6px 0 12px}
  .financial-market .market-headline small{font-size:10px;margin-bottom:2px}
  .financial-market .market-headline b{font-size:16px;font-weight:600}
  .financial-market .market-headline > div:last-child b{font-size:12px;font-weight:500;color:var(--muted)}
  .financial-market .market-product,.financial-market .market-stock-detail,.financial-market .market-build{background:none;border:0;border-top:1px solid var(--line);border-radius:0;padding:14px 0;margin:0;box-shadow:none}
  .financial-market .market-metrics{gap:10px 16px;margin:12px 0}
  .financial-market .market-metrics strong{font-size:18px}
  .financial-market .market-tabs{margin:8px 0}
  .ux-market-build .market-build{border-top:0;padding-top:0}
}

/* ============================================================
   Hubs: 目标 / 建造 / 资金 (three dock buttons, tabbed sheets)
   ============================================================ */
.dock-legacy{display:none!important}
.dock-hub{position:relative}
.modal-head.has-hub{flex-wrap:wrap;row-gap:10px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.ux-hub-tabs{flex:1 0 100%;display:flex;gap:4px;padding:3px;border-radius:12px;background:#eef1ea}
.ux-hub-tabs button{flex:1;min-height:36px;padding:0 6px;border-radius:9px;font-size:12px;font-weight:600;color:#5f6f68;white-space:nowrap}
.ux-hub-tabs button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px #263b4218}
.ux-contract{display:grid;gap:6px;padding:12px 0}
.ux-contract b{font-size:16px}
.ux-contract span{font-size:12px;color:#5f6f68}
.modal .ux-empty{padding:18px 0;color:#6f7d76;font-size:13px;line-height:1.7}
@media (orientation:portrait) and (max-width:820px){
  footer .dock{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px}   /* overrides market.css five-column dock */
  .dock-hub{flex-direction:column}
}

/* 建造 · 桥梁与道路 */
.ux-eng{display:grid;gap:14px;padding-top:8px}
.ux-eng-title{font-size:13px;font-weight:600;margin-bottom:6px}
.ux-eng-title small{font-weight:400;font-size:11px;color:var(--muted);margin-left:6px}
.ux-eng-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ux-eng-actions button{display:grid;gap:2px;text-align:left;min-height:56px;padding:10px 12px;border-radius:12px;background:var(--ink);color:#fff}
.ux-eng-actions button:last-child{background:#3d5a5f}
.ux-eng-actions small{color:#c9d6d2;font-size:11px}
.ux-eng-row{display:grid;grid-template-columns:18px 1fr auto 14px;align-items:center;gap:8px;width:100%;min-height:46px;padding:0 4px;border-bottom:1px solid var(--line);border-radius:0;text-align:left;font-size:13px}
.ux-eng-row i{width:18px;height:5px;border-radius:3px}
.ux-eng-row small{color:var(--muted);font-size:11px}
.ux-eng-row em{font-style:normal;color:var(--muted);font-size:18px}
.ux-eng-sec .quote-row{padding:9px 0}
.ux-eng-foot{padding:10px 12px;border-radius:12px;background:#f6f7f2;font-size:12px}
.ux-eng-foot h3{display:none}
.ux-eng-foot p{margin:0;font-size:12px;line-height:1.6}

/* Landscape phones: the route list becomes the same one-row strip as portrait, bottom-left beside the dock,
   so the whole map height is free. The dock keeps its three hubs on the right. */
@media (orientation:landscape) and (max-height:500px){
  footer{left:auto;right:calc(var(--gutter) + var(--safe-r));width:auto}
  footer .dock{width:auto}
  footer .dock .dock-hub{min-width:84px}
  .route-panel{display:flex;align-items:center;gap:6px;left:calc(var(--gutter) + var(--safe-l));right:calc(var(--gutter) + var(--safe-r) + 296px);width:auto;bottom:var(--dock-bottom);top:auto;padding:4px;max-height:none;overflow:visible;border-radius:16px}
  .route-panel .panel-heading{display:none}
  .route-panel #route-list,.route-panel.collapsed #route-list{display:flex;flex:1;min-width:0;gap:6px;overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain}
  .route-panel #route-list::-webkit-scrollbar{display:none}
  .route-panel #route-list:empty{display:none}
  .route-row{flex:0 0 auto;margin:0;min-height:36px;padding:0 10px 0 8px;gap:6px;border-radius:18px;background:#f3f5ef;border:1px solid transparent}
  .route-row.active{background:#fff;border-color:currentColor}
  .route-row .swatch{width:12px;border-top-width:4px}
  .route-row .name{flex:none;max-width:6.5em;font-size:12px;font-weight:600}
  .route-row small{font-size:10px}
  .add-route,.route-panel.collapsed .add-route{flex:0 0 auto;width:36px;min-height:36px;margin:0;padding:0;border:0;border-radius:18px;background:var(--ink);color:#fff;font-size:0}
  .add-route::before{content:'＋';font-size:18px}
  .route-panel:not(:has(.route-row)) .add-route{flex:1;font-size:13px}
  .route-panel:not(:has(.route-row)) .add-route::before{content:''}
  .route-foot,.route-panel.collapsed .route-foot{display:contents}
  .route-foot #stock{display:none}
  .route-foot button{flex:0 0 auto;width:36px;height:36px;border-radius:18px;background:#f3f5ef;font-size:16px}
  body:has(#drawbar:not([hidden])) #routes{display:none}
}
.dock-badge{position:absolute;top:6px;right:calc(50% - 22px);width:9px;height:9px;border-radius:5px;background:var(--accent);box-shadow:0 0 0 2px #fffdf6}
.notice-wrap{cursor:pointer}

/* Portrait activity deck: one-line intro, actions on top, shorter cards with the next one peeking in. */
@media (orientation:portrait) and (max-width:820px){
  .modal:has(.activity-grid){padding:0 14px calc(18px + var(--safe-b))}
  .activity-deck-intro{padding:6px 0 2px}
  .activity-deck-intro h3{font-size:17px!important;margin:4px 0}
  .activity-deck-intro p,.activity-deck-intro .card-swipe-hint,.activity-deck-intro small{display:none!important}
  .activity-deck-actions{justify-content:flex-start;gap:8px;margin:6px 0 2px}
  .activity-deck-actions button{min-height:36px;padding:0 14px;border-radius:18px;font-size:12px}
  .activity-grid{grid-auto-columns:78%!important;gap:10px!important;padding:8px 2px 14px!important}
  .activity-back{min-height:280px!important;padding:18px 12px!important}
  .activity-front{min-height:280px!important;padding:16px!important}
  .activity-back svg{max-width:88px;max-height:88px}
}

/* Returning player: where you left off, one button */
.ux-resume{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:14px 0 6px}
.ux-resume div{padding:10px 8px;border-radius:12px;background:#f6f7f2;text-align:center}
.ux-resume small{display:block;font-size:11px;color:var(--muted)}
.ux-resume b{display:block;margin-top:2px;font-size:16px;font-variant-numeric:tabular-nums}
.ux-resume-links{display:flex;justify-content:space-between;margin-top:6px}
.ux-resume-links button{min-height:40px;padding:0 6px;color:var(--muted);font-size:13px;background:none}

.ux-car-fold summary{color:var(--ink);font-weight:600}
.ux-car-fold summary small{flex:1;margin-left:8px;font-weight:400;color:var(--muted);font-size:11px}
.ux-car-fold .car-shop{border:0;padding:0;margin:0;background:none}
.ux-car-fold .car-shop h3,.ux-car-fold .car-shop .eyebrow{display:none}

/* 资金·收支 overview */
.ux-ledger{padding:10px 0 6px}
.ux-ledger-head{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:10px}
.ux-ledger-head div{padding:10px;border-radius:12px;background:#f6f7f2}
.ux-ledger-head small{display:block;font-size:11px;color:var(--muted)}
.ux-ledger-head b{display:block;font-size:16px;font-variant-numeric:tabular-nums;margin-top:2px}
.ux-ledger b.in{color:#4f7f45}.ux-ledger b.out{color:#b5573f}
.ux-ledger-row{display:grid;grid-template-columns:64px 1fr auto;align-items:center;gap:8px;min-height:26px;font-size:12px}
.ux-ledger-row i{height:8px;border-radius:4px;background:#9cc08f}
.ux-ledger-row.out i{background:#e3a593}
.ux-ledger-row b{font-weight:500;font-variant-numeric:tabular-nums;font-size:12px}
.ux-ledger-note{margin-top:8px;font-size:11px;color:var(--muted)}
.ux-ledger-all .finance-summary{margin-top:0}

/* First-game coach */
#ux-coach{position:absolute;z-index:8;left:16px;right:16px;margin:0 auto;width:max-content;display:flex;align-items:center;gap:6px;max-width:calc(100vw - 32px);padding:8px 6px 8px 14px;border-radius:14px;background:#fffdf6f5;border:1px solid #e9d6c4;box-shadow:0 6px 20px #263b4222;font-size:13px;line-height:1.5;color:#5f4a3a;animation:ux-pill-in .25s ease-out}
#ux-coach b{color:#c56544;margin-right:6px}
#ux-coach button{flex-shrink:0;width:30px;height:30px;border-radius:15px;color:#a39a8a;font-size:15px}

/* Sheet compaction: stat tiles, segmented choices, offer rows */
.modal .finance-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0 10px}
.modal .finance-summary span{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:2px;padding:9px 10px;border:0;border-radius:12px;background:#f6f7f2;font-size:11px;line-height:1.3}
.modal .finance-summary b{font-size:15px}
.ux-seg{display:flex;gap:3px;padding:3px;border-radius:12px;background:#eef1ea;margin:4px 0 8px}
.ux-seg button{flex:1;min-height:36px;border-radius:9px;font-size:12px;font-weight:600;color:#5f6f68;white-space:nowrap}
.ux-seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px #263b4218}
select.ux-seg-src{display:none}
.task-cities > section:has(> button[onclick^="acceptContract"]){display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:10px;padding:10px 0}
.task-cities > section:has(> button[onclick^="acceptContract"]) h3{grid-column:1;font-size:14px}
.task-cities > section:has(> button[onclick^="acceptContract"]) p{grid-column:1;margin:2px 0 0;font-size:12px}
.task-cities > section:has(> button[onclick^="acceptContract"]) > button{grid-column:2;grid-row:1/span 2;min-height:38px;padding:0 14px;border-radius:19px;background:var(--ink);color:#fff;font-weight:600}
.modal .infra-card{padding:12px 0 6px}
.modal .infra-card h3{font-size:14px;margin:0 0 6px}
.modal .infra-card > button{margin:4px 6px 4px 0}
@media (orientation:portrait) and (max-width:820px){
  .modal .finance-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Single-action cards (road segment upgrades, repairs…) read as one row: what on the left, the action on the right. */
.modal .infra-card:has(> button:only-of-type){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;padding:10px 0;border-top:0;border-bottom:1px solid var(--line);margin:0}
.modal .infra-card:has(> button:only-of-type) > :not(button){grid-column:1;margin:0}
.modal .infra-card:has(> button:only-of-type) > button{grid-column:2;grid-row:1/span 3;margin:0;min-height:38px;padding:0 14px;border-radius:19px;background:var(--ink);color:#fff;font-weight:600;white-space:nowrap}
.modal .infra-card:has(> button:only-of-type) > button:disabled{background:var(--chip);color:var(--muted)}
.modal .infra-card:has(> button:only-of-type) b{font-size:13px}
.modal .infra-card:has(> button:only-of-type) p{font-size:11px;color:var(--muted)}

/* Caption diet (portrait): header, route chips, market */
@media (orientation:portrait) and (max-width:820px){
  .calendar #calendar-tag{display:none}
  .calendar{display:flex;align-items:center}
  .stat-money > small:first-child{display:none}
  .route-panel .route-row small{display:none}
  .route-panel .route-row{padding:0 14px 0 12px}
  .financial-market .market-headline > div:nth-child(3){display:none}
  .financial-market .market-headline{grid-template-columns:auto auto}
  .financial-market .market-chart figcaption{display:none!important}
}

/* ============================================================
   Hub sheets — one design system for 目标 / 建造 / 资金
   ============================================================ */
/* header: grabber, then [tabs ……][×] on one row; the tabs are the title */
.modal-head.has-hub{flex-wrap:nowrap;align-items:center;gap:10px;padding-top:24px;padding-bottom:10px;border-bottom:0}
.modal-head.has-hub > h2,.modal-head.has-hub > div:first-child:not(.ux-hub-tabs){display:none}
.modal-head.has-hub .ux-hub-tabs{flex:1 1 auto;margin:0}
.modal-head.has-hub .close{width:38px;height:38px;flex:0 0 38px}
/* section labels and cards */
.ux-card{margin:6px 0 12px;padding:2px 12px;border-radius:14px;background:#f6f7f2}
.ux-card > .quote-row:last-child{border-bottom:0}
.ux-card-label,.ux-eng-title,.ux-list-title{font-size:12px!important;font-weight:600!important;color:#6f7d76!important;margin:14px 2px 6px!important;letter-spacing:.5px}
/* bottom footer for rule/detail folds */
.ux-foldfoot{margin-top:14px;border-top:1px solid var(--line)}
.ux-foldfoot details.ux-rules{border-top:0;margin:0}
.ux-foldfoot details.ux-rules summary{min-height:40px;font-size:12px}
.ux-footnote{font-size:11px!important;color:var(--muted)!important;margin:10px 2px 0!important}
/* tasks: glyph · name + stage · reward / bar + count */
.ux-tasks{display:block!important}
.ux-task{display:flex!important;align-items:center;gap:12px;padding:12px 4px!important;border-bottom:1px solid var(--line)}
.ux-glyph svg{width:30px;height:30px;display:block}
.ux-task-main{flex:1;min-width:0;display:grid;gap:6px}
.ux-task-top{display:flex;align-items:baseline;gap:8px;min-width:0}
.ux-task-top b{font-size:14px;white-space:nowrap}
.ux-task-top .ux-task-title{margin:0;font-size:12px;color:#5f6f68;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.ux-task-top em{font-style:normal;font-weight:600;font-size:12px;color:#9f7948;white-space:nowrap}
.ux-task-bar{display:flex;align-items:center;gap:10px}
.ux-task-bar .ux-bar{flex:1;height:6px}
.ux-task-bar small{font-size:11px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
/* build: light bridge cards with an icon, line upgrades grouped */
.ux-eng{gap:4px!important;padding-top:0!important}
.ux-eng-actions button,.ux-eng-actions button:last-child{background:#f6f7f2!important;color:var(--ink)!important;border:1px solid #e3e8de!important;grid-template-columns:28px 1fr;align-items:center;column-gap:10px;min-height:60px}
.ux-eng-actions button::before{content:'';grid-row:1/span 2;width:28px;height:20px;background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20' fill='none' stroke='%23526d6b' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M2 14h24M4 14V9M24 14V9M2 9h24M7 9a7 6 0 0 1 14 0'/%3E%3C/svg%3E")}
.ux-eng-actions button:last-child::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20' fill='none' stroke='%23526d6b' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M2 14h24M2 9h24M6 9v5M11 9v5M17 9v5M22 9v5M4 18h20'/%3E%3C/svg%3E")}
.ux-eng-actions small{color:#9f7948!important;font-weight:600}
.ux-eng-sec{padding:2px 12px;border-radius:14px;background:#f6f7f2}
.ux-eng-sec > .ux-eng-title{margin:12px 0 4px!important}
.ux-eng-row{border-bottom:1px solid #e9ece4}
.ux-eng-row:last-child{border-bottom:0}
/* vehicles: one card, consistent small text */
.modal .ux-list:has(.ux-product){padding:2px 12px;border-radius:14px;background:#f6f7f2;margin-top:6px}
.ux-product:last-child{border-bottom:0}
.ux-product small{font-size:11px;color:var(--muted)}
.ux-product .ux-lock{color:#a58a63!important}
/* weather empty state */
.modal .ux-emptystate{display:grid;justify-items:center;gap:4px;padding:26px 0 10px;text-align:center}
.ux-emptystate svg{width:34px;height:34px;fill:none;stroke:#c9a35a;stroke-width:1.6;stroke-linecap:round}
.ux-emptystate b{font-size:15px;color:var(--ink)}
.ux-emptystate span{font-size:12px;color:var(--muted)}
/* contract offers grouped in a card */
.modal .task-cities:has(button[onclick^="acceptContract"]){padding:2px 12px;border-radius:14px;background:#f6f7f2;margin-top:6px}
.task-cities > section:has(> button[onclick^="acceptContract"]):last-child{border-bottom:0}
/* build page: every section = label above, card below */
.ux-eng-sec{padding:0!important;background:none!important}
.ux-eng-sec > .ux-card{margin-top:0}
.ux-eng-row{min-height:48px}
/* finance pages: cash / return as tiles, same as 收支 and 维护 */
.financial-market .market-headline{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important;padding:4px 0 8px!important;border:0!important}
.financial-market .market-headline > div{padding:9px 10px;border-radius:12px;background:#fff;border:1px solid var(--line)}
.financial-market .market-headline small{font-size:11px!important;margin:0 0 2px!important}
.financial-market .market-headline b{font-size:15px!important}

/* finance curve: readable at phone size (SVG is 720 units wide) */
.market-chart svg{background:#fff!important;border:1px solid var(--line);border-radius:12px!important}
.market-chart svg text{font-size:22px!important;fill:#8a968c!important}
.market-chart svg path{stroke:#eef1ea!important}
.market-chart-empty{border-radius:12px!important;background:#f6f7f2!important;padding:36px 16px!important}
/* confirmation pattern */
.ux-confirm{display:flex;gap:8px;align-items:center;margin-top:16px}
.ux-confirm > button{min-height:46px;border-radius:12px;font-size:14px;font-weight:600;padding:0 16px}
.ux-confirm > button.primary{flex:1;margin:0!important}
.ux-confirm > button:not(.primary){background:var(--chip);color:#5f6f68}
.ux-confirm.is-options{flex-direction:column;align-items:stretch}
.ux-confirm.is-options > button{width:100%}
.ux-confirm.is-options > button:not(.primary):first-of-type,.ux-confirm.is-options > button:nth-child(2){background:#fff;border:1px solid var(--line);color:var(--ink)}
.ux-confirm.is-options > button:last-child:not(:nth-child(2)){background:none;color:var(--muted);min-height:38px}
.ux-confirm .ux-danger-primary{background:#b5573f!important;color:#fff!important}
/* city services list */
.ux-svc-row{display:flex;align-items:center;gap:10px;min-height:52px;border-bottom:1px solid #e9ece4}
.ux-svc-row:last-child{border-bottom:0}
.ux-svc-row > span{flex:1;min-width:0}
.ux-svc-row b{display:block;font-size:14px}
.ux-svc-row small{font-size:11px;color:var(--muted)}
.ux-svc-row button{min-height:34px;padding:0 14px;border-radius:17px;background:#fff;border:1px solid var(--line);font-size:12px}

/* active city activity */
.ux-act{display:grid;gap:12px;padding:10px 0 4px}
.ux-act-head{display:grid;grid-template-columns:auto 1fr auto;align-items:baseline;column-gap:8px}
.ux-act-stars{color:#c9a35a;font-size:13px;letter-spacing:1px}
.ux-act-head b{font-size:17px}
.ux-act-head small{grid-column:2;grid-row:2;font-size:12px;color:var(--muted)}
.ux-act-head em{grid-column:3;grid-row:1/span 2;align-self:center;font-style:normal;font-size:11px;font-weight:600;padding:5px 10px;border-radius:12px;background:#e7f0e2;color:#4f7f45;white-space:nowrap}
.ux-act-head em.is-prep{background:#f6efe0;color:#9f7948}
.ux-act-progress{display:grid;gap:6px;padding:12px;border-radius:14px;background:#f6f7f2}
.ux-act-progress .ux-bar{height:8px}
.ux-act-progress > span:last-child{font-size:12px;color:#5f6f68}
.ux-act-progress > span:last-child b{font-size:16px;color:var(--ink)}
.ux-act-progress small{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.ux-act-stakes{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.ux-act-stakes div{padding:10px;border-radius:12px;background:#f6f7f2}
.ux-act-stakes small{display:block;font-size:11px;color:var(--muted)}
.ux-act-stakes b{display:block;font-size:13px;margin-top:2px;line-height:1.4}
.ux-act-stakes .ok b{color:#4f7f45}.ux-act-stakes .bad b{color:#b5573f}
.ux-act-go{min-height:44px;border-radius:12px;background:#fff;border:1px solid var(--line);font-weight:600}
/* finance locked: steps */
.ux-steps-fin li.is-done i{background:#4f7f45}
.ux-steps-fin p{margin:2px 0 0!important;font-size:12px!important;line-height:1.6!important;color:#5f6f68!important}
.ux-steps-fin button.primary{margin-top:8px!important;min-height:38px!important;padding:0 14px!important;border-radius:19px!important;font-size:12px!important}
/* line name & colour */
.modal .colors{flex-wrap:nowrap;gap:8px;justify-content:space-between}
.modal .colors button{width:30px;height:30px;flex:0 1 30px;min-width:24px}
.modal .colors button.on{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--ink)}
/* portrait: the choose-a-line picker is a bottom sheet like the details panel */
@media (orientation:portrait) and (max-width:820px){
  #junction-picker{left:calc(var(--gutter) + var(--safe-l))!important;right:calc(var(--gutter) + var(--safe-r));top:auto!important;bottom:calc(var(--dock-bottom) + var(--dock-btn-h) + 10px);width:auto!important;padding:16px 16px 12px;border-radius:18px;box-shadow:0 -6px 40px #263b4220}
  .junction-heading{padding:0 0 10px}
  .junction-heading b{font-size:17px}
  .junction-heading small{font-size:11px}
  .junction-city-task{min-height:44px;border-radius:12px;font-weight:600}
  .junction-line{align-items:center;min-height:52px;border-bottom:1px solid var(--line);border-radius:0;margin:0}
  .junction-line:last-child{border-bottom:0}
  .junction-line span{font-size:14px;font-weight:600}
  .junction-drag{min-height:38px;padding:0 14px;border-radius:19px;background:var(--ink);color:#fff}
  body:has(#junction-picker:not([hidden])) #routes{display:none}
}
.ux-steps-fin span > b:first-child{display:block;margin-bottom:2px}
.ux-steps-fin span b:not(:first-child){display:inline;font-size:12px}
.ux-steps-fin span > button.primary{display:flex;align-items:center;width:max-content}

.modal .ux-warnline{margin:12px 0 0;padding:10px 12px;border-radius:12px;background:#f8ece6;color:#9a4a35;font-size:12px;font-weight:600}

/* ============================================================
   1.2.10 design pass
   ============================================================ */
/* finished match: the run control becomes a results button */
#pause.is-ended{width:auto!important;padding:0 14px!important;background:#f3ede2!important;color:#7a5a3a!important;font-size:13px!important;font-weight:650;letter-spacing:.5px}

/* ---------- dock: three equal hubs; the open one is marked ---------- */
footer .dock .dock-hub,footer .dock .dock-hub.is-primary{background:#fffdf7f2!important;color:var(--ink)!important;border:1px solid #e3e6dc!important;box-shadow:0 2px 10px #263b4214!important}
footer .dock .dock-hub.is-open{background:var(--ink)!important;color:#fff!important;border-color:var(--ink)!important}
footer .dock .dock-hub svg{stroke:currentColor}
/* ---------- network tray (phones in portrait) ---------- */
@media (orientation:portrait) and (max-width:820px){
  body #routes.route-panel{display:grid!important;grid-template-columns:minmax(0,1fr);gap:6px;padding:8px 10px 10px!important;max-height:none!important;overflow:visible!important;border-radius:16px;box-shadow:0 3px 14px #263b4214}
  body #routes .panel-heading{display:flex!important;align-items:center;gap:8px;min-height:36px;padding:0!important;margin:0}
  body #routes .panel-heading > span:first-child{flex:0 0 auto;font-size:13px;font-weight:650;color:var(--ink);white-space:nowrap}
  body #routes .panel-heading > span:first-child small{margin-left:4px;font-size:11px;font-weight:500;color:var(--muted)}
  #routes .ux-swatches{flex:1 1 auto;min-width:0;display:none;gap:3px;align-items:center;overflow:hidden}
  #routes.collapsed .ux-swatches{display:flex}
  #routes .ux-swatches button{flex:0 0 auto;width:18px;height:28px;padding:0;border:0;background:none;position:relative}
  #routes .ux-swatches button::before{content:'';position:absolute;left:3px;right:3px;top:12px;height:4px;border-radius:2px;background:var(--c)}
  #routes .ux-swatches button.on::before{top:10px;height:8px}
  #routes:not(.collapsed) .panel-heading > span:first-child{flex:1 1 auto}
  body #routes #route-new130{min-height:34px;padding:0 12px;border-radius:17px;font-size:12px;font-weight:650;background:var(--ink);flex:0 0 auto}
  body #routes #collapse{flex:0 0 auto;width:34px;height:34px;border-radius:17px;background:var(--chip);font-size:16px;line-height:1}
  body #routes .panel-heading #overview{position:static!important;flex:0 0 auto;width:34px!important;height:34px!important;border-radius:17px!important;background:var(--chip)!important;box-shadow:none!important;font-size:15px}
  body #routes:not(.collapsed) #route-list{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:6px;max-height:114px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
  body #routes #route-list::-webkit-scrollbar{display:none}
  body #routes #route-list:empty{display:none!important}
  body #routes .route-row{width:auto!important;min-height:34px!important;height:34px;margin:0;padding:0 10px 0 9px!important;gap:7px;border-radius:17px;background:#f3f5ef;border:1px solid transparent}
  body #routes .route-row.active{background:#fff;border-color:var(--ink)}
  body #routes .route-row .swatch{width:14px;flex:0 0 14px;border-top-width:4px}
  body #routes .route-row .name{flex:1;min-width:0;max-width:none;font-size:12px;font-weight:600}
  body #routes .route-row small,body #routes .route-row .route-actions{display:none!important}
  body #routes .route-foot{display:none!important}
}
@media (orientation:portrait) and (max-width:820px){
  body #routes .panel-heading #route-new130{width:auto!important;min-width:0!important;max-width:none!important;overflow:visible!important;font-size:12px!important}
}

/* ---------- city sheet ---------- */
.ux-load{display:grid;gap:8px;margin:10px 0 4px;padding:12px;border-radius:14px;background:#f6f7f2}
.ux-load-main{display:flex;align-items:baseline;gap:8px;min-width:0}
.ux-load-main b{font-size:24px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--ink)}
.ux-load-main span{flex:1;min-width:0;font-size:12px;color:#5f6f68}
.ux-load-main em{font-style:normal;font-size:11px;font-weight:650;padding:3px 9px;border-radius:10px;white-space:nowrap}
.ux-load-main em.is-over{background:#b5573f;color:#fff}
.ux-load-main em.is-near{background:#f3e3bf;color:#7a5a24}
.ux-load-main em.is-calm{background:#e4eee0;color:#4f7f45}
.ux-load-press{display:grid;gap:4px}
.ux-load-press .ux-bar{height:6px}
.ux-load-press .ux-bar.is-over i{background:#b5573f}
.ux-load-press small{font-size:11.5px;color:#5f6f68}
.ux-fac-strip{display:flex;align-items:center;gap:6px;margin:8px 0 2px;overflow-x:auto;scrollbar-width:none}
.ux-fac-strip::-webkit-scrollbar{display:none}
.ux-fac-strip > span{font-size:12px;color:#5f6f68;margin-right:2px;flex:0 0 auto}
.ux-fac-strip button{flex:0 0 auto;display:flex;align-items:center;gap:5px;height:32px;padding:0 10px 0 8px;border-radius:16px;background:#fff;border:1px solid var(--line);font-size:12px;color:var(--ink)}
.ux-fac-strip button.is-off{color:#93a09a}
.ux-fac-strip svg{width:16px;height:16px;fill:none;stroke:#5f7d70;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ux-fac-strip small{font-size:12px}
.ux-fac-tile.is-flash{border-color:var(--ink)!important;background:#fff!important}
.ux-fac-tile b{font-size:13px!important}
.ux-fac-tile small{font-size:11.5px!important;color:#5f6f68!important}
.ux-fac-tile em{font-size:12px!important}
.ux-wait{margin:12px 0 4px;border-radius:14px;background:#f6f7f2;padding:4px 12px 6px}
.ux-wait-head,.ux-wait-row{display:grid;grid-template-columns:minmax(0,1fr) 44px 46px;align-items:center;gap:6px}
.ux-wait-head{min-height:30px;font-size:12px;color:#5f6f68}
.ux-wait-head small{text-align:right;font-size:11px;color:var(--muted)}
.ux-wait-group{display:flex;justify-content:space-between;margin:8px 0 2px;padding-top:6px;border-top:1px solid #e3e8de;font-size:11.5px;font-weight:600;color:#5f6f68}
.ux-wait-group small{font-weight:500;color:var(--muted)}
.ux-wait-row{width:100%;min-height:34px;padding:0;background:none;border:0;border-bottom:1px solid #edf0e8;text-align:left;font-size:13px;border-radius:0}
.ux-wait-row:last-child{border-bottom:0}
.ux-wait-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.ux-wait-row b{text-align:right;font-size:15px;font-variant-numeric:tabular-nums;color:var(--ink)}
.ux-wait-row small{text-align:right;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.ux-wait-row.is-late small{color:#b5573f;font-weight:600}
/* peek: a real control instead of a painted hint */
.detail-panel .ux-peekbar{display:none}
@media (orientation:portrait) and (max-width:820px){
  .detail-panel.is-peek::after{content:none!important;display:none!important}
  .detail-panel.is-peek{padding-bottom:52px!important}
  .detail-panel.is-peek > .ux-peekbar{display:flex;position:absolute;left:0;right:0;bottom:0;z-index:2;align-items:center;justify-content:center;gap:6px;height:48px;border:0;border-radius:0 0 18px 18px;background:linear-gradient(#fffef900,#fffef9 38%);font-size:12.5px;font-weight:600;color:var(--ink)}
  .detail-panel.is-peek > .ux-peekbar i{font-style:normal;font-size:14px;color:#6f7d76}
}
@media (orientation:portrait) and (max-width:820px){
  /* the tray steps aside while a sheet, the draw bar or the line picker owns the bottom of the screen */
  body:has(#details:not([hidden])) #routes.route-panel,
  body:has(#drawbar:not([hidden])) #routes.route-panel,
  body:has(#junction-picker:not([hidden])) #routes.route-panel{display:none!important}
}

/* ---------- hub pages ---------- */
.modal-head .ux-back{flex:0 0 auto;min-height:34px;padding:0 12px;border-radius:17px;background:var(--chip);font-size:12px;font-weight:600;color:var(--ink)}
/* earthquake monitor with no quake: a settings row, not a warning card */
.quake-summary.is-idle{display:flex!important;align-items:center;justify-content:space-between;gap:10px;margin:12px 0 0!important;padding:10px 12px!important;border-radius:12px!important;background:#f6f7f2!important;border:0!important;box-shadow:none!important}
.quake-summary.is-idle b{font-size:13px;font-weight:600;color:var(--ink)}
.quake-summary.is-idle b small{margin-left:8px;font-size:12px;font-weight:500;color:#5f6f68}
.quake-summary.is-idle button{flex:0 0 auto;min-height:32px!important;margin:0!important;padding:0 12px!important;border-radius:16px!important;background:#fff!important;border:1px solid var(--line)!important;color:var(--ink)!important;font-size:12px!important}
/* vehicles: the numbers that decide a purchase are readable */
.ux-product small{font-size:12px!important;line-height:1.5;color:#5f6f68!important}
.ux-product .ux-lock{color:#8f6b3c!important}
.ux-product b{font-size:15px}
.city-mission .eyebrow,.city-mission .mission-heading span{font-size:11.5px!important;color:#5f6f68}
/* stocks: the same reading scale as the other sheets */
.financial-market .market-stock-detail{padding:12px!important;border-radius:14px!important;background:#f6f7f2!important;border:0!important}
.financial-market .market-stock-detail h2{font-size:18px!important;margin:2px 0 4px!important;letter-spacing:0}
.financial-market .market-quote b,.financial-market .market-quote strong{font-size:24px!important}
.financial-market .market-quote span,.financial-market .market-quote small{font-size:13px!important}
.financial-market .market-stock-list{scrollbar-width:none;scroll-snap-type:x proximity;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent)}
.financial-market .market-stock-list::-webkit-scrollbar{display:none}
.financial-market .market-stock{scroll-snap-align:start;min-height:52px!important}
.financial-market .market-metrics b{font-size:13px!important}
.financial-market .market-metrics small{font-size:11.5px!important;color:#5f6f68!important}
.financial-market .market-list-heading{font-size:11.5px!important;color:#5f6f68!important}
/* map picker: the card (with its save line) fits short portrait phones */
.atlas-save{font-size:11px!important;color:#5f6b58!important}
@media (orientation:portrait) and (max-height:780px){
  .atlas-terrain svg{height:min(20vh,160px)!important;width:100%!important}
  .atlas-card>p{margin:8px 0 10px!important;line-height:1.6!important}
  .atlas-card h2{margin:8px 0 6px!important}
}
/* activity deck on short landscape screens: what the task is gets the card's height; the two actions sit beside it */
@media (orientation:landscape) and (max-height:500px){
  .deck128 .deck-tip128{display:none}
  .deck-stage128 .activity-front{flex-direction:row!important}
  .deck-stage128 .card-content128{flex:1 1 auto;min-width:0;padding:12px 14px!important}
  .deck-stage128 .card-actions128{flex:0 0 190px;justify-content:center;padding:12px!important;border-left:1px solid #dce2d4}
  .deck-pager128 button{min-height:38px!important;padding:6px 10px!important}
  .deck-tools128 button{min-height:28px!important}
}
/* line picker at a shared station */
#junction-picker .junction-city-task{display:flex!important;align-items:center;gap:10px;width:100%;min-height:52px!important;padding:8px 12px!important;border-radius:14px!important;background:#fff!important;border:1px solid var(--ink)!important;color:var(--ink)!important;text-align:left}
#junction-picker .junction-city-task span{flex:1;min-width:0}
#junction-picker .junction-city-task b{display:block;font-size:14px}
#junction-picker .junction-city-task small{display:block;font-size:11.5px;color:#5f6f68;font-weight:500}
#junction-picker .junction-city-task em{font-style:normal;font-size:12px;font-weight:650;padding:3px 9px;border-radius:10px;background:#e4eee0;color:#4f7f45;white-space:nowrap}
#junction-picker .junction-city-task em.is-near{background:#f3e3bf;color:#7a5a24}
#junction-picker .junction-city-task em.is-over{background:#b5573f;color:#fff}
#junction-picker .junction-city-task i{font-style:normal;font-size:18px;color:#6f7d76}
#junction-picker .junction-line{min-height:46px!important}
#junction-picker .junction-drag{min-height:32px!important;padding:0 12px!important;border-radius:16px!important;background:#fff!important;color:var(--ink)!important;border:1px solid #cfd6cc!important;font-size:12px!important;font-weight:600}
@media (orientation:portrait) and (max-width:820px){
  #junction-picker{max-height:calc(100dvh - var(--hud-h) - var(--safe-t) - var(--dock-btn-h) - var(--dock-bottom) - 40px);overflow-y:auto}
}
/* side route panel (landscape / desktop): one tidy heading row */
@media not all and (orientation:portrait) and (max-width:820px){
  body #routes.route-panel{min-width:252px}
  body #routes .panel-heading{display:flex!important;flex-wrap:nowrap;align-items:center;gap:6px}
  body #routes .panel-heading > span:first-child{flex:1 1 auto;min-width:0;white-space:nowrap;font-size:13px;font-weight:650}
  body #routes .panel-heading > span:first-child small{margin-left:4px;font-size:11px;font-weight:500;color:var(--muted)}
  body #routes #route-new130{width:auto!important;min-height:32px!important;padding:0 10px!important;border-radius:16px!important;font-size:12px!important;flex:0 0 auto;background:var(--ink)!important}
  body #routes #collapse{flex:0 0 auto;width:30px;height:30px;border-radius:15px}
  #routes .ux-swatches{display:none;gap:3px;flex:1 1 auto;min-width:0;overflow:hidden}
  #routes.collapsed .ux-swatches{display:flex}
  #routes .ux-swatches button{flex:0 0 auto;width:16px;height:24px;padding:0;border:0;background:none;position:relative}
  #routes .ux-swatches button::before{content:'';position:absolute;left:2px;right:2px;top:10px;height:4px;border-radius:2px;background:var(--c)}
}
/* side route panel: lines as chips, two per row, so a network of eight fits without scrolling */
@media not all and (orientation:portrait) and (max-width:820px){
  body #routes:not(.collapsed) #route-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  body #routes .route-row{width:auto!important;min-height:34px!important;height:34px;margin:0;padding:0 10px 0 9px!important;gap:7px;border-radius:17px;background:#f3f5ef;border:1px solid transparent}
  body #routes .route-row.active{background:#fff;border-color:var(--ink)}
  body #routes .route-row .swatch{width:14px;flex:0 0 14px}
  body #routes .route-row .name{flex:1;min-width:0;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body #routes .route-row small,body #routes .route-row .route-actions{display:none!important}
  body #routes.route-panel{max-height:calc(100dvh - var(--hud-h) - var(--safe-t) - 120px)!important}
}
/* short landscape phones: the tray runs along the bottom edge, left of the dock, two rows at most */
@media (orientation:landscape) and (max-height:500px){
  body #routes.route-panel{top:auto!important;bottom:var(--dock-bottom)!important;left:calc(var(--gutter) + var(--safe-l))!important;right:calc(var(--gutter) + var(--safe-r) + 356px)!important;width:auto!important;min-width:0;display:grid!important;gap:6px;padding:8px 10px!important;overflow:visible!important;max-height:none!important}
  body #routes:not(.collapsed) #route-list{grid-template-columns:repeat(auto-fill,minmax(92px,1fr));max-height:74px;overflow-y:auto;scrollbar-width:none}
  body #routes .route-foot{display:none!important}
  body:has(#details:not([hidden])) #routes.route-panel,body:has(#drawbar:not([hidden])) #routes.route-panel{display:none!important}
}
/* collapsed tray: the swatches are the point, so the heading gives them the room — the title shrinks to the count,
   「＋ 新建线路」 to ＋, and swatches wrap onto a second row rather than being clipped */
body #routes.collapsed .panel-heading{flex-wrap:nowrap;align-items:center}
body #routes.collapsed .panel-heading > span:first-child{flex:0 0 auto!important;font-size:0!important}
body #routes.collapsed .panel-heading > span:first-child small{margin:0!important;font-size:12px!important;font-weight:600;color:#5f6f68}
body #routes.collapsed .ux-swatches{display:flex!important;flex:1 1 auto;min-width:0;flex-wrap:wrap;overflow:visible!important;row-gap:0}
body #routes.collapsed #route-new130{width:34px!important;min-width:34px!important;padding:0!important;font-size:0!important}
body #routes.collapsed #route-new130::before{content:'＋';font-size:18px;font-weight:400}
body #routes #collapse{font-size:15px!important;line-height:1;color:var(--ink)}
body #routes .ux-swatches{gap:2px!important}
body #routes .ux-swatches button{width:17px!important}
body #routes .panel-heading{gap:6px!important}
/* expand / collapse: a drawn chevron (the text glyph stays for screen readers via aria-label) */
body #routes #collapse{font-size:0!important;position:relative}
body #routes #collapse::before{content:'';position:absolute;left:50%;top:50%;width:8px;height:8px;border-right:2px solid var(--ink);border-bottom:2px solid var(--ink);transform:translate(-50%,-70%) rotate(45deg)}
body #routes.collapsed #collapse::before{transform:translate(-50%,-30%) rotate(-135deg)}
/* ---------- line sheet: the numbers and the route read first; adding a vehicle is a clear but quieter control ---------- */
#details .ux-fleet{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;gap:14px;margin:10px 0 6px;padding:12px;border-radius:14px;background:#f6f7f2;border:0!important}
#details .ux-fleet > div > small{display:block;font-size:12px;color:#5f6f68;margin-bottom:2px}
#details .ux-fleet > div > b{font-size:24px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--ink);line-height:1.1}
#details .ux-fleet > div > b span{font-size:13px;font-weight:500;color:#5f6f68}
#details .ux-fleet-load{min-width:0}
#details .ux-fleet-load .ux-bar{display:block;height:5px;margin-top:6px}
#details .ux-fleet-load .ux-bar i{background:var(--lc)}
#details .ux-stepper{align-self:center;display:flex;gap:6px}
#details .ux-stepper button{min-height:40px!important;border-radius:12px!important;font-size:13px!important}
#details .ux-stepper button:first-child{width:40px;background:#fff!important;border:1px solid var(--line)!important;color:var(--ink)!important}
#details .ux-stepper button.primary{padding:0 12px!important;background:#fff!important;color:var(--ink)!important;border:1.5px solid var(--ink)!important;font-weight:650}
#details .ux-stepper button.primary:disabled{border-color:var(--line)!important;color:#9aa69f!important}
/* route: stations on a line in the line's own colour */
#details .ux-route{display:flex;flex-wrap:wrap;align-items:center;row-gap:8px;column-gap:0;margin:10px 0 4px}
#details .ux-route > i{flex:0 0 14px;height:4px;margin:0 2px;border-radius:2px;background:var(--lc);font-size:0;color:transparent}
#details .ux-stop{display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:0 6px 0 10px;border-radius:16px;background:#fff;border:2px solid var(--lc);font-size:13px;font-weight:600;color:var(--ink)}
#details .ux-stop button{width:22px;height:22px;min-height:0;padding:0;border-radius:11px;background:transparent;color:#8a968c;font-size:13px}
/* vehicles */
#details .ux-list .ux-row{min-height:44px}
#details .ux-list .ux-row b{font-size:13px}
#details .ux-list .ux-row span{font-size:13px}
#details .ux-list .ux-row small{font-size:12px;color:#5f6f68}
#details .ux-fleet{align-items:start!important}
#details .ux-stepper{align-self:center!important}
#details .ux-route{column-gap:0!important}
#details .ux-hop{display:inline-flex;align-items:center}
#details .ux-hop > i{display:block;width:14px;height:4px;margin:0 2px;border-radius:2px;background:var(--lc)}
#details .ux-stop{border-width:1.5px!important;font-size:13px!important}

/* collapsed tray: each entry is a coded pill in the line colour (same code as on the map) */
body #routes .ux-swatches button{width:auto!important;min-width:24px;height:24px!important;padding:0 6px!important;margin:2px 0;border-radius:12px!important;background:var(--c)!important;color:#fff!important;font-size:11px!important;font-weight:700;line-height:24px;letter-spacing:.2px}
body #routes .ux-swatches button::before{content:none!important}
body #routes .ux-swatches button.on{box-shadow:0 0 0 2px #fff,0 0 0 3.5px var(--ink)}
body #routes .ux-swatches{gap:4px!important;row-gap:2px!important}
body #routes.collapsed .panel-heading > span:first-child{display:none!important}
/* upstream 1.3 (revision13.css) styles every heading span as flex: keep the code strip for the collapsed state only */
body #routes .panel-heading > span.ux-swatches{display:none!important}
body #routes.collapsed .panel-heading > span.ux-swatches{display:flex!important;flex-wrap:wrap;align-items:center}
/* ---------- hub sheets: one frame per hub — every page opens at the same height (and width), so the tabs and ×
   stay where the thumb left them while switching 收支 / 维护 / 理财 / 股票; content scrolls inside ---------- */
.modal:has(.ux-hub-tabs){height:min(84dvh,820px);width:min(820px,calc(100vw - 40px))!important;max-width:820px!important}
@media (orientation:portrait) and (max-width:820px){
  .modal:has(.ux-hub-tabs){height:86dvh!important;max-height:86dvh!important;width:100%!important;max-width:100%!important}
}
@media (orientation:landscape) and (max-height:500px){
  .modal:has(.ux-hub-tabs){height:calc(100dvh - 16px)!important;max-height:calc(100dvh - 16px)!important}
}
@media (orientation:portrait) and (max-width:820px){ .modal:has(.ux-hub-tabs){padding-left:18px!important;padding-right:18px!important} }
.modal:has(.ux-hub-tabs){background:#fff!important}
/* activity card on short landscape screens: the basis for the decision (stakes, target, timing, reward, penalty) is
   on the first screen next to 承接 — a two-column fact layout instead of the portrait card's tall stack */
@media (orientation:landscape) and (max-height:500px){
  .deck-stage128 .card-content128{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:12px;row-gap:6px;align-content:start}
  .deck-stage128 .card-content128 > .card-rarity{grid-column:1;grid-row:1;min-height:0!important;padding:0!important;border:0!important;margin:0!important}
  .deck-stage128 .card-content128 > .card-rarity span{font-size:14px!important}
  .deck-stage128 .card-content128 > .card-feature{grid-column:2;grid-row:1;justify-self:end;align-self:center;margin:0!important;font-size:11px!important}
  .deck-stage128 .card-content128 > h3{grid-column:1;grid-row:2;margin:0!important;font-size:19px!important;line-height:1.25}
  .deck-stage128 .card-content128 > .card-city{grid-column:2;grid-row:2;align-self:center;justify-self:start;font-size:13px!important}
  .deck-stage128 .card-content128 > .card-stats{grid-column:1/-1;grid-row:3;display:flex!important;gap:6px;margin:2px 0 0!important;padding:0!important;border:0!important}
  .deck-stage128 .card-content128 > .card-stats span{flex:1;display:flex;align-items:baseline;justify-content:center;gap:3px;padding:6px 4px;border-radius:10px;background:#ffffff14;font-size:11px;white-space:nowrap}
  .deck-stage128 .card-content128 > .card-stats b{font-size:17px!important}
  .deck-stage128 .card-content128 > .card-reward{grid-column:1;grid-row:4;margin:0!important;padding:8px 10px!important;border-radius:10px}
  .deck-stage128 .card-content128 > .card-reward p{margin:2px 0 0!important;font-size:14px!important}
  .deck-stage128 .card-content128 > .card-risk{grid-column:2;grid-row:4;margin:0!important;padding:8px 10px;border-radius:10px;background:#ffffff0d;font-size:12px!important;line-height:1.45}
  .deck-stage128 .card-content128 > .card-sources{grid-column:1/-1;grid-row:5;margin:4px 0 0!important;font-size:12px!important}
}
@media (orientation:landscape) and (max-height:500px){
  .deck-stage128 .card-content128 > .card-stats span{display:flex!important;flex-direction:row!important;align-items:baseline!important;justify-content:center!important;gap:3px!important;padding:5px 4px!important;text-align:left!important}
  .deck-stage128 .card-content128 > .card-stats b{display:inline!important;font-size:16px!important;line-height:1!important}
  .deck-stage128 .card-content128{padding-top:10px!important;row-gap:5px!important}
  .deck-stage128 .card-content128 > h3{font-size:18px!important}
}

/* maintenance: transport mode on each bill */
.ux-mode{display:inline-block;margin-right:8px;padding:1px 7px;border-radius:9px;font-style:normal;font-size:11px;font-weight:650;vertical-align:1px}
.ux-mode.is-road{background:#efe9dc;color:#7a5f3a}
.ux-mode.is-rail{background:#e1ebf2;color:#3f5a7a}
.ux-mode.is-bridge{background:#e5ece7;color:#4f6f60}
/* roads page: facility count as three tiles */
.ux-tiles3{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:10px 0 2px}
.ux-tiles3 div{padding:8px 10px;border-radius:10px;background:#fff}
.ux-tiles3 small{display:block;font-size:11.5px;color:#5f6f68}
.ux-tiles3 b{font-size:17px;font-variant-numeric:tabular-nums}
.ux-fac-count .ux-footnote{margin:6px 2px 10px!important}
/* locked vehicles: future content — full-colour icon, the unlock path as one tagged line, price as information */
.ux-product.is-locked .transport-icon{color:#7c8f88!important;opacity:.85}
.ux-product.is-locked b{color:var(--ink)}
.ux-product .ux-lock{display:block;margin-top:3px;line-height:1.5}
.ux-product .ux-lock i{display:inline-block;margin-right:6px;padding:0 6px;border-radius:8px;background:#f3e6cf;color:#8a6232;font-style:normal;font-size:10.5px;font-weight:650}
.ux-product.is-locked button:disabled{background:transparent!important;border:1px dashed #d8d2c3!important;color:#8a7a5c!important;opacity:1!important}
/* stocks with no settled day yet */
.market-chart.ux-nohist{display:grid;place-items:center;min-height:150px;border-radius:12px;background:#f6f7f2}
.market-chart.ux-nohist .ux-emptystate{padding:18px 0}
.market-chart.ux-nohist svg{width:30px;height:30px;fill:none;stroke:#7f9a8c;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.ux-hidden{display:none!important}
@media (orientation:landscape) and (max-height:500px){
  .deck-stage128 .card-content128 > .card-reward{padding:6px 10px!important;display:flex!important;flex-direction:column;justify-content:center}
  .deck-stage128 .card-content128 > .card-reward small{font-size:10.5px!important}
  .deck-stage128 .card-content128 > .card-reward p{font-size:13px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3!important}
  .deck-stage128 .card-content128 > .card-risk{padding:6px 10px!important;font-size:11.5px!important;line-height:1.35!important}
  .deck-stage128 .card-content128 > .card-risk small{font-size:10.5px!important;line-height:1.3!important}
  .deck-stage128 .card-content128 > .card-stats span{padding:4px!important}
}
@media (orientation:landscape) and (max-height:500px){ .deck-stage128 .card-content128 > .card-reward p{white-space:normal!important;overflow:visible!important} }
/* drawing bar: upstream 1.3 lays the actions out for Android's quote-summary button (#quote-expand) beside 取消.
   On the web (no such button) that left 取消 alone on a row: here the actions are one row — 取消 and a wide 建设 */
#drawbar .db-actions:not(:has(#quote-expand)){display:flex!important;flex-direction:row!important;align-items:stretch;gap:8px!important;width:100%}
#drawbar .db-actions:not(:has(#quote-expand)) #drawundo{flex:0 0 44px}
#drawbar .db-actions:not(:has(#quote-expand)) #drawcancel{flex:0 0 auto;width:auto!important;min-width:76px!important;grid-column:auto!important;grid-row:auto!important}
#drawbar .db-actions:not(:has(#quote-expand)) #drawdone{flex:1 1 auto;width:auto!important;grid-column:auto!important;grid-row:auto!important}
/* achievements (upstream v1.4, page rebuilt in ux.js uxAchievementsHTML): one close button in a sticky header like
   every other sheet; a summary (count, bar, medals per tier); categories with their own count; compact rows where a
   locked medal is pale but the condition stays readable, and a bar only where there is something to count */
.achievements-open14 #ach-close14{display:none!important}
.achievements-open14 #modal-content > .modal-head{position:sticky;top:0;z-index:5;margin:0 -18px 6px;padding:18px 18px 10px;background:#fffef9;box-shadow:0 1px 0 var(--line)}
.uxa-sum{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 16px;margin:6px 0 4px;padding:14px 16px;border-radius:16px;background:#f3f5ec;border:1px solid #e1e6d8}
.uxa-count{display:flex;align-items:baseline;gap:6px;white-space:nowrap}
.uxa-count b{font-size:30px;line-height:1;color:#2f5547;font-variant-numeric:tabular-nums}
.uxa-count span{font-size:12px;color:#6b7a73}
.uxa-bar{height:6px;border-radius:3px;background:#dfe5d6;overflow:hidden}
.uxa-bar i,.uxa-prog i{display:block;height:100%;border-radius:inherit;background:#6f927d}
.uxa-tiers{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px}
.uxa-tier{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 10px 0 5px;border-radius:14px;background:#fffef9;border:1px solid #e1e6d8;font-size:12px;color:#4f5f58;white-space:nowrap}
.uxa-tier .ach-badge14{width:18px;height:20px}
.uxa-tier b{font-variant-numeric:tabular-nums;color:#2f4a40}
.uxa-tier small{font-size:11px;color:#7a877f}
/* the same frame as the hub pages on wide screens, so rows can sit in two columns */
@media not ((orientation:portrait) and (max-width:820px)){ .modal:has(.uxa-sum){width:min(820px,calc(100vw - 40px))!important;max-width:820px!important} }
.uxa-sum p{grid-column:1/-1;margin:0;font-size:11.5px;line-height:1.5;color:#7a877f}
.uxa-cat{display:flex;align-items:baseline;justify-content:space-between;margin:18px 2px 8px;font-size:12px;font-weight:600;letter-spacing:2px;color:#6f7d6c}
.uxa-cat small{letter-spacing:0;font-weight:500;font-variant-numeric:tabular-nums;color:#8a968a}
.uxa-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:8px}
/* rows also carry upstream's ach-row14 class (its tests and hooks); these selectors outrank achievements14.css */
.uxa-list .uxa-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:7px 12px;padding:10px 12px 10px 10px;border-radius:14px;background:#f6f7f0;border:1px solid #e3e7dc}
.uxa-list .uxa-row > .ach-badge14{width:34px;height:38px}
.uxa-list .uxa-row:has(.uxa-prog) > .ach-badge14{grid-row:1/span 2}
.uxa-list .uxa-row.is-locked > .ach-badge14{opacity:.38}
.uxa-list .uxa-row.is-done{background:#eef3e6;border-color:#d6e1cc}
.uxa-list .uxa-row.is-done.diamond{background:#edf6f7;border-color:#b9d8e1}
.uxa-row .uxa-txt h4{display:flex;align-items:baseline;gap:6px;margin:0 0 2px;font-size:14px;color:#2f4640}
.uxa-row .uxa-txt h4 small{display:inline;margin:0;font-size:10.5px;font-weight:500;color:#8b968c}
.uxa-list .uxa-row.is-locked .uxa-txt h4{color:#4c5d56}
.uxa-row .uxa-txt p{margin:0;font-size:12px;line-height:1.5;color:#62716a}
.uxa-prog{grid-column:2/-1;align-self:start;height:4px;border-radius:2px;background:#e0e5d8;overflow:hidden}
.uxa-row small.uxa-when{display:block;margin-top:3px;font-size:11px;color:#6f8a76}
.uxa-st{align-self:start;margin-top:1px;font-size:12px;font-variant-numeric:tabular-nums;color:#4f6158;white-space:nowrap}
.uxa-st.is-none{color:#9aa49b}
.uxa-st.is-done{display:inline-flex;align-items:center;gap:3px;height:22px;padding:0 8px;border-radius:11px;background:#dfeadb;color:#3f6b52;font-size:11.5px;font-weight:600}
.uxa-st.is-done::before{content:'✓';font-size:11px}
/* line picker: never more than half the screen — the station it belongs to stays in view above it; a long line list
   scrolls inside the picker */
@media (orientation:portrait) and (max-width:820px){ #junction-picker{max-height:min(50dvh,calc(100dvh - var(--hud-h) - var(--safe-t) - var(--dock-btn-h) - var(--dock-bottom) - 40px))!important} }

/* ---------- capsules: one family for everything that floats over the map ----------
   Notice (status), new-city / alarm pointers, construction undo, orientation hint and the first-game coach share one
   height, radius, paper, rule and shadow; the toast is the same shape in ink (feedback, momentary). Notices and the
   undo pill stack in one centred column under the header instead of the undo floating alone at the top right. */
:root{--cap-h:34px;--cap-r:17px;--cap-bg:#fffdf6f2;--cap-bd:#e6dcc2;--cap-sh:0 3px 12px #263b421a}
.notice-wrap,#orientation-hint,.top-stack .undo-build,.ux-edge-pill{min-height:var(--cap-h);border-radius:var(--cap-r)!important;background:var(--cap-bg);border:1px solid var(--cap-bd);box-shadow:var(--cap-sh)!important;box-sizing:border-box}
.ux-edge-pill{height:var(--cap-h)}
.notice-wrap{padding:2px 2px 2px 14px!important}
.notice-wrap .notice{font-size:12px;line-height:1.45;color:#5d5038;padding:5px 0}
#notice-close,#dismiss-orientation{width:28px!important;height:28px!important;border-radius:14px!important}
#orientation-hint{padding:2px 2px 2px 14px;font-size:12px}
#orientation-hint button#landscape-enter{height:28px;border-radius:14px}
#ux-coach{border-radius:var(--cap-r);box-shadow:var(--cap-sh);min-height:var(--cap-h);box-sizing:border-box}
#toast{border-radius:var(--cap-r);padding:8px 18px;min-height:var(--cap-h);box-sizing:border-box}
.top-stack .undo-build{position:static!important;transform:none!important;top:auto!important;right:auto!important;left:auto!important;pointer-events:auto;display:inline-flex;align-items:center;gap:7px;max-width:100%;padding:0 14px 0 6px!important;background:#fff6e2f2;border-color:#e3c99c;color:#6d5430;font-size:12px!important;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.top-stack .undo-build::before{content:'↶';display:inline-grid;place-items:center;flex:0 0 22px;height:22px;border-radius:11px;background:#f3e2bd;font-size:13px;font-weight:700}
.top-stack .undo-build[hidden]{display:none!important}
.top-stack .undo-build:hover{background:#fff0d2}
/* landscape / desktop with the side details panel open: the column centres over the map that is left */
@media not ((orientation:portrait) and (max-width:820px)){
  body:has(#details:not([hidden])) .top-stack{left:calc(50% - 150px);width:min(560px,calc(100vw - 340px))}
}
/* side details panel (landscape / desktop, ~280px): 车辆 and 载客 share the first row, the − / + stepper takes the
   second — three columns squeezed 载客 · 0% into a one-character column */
@media not ((orientation:portrait) and (max-width:820px)){
  #details .ux-fleet{grid-template-columns:auto minmax(0,1fr)!important;align-items:start!important;row-gap:10px}
  #details .ux-fleet .ux-stepper{grid-column:1/-1;align-self:stretch!important;margin-left:0;width:100%}
  #details .ux-fleet .ux-stepper button.primary{flex:1 1 auto}
  #details .ux-fleet-load small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
/* achievements on a short landscape screen: the summary keeps its numbers, the footnote goes */
@media (orientation:landscape) and (max-height:500px){ .uxa-sum{padding:10px 14px} .uxa-sum p{display:none} }
/* portrait city sheet, fully expanded: the facility grid is on the page, so the peek-state shortcut strip above it
   (same four facilities as chips) steps aside */
@media (orientation:portrait) and (max-width:820px){ #details.is-full .ux-fac-strip{display:none} }
/* the city's task: the same soft card as the waiting and fleet cards above it, not a ruled-off quote */
#details .city-mission{margin:10px 0;padding:12px 14px;border:0;border-radius:14px;background:#f6f7f2}
/* notice category icon (ux.js uxNoticeIcon sets data-kind): the same 22px round slot as the undo pill and the edge
   pointers; a leading ★ / ♪ in the text is hidden because the icon already says it */
.notice-wrap[data-kind]:not([data-kind=""]){padding-left:6px!important;gap:7px}
.notice-wrap[data-kind=""]::before{display:none}
.notice-wrap[data-kind]::before{content:'';flex:0 0 22px;height:22px;border-radius:11px;background:#f1e7cf center/14px 14px no-repeat}
.notice-wrap[data-sym="1"] .notice::first-letter{font-size:0}
.notice-wrap[data-kind="activity"]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8L12 16.9l-5.3 2.7 1-5.8-4.2-4.1 5.9-.9z' fill='%23a57a2c'/%3E%3C/svg%3E")}
.notice-wrap[data-kind="concert"]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a57a2c' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M9 17.5V6l10-2v11.5'/%3E%3Ccircle cx='6.5' cy='17.5' r='2.5'/%3E%3Ccircle cx='16.5' cy='15.5' r='2.5'/%3E%3C/svg%3E")}
.notice-wrap[data-kind="weather"]::before{background-color:#e3ebec;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b7d86' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M7 18h10a4 4 0 0 0 .6-7.9A6 6 0 0 0 6.2 11.7 3.2 3.2 0 0 0 7 18z'/%3E%3C/svg%3E")}
.notice-wrap[data-kind="damage"]::before{background-color:#f7d9cf;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5573f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 21 19.5H3z'/%3E%3Cpath d='M12 10v4.5M12 17v.2'/%3E%3C/svg%3E")}
.notice-wrap[data-kind="works"]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a57a2c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5h16M7 19.5 10.5 5h3L17 19.5M8.6 13.5h6.8'/%3E%3C/svg%3E")}
.notice-wrap[data-kind="opening"]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a57a2c' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.6-6-10a6 6 0 0 1 12 0c0 4.4-6 10-6 10z'/%3E%3Ccircle cx='12' cy='11' r='2'/%3E%3C/svg%3E")}
.notice-wrap[data-kind="info"]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a57a2c' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 11v5M12 8v.2'/%3E%3C/svg%3E")}

/* ---------- v1.5 portrait shell ----------
   Sheets keep their own ×. The shell hides every modal's own close (update123.css) and shows its shared close only for
   sheets without one (update129.css): hub pages, help and achievements have one in their header, so neither showed and
   those sheets could not be closed. The header × comes back (same place in every sheet: right end of the head / tabs). */
.portrait-shell #modal-content .modal-head > .close{display:grid!important;place-items:center}
/* save & exit: an exit glyph instead of ↶ (↶ means undo everywhere else: 撤回建线, 撤销一站), the size and paper of the
   header's other round buttons, centred on the date line */
.portrait-shell #game-exit{display:grid;place-items:center;width:38px;height:38px;min-width:38px;min-height:38px;padding:0!important;border-radius:11px;background:#fffef9;border:1px solid #e3e6dc;color:#36594c;align-self:center!important}
.portrait-shell #game-exit svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
/* bridge mode: the Android quote toggle has nothing to toggle — no empty grey box in the bar */
#drawbar #quote-expand:empty{display:none!important}
/* hub pages in the shell: tabs and × on one line (the shell's wrap + 62px reserve for its own close pushed our × onto a
   line of its own above the tabs) */
.portrait-shell #modal-content .modal-head.has-hub{flex-wrap:nowrap!important;padding-right:0!important}
.portrait-shell #modal-content .modal-head.has-hub > .close{order:9;margin-left:auto}
/* bridge bar (no quote to expand): 取消 and 确认桥梁 share one row, as in the route bar */
#drawbar .db-actions:has(#quote-expand:empty){display:flex!important;flex-direction:row!important;align-items:stretch;gap:8px!important;width:100%}
#drawbar .db-actions:has(#quote-expand:empty) #drawcancel{flex:0 0 auto;width:auto!important;min-width:76px!important;grid-column:auto!important;grid-row:auto!important}
#drawbar .db-actions:has(#quote-expand:empty) #drawdone{flex:1 1 auto;width:auto!important;grid-column:auto!important;grid-row:auto!important}
/* achievements in the shell: its sheet padding is 14px, so the sticky header bleeds by 14 (not 18) to the sheet edge */
.portrait-shell.achievements-open14 #modal-content > .modal-head,.portrait-shell .achievements-open14 #modal-content > .modal-head{margin-left:-14px;margin-right:-14px;padding-left:14px;padding-right:14px}
/* portrait sheet, peek state: the shell fixes every detail sheet at 48% of the screen, which left a selected line's
   lower stations and ＋ tabs (and the towns to extend to) under the sheet in a late network. Peek is the short state
   (title, numbers, stops, main action — ~36%); 展开全部 / swipe up still opens everything. */
@media (orientation:portrait){ .portrait-shell .detail-panel.is-peek{max-height:min(36dvh,300px)!important;overflow:hidden!important} }
/* line sheet: route tools (多站移除 / 整条重画) and stop picking */
.ux-route-tools{display:flex;align-items:center;gap:8px;margin:6px 0 10px}
.ux-route-tools button{height:34px;padding:0 14px;border-radius:17px;background:#f1f3ec;border:1px solid #e1e6da;color:#3c534c;font-size:12.5px;font-weight:600}
.ux-route-tools button:disabled{opacity:.45}
.ux-route-tools.is-picking span{flex:1 1 auto;min-width:0;font-size:12px;color:#5f6f68}
.ux-route-tools.is-picking button.primary{background:var(--ink);border-color:var(--ink);color:#fff}
.ux-route.is-picking button.ux-stop{cursor:pointer;font:inherit}
.ux-route.is-picking button.ux-stop.is-off{background:#fbe9e4!important;border-color:#e6b3a5!important;color:#b5573f!important;text-decoration:line-through}

/* ---------- portrait density (user 2026-11-16) ---------- */
/* header: one row — ☰ menu · date · funds ♥ · play/speed (help, sound, exit in the menu) */
#ux-menu,#ux-menu-pop{display:none}
@media (orientation:portrait){
  .portrait-shell header{grid-template-columns:auto auto minmax(0,1fr) auto auto!important;grid-template-rows:auto!important;align-items:center!important;row-gap:0!important;column-gap:8px!important;padding-bottom:6px!important}
  .portrait-shell #ux-menu{display:grid;place-items:center;grid-column:1;grid-row:1;width:36px;height:36px;min-width:36px;min-height:36px;padding:0;border-radius:11px;background:#fffef9;border:1px solid #e3e6dc;color:#36594c}
  .portrait-shell #ux-menu svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  .portrait-shell #game-exit,.portrait-shell header #help,.portrait-shell header .effects-button156{display:none!important}
  .portrait-shell header .calendar{grid-column:2!important;grid-row:1!important;padding-left:0!important;align-self:center}
  .portrait-shell header .stats{grid-column:4!important;grid-row:1!important}
  .portrait-shell header .controls{grid-column:5!important;grid-row:1!important;gap:0!important}
  .portrait-shell header .playback{min-height:36px!important;height:36px}
  .portrait-shell header .playback button{min-height:32px!important;height:32px}
  #ux-menu-pop:not([hidden]){display:grid;position:fixed;z-index:60;top:calc(var(--hud-bottom) + 2px);left:calc(10px + var(--safe-l));min-width:150px;padding:6px;border-radius:14px;background:#fffef9;border:1px solid #e3e6dc;box-shadow:0 8px 24px #263b4226}
  #ux-menu-pop button{height:40px;padding:0 12px;border-radius:9px;text-align:left;font-size:14px;color:#2f4640}
  #ux-menu-pop button:active{background:#eef1e8}
  #ux-menu-pop button[data-k="exit"]{color:#a8553f}
}
/* line sheet, compact: title + type/stops on one line; fleet as one row (no card); route tools inline after the stops */
#details .ux-fleet.ux-fleet-row{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px 10px;margin:2px 0 4px;padding:4px 0;background:none;border-radius:0;border:0!important}
#details .ux-fleet-row .ux-fleet-txt{flex:1 1 150px;min-width:0;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:12px;row-gap:5px;font-size:12.5px;color:#5f6f68}
#details .ux-fleet-row .ux-fleet-txt b{font-size:16px;font-weight:650;color:var(--ink);font-variant-numeric:tabular-nums}
#details .ux-fleet-row .ux-fleet-txt .ux-bar{display:block;flex:1 0 100%;height:3px;margin:0;border-radius:2px}
#details .ux-fleet-row .ux-fleet-txt .ux-bar i{background:var(--lc)}
#details .ux-fleet-row .ux-stepper{grid-column:auto!important;width:auto!important;margin-left:auto!important;align-self:center!important;gap:6px}
#details .ux-fleet-row .ux-stepper button{min-height:34px!important;height:34px}
#details .ux-fleet-row .ux-stepper button:first-child{width:34px}
#details .ux-fleet-row .ux-stepper button.primary{flex:0 0 auto!important;padding:0 12px!important}
#details .ux-route .ux-route-tools{display:inline-flex;gap:6px;margin:0 0 0 8px}
#details .ux-route .ux-route-tools button{height:28px;padding:0 10px;border-radius:14px;background:transparent;border:1px dashed #c9d2c6;color:#56685f;font-size:12px;font-weight:600}
#details .ux-route .ux-route-tools button:disabled{opacity:.4}
@media (orientation:portrait){
  .portrait-shell .detail-panel{padding:10px 12px!important}
  #details .ux-sheet-head{margin-bottom:4px!important;gap:8px!important;min-height:0}
  #details .ux-sheet-head .ux-title{display:flex;align-items:baseline;gap:8px;min-width:0;flex:1 1 auto}
  #details .ux-sheet-head .ux-title h3{margin:0;font-size:17px;line-height:1.3;white-space:nowrap}
  #details .ux-sheet-head .ux-title small{min-width:0;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #details .ux-sheet-head .ux-icon,#details .ux-sheet-head .close{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;flex:0 0 34px}
  #details .ux-sheet-head .ux-swatch{height:20px!important}
  #details .ux-route{margin:6px 0 2px!important;row-gap:6px!important}
  #details .ux-stop{min-height:28px!important;font-size:12.5px!important}
  #details .ux-stop button{width:20px;height:20px}
  .detail-panel.is-peek{padding-bottom:30px!important}
  .detail-panel.is-peek > .ux-peekbar{height:30px!important;font-size:12px!important}
}
/* city sheet, compact: name and kind on one line; waiting as a number row with a thin bar (no card) */
@media (orientation:portrait){
  #details > h3{display:inline;margin:0 8px 0 0;font-size:17px;line-height:1.5}
  #details > .detail-sub{display:inline;font-size:12px}
  #details .ux-load{gap:4px;margin:6px 0 2px;padding:0;background:none;border-radius:0}
  #details .ux-load-main b{font-size:18px}
  #details .ux-load-press .ux-bar{height:3px}
  #details .ux-load-press small{font-size:11.5px}
  #details .ux-fac-strip{margin:6px 0 0}
}
/* feedback capsule: message + construction undo in one ink capsule above the bottom sheet (ux.js uxFeedbackBox) */
#ux-feedback{position:absolute;z-index:9;left:50%;transform:translateX(-50%);bottom:calc(var(--dock-bottom,12px) + var(--dock-btn-h,56px) + 18px);display:none;align-items:center;max-width:calc(100vw - 24px);min-height:34px;border-radius:17px;background:#263b42f2;color:#fff;box-shadow:0 6px 20px #263b4230;font-size:12px;overflow:hidden;pointer-events:none}
#ux-feedback.show{display:flex}
#ux-feedback #toast{position:static!important;transform:none!important;opacity:1!important;inset:auto!important;width:auto!important;max-width:none!important;min-height:0!important;margin:0!important;padding:8px 14px!important;border-radius:0!important;background:none!important;box-shadow:none!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:auto;transition:none}
#ux-feedback #toast:not(.show){display:none!important}
#ux-feedback .undo-build{position:static!important;transform:none!important;display:inline-flex;align-items:center;gap:6px;height:34px;min-height:34px;margin:0!important;padding:0 14px 0 12px!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;color:#f6d69a!important;font-size:12px!important;font-weight:600;white-space:nowrap;pointer-events:auto;cursor:pointer}
#ux-feedback .undo-build[hidden]{display:none!important}
#ux-feedback .undo-build::before{content:'↶';display:inline;font-size:14px;line-height:1;background:none;width:auto;height:auto}
#ux-feedback.has-msg .undo-build{border-left:1px solid #ffffff2e!important;font-size:0!important;gap:0}
#ux-feedback.has-msg .undo-build::before{margin-right:5px}
#ux-feedback.has-msg .undo-build::after{content:attr(data-short);font-size:12px}
@media (orientation:portrait){
  /* the title's 36px right padding reserved room for the × on a line of its own; inline, it only pushed the kind away */
  #details > h3{padding-right:0!important}
  .portrait-shell #details.detail-panel > .close{min-width:34px!important;min-height:34px!important;width:34px;height:34px;padding:0}
}
/* route bar: what the quote contains when a crossing is resolved automatically (new bridge / existing bridge) */
.ux-bridge-note{color:#8a6d3b;font-weight:600}

/* ---------- network tray grouped by mode (ux.js uxTrayGroups) ---------- */
html body #routes:not(.ux-x) > #route-list,html body #routes:not(.ux-x) .ux-swatches{display:none!important}
.ux-tgroups{display:grid;gap:6px;margin:6px 0 2px;max-height:min(112px,18dvh);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
.ux-tgroups::-webkit-scrollbar{display:none}
#routes.collapsed .ux-tgroups{display:none}
.ux-tg{display:grid;grid-template-columns:58px minmax(0,1fr);align-items:start;gap:6px;padding:2px;border-radius:12px;transition:background-color .4s}
.ux-tg.is-focus{background:#f6efdc}
.ux-tg > .ux-tg-head{display:flex;align-items:center;gap:5px;height:30px;padding-left:2px;font-size:12.5px;color:#3f524b;white-space:nowrap}
.ux-tg > .ux-tg-head b{font-weight:650}
.ux-tg > .ux-tg-head small{font-size:11.5px;color:#7a877f;font-variant-numeric:tabular-nums}
.ux-tg-lines{display:flex;flex-wrap:wrap;gap:5px;min-width:0}
.ux-tline{display:inline-flex;align-items:center;gap:6px;height:30px;min-width:42px;padding:0 10px 0 8px;border-radius:15px;background:#f3f5ef;border:1.5px solid transparent;font-size:13px;font-weight:650;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.ux-tline i{flex:0 0 12px;height:4px;border-radius:2px;background:var(--c)}
.ux-tg[data-mode="emu"] .ux-tline i{height:6px;border-radius:1px;background:linear-gradient(var(--c) 0 2px,transparent 2px 4px,var(--c) 4px)}
.ux-tg[data-mode="rail"] .ux-tline i{height:7px;border-radius:1px;background:linear-gradient(var(--c) 0 2.5px,transparent 2.5px 4.5px,var(--c) 4.5px)}
.ux-tg[data-mode="air"] .ux-tline i{height:3px;border-radius:0;background:repeating-linear-gradient(90deg,var(--c) 0 3px,transparent 3px 5px)}
.ux-tline.on{background:#fff;border-color:var(--ink)}
.ux-tline.is-retiring{opacity:.5}
/* mode marks: the line style of the mode, in ink */
.ux-tmark{display:inline-block;flex:0 0 14px;width:14px;height:3px;border-radius:2px;background:#4f5f58}
.ux-tmark.emu{height:6px;border-radius:1px;background:linear-gradient(#4f5f58 0 2px,transparent 2px 4px,#4f5f58 4px)}
.ux-tmark.rail{height:7px;border-radius:1px;background:linear-gradient(#4f5f58 0 2.5px,transparent 2.5px 4.5px,#4f5f58 4.5px)}
.ux-tmark.air{height:2px;border-radius:0;background:repeating-linear-gradient(90deg,#4f5f58 0 3px,transparent 3px 5px)}
/* collapsed: one pill per mode (count + colour dots) */
.ux-tsum{display:none}
#routes.collapsed .ux-tsum{display:flex;flex:1 1 auto;min-width:0;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none}
#routes.collapsed .ux-tsum::-webkit-scrollbar{display:none}
.ux-tpill{display:inline-flex;flex:0 0 auto;align-items:center;gap:5px;height:34px;padding:0 11px 0 10px;border-radius:17px;background:#f3f5ef;border:1px solid #e3e7dc;font-size:12.5px;color:#2f4640;white-space:nowrap}
.ux-tpill b{font-weight:650}
.ux-tpill small{font-size:12px;font-weight:650;color:#6b7a73;font-variant-numeric:tabular-nums}
.ux-tdots{display:inline-flex;align-items:center;gap:2px;margin-left:1px}
.ux-tdots i{width:7px;height:7px;border-radius:50%;background:var(--c)}
.ux-tdots em{font-style:normal;font-size:10.5px;color:#7a877f;margin-left:2px}
/* collapsed tray: the mode pills take the row (the heading's button sizing does not apply to them; the title steps aside) */
html body #routes.collapsed .ux-tsum .ux-tpill{width:auto!important;min-width:0!important;max-width:none!important;flex:0 0 auto!important;height:34px!important;min-height:34px!important;padding:0 11px 0 10px!important;font-size:12.5px!important}
html body #routes.collapsed .panel-heading > span:not(.ux-swatches){display:none!important}
/* collapsed tray: compact controls so three or four mode pills fit on a 360px phone */
html body #routes.collapsed .panel-heading{gap:6px!important}
html body #routes.collapsed .panel-heading > #route-new130{width:42px!important;min-width:42px!important;max-width:42px!important;height:40px!important;min-height:40px!important;padding:0!important;border-radius:13px!important}
html body #routes.collapsed .panel-heading > #collapse{width:38px!important;min-width:38px!important;max-width:38px!important;height:40px!important;min-height:40px!important;padding:0!important;border-radius:13px!important}
html body #routes.collapsed .panel-heading > #overview{width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important}
html body #routes.collapsed .ux-tsum{gap:5px}
html body #routes.collapsed .ux-tsum .ux-tpill{gap:4px;padding:0 9px 0 8px!important}

/* ---------- line picker grouped by mode (ux.js uxJunctionGroups) ---------- */
#junction-picker .junction-heading small{font-size:11.5px}
#junction-picker .junction-lines{display:grid;gap:8px;margin-top:8px}
.ux-jg{display:grid;grid-template-columns:52px minmax(0,1fr);align-items:start;gap:6px}
.ux-jg-head{display:flex;align-items:center;gap:5px;height:38px;font-size:12.5px;color:#3f524b;white-space:nowrap}
.ux-jg-head b{font-weight:650}
.ux-jg-head small{font-size:11.5px;color:#7a877f}
.ux-jg-cells{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:6px;min-width:0}
html body #junction-picker .ux-jg .junction-line{display:flex;align-items:stretch;gap:0;min-height:38px;height:38px;margin:0;padding:0;border:1px solid #e3e7dc!important;border-radius:12px!important;background:#f6f7f0;overflow:hidden}
html body #junction-picker .ux-jg .junction-line.chosen{background:#fff;border-color:var(--ink)!important}
html body #junction-picker .ux-jg .junction-line > button:first-child{display:flex;align-items:center;gap:7px;flex:1 1 auto;min-width:0;padding:0 6px 0 9px;background:none}
html body #junction-picker .ux-jg .junction-line i{flex:0 0 12px;width:12px;height:4px;border-radius:2px;background:var(--c)!important}
.ux-jg[data-mode="emu"] .junction-line i{height:6px!important;border-radius:1px!important;background:linear-gradient(var(--c) 0 2px,transparent 2px 4px,var(--c) 4px)!important}
.ux-jg[data-mode="rail"] .junction-line i{height:7px!important;border-radius:1px!important;background:linear-gradient(var(--c) 0 2.5px,transparent 2.5px 4.5px,var(--c) 4.5px)!important}
.ux-jg[data-mode="air"] .junction-line i{height:3px!important;border-radius:0!important;background:repeating-linear-gradient(90deg,var(--c) 0 3px,transparent 3px 5px)!important}
html body #junction-picker .ux-jg .junction-line span{display:flex;align-items:baseline;gap:6px;min-width:0;font-size:12px}
html body #junction-picker .ux-jg .junction-line span b{font-size:14px;font-weight:650;color:var(--ink);font-variant-numeric:tabular-nums}
html body #junction-picker .ux-jg .junction-line span small{display:inline;margin:0;font-size:11px;color:#7a877f}
html body #junction-picker .ux-jg .junction-line .junction-drag{flex:0 0 36px;width:36px!important;min-width:36px!important;min-height:0!important;height:auto!important;margin:0!important;padding:0!important;border:0!important;border-left:1px solid #e3e7dc!important;border-radius:0!important;box-shadow:none!important;background:#fffef9!important;font-size:15px;font-weight:700;color:#36594c}
html body #junction-picker .junction-city-task{display:flex;align-items:center;gap:8px;min-height:40px!important;padding:0 12px!important}
html body #junction-picker .junction-city-task span{flex:1 1 auto}

/* ---------- city sheet: waiting destinations as a grid of tiles (count first) ---------- */
html body #details .ux-wait{display:grid;grid-template-columns:repeat(auto-fill,minmax(102px,1fr));gap:6px;padding:10px;border-radius:14px;background:#f6f7f2}
html body #details .ux-wait-head,html body #details .ux-wait-group{grid-column:1/-1}
html body #details .ux-wait-head{display:flex!important;align-items:baseline;justify-content:flex-start;gap:10px;margin:0 2px 2px;padding:0;border:0!important}
html body #details .ux-wait-head span{font-size:13px;font-weight:650;color:#3f524b}
html body #details .ux-wait-head small{font-size:11.5px;color:#7a877f}
html body #details .ux-wait-group{display:flex!important;justify-content:space-between;margin:6px 2px 0;padding:0;border:0!important;font-size:11.5px;color:#6b7a73;font-weight:600}
html body #details .ux-wait-group small{font-weight:500;color:#8a968a}
html body #details .ux-wait-row{display:grid!important;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;column-gap:6px;align-items:baseline;min-height:0!important;padding:7px 9px!important;border:0!important;border-radius:10px;background:#fffef9}
html body #details .ux-wait-row > b{grid-row:1;grid-column:1;text-align:left!important;font-size:18px!important;line-height:1.1;font-weight:650}
html body #details .ux-wait-row > small{grid-row:1;grid-column:2;justify-self:end;text-align:right;font-size:11px!important;color:#b5573f!important;font-weight:600}
html body #details .ux-wait-row > span{grid-row:2;grid-column:1/-1;min-width:0;font-size:11.5px!important;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #details .ux-wait-row > span i{font-style:normal;margin-right:3px}
html body #details .ux-wait-row.is-late{background:#fdf1ec}
/* activity deck: hub tabs in its header and its own × back (the shell hides every modal's ×) */
.portrait-shell .modal .deck-heading128 > .close,html body .deck-heading128 > .close{display:grid!important;place-items:center;flex:0 0 38px!important;width:38px!important;height:38px!important;font-size:22px!important}
.ux-deck-tabs{flex:1 1 auto;display:flex;gap:4px;padding:3px;border-radius:12px;background:#e6eae0}
.ux-deck-tabs button{flex:1;min-height:36px;padding:0 6px;border-radius:9px;font-size:12px;font-weight:600;color:#5f6f68;white-space:nowrap}
.ux-deck-tabs button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px #263b4218}
/* finance pages: cash · return · 收益记录 in one strip, the pause note as small print under it */
html body #modal-content .market-headline.ux-strip{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 14px;margin:2px 0 4px!important;padding:8px 8px 8px 14px!important;border-radius:12px;background:#f6f7f2;border:0}
html body #modal-content .market-headline.ux-strip > div{display:flex;align-items:baseline;gap:6px;padding:0!important;margin:0;background:none!important;border:0!important;min-width:0}
html body #modal-content .market-headline.ux-strip > div small{font-size:11.5px;color:#6b7a73;white-space:nowrap}
html body #modal-content .market-headline.ux-strip > div b{font-size:15px;font-weight:650;white-space:nowrap}
html body #modal-content .market-headline.ux-strip > div:nth-child(3){display:none!important}
html body #modal-content .market-headline.ux-strip > button{margin-left:auto;height:30px;padding:0 12px;border-radius:15px;background:#fff;border:1px solid #e1e6da;font-size:12px;font-weight:600;color:#3c534c}
html body #modal-content .market-pause-note.ux-strip-note{margin:0 2px 8px;font-size:11px;color:#8a968a}
/* 路网状态 (calm): the status under its title on one line, never broken mid-word */
html body #modal-content .quake-summary.is-idle b small{display:block;margin:2px 0 0;white-space:nowrap}
/* market pages restore their own scroll position after a trade; the browser's scroll anchoring must not move it again
   when the header strip is assembled */
#modal-content:has(.financial-market){overflow-anchor:none}
/* vehicle shop: locked types in their own short list (name · price, unlock condition) */
.ux-locked-title{margin:14px 2px 6px;font-size:12px;font-weight:600;color:#6f7d6c;letter-spacing:1px}
.ux-locked{display:grid;gap:0;padding:2px 12px;border-radius:14px;background:#f6f7f2}
.ux-locked .ux-product{gap:12px;padding:9px 0}
.ux-locked .ux-product .transport-icon{width:36px;height:26px;opacity:.55}
.ux-locked .ux-product b{display:flex;align-items:baseline;gap:8px;font-size:13px;color:#4c5d56}
.ux-locked .ux-product b em{font-style:normal;font-size:12px;font-weight:600;color:#8a968c;margin-left:auto}
.ux-locked .ux-product .ux-lock{margin-top:1px;font-size:11.5px;line-height:1.45}
.modal .ux-list .ux-product > button{min-width:74px!important;padding:0 12px}
/* hub sheets fit their content (user 2026-11-16: a short page such as 车辆 left a large blank under it); 86% of the
   screen stays the ceiling, long pages scroll inside. The tab bar may move when switching between short and long tabs. */
@media (orientation:portrait) and (max-width:820px){
  .modal:has(.ux-hub-tabs){height:auto!important}
}
@media not ((orientation:portrait) and (max-width:820px)){
  .modal:has(.ux-hub-tabs){height:auto!important;max-height:min(84dvh,820px)!important}
}
.ux-tempty{font-size:12.5px;color:#6b7a73;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:4px}
p.ux-tempty{margin:6px 2px;white-space:normal}

/* ---------- v1.6 pages in the hubs ---------- */
/* vehicle trading: quiet empty line; running vehicles folded */
.ux-sale-empty{margin:4px 2px 8px;font-size:12px;color:#7a877f}
html body #modal-content .fleet-sale16 > h3{font-size:13px;margin:16px 2px 4px}
html body #modal-content .fleet-sale16 > p:not(.ux-sale-empty){font-size:11.5px;color:#7a877f;margin:0 2px 6px}
/* research: two columns of compact cards; a state that cannot be acted on reads as a note, not a big grey button */
html body #modal-content .research-grid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important;gap:8px!important}
html body #modal-content .research-card{padding:10px 11px!important;border-radius:12px!important;gap:4px!important;min-height:0!important}
html body #modal-content .research-card .eyebrow{font-size:10.5px!important;letter-spacing:1px!important}
html body #modal-content .research-card h3{font-size:14px!important;margin:2px 0 0!important}
html body #modal-content .research-card p{font-size:11.5px!important;line-height:1.45!important;margin:0!important;color:#5f6f68}
html body #modal-content .research-card .research-cost{display:flex;justify-content:space-between;align-items:baseline;margin:4px 0 2px!important;font-size:12px}
html body #modal-content .research-card .research-cost b{font-size:13px}
html body #modal-content .research-card button{min-height:32px!important;height:auto;padding:6px 8px!important;border-radius:10px!important;font-size:12px!important}
html body #modal-content .research-card button:disabled{background:transparent!important;color:#7a877f!important;border:1px dashed #d3dace!important;box-shadow:none!important}
html body #modal-content .research-intro{font-size:11.5px;line-height:1.55;color:#6b7a73}
html body #modal-content .research-card p{flex:none!important}
@media (max-width:380px){ .modal .ux-list .ux-product{gap:10px} .modal .ux-list .ux-product .transport-icon{width:40px;height:30px} }
html body #modal-content .research-grid{align-items:start!important}
html body #modal-content .research-card button{margin-top:6px!important}
html body #modal-content .research-card .research-cost{padding:0!important;min-height:0!important;height:auto!important;border:0!important;background:none!important}
/* sea modes (v1.6): a dotted mark, like a shipping lane on a chart */
.ux-tmark.ship,.ux-tmark.ferry{height:3px;border-radius:0;background:radial-gradient(circle,#4f5f58 1.3px,transparent 1.5px) 0 50%/5px 3px repeat-x}
.ux-tmark.ferry{height:4px;background:radial-gradient(circle,#4f5f58 1.8px,transparent 2px) 0 50%/6px 4px repeat-x}
.ux-tg[data-mode="ship"] .ux-tline i,.ux-jg[data-mode="ship"] .junction-line i{height:4px!important;border-radius:0!important;background:radial-gradient(circle,var(--c) 1.5px,transparent 1.8px) 0 50%/5px 4px repeat-x!important}
.ux-tg[data-mode="ferry"] .ux-tline i,.ux-jg[data-mode="ferry"] .junction-line i{height:5px!important;border-radius:0!important;background:radial-gradient(circle,var(--c) 2px,transparent 2.3px) 0 50%/6px 5px repeat-x!important}
/* fleet row: the kind label stays in the markup (v1.6.5 harbour layer renames 车辆/辆 to 船舶/艘 through it) but the row
   reads "1 辆" on its own */
html body #details .ux-fleet-row .ux-fleet-kind{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
html body #details .ux-fleet-row .ux-fleet-n span{font-size:12.5px;font-weight:400;color:#5f6f68}
/* results: the last life lost, above the four figures */
.ux-lastlife{margin:6px 0 10px;padding:10px 12px;border-radius:12px;background:#fbefe9;color:#7d3f2c;font-size:13.5px;line-height:1.5}
.ux-lastlife b{display:inline-block;margin-right:8px;padding:1px 8px;border-radius:9px;background:#b5573f;color:#fff;font-size:11.5px;font-weight:650}
.ux-lastlife small{display:block;margin-top:2px;font-size:11.5px;color:#9a6a58}
/* harbour chip leads the facility strip on the ocean map */
html body #details .ux-fac-strip .ux-harbor{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;height:32px;padding:0 11px 0 8px;border-radius:16px;background:#e3eef2;border:1px solid #b9d3dc;color:#24546a;font-size:12px;font-weight:650;white-space:nowrap}
html body #details .ux-fac-strip .ux-harbor i{font-style:normal;font-size:13px}
html body #details .ux-fac-strip .ux-harbor small{font-size:11.5px;font-weight:500;color:#4f7586}
html body #details .ux-fac-strip .ux-harbor.is-note{background:#f3f6f6;border-color:#d7e2e5;color:#3f5f6b}
html body #details .ux-fac-strip .ux-harbor.is-off{opacity:.55}
/* The strip is normally replaced by the full facility list; the harbour action has no twin there. */
@media (orientation:portrait) and (max-width:820px){
  #details.is-full .ux-fac-strip:has(.ux-harbor){display:flex}
  #details.is-full .ux-fac-strip:has(.ux-harbor) > button:not(.ux-harbor){display:none}
}
html body #details > .ux-harbor-note{margin:10px 2px 4px;font-size:11.5px;line-height:1.5;color:#6b7a73}

.modal:has(.financial-market){width:min(1120px,calc(100vw - 40px));max-width:1120px;background:#f6f7f0;overflow-x:hidden}.financial-market{color:#304d43}.financial-market h2{margin:6px 0 16px}.financial-market button{border-radius:9px}.market-headline{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:18px;padding:19px 0 24px;border-bottom:1px solid #d8dfd3}.market-headline small,.market-metrics small{display:block;font-size:11px;color:#7a887a;margin-bottom:7px}.market-headline b{font-size:20px;font-weight:600}.market-tabs{display:flex;gap:6px;margin:23px 0}.market-tabs button,.market-range button{background:transparent;border:1px solid #cdd7c9;color:#6d7f6b;padding:10px 17px}.market-tabs button.active,.market-range button.active{background:#36594d;color:#fffdf2;border-color:#36594d}.market-build{padding:18px;background:#eaf0e3;border:1px solid #d5dfcc;border-radius:12px;margin-bottom:22px}.market-build h3{margin:0 0 7px}.market-build h3 small{font-size:12px;margin-left:10px;color:#657f60}.market-build p,.market-product p{font-size:13px;line-height:1.8}.market-build-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-top:1px solid #d6dfce}.market-build-row small{display:block;color:#7a8877;font-size:11px;line-height:1.7;margin-top:4px}.market-build-row button{flex-shrink:0;padding:9px 13px;border:1px solid #bdcbb6;background:#fafcf7}.market-product{padding:22px;background:#fffef8;border:1px solid #d7decf;border-radius:12px;margin-bottom:20px}.market-product h2{font-size:25px}.market-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:21px 0}.market-metrics strong{font-size:25px;font-weight:500}.market-metrics.compact b{font-size:12px;line-height:1.6}.market-order{display:flex;gap:10px;align-items:flex-end;margin:24px 0 13px}.market-order label{display:flex;flex-direction:column;gap:7px;font-size:12px;flex:1;min-width:80px}.market-order input{width:100%;box-sizing:border-box;min-width:0;background:#fff;border:1px solid #bccbb5;border-radius:9px;padding:11px;font:inherit;color:#304d43}.market-order button{padding:11px 17px;border:1px solid #c9d4c2;white-space:nowrap}.financial-market button:disabled{opacity:.45;cursor:not-allowed}.market-muted{font-size:12px;color:#7b8875;line-height:1.8}.market-stock-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:23px}.market-stock-list{display:grid;gap:5px;max-height:650px;overflow-y:auto}.market-stock{display:flex;justify-content:space-between;align-items:center;text-align:left;width:100%;padding:13px;border:1px solid transparent;background:#fffef8;color:#355347;gap:10px}.market-stock.selected{border-color:#799473;background:#e5eddd}.market-stock>span:last-child{text-align:right;white-space:nowrap}.market-stock b{font-size:13px}.market-stock small{display:block;font-size:10px;margin-top:5px;color:#7b8a79}.market-list-heading{display:flex;justify-content:space-between;font-size:10px;color:#81907b;margin:0 6px 10px}.market-stock-detail{padding:20px;border:1px solid #d5decd;background:#fffef8;border-radius:12px;min-width:0}.market-stock-detail h2{font-size:26px}.market-quote{display:flex;gap:14px;align-items:baseline}.market-quote strong{font-size:31px;font-weight:500}.market-quote span{font-size:16px}.market-range{display:flex;gap:6px;margin-top:21px}.market-range button{padding:6px 11px;font-size:11px}.market-chart{margin:14px 0 20px}.market-chart figcaption{display:flex;justify-content:space-between;font-size:11px;color:#6c8067;margin-bottom:8px}.market-chart svg{width:100%;display:block;height:auto;background:#f8faf3;border-radius:9px}.market-chart text{font-size:10px;fill:#7f8c7a}.market-chart-empty{padding:50px 16px;text-align:center;color:#8a9685;background:#edf2e7;border-radius:9px;font-size:13px}.financial-market .positive{color:#b25a44!important}.financial-market .negative{color:#34775b!important}.dock .dock-market{display:inline-flex}.activity-slot.has-special-flip.is-revealing .card-reveal-fx{opacity:1;animation:card-fx-fade 1.1s ease-out both}.activity-slot.has-special-flip .card-halo{border-color:#d5b46c;box-shadow:0 0 28px #e4c16b88}
@media(max-width:700px){.modal:has(.financial-market){width:100%;max-width:100%;padding:0 16px calc(24px + var(--safe-b))}.financial-market .modal-head{margin:0 -16px 4px;padding:25px 16px 10px}.market-headline{grid-template-columns:1fr 1fr;gap:17px}.market-headline>div:last-child{grid-column:1/-1}.market-headline b{font-size:19px}.market-tabs{gap:5px}.market-tabs button{padding:9px 13px;flex:1;font-size:12px}.market-stock-layout{grid-template-columns:1fr;gap:15px}.market-stock-list{display:flex;overflow-x:auto;overflow-y:hidden;max-height:none;scroll-snap-type:x proximity;padding-bottom:8px}.market-stock{flex:0 0 180px;scroll-snap-align:start;padding:12px}.market-list-heading{display:none}.market-stock-detail,.market-product{padding:17px}.market-build{padding:15px}.market-metrics{gap:15px}.market-metrics strong{font-size:21px}.market-order{gap:7px}.market-order button{padding:11px;font-size:12px}.dock{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:3px}.dock-btn{min-width:0;padding-left:5px!important;padding-right:5px!important}.market-build-row button{font-size:12px}}
@media(prefers-reduced-motion:reduce){.activity-slot.has-special-flip.is-revealing .card-reveal-fx{animation:none;opacity:0}}
.market-stock-layout>section{min-width:0;max-width:100%}.market-stock-list{min-width:0;max-width:100%}
@media(max-width:700px){.market-stock-layout{grid-template-columns:minmax(0,1fr)}}
@keyframes card-fx-fade{0%{opacity:0}20%{opacity:1}100%{opacity:0}}

.dock .dock-market[hidden]{display:none!important}

.dock-market.is-locked{opacity:.6}.market-tabs .is-locked{color:#879184;border-style:dashed}.finance-unlock-city{display:flex;align-items:center;gap:16px;padding:16px 0 22px}.finance-city-icons{display:flex;gap:5px;flex-shrink:0}.finance-city-icons svg{display:block}.finance-unlock-city p{font-size:12px;color:#788774;line-height:1.7;margin:7px 0 0}@media(max-width:500px){.finance-unlock-city{align-items:flex-start;gap:12px}.finance-city-icons{gap:2px}.finance-city-icons svg{width:26px;height:26px}}
/* Holdings and the daily market review */
.market-daily-banner{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:16px 18px;background:#e8f1eb;border:1px solid #b9cfc0;border-radius:12px;margin:0 0 18px;color:#355c4d}.market-daily-banner p{margin:5px 0 0;font-size:12px}.market-daily-banner button{flex-shrink:0}.market-pause-note{font-size:12px;color:#6f8279}.market-section-title,.holding-heading{display:flex;justify-content:space-between;gap:14px;align-items:center}.market-section-title>span{color:#809088;font-size:12px}.holding-card{border:1px solid #dce3d9;border-radius:12px;padding:18px;margin:14px 0;background:#fffefa}.holding-name{border:0;background:transparent;padding:0;text-align:left;display:grid;gap:5px}.holding-name b{font-size:16px}.holding-name small,.holding-values dt{font-size:11px;color:#7c8980}.holding-values{display:grid;grid-template-columns:1fr 1fr 1.5fr;gap:12px;margin:18px 0}.holding-values dd{margin:5px 0 0;font-size:13px;font-variant-numeric:tabular-nums}.holding-actions{display:flex;gap:8px;align-items:end}.holding-actions label{display:grid;gap:4px;font-size:11px;color:#77867c;flex:1}.holding-actions input{width:100%;box-sizing:border-box;min-width:65px}.holding-empty{padding:38px 20px;text-align:center;background:#f3f5ee;border-radius:12px}.market-tabs{flex-wrap:wrap}.quake-summary{padding:16px;border:1px solid #e6c2a7;background:#fff3e7;border-radius:12px;margin:14px 0}.quake-summary p{font-size:12px}.quake-summary button{margin:4px}.region-note{font-size:12px;color:#7e8b7a}@media(max-width:600px){.market-daily-banner{align-items:stretch;flex-direction:column;gap:10px;padding:13px}.holding-values{grid-template-columns:1fr 1fr}.holding-values>div:last-child{grid-column:1/-1}.holding-card{padding:14px}.holding-actions{flex-wrap:wrap}.holding-actions label{min-width:100%;}.market-tabs button{flex:1 1 35%}}
.research-summary{display:flex;align-items:center;justify-content:space-between;gap:20px}.research-summary p{margin-bottom:0}.research-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:22px 0}.research-card{display:flex;flex-direction:column;padding:22px;border:1px solid #d6dfd4;border-radius:14px;background:#fffefa}.research-card h3{margin:10px 0}.research-card p{font-size:13px;line-height:1.8;flex:1}.research-card.is-complete{background:#eaf1e8}.research-cost{display:flex;justify-content:space-between;align-items:center;padding:12px 0 20px;font-variant-numeric:tabular-nums}.research-cost span{font-size:12px;color:#7d8a7f}.research-card button{width:100%}.research-progress{display:grid;gap:12px;padding:20px;background:#eaf1e8;border:1px solid #c2d3c1;border-radius:12px}.research-progress progress{width:100%;height:9px;accent-color:#4b7560}.research-progress span,.research-progress p,.research-intro{font-size:13px;color:#66796b;line-height:1.8}.research-progress p{margin:0}@media(max-width:600px){.research-grid{grid-template-columns:1fr}.research-summary{align-items:stretch;flex-direction:column;gap:10px}.research-card{padding:18px}}

.farm-sheet{color:var(--ink);max-width:100%}.farm-sheet h2{margin:6px 0 12px}.farm-sheet>p{font-size:13px;line-height:1.8}.farm-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0}.farm-metrics>div{background:#f2f5ee;border:1px solid #e0e7db;border-radius:12px;padding:13px 12px}.farm-metrics small{display:block;font-size:11px;color:#718372;margin-bottom:7px}.farm-metrics b{font-size:16px}.farm-status{padding:18px;background:#f1f4e9;border:1px solid #dbe4cf;border-radius:14px;margin:20px 0}.farm-status p{font-size:13px;line-height:1.8;color:#66765f}.farm-status progress{width:100%;accent-color:#7d9c66;height:9px}.farm-table-wrap{overflow-x:auto}.farm-table{border-collapse:collapse;width:100%;font-size:13px;margin:14px 0}.farm-table th{text-align:left;font-size:11px;color:#718372;font-weight:500}.farm-table td,.farm-table th{padding:12px 8px;border-bottom:1px solid #e4e9dd;white-space:nowrap}.farm-table td:first-child{white-space:normal;min-width:112px}.farm-table small{display:block;color:#8b9585;font-size:10px;margin-top:5px}.farm-batch{padding:22px;background:#edf3e5;border-radius:14px;margin:18px 0}.farm-batch small{display:block;color:#6f8064}.farm-batch strong{display:block;font-size:32px;margin-top:10px}.farm-paused{border-left:3px solid #9db18b;padding-left:12px;color:#78856f}.farm-chart{margin:20px 0;background:#f8f9f3;border-radius:12px;padding:14px}.farm-chart figcaption{font-size:12px;color:#74816e;margin-bottom:8px}.farm-chart svg{display:block;width:100%;height:auto}.farm-empty{padding:25px;text-align:center;background:#f7f8f1;color:#8b9582;border-radius:12px;font-size:12px;margin:15px 0}.farm-city-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.farm-city{padding:16px!important;text-align:left;background:#f3f6ed!important;border:1px solid #e0e7d9!important;border-radius:12px!important;display:grid;gap:6px}.farm-city span{font-size:12px;color:#6f815e}.farm-city small{font-size:11px;color:#8b9585}.farm-continue{width:100%;margin-top:14px}.farm-sheet .positive{color:#4d8268}.farm-sheet .negative{color:#bd7159}@media(max-width:600px){.farm-metrics{gap:6px}.farm-metrics>div{padding:10px 7px}.farm-metrics b{font-size:13px}.farm-metrics small{font-size:10px}.farm-table td,.farm-table th{padding:10px 5px}.farm-city-list{grid-template-columns:1fr}.farm-batch strong{font-size:28px}}

.map-selection[hidden]{display:none!important}.map-selection{position:fixed;inset:0;z-index:1000;overflow:hidden;background:#f0f0e8;color:#2f3935;display:flex;flex-direction:column;font-family:system-ui,-apple-system,sans-serif;padding-top:env(safe-area-inset-top);isolation:isolate}.atlas-selecting>header,.atlas-selecting>footer,.atlas-selecting>.panel,.atlas-selecting>.map-caption,.atlas-selecting>.top-stack,.atlas-selecting>#toast{visibility:hidden}.atlas-top{display:flex;align-items:center;gap:14px;padding:20px 22px 8px;flex-shrink:0}.atlas-back{border:0;background:none;color:#35423a;font-size:38px;width:40px;height:42px;line-height:1}.atlas-top>span{font-weight:750;font-size:16px;letter-spacing:2px}.atlas-top i{display:block;font-size:8px;font-style:normal;letter-spacing:2px;color:#929c90;margin-top:2px}.atlas-top>small{margin-left:auto;font-size:11px;color:#7d887d;letter-spacing:2px}.atlas-heading{padding:22px 28px 14px;flex-shrink:0}.atlas-heading .eyebrow{font-size:10px;letter-spacing:3px;color:#8a987e}.atlas-heading h1{font-weight:650;font-size:27px;letter-spacing:1px;margin:10px 0 8px}.atlas-heading p{font-size:11px;color:#8a958a;margin:0}.atlas-track-line{position:absolute;left:0;right:0;top:36%;height:8px;background:#ddc257;z-index:-1}.atlas-rail{display:flex;gap:20px;align-items:center;position:relative;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;flex:1;min-height:0;padding:10px max(28px,calc((100vw - 288px)/2));touch-action:pan-x;scroll-padding:0}.atlas-rail::-webkit-scrollbar{display:none}.atlas-card{flex:0 0 288px;box-sizing:border-box;background:#e0e2d7;border:1px solid #d4d9ca;padding:19px 18px 15px;scroll-snap-align:center;position:relative;opacity:.54;transform:scale(.93);transition:opacity .25s,transform .25s;max-height:100%;overflow-y:auto;scrollbar-width:none}.atlas-card.is-selected{opacity:1;transform:scale(1)}.atlas-card:after{content:'';position:absolute;right:0;top:0;width:0;height:0;border-top:16px solid #7e8a75;border-left:16px solid transparent}.atlas-card-top{display:flex;justify-content:space-between;font-size:9px;letter-spacing:1px;color:#85907c}.atlas-card-top b{font-weight:500}.atlas-card h2{font-size:32px;line-height:1.1;margin:15px 0 9px;letter-spacing:3px}.atlas-palette{display:flex;gap:4px;margin-bottom:15px}.atlas-palette i{width:9px;height:9px;border-radius:50%;background:#d8b446}.atlas-palette i:nth-child(2){background:#c67f64}.atlas-palette i:nth-child(3){background:#5d95af}.atlas-palette i:nth-child(4){background:#79a083}.atlas-palette i:nth-child(5){background:#9b86a6}.atlas-terrain{background:#edf0df;overflow:hidden;border:1px solid #d4ddc5}.atlas-terrain svg{display:block;width:100%;height:auto}.atlas-card>p{font-size:12px;line-height:1.85;color:#6f7c6d;margin:14px 0 17px}.atlas-record{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #cbd2c3;padding-top:12px}.atlas-record>span:first-child{font-size:9px;color:#808b79}.atlas-record b{display:block;font-size:18px;font-weight:600;color:#495646;margin-top:3px}.atlas-medal{display:grid;place-items:center;font-size:25px;font-weight:700;width:38px;height:38px;border:3px solid #52604e;border-radius:50%;color:#52604e}.atlas-save{font-size:9px;color:#7f8b77;display:block;margin-top:12px}.atlas-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 24px max(28px,env(safe-area-inset-bottom));flex-shrink:0}.atlas-pagination{display:flex;align-items:center;gap:10px}.atlas-pagination>button{border:0;background:none;padding:8px 2px;color:#8c977f;font-size:20px}.atlas-pagination>.atlas-dot{padding:0;width:6px;height:6px;border-radius:50%;background:#cbd2c3}.atlas-pagination>.atlas-dot.active{background:#747f68}.atlas-start{background:#ddc257;border:0;padding:14px 17px;color:#fffef3;font-size:21px;font-weight:750;letter-spacing:1px;white-space:nowrap;box-shadow:none;min-height:52px;border-radius:0}.atlas-start span{display:inline-block;margin-left:12px;color:#4b5140}.atlas-start:hover{background:#cdb34d}.atlas-back:focus-visible,.atlas-card:focus-visible,.atlas-rail:focus-visible,.atlas-start:focus-visible{outline:2px solid #789a81;outline-offset:3px}#atlas-menu{font-size:11px}#orientation-hint{display:none!important}
@media(min-width:700px){.atlas-heading{padding-left:max(40px,calc((100vw - 780px)/2))}.atlas-top{padding:24px 38px 8px}.atlas-heading h1{font-size:32px}.atlas-card{flex-basis:310px}.atlas-rail{padding-left:calc((100vw - 310px)/2);padding-right:calc((100vw - 310px)/2)}.atlas-bottom{padding:22px 40px 28px}.atlas-track-line{top:38%}}
@media(max-height:700px){.atlas-top{padding-top:10px;padding-bottom:0}.atlas-heading{padding-top:8px;padding-bottom:4px}.atlas-heading h1{font-size:22px;margin:6px 0}.atlas-card{padding:13px 15px;flex-basis:260px}.atlas-rail{padding-left:calc((100vw - 260px)/2);padding-right:calc((100vw - 260px)/2)}.atlas-card h2{font-size:27px;margin-top:10px}.atlas-card>p{margin:8px 0;font-size:11px}.atlas-palette{margin-bottom:9px}.atlas-record{padding-top:8px}.atlas-bottom{padding-top:10px;padding-bottom:max(16px,env(safe-area-inset-bottom))}.atlas-save{margin-top:6px}.atlas-heading p{font-size:10px}}
@media(orientation:landscape) and (max-height:550px){.atlas-heading{position:absolute;left:5%;top:80px;width:25%;padding:0}.atlas-heading h1{font-size:26px;line-height:1.5}.atlas-rail{margin-left:29%;flex:1;padding-top:8px;padding-bottom:8px}.atlas-card{flex-basis:240px;max-height:100%;padding:10px 14px}.atlas-card h2{font-size:22px;margin:7px 0}.atlas-terrain{height:90px}.atlas-terrain svg{height:100%;width:100%}.atlas-card>p{font-size:10px;line-height:1.5;margin:6px 0}.atlas-palette{margin-bottom:7px}.atlas-record{padding-top:5px}.atlas-record b{font-size:14px}.atlas-save{font-size:8px}.atlas-top{padding-top:10px}.atlas-bottom{padding:8px 24px}.atlas-start{padding:9px 16px;font-size:18px;min-height:42px}}
@media(max-height:620px) and (orientation:portrait){.atlas-heading{padding-top:5px}.atlas-heading h1{font-size:20px}.atlas-card{padding:11px 14px}.atlas-card h2{font-size:24px;margin:8px 0}.atlas-terrain{height:102px}.atlas-terrain svg{height:100%;width:100%}.atlas-card>p{font-size:10px;line-height:1.6;margin:8px 0}.atlas-record{padding-top:6px}.atlas-record b{font-size:15px}.atlas-medal{width:29px;height:29px;font-size:20px}.atlas-save{font-size:8px}.atlas-bottom{padding-top:7px;padding-bottom:14px}.atlas-start{font-size:19px;min-height:45px;padding:11px 15px}}

@media(max-height:620px) and (orientation:portrait){.atlas-rail{gap:12px}}
/* Keep the date, growing cash balance and menu inside narrow phones. */
@media(orientation:portrait) and (max-width:480px){:root{--hud-h:106px}header{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:48px 46px;gap:0 8px;align-content:start;padding-top:calc(var(--safe-t) + 4px)}header .calendar{grid-column:1;grid-row:1}header .stats{grid-column:2;grid-row:1;margin-left:0;gap:14px}header .controls{grid-column:1/-1;grid-row:2;justify-content:flex-end;gap:8px}header #finance{max-width:200px}header #points{overflow:hidden;text-overflow:ellipsis}.undo-build{top:calc(var(--hud-h) + var(--safe-t) + 8px)}}

/* One portrait composition, sized by the usable viewport rather than a rotated landscape layout. */
:root{--web128-h:100dvh}
html,body{overscroll-behavior:none}button{touch-action:manipulation}
.atlas-selecting #ux-coach{display:none!important}
.modal:has(.deck128){width:min(520px,calc(100vw - 24px))!important;max-width:520px!important;height:calc(var(--web128-h) - max(24px,env(safe-area-inset-top)) - max(24px,env(safe-area-inset-bottom)))!important;max-height:880px!important;padding:0!important;overflow:hidden!important;background:#f5f6ef;border-radius:24px}
.modal>.deck128:first-child{margin:0!important}
.deck128{height:100%;min-height:0;display:flex;flex-direction:column;padding:18px 16px 12px;box-sizing:border-box;gap:10px}
.deck-heading128{position:static!important;inset:auto!important;width:auto!important;height:auto!important;min-height:0!important;display:flex!important;justify-content:space-between;align-items:center;padding:0!important;background:transparent!important;gap:12px;flex:none;box-shadow:none;backdrop-filter:none}
.deck-heading128 small{font-size:11px;color:#83907f;letter-spacing:2px}.deck-heading128 h2{font-size:23px!important;margin-top:5px!important;color:#263e42}.deck-heading128 .close{float:none;flex:none;margin:0;width:42px;height:42px;background:#e9ede3;border-radius:50%;font-size:26px}
.deck128 .deck-tip128{margin:0;font-size:12px;line-height:1.5;color:#778573;flex:none}
.deck-stage128{flex:1;min-height:0;overflow:hidden;padding:3px;isolation:isolate;touch-action:pan-y}
.deck-stage128 .activity-slot{height:100%;width:100%;margin:0;animation:none;min-height:0!important;box-sizing:border-box}
.deck-stage128 .activity-flipper{height:100%;min-height:0!important}
.deck-stage128 .activity-back,.deck-stage128 .activity-front{min-height:0!important;max-height:100%;height:100%;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;border-radius:19px;padding:18px!important;overscroll-behavior:contain;scrollbar-width:thin}
.deck-stage128 .activity-front{gap:0;border:1px solid #cbd4c3;box-shadow:0 8px 24px #334e3910}
.deck-stage128 .activity-front h3{font-size:22px;margin:9px 0 5px}.deck-stage128 .card-city{font-size:14px}.deck-stage128 .card-rarity{padding-bottom:9px}.deck-stage128 .card-stats{margin:12px 0;padding:12px 0}.deck-stage128 .card-stats b{font-size:24px}.deck-stage128 .card-sources{font-size:12px;margin:10px 0}.deck-stage128 .card-risk{margin:10px 0;font-size:12px}.deck-stage128 .card-accept{position:sticky;bottom:0;min-height:48px!important;flex:none;margin-top:12px!important;font-size:15px!important;box-shadow:0 -8px 12px #f5f6efcc}
.deck-stage128 .activity-front>button:not(.card-accept){flex:none;min-height:40px;padding:9px;margin:6px 0 0;border:1px solid #cbd4c3;border-radius:10px;background:#edf1e6;color:#36594d}
.deck-stage128 .card-back-title{font-size:23px}.deck-stage128 .card-sigil{flex:1;min-height:70px;display:grid;place-items:center}.deck-stage128 .card-sigil svg{max-height:150px;max-width:45vw}.deck-stage128 .card-back-top{font-size:9px;letter-spacing:2px}
.deck-pager128{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;flex:none;padding:4px 0;border-top:1px solid #dce2d4}
.deck-pager128 button{min-height:48px;padding:10px 12px;border-radius:13px;background:#36594d;color:white;font-size:14px;font-weight:650;border:0}.deck-pager128 button:disabled{background:#e6ebdf;color:#9ba793;opacity:1}.deck-pager128 strong{font-size:23px;color:#36594d;min-width:57px;text-align:center}.deck-pager128 strong span{font-size:14px;color:#89957f;font-weight:400}
.deck-tools128{display:flex;justify-content:space-between;gap:12px;flex:none}.deck-tools128 button{padding:7px 10px;border:0;background:transparent;color:#75836e;min-height:36px;font-size:12px}.deck128 .deck-debt128{margin:0;color:#ab6b4c;font-size:12px}
#draft-repair128{grid-column:1/-1;grid-row:auto;flex:1 0 100%;width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #d2ac72;background:#fff4df;border-radius:12px;clear:both}
#draft-repair128[hidden]{display:none!important}#draft-repair128>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:4px 0}#draft-repair128 span{min-width:0;flex:1}#draft-repair128 b{display:block;color:#865c35;font-size:12px}#draft-repair128 small{display:block;color:#947c59;font-size:11px;line-height:1.5;margin-top:4px}#drawbar #draft-repair128 button{background:#9b6742;color:white;border:0;border-radius:10px;padding:9px 12px;font-size:12px;min-height:44px;white-space:nowrap}#drawbar #draft-repair128 button:disabled{opacity:.5}
#drawbar:has(#draft-repair128:not([hidden])){flex-wrap:wrap;max-height:45dvh;overflow-y:auto}
@media(max-height:650px){.deck128{padding:12px;gap:6px}.deck-heading128 h2{font-size:19px!important}.deck128 .deck-tip128{font-size:11px}.deck-pager128 button{min-height:42px}.deck-stage128 .activity-back,.deck-stage128 .activity-front{padding:13px!important}.deck-stage128 .card-stats{margin:8px 0;padding:8px 0}.deck-tools128 button{min-height:30px;padding:3px 8px}}
@media(prefers-reduced-motion:reduce){.deck128 .activity-flipper{transition:none}}

/* Keep both location and acceptance outside the scrolling text, without overlapping either action. */
.deck-stage128 .activity-front{display:flex!important;flex-direction:column;padding:0!important;overflow:hidden!important}
.card-content128{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px 18px 6px;scrollbar-width:thin}
.card-actions128{flex:none;display:flex;flex-direction:column;gap:8px;padding:8px 18px 18px;background:inherit}
.deck-stage128 .card-actions128>button{position:static!important;flex:none;width:100%;box-sizing:border-box;margin:0!important;box-shadow:none}
.deck-stage128 .card-actions128>button:not(.card-accept){min-height:40px;border:1px solid #b8c8b3;border-radius:10px;background:#edf1e6;color:#36594d;font-size:13px}
.deck-stage128 .card-actions128 .card-accept{min-height:48px!important}
@media(max-height:650px){.card-content128{padding:13px 13px 4px}.card-actions128{padding:6px 13px 13px;gap:6px}}

#atlas-back,.atlas-medal{display:none!important}.atlas-heading{position:relative;padding-right:105px}.atlas-heading h1{font-size:clamp(20px,5vw,27px)}
#achievements-entry14{position:absolute;right:23px;top:27px;display:grid;justify-items:center;gap:3px;padding:8px 10px;min-width:63px;border:1px solid #d5dccb;border-radius:16px;background:#f7f7ed;color:#36594c;font-size:12px;line-height:1.4}#achievements-entry14 small{font-size:9px;color:#84927c}#achievements-entry14 svg{width:27px;height:27px}#achievements-entry14.has-new:after{content:'';position:absolute;right:8px;top:7px;width:7px;height:7px;background:#bd654d;border:2px solid #fff;border-radius:50%}
.achievements-open14 #modal{z-index:1300}.achievements-open14 #modal-content{max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 28px);overflow-y:auto}.ach-intro14{font-size:12px;color:#7b8777;line-height:1.7}.ach-list14{display:grid;gap:10px}.ach-row14{display:grid;grid-template-columns:52px minmax(0,1fr);gap:12px;align-items:center;padding:14px 12px;border:1px solid #dce1d3;border-radius:15px;background:#f5f6ed}.ach-row14.locked{opacity:.65}.ach-row14 h3{font-size:15px;margin:0 0 5px}.ach-row14 p{font-size:11px;line-height:1.6;margin:0;color:#778473}.ach-row14 small{display:block;font-size:10px;margin-top:5px;color:#7f8c78}.ach-badge14{width:46px;height:52px;color:#ad7955}.ach-badge14.silver{color:#89999b}.ach-badge14.gold{color:#c2a451}.ach-badge14.diamond{color:#69aeca;filter:drop-shadow(0 0 5px #bbdfeb)}.ach-progress14{height:4px;border-radius:6px;background:#dfe5d8;margin-top:7px;overflow:hidden}.ach-progress14 i{display:block;height:100%;background:#739581}.ach-row14.unlocked{background:#edf2e5}.ach-row14.diamond-row{border-color:#a9ceda;background:#edf6f7}.ach-total14{font-size:25px;font-weight:700;color:#36594c}.ach-category14{font-size:12px;color:#85917d;letter-spacing:2px;margin:20px 0 10px}
@media(max-width:350px){.atlas-heading{padding-right:90px}#achievements-entry14{right:15px;min-width:55px;padding:7px}.ach-row14{padding:11px 9px;gap:9px}}

#ach-close14{position:sticky;top:0;float:right;z-index:5;display:grid;place-items:center;width:40px;min-width:40px;height:40px;padding:0;border-radius:50%;background:#edf1e7;color:#36594c;border:1px solid #d3dccb;font-size:25px}.achievements-open14 #ux-close{display:none!important}

/* APK-only portrait shell. Layout follows the usable WebView, not a fixed phone size. */
/* Build actions keep a dedicated row and explicit contrast, including disabled quotes. */
.portrait-shell #drawbar .db-actions{display:grid;grid-template-columns:44px minmax(64px,1fr);width:100%;min-width:0}
.portrait-shell #drawbar #drawdone{grid-column:1/-1;width:100%;min-width:0;min-height:46px;white-space:normal;overflow-wrap:anywhere;background:#263b42!important;color:#fff!important;opacity:1;font-weight:700}
.portrait-shell #drawbar #drawdone:disabled{background:#63726b!important;color:#fff!important;opacity:1;cursor:default}
.portrait-shell .atlas-bottom{flex-wrap:wrap}
.portrait-shell .atlas-pagination{flex:0 0 100%;justify-content:center}
.portrait-shell .atlas-start{flex:1 1 130px;min-width:0;white-space:normal}
.portrait-shell #atlas-restart{flex:1 1 100px;min-height:46px;padding:10px;background:#e4e9de;color:#263b42;font-weight:600;border:1px solid #c9d1c2;border-radius:0}
.portrait-shell{--app-w:100vw;--app-h:100dvh;--safe-t:max(env(safe-area-inset-top,0px),var(--safe-area-inset-top,0px));--safe-b:max(env(safe-area-inset-bottom,0px),var(--safe-area-inset-bottom,0px));--safe-l:max(env(safe-area-inset-left,0px),var(--safe-area-inset-left,0px));--safe-r:max(env(safe-area-inset-right,0px),var(--safe-area-inset-right,0px));--hud-bottom:110px;--dock-height:56px;--gutter:10px;--ctl:42px;--dock-btn-h:54px;--dock-bottom:calc(8px + var(--safe-b));background:#e6edda}
.portrait-shell,.portrait-shell body{width:var(--app-w);height:var(--app-h);margin:0;overflow:hidden;overscroll-behavior:none}
.portrait-shell body{position:fixed;inset:0 auto auto 0;background:#e6edda;text-size-adjust:100%;-webkit-text-size-adjust:100%}
.portrait-shell #map{position:absolute;inset:0;width:var(--app-w);height:var(--app-h)}
.portrait-shell header{position:absolute;inset:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.7fr);grid-template-rows:auto auto;gap:5px 8px;height:auto;min-height:0;padding:calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) 7px calc(10px + var(--safe-l));background:linear-gradient(#fffef9ed 85%,#fffef938);align-items:center;align-content:start}
.portrait-shell .brand,.portrait-shell .stat-delivered,.portrait-shell .stat-lives>small,.portrait-shell #year,.portrait-shell #date span,.portrait-shell #tasks,.portrait-shell #fullscreen,.portrait-shell .map-caption,.portrait-shell .legend{display:none!important}
.portrait-shell .calendar{grid-column:1;grid-row:1;min-width:0;border:0;padding:0}.portrait-shell #date{font-size:17px;white-space:normal}.portrait-shell #calendar-tag{font-size:10px;letter-spacing:0;white-space:normal}
.portrait-shell header .stats{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:flex-end;min-width:0;gap:8px;margin:0}.portrait-shell #finance{min-width:0;max-width:100%;overflow:hidden}.portrait-shell #points{font-size:19px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.portrait-shell .stat-lives{flex:none}.portrait-shell .stat-lives b{margin:0;font-size:15px;line-height:1}.portrait-shell #maintenance-estimate{font-size:9px;white-space:normal}
.portrait-shell header .controls{grid-column:1/-1;grid-row:2;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:6px;min-width:0}.portrait-shell .ctl,.portrait-shell .playback{height:auto;min-height:42px}.portrait-shell .ctl{min-width:42px;padding:6px 10px}.portrait-shell .playback{display:flex;align-items:stretch;padding:2px}.portrait-shell .playback button{height:auto;min-height:36px;min-width:40px}.portrait-shell #atlas-menu{font-size:12px}
.portrait-shell footer{position:absolute;left:calc(8px + var(--safe-l));right:calc(8px + var(--safe-r));bottom:calc(8px + var(--safe-b));display:block;min-width:0}.portrait-shell .dock{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px;width:100%;margin:0}.portrait-shell .dock-btn{display:flex;min-width:0;min-height:54px;height:auto;flex-direction:column;padding:7px 2px!important;gap:3px;border-radius:12px;background:#fffdf5e8;font-size:12px;line-height:1.2}.portrait-shell .dock-btn.is-primary{background:#263b42;color:white}.portrait-shell .dock-btn svg{width:19px;height:19px;flex:none}.portrait-shell .dock-more,.portrait-shell #next-supply{display:none!important}.portrait-shell .dock-tasks{display:flex!important}
.portrait-shell .route-panel,.portrait-shell .detail-panel{position:absolute;left:calc(8px + var(--safe-l));right:calc(8px + var(--safe-r));width:auto;top:auto;bottom:calc(var(--dock-height) + 16px + var(--safe-b));min-width:0;overflow:auto;max-height:min(calc(var(--app-h)*.4),calc(var(--app-h) - var(--hud-bottom) - var(--dock-height) - var(--safe-b) - 64px));background:#fffef8f2;overscroll-behavior:contain}
.portrait-shell .route-panel{padding:9px 12px;display:block}.portrait-shell .route-panel .panel-heading{position:sticky;top:-9px;z-index:1;padding:6px 0;background:#fffef8f5;gap:5px}.portrait-shell .panel-heading>span{min-width:0;overflow-wrap:anywhere}.portrait-shell .route-panel #route-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.portrait-shell .route-panel .add-route{width:100%;min-height:42px;margin-top:8px}.portrait-shell .route-foot{display:flex;margin-top:6px}.portrait-shell .route-foot #stock{display:none}.portrait-shell .route-foot button{margin-left:auto;width:40px;height:40px}.portrait-shell .route-panel.collapsed #route-list,.portrait-shell .route-panel.collapsed .add-route,.portrait-shell .route-panel.collapsed .route-foot{display:none!important}.portrait-shell .route-panel.collapsed .panel-heading{padding:0;position:static}.portrait-shell .route-panel.collapsed{max-height:64px}.portrait-shell .route-row .name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.portrait-shell .detail-panel{max-height:min(calc(var(--app-h)*.48),calc(var(--app-h) - var(--hud-bottom) - var(--dock-height) - var(--safe-b) - 48px));padding:12px 14px;border-radius:16px}.portrait-shell .detail-panel>.close{position:sticky;top:0;z-index:3;float:right;background:#f1f4ef;min-width:40px;min-height:40px}.portrait-shell .detail-panel::before{display:none}.portrait-shell .detail-panel h3{overflow-wrap:anywhere;margin-right:40px}.portrait-shell .detail-actions{display:flex;flex-wrap:wrap;gap:6px}.portrait-shell .detail-actions button{min-height:40px;flex:1 1 100px;white-space:normal}
.portrait-shell .overlay{position:absolute;inset:0;width:var(--app-w);height:var(--app-h);display:flex;align-items:flex-end;justify-content:center;padding:calc(var(--safe-t) + 38px) calc(6px + var(--safe-r)) calc(6px + var(--safe-b)) calc(6px + var(--safe-l));overflow:hidden}
.portrait-shell .modal,.portrait-shell .modal:has(.financial-market){width:100%;max-width:100%;max-height:100%;min-width:0;overflow:auto;overflow-x:hidden;border-radius:18px 18px 10px 10px;padding:0 14px 16px;overscroll-behavior:contain}.portrait-shell .modal-head{position:sticky;top:0;z-index:5;margin:0 -14px 8px;padding:16px 14px 10px;min-width:0}.portrait-shell .modal-head>div{min-width:0}.portrait-shell .modal h1,.portrait-shell .modal h2{font-size:22px;overflow-wrap:anywhere}.portrait-shell .modal .primary{white-space:normal;overflow-wrap:anywhere}.portrait-shell .ux-actions,.portrait-shell .construction-actions,.portrait-shell .holding-actions,.portrait-shell .market-order{flex-wrap:wrap;gap:7px}.portrait-shell .market-order label{flex:1 1 100%;min-width:0}.portrait-shell .market-order button{flex:1 1 100px}.portrait-shell .modal input{max-width:100%;min-width:0}.portrait-shell .market-tabs{flex-wrap:wrap}.portrait-shell .market-tabs button{flex:1 1 100px;min-width:0}.portrait-shell .market-stock-layout{grid-template-columns:minmax(0,1fr)}.portrait-shell .research-grid,.portrait-shell .fleet-grid,.portrait-shell .ops-grid,.portrait-shell .farm-city-list{grid-template-columns:minmax(0,1fr)}.portrait-shell .market-metrics,.portrait-shell .farm-metrics,.portrait-shell .holding-values{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}.portrait-shell .farm-metrics>div:last-child{grid-column:1/-1}.portrait-shell .market-stock-list{display:flex;overflow-x:auto;max-width:100%;max-height:none}.portrait-shell .market-stock{flex:0 0 160px}.portrait-shell .market-build-row{flex-wrap:wrap}.portrait-shell .market-build-row button{min-height:40px}.portrait-shell .market-range{flex-wrap:wrap}.portrait-shell .market-product,.portrait-shell .research-card,.portrait-shell .holding-card{padding:14px}.portrait-shell .modal svg{max-width:100%}
.portrait-shell .portrait-modal-close{position:absolute;right:calc(10px + var(--safe-r));top:calc(5px + var(--safe-t));z-index:25;width:34px;height:34px;background:#fffef8;border:1px solid #d6dfd0;border-radius:50%;font-size:22px;box-shadow:0 2px 8px #263b4222}
.portrait-shell #drawbar,.portrait-shell #drawbar.db-line{position:absolute;left:calc(8px + var(--safe-l));right:calc(8px + var(--safe-r));bottom:calc(8px + var(--safe-b));width:auto;max-width:none;transform:none;display:flex;flex-wrap:wrap;gap:8px;padding:10px}.portrait-shell .db-info{flex:1 1 100%;min-width:0}.portrait-shell .db-actions{display:flex;flex:1 1 100%;justify-content:flex-end;flex-wrap:wrap;gap:6px}.portrait-shell .db-actions button{min-height:40px;padding:0 12px}.portrait-shell .db-cost{flex-wrap:wrap}
.portrait-shell .top-stack,.portrait-shell #toast{top:calc(var(--hud-bottom) + 6px);max-width:calc(var(--app-w) - var(--safe-l) - var(--safe-r) - 20px)}.portrait-shell .undo-build{top:calc(var(--hud-bottom) + 6px);max-width:calc(var(--app-w) - 24px);right:12px}.portrait-shell #toast{white-space:normal;overflow-wrap:anywhere}
.portrait-shell .map-selection{position:absolute;inset:0;width:var(--app-w);height:var(--app-h);padding-top:var(--safe-t);padding-left:var(--safe-l);padding-right:var(--safe-r)}.portrait-shell .atlas-top{padding:10px 16px 4px}.portrait-shell .atlas-heading{padding:10px 20px 6px}.portrait-shell .atlas-heading h1{font-size:clamp(20px,6vw,27px)}.portrait-shell .atlas-rail{gap:14px;padding:8px max(20px,calc((var(--app-w) - min(280px,calc(var(--app-w) - 58px)))/2));min-height:0;touch-action:pan-x pan-y}.portrait-shell .atlas-card{flex:0 0 min(280px,calc(var(--app-w) - 58px));max-height:100%;padding:13px 15px;overscroll-behavior:contain}.portrait-shell .atlas-terrain{height:clamp(82px,calc(var(--app-h)*.18),185px)}.portrait-shell .atlas-terrain svg{width:100%;height:100%}.portrait-shell .atlas-bottom{padding:12px 16px calc(12px + var(--safe-b));gap:6px}.portrait-shell .atlas-start{font-size:20px;padding:12px;min-height:46px}.portrait-shell .atlas-pagination{gap:7px}.portrait-shell .atlas-card>p{font-size:11px;line-height:1.6;margin:8px 0}
@media(max-height:580px){.portrait-shell header{gap:2px 6px;padding-top:calc(3px + var(--safe-t));padding-bottom:4px}.portrait-shell .ctl{min-height:36px;min-width:38px}.portrait-shell .playback button{min-height:30px}.portrait-shell .dock-btn{min-height:46px;padding-top:5px!important;padding-bottom:5px!important}.portrait-shell .atlas-heading{padding-top:4px}.portrait-shell .atlas-heading h1{font-size:20px;margin:5px 0}.portrait-shell .atlas-heading p{display:none}.portrait-shell .atlas-card h2{font-size:25px;margin:8px 0}.portrait-shell .atlas-save{font-size:8px}.portrait-shell .atlas-record b{font-size:14px}.portrait-shell .atlas-bottom{padding-top:7px;padding-bottom:calc(8px + var(--safe-b))}.portrait-shell .atlas-medal{width:28px;height:28px;font-size:19px}}

/* One close action per dialog, always within the safe viewport. */
.portrait-shell .modal .close,.portrait-shell .modal-head>button,.portrait-shell .modal-head>.close{display:none!important}
.portrait-shell .overlay{padding-top:calc(var(--safe-t) + 8px)}
.portrait-shell .portrait-modal-close{top:auto;bottom:calc(var(--app-h) - var(--panel-top,60px) - 42px);right:calc(16px + var(--safe-r));width:38px;height:38px}
.portrait-shell .modal-head{padding-right:62px;min-height:62px}
.portrait-shell .modal:has(.activity-grid){padding:0 12px 12px;display:flex;flex-direction:column;height:min(760px,100%);overflow:hidden}
.portrait-shell .modal:has(.activity-grid) .modal-head{flex:none;margin:0 -12px 0;padding:12px 58px 9px 12px;min-height:50px}
.portrait-shell .activity-deck-intro{flex:none;margin:4px 0 6px;text-align:left}
.portrait-shell .activity-deck-intro>.eyebrow,.portrait-shell .activity-deck-intro h3{display:none}
.portrait-shell .activity-deck-intro p{font-size:11px;line-height:1.5;margin:3px 0}
.portrait-shell .card-swipe-hint{display:inline;margin-left:5px}
.portrait-shell .activity-grid{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:94%;flex:1;min-height:0;gap:10px;padding:4px 2px 8px;margin:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;touch-action:pan-x}
.portrait-shell .activity-slot{height:100%;min-height:0;scroll-snap-align:center;overflow:hidden}
.portrait-shell .activity-flipper{height:100%;min-height:0}
.portrait-shell .activity-back,.portrait-shell .activity-front{height:100%;min-height:0!important;max-height:100%;border-radius:14px}
.portrait-shell .activity-back{padding:14px 10px;justify-content:space-evenly}
.portrait-shell .card-sigil{width:80px;height:80px;margin:8px}
.portrait-shell .card-back-top{font-size:8px;letter-spacing:1px}.portrait-shell .card-back-title{font-size:21px}.portrait-shell .card-back-sub{font-size:10px}
.portrait-shell .activity-card.activity-front{padding:12px;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:6px}
.portrait-shell .activity-front h3{font-size:19px;margin:3px 0}.portrait-shell .activity-front p{font-size:11px;margin:3px 0;line-height:1.55}
.portrait-shell .card-stats{padding:7px 0;gap:5px}.portrait-shell .card-stats b{font-size:17px}.portrait-shell .card-reward{padding:8px}
.portrait-shell .card-accept{position:sticky;bottom:0;min-height:44px;flex:none;margin-top:auto!important;padding:9px!important;box-shadow:0 -6px 10px #fffef8}
.portrait-shell .activity-deck-actions{flex:none;padding:6px 0 0;margin:0;gap:6px}.portrait-shell .activity-deck-actions button{min-height:36px;padding:5px 9px;font-size:11px}
.portrait-shell #drawbar.quote-compact .db-info,.portrait-shell #drawbar.quote-compact #db-types,.portrait-shell #drawbar.quote-compact #drawundo{display:none!important}
.portrait-shell #drawbar.quote-compact .db-actions{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:6px}
.portrait-shell #drawbar.quote-compact #drawdone{flex:1;min-height:42px;width:auto;min-width:100px;font-size:12px}
.portrait-shell #drawbar.quote-compact #drawcancel{min-width:52px;padding:5px}
.portrait-shell #quote-expand{min-height:40px;max-width:100%;font-size:11px;padding:5px 8px}
.portrait-shell #game-exit{grid-column:1;grid-row:1;justify-self:start;align-self:start;min-width:38px;min-height:38px;padding:6px;font-size:23px;background:#fffdf5d9;border:1px solid #d6dfd0}
.portrait-shell header .calendar{padding-left:45px}
.portrait-shell #atlas-menu{display:none!important}
.portrait-shell #tutorial-guide{position:absolute;z-index:10;left:10px;right:10px;top:calc(var(--hud-bottom) + 8px);padding:10px 12px;background:#fffef8f5;border:1px solid #b9c8b4;border-radius:14px;box-shadow:0 4px 18px #263b421c;max-height:min(26%,160px);overflow:auto;font-size:12px;line-height:1.6}
.portrait-shell #tutorial-guide p{margin:3px 0}.portrait-shell #tutorial-guide button{padding:5px 9px;min-height:34px;background:#e5ecdd;margin:3px 4px 0 0}
.portrait-shell #tutorial-guide b{color:#294b43}.portrait-shell .tutorial-fog{position:absolute;inset:0;z-index:2;pointer-events:none;background:radial-gradient(ellipse at center,#dfe7e95e,#edf2f31a);animation:tutorial-fog 3s ease-in-out infinite alternate}
@keyframes tutorial-fog{to{opacity:.4}}
.portrait-shell .card-pagination123{display:flex;justify-content:center;align-items:center;gap:20px;font-size:11px;flex:none;min-height:30px}.portrait-shell .card-pagination123 button{min-width:36px;min-height:30px;background:#e5ecdd}
.portrait-shell .modal:not(:has(.modal-head)){padding-top:46px}
@media(max-height:620px){.portrait-shell .activity-deck-intro p{font-size:10px}.portrait-shell .card-sigil{width:52px;height:52px}.portrait-shell .activity-front h3{font-size:16px}.portrait-shell .activity-front p{font-size:10px}.portrait-shell .card-feature{display:none}.portrait-shell #tutorial-guide{max-height:100px;font-size:11px}}

.portrait-shell #tutorial-button-ring124{position:absolute;z-index:100;pointer-events:none;border:3px solid #c2943a;border-radius:14px;box-shadow:0 0 0 4px #e8d39966;animation:cue124 1.1s ease-in-out infinite alternate}
@keyframes cue124{to{border-color:#f0bc51;box-shadow:0 0 0 7px #e8d39922}}
@media(prefers-reduced-motion:reduce){.portrait-shell #tutorial-button-ring124{animation:none}}

/* Explicit columns override the earlier inherited full-row undo/auto-placement rules. */
.portrait-shell #drawbar .db-actions,.portrait-shell #drawbar.quote-compact .db-actions{display:grid;grid-template-columns:minmax(0,1fr) 44px 58px;grid-template-rows:auto auto;gap:6px;min-width:0;width:100%;align-items:stretch}
.portrait-shell #drawbar #quote-expand{grid-column:1;grid-row:1;width:100%;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left;padding:7px 9px;font-size:12px;line-height:1.4;min-height:42px}
.portrait-shell #drawbar #drawundo{grid-column:2;grid-row:1;width:44px;min-width:44px;max-width:44px;min-height:42px;padding:0}
.portrait-shell #drawbar #drawcancel{grid-column:3;grid-row:1;width:58px;min-width:0;min-height:42px;padding:5px;font-size:12px}
.portrait-shell #drawbar #drawdone,.portrait-shell #drawbar.quote-compact #drawdone{grid-column:1/-1;grid-row:2;min-width:0;width:100%;min-height:46px;margin:0;padding:9px;font-size:14px;line-height:1.4}
.portrait-shell #drawbar.quote-compact .db-actions{grid-template-columns:minmax(0,1fr) 58px minmax(108px,1.1fr);grid-template-rows:auto}
.portrait-shell #drawbar.quote-compact #quote-expand{grid-column:1;grid-row:1}
.portrait-shell #drawbar.quote-compact #drawcancel{grid-column:2;grid-row:1}
.portrait-shell #drawbar.quote-compact #drawdone{grid-column:3;grid-row:1;min-height:44px}
.portrait-shell body:has(#tutorial-guide:not([hidden])) .notice-wrap{display:none!important}
.portrait-shell #tutorial-guide{background:#fffef8}
@media(max-width:330px){.portrait-shell #drawbar.quote-compact .db-actions{grid-template-columns:minmax(0,1fr) 50px}.portrait-shell #drawbar.quote-compact #drawcancel{grid-column:2;width:50px}.portrait-shell #drawbar.quote-compact #drawdone{grid-column:1/-1;grid-row:2}.portrait-shell #drawbar #quote-expand{font-size:11px}}

.portrait-shell .modal:has(.deck128){height:calc(var(--app-h) - var(--safe-t) - var(--safe-b) - 54px)!important;max-height:880px!important}
.portrait-shell .overlay:has(.deck128)>.portrait-modal-close{display:none!important}
.portrait-shell .deck-stage128 .activity-card.activity-front{padding:0!important;gap:0;overflow:hidden!important}
.portrait-shell .deck-stage128 .card-sigil{width:auto;height:auto;flex:1;margin:8px}
.portrait-shell .deck-stage128 .card-actions128 .card-accept{margin:0!important}

/* PR navigation and sheets follow the native usable portrait viewport. */
.portrait-shell footer .dock{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px}
.portrait-shell .dock-legacy,.portrait-shell #atlas-menu,.portrait-shell #orientation-hint{display:none!important}
.portrait-shell .portrait-modal-close{display:none!important}
.portrait-shell .overlay:not(:has(.modal-head .close,.deck-heading128 .close))>.portrait-modal-close{display:block!important}
.portrait-shell .modal-head.has-hub{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.portrait-shell .has-hub h2{flex:1;min-width:0;margin:0}
.portrait-shell .ux-hub-tabs{order:3;display:flex;width:100%;gap:5px;overflow-x:auto;flex:1 0 100%;padding:4px 0}
.portrait-shell .ux-hub-tabs button{flex:1 0 auto;min-height:42px;padding:8px 12px;font-size:13px;white-space:nowrap}
.portrait-shell .has-hub>.close{margin:0;flex:none}
.portrait-shell #junction-picker{position:absolute!important;left:calc(8px + var(--safe-l))!important;right:calc(8px + var(--safe-r))!important;top:auto!important;bottom:calc(var(--dock-height) + var(--safe-b) + 18px)!important;width:auto!important;max-height:45dvh!important;overflow:auto;border-radius:18px}
.portrait-shell .junction-line button{min-height:46px}
.portrait-shell #tutorial-guide{position:absolute;z-index:95;left:calc(10px + var(--safe-l));right:calc(10px + var(--safe-r));width:auto;max-width:none;max-height:28dvh;overflow:auto;padding:12px 14px;background:#fffef8f5;border:1px solid #bccbb4;border-radius:16px;box-shadow:0 5px 20px #263b4215;font-size:14px;line-height:1.5}
.portrait-shell #tutorial-guide b{font-size:16px}.portrait-shell #tutorial-guide p{margin:5px 0 9px;font-size:14px}
.portrait-shell #tutorial-guide>div{display:flex;flex-wrap:wrap;gap:8px}.portrait-shell #tutorial-guide button{min-height:40px;padding:8px 12px;border-radius:10px;background:#36594d;color:white;font-size:13px}.portrait-shell #tutorial-guide .guide-skip129{background:#e9eee3;color:#60705c}
#ux-coach{display:none!important}
@media(max-height:650px){.portrait-shell #tutorial-guide{padding:8px 12px;max-height:26dvh}.portrait-shell #tutorial-guide p{font-size:12px}.portrait-shell .dock-btn{min-height:46px}}

#routes.route-panel {
  display: block !important;
  padding: 10px 12px !important;
  overflow: auto !important;
  max-height: 32dvh !important;
}
#routes .panel-heading {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
#routes .panel-heading > span {
  flex: 1;
  min-width: 0;
}
#routes .panel-heading small {
  font-size: 11px;
}
#route-new130 {
  background: #36594d;
  color: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 42px;
  font-size: 12px;
  white-space: nowrap;
}
#routes #newroute {
  display: none !important;
}
#routes.collapsed #route-list,
#routes.collapsed .route-foot {
  display: none !important;
}
#routes:not(.collapsed) #route-list {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
}
#routes .route-row {
  width: 100%;
  min-height: 44px;
}
#loop-action130 {
  padding: 8px 12px;
  min-height: 42px;
  border: 1px solid #bbc7b6;
  border-radius: 10px;
  margin: 4px;
}
.dock-btn {
  position: relative;
}
.notice-dot130 {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c95d45;
  box-shadow: 0 0 0 2px #fff;
}
.notice-dot130[hidden] {
  display: none;
}
.deck128 .card-rarity {
  display: flex !important;
  opacity: 1 !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  color: #dbc17f;
}
.deck128 .card-rarity span {
  font-size: 18px;
  letter-spacing: 2px;
}
.deck128 .card-rarity small {
  font-size: 11px;
}
.deck128 .card-reward p {
  display: block !important;
  opacity: 1 !important;
  color: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
  margin: 8px 0;
  max-height: none !important;
}
.deck128 .activity-slot {
  perspective: 1400px;
}
.deck128 .activity-flipper {
  transition: transform .58s cubic-bezier(.2, .7, .25, 1);
  transform-style: preserve-3d;
}
.deck128 .activity-back,
.deck128 .activity-front {
  backface-visibility: hidden;
  box-shadow: 0 8px 20px #182b3026, inset 0 0 0 2px #fff2;
  background-image:
    repeating-linear-gradient(
      110deg,
      #ffffff03 0 1px,
      transparent 1px 4px);
}
.deck128 .is-revealing.stars-5 .card-reward,
.deck128 .is-revealing.stars-6 .card-reward {
  animation: reward-shine130 1.1s ease-out;
}
@keyframes reward-shine130 {
  from {
    box-shadow: 0 0 35px #f5d47b;
    filter: brightness(1.5);
  }
  to {
    box-shadow: 0 0 0 transparent;
    filter: brightness(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .deck128 .activity-flipper {
    transition: none;
  }
  .deck128 .card-reward {
    animation: none !important;
  }
}

.deck128 .is-revealed .card-rarity, .deck128 .is-revealed .card-reward p { visibility: visible; }

#routes .panel-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content 40px;
  gap: 8px;
  position: static;
  min-height: 42px;
}
#routes .panel-heading > span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  overflow-wrap: normal;
  font-size: 14px;
}
#routes .panel-heading #route-new130 {
  width: auto !important;
  min-width: 104px !important;
  max-width: none !important;
  height: 42px;
  white-space: nowrap;
  font-size: 12px;
  flex-shrink: 0;
  padding: 8px 10px;
}
#routes .panel-heading #collapse {
  width: 40px !important;
  height: 42px;
  padding: 0;
  margin: 0;
}
#routes.route-panel.collapsed {
  max-height: none !important;
}
#drawbar,
#drawbar.db-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
#drawbar .db-actions,
#drawbar.quote-compact .db-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 70px !important;
  grid-template-rows: auto auto !important;
  width: 100%;
  min-width: 0;
  gap: 8px !important;
}
#drawbar #quote-expand,
#drawbar.quote-compact #quote-expand {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 44px;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal !important;
  text-align: left;
}
#drawbar #drawcancel,
#drawbar.quote-compact #drawcancel {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 70px !important;
  min-width: 70px !important;
  min-height: 44px;
  white-space: nowrap;
}
#drawbar #drawdone,
#drawbar.quote-compact #drawdone {
  grid-column: 1/-1 !important;
  grid-row: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px;
  white-space: nowrap !important;
  margin: 0 !important;
  background: #263b42;
  color: white;
}
#drawbar #drawundo {
  display: none !important;
}
#runtime-recovery13 {
  position: fixed;
  z-index: 2147483646;
  inset: auto 12px calc(16px + env(safe-area-inset-bottom));
  padding: 20px;
  border: 1px solid #b7c7b1;
  border-radius: 18px;
  background: #fffef8;
  box-shadow: 0 0 0 100vmax #263b4270;
  color: #263b42;
  font: 15px/1.6 system-ui;
}
#runtime-recovery13[hidden] {
  display: none;
}
#runtime-recovery13 h2 {
  font-size: 20px;
  margin: 0 0 8px;
}
#runtime-recovery13 button {
  min-height: 44px;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 5px;
  background: #36594d;
  color: #fff;
}
@media (max-width: 340px) {
  #routes .panel-heading {
    grid-template-columns: minmax(0, 1fr) max-content 36px;
    gap: 4px;
  }
  #routes .panel-heading #route-new130 {
    min-width: 94px !important;
    padding: 8px 6px;
  }
  #routes .panel-heading > span {
    font-size: 12px;
  }
}
#runtime-recovery13 { max-height: calc(100dvh - 40px); overflow: auto; }
#runtime-recovery13 .error-detail1621 { font-size: 12px; overflow-wrap: anywhere; }
#runtime-recovery13 textarea { width: 100%; min-height: 100px; font-size: 12px; }

/* Explicit zero-minimum grid track stops long six-star text expanding behind the clip. */
.deck128 .activity-flipper{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr);min-height:0!important}
.deck128 .activity-front{min-width:0;min-height:0!important;align-self:stretch;justify-content:flex-start!important}
.deck128 .card-content128{display:block!important;min-height:0;flex:1 1 0;overflow-y:auto;overflow-x:hidden;overflow-anchor:none;scroll-padding-top:12px}
.deck128 .card-content128>*{flex-shrink:0}
.deck128 .card-actions128{position:relative;z-index:1;flex:0 0 auto}
.deck128 .stars-6 .card-reward p,.deck128 .stars-6 .card-reward small{color:#f6e4b5!important;opacity:1!important}
.deck128 .stars-6 .card-reward{background:#d4b46c18!important}
.deck128 .stars-6 .card-content128{color:#c9d7cb}
.deck128 .activity-front::after{z-index:0;pointer-events:none}
.deck128 .card-reward p{overflow-wrap:anywhere}
.deck128 .reward-line-web{display:block;padding:2px 0;font-size:14px;line-height:1.5}

#earnings-brief15{position:fixed;z-index:75;left:12px;right:12px;max-width:600px;margin-inline:auto;min-height:48px;padding:9px 12px 9px 15px;display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #c5ccba;border-radius:14px;background:#fbfaf1f5;box-shadow:0 4px 18px #263b4214;color:#344b44;font:14px/1.35 system-ui;backdrop-filter:blur(8px)}
#earnings-brief15[hidden]{display:none!important}#earnings-brief15>div{min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px}#earnings-brief15 b{font-size:13px;letter-spacing:.03em}#earnings-brief15 span{font-variant-numeric:tabular-nums}#earnings-brief15[data-tone=negative] span{color:#a85d45}#earnings-brief15 button{flex:0 0 auto;min-height:34px;min-width:64px;padding:6px 8px;border:0;border-radius:8px;background:#e4e9dc;color:#35584b;font:600 13px system-ui}.brief-history15 ul{padding:0;list-style:none}.brief-history15 li{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #d8dece;font-size:14px}.brief-history15 b{white-space:nowrap}.brief-sheet15>.primary{margin-right:8px}
/* The legacy portrait layer hides nested modal closes. This new sheet owns one visible close. */
.portrait-shell .modal .brief-sheet15 .modal-head>button.close{display:grid!important;place-items:center;position:static!important;width:40px;height:40px;flex:0 0 40px;margin:0;border-radius:50%;background:#edf0e7;color:#263b42;font-size:23px}
.brief-sheet15 .modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px}

/* The selector owns both gesture axes, including vertical reading inside a card. */
.portrait-shell .atlas-rail,.atlas-rail,.atlas-rail .atlas-card,.atlas-rail .atlas-card *{touch-action:none!important}
.atlas-rail{cursor:grab}.atlas-rail:active{cursor:grabbing}.atlas-rail .atlas-terrain,.atlas-rail .atlas-terrain *{user-select:none;-webkit-user-drag:none}

.effects-button156{min-width:32px;min-height:32px;flex-shrink:0}
.atlas-top .effects-button156{margin-left:auto;color:inherit;border:1px solid #cbd4c5;background:#fffef9;border-radius:50%}
.atlas-top .effects-button156+small{margin-left:8px}
.effects-sheet156 p{font-size:13px;color:#68766b;margin:16px 0}
.effects-row156{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:24px 0 16px}
.effects-row156 button{min-width:64px;min-height:44px}
.effects-row156 button[aria-pressed=false]{opacity:.6}
.effects-volume156{display:flex;align-items:center;justify-content:space-between;gap:24px}
.effects-volume156 input{min-width:0;flex:1;min-height:44px;accent-color:#456f58}
.effects-sheet156>.primary{float:right;min-height:44px}
body.atlas-selecting #modal:has(.effects-sheet156){z-index:10010!important}

.unlock-list158{display:grid;gap:8px;margin:16px 0}
.unlock-item158{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#f4f6ef;border-radius:14px;padding:12px 14px}
.unlock-item158>div{min-width:0}.unlock-item158 b{font-size:14px}.unlock-item158 p{margin:5px 0 0;color:#738073;font-size:12px;line-height:1.65}
.unlock-item158>button{flex-shrink:0;min-height:40px;padding:6px 12px}
.unlock-actions158{display:flex;gap:10px;margin-top:16px}.unlock-actions158>button{flex:1;min-height:44px}

.ux-hub-tabs{overflow-x:auto;scrollbar-width:none}.ux-hub-tabs button{white-space:nowrap;flex-shrink:0}.portrait-shell #date .year16{display:inline!important;font-size:10px;margin-left:5px;opacity:.7}
.slot-machine16{position:relative;background:linear-gradient(140deg,#293e49,#112a38);border:5px solid #bd9a61;border-radius:18px;padding:20px 52px 18px 12px;color:#f8e7ba;margin:18px 0;box-shadow:inset 0 0 0 3px #d2bc86,0 8px 18px #243c4426}.slot-lights16{text-align:center;font:700 18px Georgia,serif;letter-spacing:3px;padding-bottom:14px}.slot-reels16{display:flex;gap:6px;background:#091923;padding:8px;border-radius:8px}.slot-reels16 span{display:grid;place-items:center;width:33.333%;height:75px;font-size:33px;color:#b64b44;font-weight:800;background:linear-gradient(#d9d4c6,#fffdf2 35%,#fffdf2 65%,#d9d4c6);border-radius:5px}.slot-reels16 .spinning{animation:slot-roll16 .12s linear infinite;filter:blur(1px)}@keyframes slot-roll16{50%{transform:translateY(5px);opacity:.55}}.slot-lever-track16{position:absolute;right:17px;top:55px;width:12px;height:120px;background:#0b1d29;border:2px solid #8b969a;border-radius:8px}.slot-lever-track16 button{position:absolute;top:0;left:-11px;width:32px;height:32px;min-width:0;padding:0;border:2px solid #edb396;border-radius:50%;background:radial-gradient(circle at 30% 25%,#f5aaa3,#b9363c 65%);transform:translateY(var(--pull,0));transition:transform .18s cubic-bezier(.2,.9,.3,1.3);touch-action:none;box-shadow:0 4px 2px #0006}.slot-status16{font-size:12px;text-align:center;min-height:20px;margin-top:14px}.fleet-sale16 .quote-row{gap:8px;flex-wrap:wrap}.casino-notice16{position:fixed;top:124px;right:14px;z-index:25;background:#efe2bc;color:#62523b;padding:8px 14px;border-radius:20px;border:1px solid #bda36e;font-size:12px}.casino-notice16[hidden]{display:none}

/* Keep full lever travel even while the global button active state applies. */
.slot-lever-track16{height:144px;width:12px;top:55px;right:17px}
#slot-lever16{position:absolute;top:0;left:-12px;width:36px;height:36px;min-width:36px;min-height:36px;max-width:36px;max-height:36px;padding:0;border:2px solid #edb396;border-radius:50%;background:radial-gradient(circle at 30% 25%,#ffd1be,#d84a47 42%,#912d35 80%);transform:translateY(var(--pull,0px));transition:transform .38s cubic-bezier(.18,1.45,.38,1);touch-action:none;box-shadow:0 4px 3px #0007,inset -3px -4px 5px #6d182e66}
#slot-lever16:active:not(:disabled){transform:translateY(var(--pull,0px)) scale(.98)}
#slot-lever16.is-dragging16{transition:none}
#slot-lever16:disabled{transform:translateY(var(--pull,0px));opacity:.85}
.casino-first165{text-align:center;padding:8px 0}.casino-first165 .modal-head{min-height:32px}.casino-first165 .modal-head h2{font-size:13px;color:#94876d}.casino-first-icon165{font-size:46px;margin:22px 0 12px}.casino-first165 p{line-height:1.9}.casino-first165 small{display:block;color:#89918a;margin:24px 0}.casino-first165 .ux-actions{margin-top:28px}

.portrait-shell #date{display:block!important;white-space:nowrap!important;overflow:visible;line-height:1.2}.portrait-shell #date .year16{display:none!important}.portrait-shell #calendar-tag{display:block!important;white-space:nowrap!important;overflow:visible;font-size:9.5px;line-height:1.45;margin-top:4px}.portrait-shell .calendar{min-width:0}body.atlas-selecting #calendar-tag{display:none!important}
.portrait-shell header .calendar{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center;gap:0}.portrait-shell #calendar-tag{margin-left:0!important;max-width:none}

#map-loading166{position:fixed;inset:0;z-index:2147483646;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:20px;background:#e6edda;color:#263b42;font:16px system-ui}#map-loading166[hidden]{display:none}#map-loading166 strong{font-size:27px}#map-loading166 p{min-height:24px}.map-load-track166{width:180px;height:5px;background:#c9d7c8;overflow:hidden;border-radius:5px}.map-load-track166 i{display:block;width:35%;height:100%;background:#2f8a78;animation:mapload166 1.2s ease-in-out infinite}@keyframes mapload166{from{transform:translateX(-100%)}to{transform:translateX(390%)}}
#modal-content:has(.slot-machine16){transform:none!important;overscroll-behavior:none;touch-action:pan-y}#slot-lever16,.slot-lever-track16{touch-action:none!important;user-select:none;-webkit-user-select:none}#modal-content:has(.slot-machine16)::before{display:none}.casino-notice16{display:none!important}
@media(prefers-reduced-motion:reduce){.map-load-track166 i{animation:none;width:100%}}
#modal:has(.slot-machine16)>.portrait-modal-close{display:none!important}#slot-exit16{width:100%;min-height:48px;margin-top:12px;background:#345950;color:#fff;font-size:16px}

/* Every card in one row stretches equally; long copy pushes the entire row. */
html body #modal-content .research-grid{align-items:stretch!important;grid-auto-rows:auto!important}
html body #modal-content .research-card{height:100%!important;box-sizing:border-box;display:flex!important;flex-direction:column!important}
html body #modal-content .research-card p{flex:1 0 auto!important}
html body #modal-content .research-card .research-cost{margin-top:auto!important}
html body #modal-content .research-card button{min-height:36px!important;flex-shrink:0}
html body #details .ux-fac-strip:has(.farm-chip1612){display:flex!important}
html body #details.is-full .ux-fac-strip:has(.ux-harbor)>button:not(.ux-harbor){display:inline-flex!important}
html body #details .farm-chip1612{flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
html body #details .farm-chip1612 em{font-style:normal;font-size:11px;color:#738367}

/* Original symbols, presented inside a machined cabinet. */
.slot-machine16{--slot-cell:76px;isolation:isolate;background:radial-gradient(ellipse at 30% 0,#88464a,transparent 65%),linear-gradient(145deg,#582d38,#241f2b 65%,#39212e);border:3px solid #d6b87c;border-radius:24px;padding:23px 51px 19px 13px;box-shadow:inset 0 0 0 3px #513824,inset 0 0 0 5px #ecd6a055,0 14px 24px #15293235;overflow:hidden}
.slot-machine16::before{content:"";position:absolute;inset:8px;border:1px solid #e1be7255;border-radius:16px;pointer-events:none;z-index:-1}
.slot-lights16{position:relative;margin:0 0 14px;padding:10px 4px 12px;border:1px solid #d4b57588;border-radius:12px;background:linear-gradient(#171d26,#30252c);font:bold clamp(16px,4.8vw,23px) Georgia,serif;letter-spacing:2px;color:#ffe8ac;text-shadow:0 1px 0 #000,0 0 13px #e3b65b55;box-shadow:inset 0 2px 5px #0008,0 1px #f4deb04d}
.slot-lights16 small{display:block;font:600 10px system-ui;letter-spacing:5px;color:#bda884;margin:0 0 5px}
.slot-reels16{position:relative;gap:5px;padding:6px;background:linear-gradient(#070e15,#19202b);border:2px solid #b09059;border-radius:12px;box-shadow:inset 0 4px 8px #000b,0 2px #e8d4a566}
.slot-reels16::after{content:"";position:absolute;left:5px;right:5px;top:50%;height:var(--slot-cell);transform:translateY(-50%);border-top:1px solid #d89c5266;border-bottom:1px solid #d89c5266;box-shadow:0 0 8px #edc96e1a;pointer-events:none;z-index:3}
.slot-reels16 .slot-reel1617{position:relative;display:block;flex:1;min-width:0;height:132px;width:auto;overflow:hidden;border-radius:6px;background:#fff9e9;box-shadow:inset 1px 0 3px #0008}
.slot-reel1617::after{content:"";position:absolute;inset:0;z-index:2;border-radius:inherit;background:linear-gradient(#17212bb8,#17212b00 32%,#fff8 46%,#fff0 58%,#17212b00 72%,#17212ba8);box-shadow:inset 0 6px 10px #0004;pointer-events:none}
.slot-strip1617{position:absolute;left:0;right:0;top:-48px;display:flex;flex-direction:column;font-style:normal;will-change:transform}
.slot-strip1617 b{display:grid;place-items:center;flex:0 0 var(--slot-cell);height:var(--slot-cell);font-size:clamp(28px,8vw,43px);font-weight:800;line-height:1;color:#a62c37;text-shadow:0 2px 1px #0002}
.slot-lever-track16{right:17px;top:93px;height:150px;width:13px;background:linear-gradient(90deg,#05090e,#55515a,#080d14);border:2px solid #bfaa7f;box-shadow:0 0 0 3px #191521,inset 0 3px 7px #000b}
#slot-lever16{background:radial-gradient(circle at 30% 24%,#fff0d4,#ff9790 13%,#cd343c 48%,#70192c 80%);border:2px solid #f3c295;box-shadow:0 4px 5px #0009,inset -3px -4px 5px #48102588}
.slot-status16{min-height:42px;display:grid;place-items:center;font-size:14px;line-height:1.5;color:#f2dfb4;margin-top:14px;padding:8px;border-radius:8px;background:#140f1b70;border:1px solid #c69f5844}
.is-running1617 .slot-lights16{animation:slot-lamps1617 1.2s ease-in-out infinite alternate}
.is-running1617 .slot-reel1617:not(.is-stopped1617){box-shadow:inset 0 0 12px #0005}
.slot-reel1617.is-stopped1617{outline:1px solid #e3c779;outline-offset:-1px}
.is-jackpot1617,.is-major1617{animation:slot-award1617 .65s ease-out 3}
.slot-celebration1617{position:absolute;inset:0;z-index:5;overflow:hidden;pointer-events:none;background:radial-gradient(ellipse,#fff2ae33,transparent 70%)}
.slot-celebration1617>i{position:absolute;left:var(--x);top:48%;font-style:normal;font-size:23px;opacity:0;animation:slot-coins1617 2s var(--delay) ease-out both}
.slot-celebration1617 strong{position:absolute;left:12px;right:12px;top:38%;padding:14px 6px;text-align:center;background:linear-gradient(110deg,#4b2015f2,#332015f5);border:2px solid #f5d480;border-radius:12px;color:#ffe6a0;font-size:25px;letter-spacing:3px;box-shadow:0 4px 24px #0006;animation:slot-banner1617 3.5s both}
.slot-celebration1617 em{display:block;font-style:normal;font-size:30px;letter-spacing:0;font-variant-numeric:tabular-nums;margin-top:5px}
@keyframes slot-lamps1617{to{box-shadow:inset 0 2px 5px #0008,0 0 15px #e5b85977;color:#fff5cf}}
@keyframes slot-award1617{50%{box-shadow:inset 0 0 0 3px #513824,0 0 25px #f6c758aa}}
@keyframes slot-coins1617{0%{opacity:0;transform:translate(0,0) scale(.5)}12%{opacity:1}45%{transform:translate(calc(var(--drift) * .6),-100px) rotate(100deg)}100%{opacity:0;transform:translate(var(--drift),220px) rotate(320deg)}}
@keyframes slot-banner1617{0%{opacity:0;transform:scale(.8)}10%,80%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.slot-machine16,.slot-lights16,.slot-celebration1617 *{animation:none!important}.slot-celebration1617 strong{opacity:1}}

.market-holdings{margin-top:28px;border-top:1px solid #cdd8d0;padding-top:24px}.holding-sale{margin-top:12px;padding:14px;background:#eff3ee;border-radius:12px}.holding-sale[hidden]{display:none}.holding-sale label{display:flex;align-items:center;gap:12px;font-size:14px}.holding-sale input{width:140px;max-width:55%;padding:10px;font-size:16px;border:1px solid #a6b6b0;border-radius:8px}.holding-fractions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}.holding-fractions button,.holding-card>button{min-height:44px;min-width:64px}.holding-sale p{font-size:14px}.holding-heading{gap:12px;flex-wrap:wrap}.holding-heading>b{font-size:16px}.holding-heading strong{font-size:14px}#junction-picker .junction-line>button{min-height:48px}
.market-holdings .holding-values dt,.market-holdings .holding-values dd,.market-holdings .market-section-title>span{font-size:14px}.market-holdings .holding-values dd{overflow-wrap:anywhere}

.ux-fac-strip{touch-action:pan-x;overscroll-behavior-x:contain;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scroll-behavior:auto}
.ux-fac-strip button{touch-action:pan-x;user-select:none}
.ux-fac-strip .arcade1622{background:#f5ecd5;border-color:#dac496;color:#70572e}
.cold-notice1622{pointer-events:auto;display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:8px 14px;border:1px solid #bdd0d8;border-radius:22px;background:#edf5f6ed;color:#456875;font-size:12px;box-shadow:0 2px 8px #263b4210}
.cold-notice1622[hidden]{display:none}
#pwa-launch{padding:10px 14px;border:1px solid #b9cbc5;border-radius:12px;background:#fffef9;color:#263b42;font:inherit;cursor:pointer}
#pwa-panel{position:fixed;inset:0;z-index:2147483600;background:#263b4280;display:grid;place-items:center;padding:16px;overflow:auto;touch-action:pan-y}
#pwa-panel[hidden],#pwa-panel [hidden]{display:none!important}
.pwa-card{position:relative;width:min(100%,520px);max-height:90dvh;overflow:auto;box-sizing:border-box;padding:26px;background:#fffef9;border-radius:22px;color:#263b42;box-shadow:0 20px 80px #102e4033;font:16px/1.6 system-ui}
.pwa-card h2{margin:0 0 4px}.pwa-card p{overflow-wrap:anywhere}.pwa-card small,.pwa-note{font-size:14px;color:#5d7075}.pwa-card button{padding:10px 14px;margin:4px 4px 4px 0;border:1px solid #bdccc3;background:#f0f3eb;color:#263b42;border-radius:10px;font:inherit;cursor:pointer}.pwa-card button:disabled{opacity:.6}.pwa-card .pwa-main{background:#2e535c;color:white}.pwa-close{position:absolute;right:18px;top:18px}.pwa-card hr{border:0;border-top:1px solid #dbe2d6;margin:20px 0}.pwa-card progress{width:100%;accent-color:#308576}.pwa-card input[type=file]{display:none}.map-load-actions{display:flex;gap:12px;margin-top:20px}.map-load-actions[hidden]{display:none}.map-load-actions button{padding:12px 18px;border-radius:10px;border:1px solid #b9cbb9;background:#fffef9;color:#263b42;font:16px system-ui}
.atlas-terrain{background:#a7baa5}.atlas-terrain img{width:100%;height:100%;object-fit:cover}
