/* Remaining legacy surfaces: paper, ink and petrol. Back controls are excluded. */
#app#app .local-service :is(input,select,textarea){
 color-scheme:light;background:#fffaf0!important;color:#203c3e!important;
 border-color:#ddcfaa!important;accent-color:#1b6266;
}
#app#app .local-service input[type=range]{background:#e7deca!important}
#app#app .city-hotspot>span{background:#fffaf0;color:#203c3e}
#app#app .fullscreen-main-view--office.fullscreen-main-view--subview{background:#faf6e9}
#app#app .fullscreen-main-view--career .career-rank-emblem-wrap{background:#f3ecd9;border-color:#ddcfaa}

/* Convoy progress and details had retained the older brown card palette. */
#app#app .convoy-lifecycle b,#modal-root#modal-root .convoy-lifecycle b{background:#1b6266;color:#fff8e8!important}
#modal-root#modal-root .modal.convoy-detail-modal{
 --ink:#203c3e;--muted:#526762;--line:#ddcfaa;
 background:linear-gradient(145deg,#fff9eb,#f3ecd9)!important;color:var(--ink)!important;border-color:var(--line);
}
#modal-root#modal-root .convoy-detail-modal :is(.convoy-detail-summary span,.convoy-member-metrics span,.convoy-detail-ships article,.convoy-rename-panel,.convoy-route-summary){
 background:#fffaf0;color:#203c3e;border-color:#ddcfaa;
}
#modal-root#modal-root .convoy-detail-modal :is(h2,h3,h4,strong,b,label){color:#203c3e}
#modal-root#modal-root .convoy-detail-modal :is(p,small,.panel-note){color:#526762}
#modal-root#modal-root .convoy-detail-modal .convoy-lifecycle span{background:#f3ecd9;color:#526762}
#modal-root#modal-root .convoy-detail-modal .convoy-lifecycle span.is-reached{background:#e5f0e9}
#modal-root#modal-root .convoy-detail-modal .convoy-lifecycle span.is-current{background:#e5f0e9;outline-color:#1b6266}
#modal-root#modal-root .convoy-detail-modal .convoy-role-pill{color:#203c3e;border-color:#ddcfaa}
#modal-root#modal-root .convoy-detail-modal .convoy-role-pill.leitschiff{background:#e5f0e9}
#modal-root#modal-root .convoy-detail-modal .convoy-role-pill.handelsschiff{background:#edf1e7}
#modal-root#modal-root .convoy-detail-modal .convoy-role-pill.eskorte{background:#e4eef1}
#modal-root#modal-root .convoy-detail-modal :is(button,.button,input,select){background:#fffaf0;color:#203c3e;border-color:#ddcfaa;color-scheme:light}
#modal-root#modal-root .convoy-detail-modal .button.primary{background:#1b6266;color:#fff8e8;border-color:#1b6266}
#modal-root#modal-root .convoy-detail-modal :is(button,input,select):focus-visible{outline-color:#267b80}

/* Later career phases use the same light surfaces as the initial rank view. */
#app#app .fullscreen-main-view--career :is(.career-charter-steps span,.charter-trial-phase){background:#fffaf0;color:#526762;border-color:#ddcfaa}
#app#app .fullscreen-main-view--career .career-charter-steps .active{background:#e5f0e9;color:#203c3e;border-color:#1b6266}
#app#app .fullscreen-main-view--career .charter-trial-objective input{background:#fffaf0;color:#203c3e;color-scheme:light;border-color:#ddcfaa}
#app#app .war-map-notice{background:#fffaf0;color:#9b3f30;border:1px solid #ddcfaa}

/* Native tavern rulebook controls also inherit the old local-service rules. */
#app#app .local-service-tavern .tavern-rulebook-close{background:#fffaf0!important;color:#203c3e!important;border-color:#ddcfaa!important}
#app#app .local-service-tavern :is(.personnel-section-heading,.personnel-ship-row,.tavern-rulebook-heading) .eyebrow{color:#526762!important;-webkit-text-fill-color:currentColor!important}

/* Landscape scene captions remain readable on the same light paper. */
#app#app .world-main.location-scene-view>:is(.office-scene-title,.yard-scene-title,.harbor-scene-title,.tavern-scene-title,.governor-scene-title){background:#fffaf0;color:#203c3e;border-color:#ddcfaa}
#app#app .world-main.location-scene-view>:is(.office-scene-title,.yard-scene-title,.harbor-scene-title,.tavern-scene-title,.governor-scene-title) :is(strong,small,span){color:#203c3e!important}

/* National flags are transparent illustrations throughout the game. */
#app#app .nation-flag--cutout,#modal-root#modal-root .nation-flag--cutout{object-fit:contain;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding:0!important}
#modal-root#modal-root .promotion-ceremony-award-head{border:0;background:transparent}

/* A price is a single readable amount next to the existing coin cutout. */
#app#app .local-service-office .office-acquisition-cost{display:grid;grid-template-columns:minmax(0,1fr);gap:9px}
#app#app .office-acquisition-price{display:grid;gap:6px;min-width:0}
#app#app .office-acquisition-price>span{display:block;font-size:13px;color:#526762}
#app#app .office-acquisition-price>strong{display:flex;align-items:center;gap:9px;white-space:nowrap;font-size:28px;line-height:1.15}
#app#app .office-acquisition-price>strong>img{display:block;width:40px;height:40px;object-fit:contain}
#app#app .office-acquisition-cost>small{grid-column:1/-1;line-height:1.4}

/* The route map owns its gestures and has compact, explicit camera controls. */
.route-map-card .route-planner-map,.route-map-card .route-map-port{touch-action:none;user-select:none}
.route-map-card .route-planner-map{cursor:grab}.route-map-card .route-planner-map:active{cursor:grabbing}
.route-map-card .route-map-camera-controls{position:absolute;right:10px;bottom:10px;z-index:8;display:flex;gap:5px}
#app#app .route-map-camera-controls button,#modal-root#modal-root .route-map-camera-controls button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid #ddcfaa;border-radius:7px;background:#fffaf0;color:#203c3e;font:24px/1 sans-serif;cursor:pointer}
@media(max-width:800px){.route-map-card .route-map-heading{left:8px;right:8px;top:8px;max-width:none;margin:0;padding:8px 10px}.route-map-card .route-map-heading h3{font-size:16px}.route-map-card .route-map-heading .eyebrow{font-size:10px}.route-map-card .route-map-heading small{font-size:11px}}

/* Stop-wide captain trading is independent of an individual commodity. */
.route-trade-workspace.route-trade-stop-policy{display:grid;grid-template-columns:minmax(220px,1fr) minmax(0,3fr)}
.route-trade-stop-policy .route-trade-check>span{display:grid;gap:5px}.route-trade-stop-policy .route-trade-check small{font-size:12px;line-height:1.4;font-weight:400}
.route-policy-intro,.route-policy-note{color:#526762;font-size:13px;line-height:1.5}
.route-market-preview,.route-legacy-orders{margin-top:16px;border-top:1px solid #ddcfaa;padding-top:12px}
.route-market-preview summary,.route-legacy-orders summary{cursor:pointer;min-height:44px;display:flex;align-items:center}
.route-market-preview table{width:100%;border-collapse:collapse;font-size:12px}.route-market-preview :is(th,td){padding:7px 4px;text-align:right;border-bottom:1px solid #e4d8bd}.route-market-preview th:first-child{text-align:left}
@media(max-width:800px){.route-trade-workspace.route-trade-stop-policy{display:block}.route-trade-stop-policy>.route-stop-rail{position:static;width:100%;max-height:none}.route-trade-stop-policy>.route-trade-detail{padding:16px;min-width:0}}

/* Brief notices stay above the measured navigation, without blocking controls. */
#toast,#toast.arrival-notice{position:fixed;left:50%;right:auto;top:auto;bottom:var(--toast-bottom,84px);transform:translateX(-50%);box-sizing:border-box;width:max-content;max-width:calc(100vw - 24px);z-index:11000;pointer-events:none;background:#19676b;color:#fffaf0;border:1px solid #4e8d8b;border-radius:9px;padding:10px 14px;box-shadow:0 5px 18px #173f4330;font-size:14px;line-height:1.4;text-align:center}

/* Event illustrations keep their atmosphere; the reading surface stays light. */
#modal-root#modal-root .modal.event-scene-dialog--pirate{background:linear-gradient(155deg,#fffdf5,#f0e4c8)!important;color:#243e42!important}
#modal-root#modal-root .modal.event-scene-dialog--pirate .event-scene .eyebrow{color:#9b3f30!important}
#modal-root#modal-root .modal.event-scene-dialog--pirate .event-scene h2{color:#243e42!important}
#modal-root#modal-root .modal.event-scene-dialog--pirate .event-scene p{color:#526762!important}
#modal-root#modal-root .modal.event-scene-dialog--pirate .event-scene [data-event-scene-ack]{background:#1b6266!important;color:#fff8e8!important;border-color:#1b6266!important}

/* Route maintenance uses the same paper and petrol controls. */
.route-shipyard-policy{margin:12px 0;padding:12px;background:#faf6e9;border:1px solid #ded2b3;border-radius:12px;color:#203c3e;display:grid;gap:10px}.route-shipyard-policy>label:first-child{display:flex;gap:10px;align-items:flex-start}.route-shipyard-policy input{accent-color:#19676b;width:20px;height:20px;flex-shrink:0}.route-shipyard-policy small{display:block;color:#607878;font-size:13px;line-height:1.4}.route-shipyard-policy select{display:block;width:100%;min-height:44px;background:#fffdf6;color:#203c3e;border:1px solid #ded2b3;border-radius:8px;margin-top:6px;padding:8px}.route-shipyard-policy label{min-width:0}.ship-route-controls{background:#faf6e9!important;color:#203c3e!important}.ship-route-controls-actions{display:flex;gap:8px;flex-wrap:wrap}.ship-route-controls-actions .button{flex:1;min-height:44px}
/* Route planning: compact paper cards, visible route cutout, no city-back rules. */
:is(#app#app,#modal-root#modal-root) .route-overview .route-card{display:block;padding:12px;background:#faf6e9;background-image:none;color:#203c3e;border:1px solid #d9cba7;border-radius:14px;box-shadow:0 3px 12px #203c3e12}
:is(#app#app,#modal-root#modal-root) .route-card-heading{display:grid;grid-template-columns:96px minmax(0,1fr);gap:12px;align-items:center;border-bottom:1px solid #e5dbc2;padding-bottom:10px}
:is(#app#app,#modal-root#modal-root) .route-card-heading .route-card-art{width:96px;height:100px;object-fit:contain;background:none;border:0;box-shadow:none}
:is(#app#app,#modal-root#modal-root) .route-card-heading h3{font-size:25px;line-height:1.15;margin:5px 0;color:#203c3e;overflow-wrap:anywhere}
:is(#app#app,#modal-root#modal-root) .route-card-heading .eyebrow{font-size:10px;line-height:1.5;letter-spacing:.07em;color:#526e6c}
:is(#app#app,#modal-root#modal-root) .route-card-heading small{font-size:13px;color:#526e6c}
:is(#app#app,#modal-root#modal-root) .route-card-assignment{margin:12px 0;font-size:15px;line-height:1.45;color:#203c3e}
:is(#app#app,#modal-root#modal-root) .route-card-assignment span{display:block;font-size:13px;color:#526e6c}
:is(#app#app,#modal-root#modal-root) .route-card .route-ops-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}
:is(#app#app,#modal-root#modal-root) .route-card .route-ops-summary>span{background:#fffdf6;padding:9px;border:1px solid #e2d6bb}
:is(#app#app,#modal-root#modal-root) .route-card .route-ops-summary small{font-size:10px;color:#526e6c}
:is(#app#app,#modal-root#modal-root) .route-card .route-ops-summary b{font-size:15px;color:#203c3e}
:is(#app#app,#modal-root#modal-root) .route-card .route-op-message{font-size:13px;line-height:1.45;color:#526e6c}
:is(#app#app,#modal-root#modal-root) .route-card .route-card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
:is(#app#app,#modal-root#modal-root) .route-card-actions>.button{flex:1;min-width:110px;min-height:44px;background:#fffdf6;color:#203c3e;border:1px solid #d9cba7;border-radius:9px;font-weight:700}
:is(#app#app,#modal-root#modal-root) .route-card-actions>.button.primary{background:#19676b;color:#fffdf6;-webkit-text-fill-color:#fffdf6}
:is(#app#app,#modal-root#modal-root) .route-card-actions>.button:disabled{background:#e5dfce;color:#697874;-webkit-text-fill-color:#697874;opacity:1}
.route-shipyard-policy .route-maintenance-top{display:grid;grid-template-columns:42px minmax(0,1fr);gap:9px;align-items:center}
.route-maintenance-top>img{width:42px;height:45px;object-fit:contain}
.route-shipyard-policy .route-maintenance-switch{display:grid;grid-template-columns:minmax(0,1fr) 24px;gap:8px;align-items:center;min-width:0}
.route-maintenance-switch b{font-size:16px;line-height:1.3;display:block}
.route-maintenance-switch small{font-size:12px;margin-top:3px}
.route-shipyard-policy .route-maintenance-threshold{display:grid;grid-template-columns:96px minmax(0,1fr);gap:8px;align-items:center;font-size:14px}
.route-maintenance-threshold select{margin:0;font-size:14px}
.route-maintenance-help{border-top:1px solid #e5dbc2;padding-top:7px;font-size:12px;color:#526e6c}
.route-maintenance-help summary{cursor:pointer;min-height:24px}
.route-maintenance-help p{font-size:12px;line-height:1.4;margin:6px 0}
.route-policy-goods{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.route-policy-goods>span{display:flex;flex-direction:column;align-items:center;max-width:78px;text-align:center}
.route-policy-goods img{width:36px;height:36px;object-fit:contain}
.route-policy-goods small{font-size:10px!important;line-height:1.2}
.route-trade-check>span{min-width:0}
.route-trade-check small{font-size:13px;line-height:1.4}
.route-goods-settings{margin-top:18px;border-top:1px solid #e5dbc2;padding-top:14px}
.route-goods-settings h4{font-size:18px;margin:0 0 5px;color:#203c3e}
.route-goods-settings>div>small,.route-supply-needs>small{display:block;color:#526e6c;font-size:13px;line-height:1.45}
.route-goods-permissions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:12px}
.route-goods-permission{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;gap:5px;padding:8px 3px;background:#fffdf6;border:1px solid #d9cba7;border-radius:10px;min-width:0;cursor:pointer;color:#203c3e}
.route-goods-permission input{position:absolute;top:4px;right:4px;width:16px;height:16px;accent-color:#19676b}
.route-goods-permission img{width:44px;height:44px;object-fit:contain;margin-top:5px}
.route-goods-permission>span{font-size:11px;line-height:1.3;overflow-wrap:anywhere}
.route-goods-permission.is-excluded{background:#ebe7dc;color:#697874}
.route-goods-permission.is-excluded img{opacity:.4;filter:grayscale(1)}
.route-supply-needs{padding:12px;border:1px solid #d9cba7;background:#faf6e9;border-radius:10px;color:#203c3e}
@media(min-width:800px){.route-shipyard-policy{max-width:700px;margin-left:auto;margin-right:auto}.route-goods-permissions{grid-template-columns:repeat(7,minmax(0,1fr))}.route-overview .route-card{max-width:920px}.route-trade-checks .route-trade-check{align-items:start}}
.route-activation-hint{background:#fffdf6;color:#203c3e;padding:10px;border:1px solid #d9cba7;border-radius:9px;font-size:13px;line-height:1.4}
.route-activation-hint b{display:block;font-size:13px}
.route-activation-hint ul{margin:6px 0 0;padding-left:17px}
.route-activation-hint li{margin:5px 0;color:#526e6c}
/* One route menu per overlay; details stay in normal document flow. */
#modal-root#modal-root .modal.route-control-menu-modal{width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 140px);overflow-y:auto;overflow-x:hidden;padding:18px;background:#faf6e9;color:#203c3e;border:1px solid #d9cba7;border-radius:15px}
.route-control-menu-modal>.modal-close{top:9px;right:9px;width:38px;height:38px;min-width:38px;min-height:38px;padding:0}
.route-control-menu-head,.ship-route-menu>header{display:grid;grid-template-columns:56px minmax(0,1fr);gap:10px;align-items:center;padding-right:25px;margin-bottom:14px}
.route-control-menu-head>img,.ship-route-menu>header>img{width:56px;height:64px;object-fit:contain;border:0;background:none}
.route-control-menu-head h2,.ship-route-menu>header h2{font-size:27px;line-height:1.15;margin:4px 0;overflow-wrap:anywhere}
.route-control-menu-head .eyebrow,.ship-route-menu>header .eyebrow{font-size:10px;line-height:1.4}
.route-control-menu-head small{font-size:13px;color:#526e6c}
.route-control-status{background:#fffdf6;border:1px solid #ded2b3;border-radius:10px;padding:10px;margin-bottom:12px;color:#203c3e}
.route-control-status>small,.route-control-status>b{display:block}
.route-control-status>small{font-size:10px;letter-spacing:.05em;color:#526e6c}
.route-control-status>b{font-size:15px;margin:4px 0}
.route-control-status>p{font-size:13px;line-height:1.4;margin:5px 0}
.route-control-status .route-activation-hint{padding:6px 0;border:0}
.route-control-menu-actions{display:grid;gap:8px;margin-bottom:12px}
.route-control-menu-modal .button{min-height:44px;background:#fffdf6;color:#203c3e;border:1px solid #d9cba7;border-radius:9px;font-size:14px}
.route-control-menu-modal .button.primary{background:#19676b;color:#fffdf6;-webkit-text-fill-color:#fffdf6}
.route-control-menu-modal .button:disabled{background:#e5dfce;color:#697874;-webkit-text-fill-color:#697874;opacity:1}
.route-menu-section{position:static;display:block;float:none;clear:both;margin:0;border-top:1px solid #e5dbc2;padding:9px 0;color:#203c3e;font-size:13px}
.route-menu-section>summary{min-height:24px;cursor:pointer;font-weight:700;line-height:1.5}
.route-menu-section .route-shipyard-policy{margin:8px 0 0}
.route-menu-stops{display:block;position:static;list-style:decimal;padding-left:22px;margin:8px 0}
.route-menu-stops>li{position:static;display:list-item;padding:5px 0;font-size:14px}
.route-menu-stops>li.is-current{font-weight:700;color:#19676b}
.route-menu-statistics{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:8px 0}
.route-menu-statistics dd{margin:0;text-align:right}
.ship-route-menu .ship-route-controls{margin:0;padding:10px;border:1px solid #ded2b3;border-radius:10px}
.ship-route-menu .ship-route-controls-head{display:block}
.ship-route-menu .ship-route-controls-head strong{font-size:23px;line-height:1.2;margin:5px 0}
.ship-route-menu .ship-route-controls-head small{font-size:12px}
.ship-route-menu .ship-route-controls-head>.button{margin-top:9px}
.ship-route-menu .ship-route-controls-actions{margin-top:10px}
.ship-route-menu .ship-route-controls>p{font-size:12px;line-height:1.4}
@media(max-height:420px){#modal-root#modal-root .modal.route-control-menu-modal{max-height:calc(100dvh - 32px)}}
/* Ships remain cutouts; only a thin circular marker identifies selection. */
#chart .map-owned-ship-halo{fill:none;stroke:#e3d8b5;stroke-width:1.5;filter:none;opacity:.65}
#chart #ship-on-map .map-owned-ship-halo{fill:none;stroke:#ffdf7b;stroke-width:2;filter:drop-shadow(0 1px 2px #203c3e80);opacity:1}
#modal-root#modal-root .route-control-menu-modal .button.primary:disabled{background:#e5dfce;color:#697874;-webkit-text-fill-color:#697874;border-color:#d9cba7}
.menu-build-info{margin-top:14px;padding-top:10px;border-top:1px solid #ded2b3;color:#526e6c;font-size:12px;text-align:center}
#modal-root#modal-root .route-control-menu-modal .button.primary:disabled{background:#e5dfce!important;color:#697874!important;-webkit-text-fill-color:#697874!important;border-color:#d9cba7!important}
#chart .map-ship-visual .ship-artwork,#chart .map-ship-visual.ship-config-military .ship-artwork{filter:drop-shadow(0 0 1px #fff8e3) drop-shadow(0 2px 2px #082d36)}
#chart [data-fleet-marker] .map-ship-visual{opacity:1}
#chart #ship-on-map .map-owned-ship-label{font-size:11px;stroke:#103b42;stroke-width:3px;fill:#fffdf0}
#chart .map-fleet-marker.docked .ship-wake,#chart #ship-on-map.docked .ship-wake{display:none}
#app#app .mission-history-entry{display:grid;gap:5px;padding:13px;background:#fffaf0;color:#203c3e;border:1px solid #ddcfaa;border-radius:10px;margin:9px 0}
#app#app .mission-history-entry :is(b,span,small){color:#203c3e;-webkit-text-fill-color:currentColor}
#app#app .mission-history-entry small{font-size:12px;color:#526762}
#app#app .yard-capability-note{display:grid;gap:4px;padding:12px;border:1px solid #ddcfaa;border-radius:10px;background:#fffaf0;color:#203c3e}
#app#app .yard-capability-note b{color:#203c3e;font-size:15px}
#app#app .yard-capability-note span{color:#526762;font-size:13px;line-height:1.4}
.mystic-offer,.yard-refits .refit-card{background:#fffaf0;color:#203c3e;border:1px solid #e2d4ad;border-radius:12px;padding:12px;min-width:0}
.mystic-offer header{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px;align-items:center}
.mystic-offer header img{width:100%;height:220px;object-fit:contain}
.mystic-offer h3,.yard-refits h4{color:#203c3e;overflow-wrap:anywhere}
.mystic-ship-art{display:block;width:100%;height:180px;object-fit:contain}
.mystic-offer dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.mystic-offer dl div{padding:8px;background:#eef4ef;border-radius:8px}
.mystic-offer dd{margin:0;font-weight:700}
.mystic-offer .button,.refit-card .button{display:block;width:100%;margin-top:12px;white-space:normal;min-height:44px;background:#fffdf7;color:#203c3e;border:1px solid #dfd0a8;border-radius:8px}
.mystic-offer .button.primary,.refit-card .button.primary{background:#19676b;color:#fffaf0}
.mystic-offer .button:disabled,.refit-card .button:disabled{background:#e8e5da;color:#697b79;opacity:1}
.mystic-offer small,.refit-card small{display:block;color:#596f6c;margin-top:8px}
.yard-refits{margin-top:24px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.yard-refits>h3,.yard-refits>p{grid-column:1/-1}
.refit-card>img{width:100%;height:120px;object-fit:contain}
@media(max-width:600px){.yard-refits{grid-template-columns:1fr}.mystic-offer header{grid-template-columns:84px minmax(0,1fr)}.mystic-offer header img{height:180px}.refit-card>img{height:140px}}

/* Playable table controls follow the approved paper/teal palette. */
#app>.world-main.location-scene-view>.local-service.local-service-tavern .tavern-playable .tavern-game-board button.button{background:#fffdf7!important;color:#203c3e!important;-webkit-text-fill-color:currentColor!important;border:1px solid #dfd3b5!important;box-shadow:none!important}
#app>.world-main.location-scene-view>.local-service.local-service-tavern .tavern-playable .tavern-game-board button.button.primary{background:#19676b!important;color:#fffaf0!important}
#app>.world-main.location-scene-view>.local-service.local-service-tavern .tavern-playable .tavern-game-board button.tavern-forfeit{color:#a93d32!important}
#app>.world-main.location-scene-view>.local-service.local-service-tavern .tavern-playable .tavern-game-board button.tavern-card-button.is-selected{background:#dbece6!important;border:3px solid #19676b!important}
@media(max-width:600px){#app>.world-main.location-scene-view>.local-service.local-service-tavern .personnel-tabs button#personnel-tab-games>img.personnel-tab-cutout{width:40px;height:40px;max-width:100%;margin:0;place-self:center}}

/* Business action and preview are distinct, readable surfaces. */
#app .business-instance>[data-business-upgrade]{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 10px;white-space:normal;line-height:1.35}
#app .business-instance .business-upgrade-price,#app .business-instance .business-money{white-space:nowrap}
#app .business-instance .business-upgrade-preview{display:grid;gap:6px;padding:10px;margin:6px 0 12px;background:#f0f5ee!important;border:1px solid #d2dfd4;border-radius:8px;color:#203c3e!important;-webkit-text-fill-color:#203c3e!important;font-size:13px;line-height:1.45}
#app .business-instance .business-upgrade-preview :is(span,b){color:#203c3e!important;-webkit-text-fill-color:#203c3e!important}
#app .business-instance .business-upgrade-preview .goods-bundle{display:inline-flex;gap:4px;align-items:center;white-space:normal}

#app .mystic-sightings{background:#fffaf0;color:#203c3e;padding:12px;border:1px solid #dfd3b5;border-radius:10px}
#app .mystic-sightings article{display:grid;grid-template-columns:70px minmax(0,1fr);gap:12px;align-items:center;padding:12px 0;border-top:1px solid #dfd3b5}
#app .mystic-sightings article img{width:70px;height:120px;object-fit:contain}#app .mystic-sightings h4{margin:0 0 8px;color:#203c3e}#app .mystic-sightings p{color:#405d58;line-height:1.5}#app .mystic-sightings small{display:block;color:#526d69}

/* Dedicated refit navigation; protected city back buttons remain untouched. */
#app>.world-main.location-scene-view>.local-service-yard .yard-v2 .yard-v2-tabs{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#app>.world-main.location-scene-view>.local-service-yard .yard-v2 .yard-v2-tabs button{display:grid;place-items:center;align-content:center;gap:3px;min-height:66px;padding:5px 3px}
#app>.world-main.location-scene-view>.local-service-yard .yard-v2 .yard-v2-tabs button img{width:40px;height:40px;max-width:100%;object-fit:contain}
#app .yard-v2 .yard-tab-label{display:block;font-size:11px;line-height:1.2;white-space:nowrap}
#app .yard-refit-picker{display:grid;gap:8px;margin:12px 0}#app .yard-refit-picker .yard-fleet-choice{width:100%;min-width:0}
#app .yard-refits .refit-card h4{font-size:20px;margin:4px 0 10px}#app .yard-refits .refit-card .eyebrow{color:#526d69;font-size:11px}

#app .yard-refit-picker .yard-refit-choice{display:grid;grid-template-columns:58px minmax(0,1fr);gap:10px;align-items:center;width:100%;min-height:74px;padding:8px 10px;border:1px solid #dfd3b5;border-radius:9px;background:#fffaf0;color:#203c3e;text-align:left}
#app .yard-refit-picker .yard-refit-choice.active{background:#e5f0e9;border-color:#7ca6a0}#app .yard-refit-choice small{display:block;color:#526d69;margin-top:4px}

#app .yard-refits>.refit-current{grid-column:1/-1;display:grid;gap:6px;background:#eef4ef;border:1px solid #d2dfd4;border-radius:9px;padding:10px;color:#203c3e}
#app .yard-refits>.refit-current :is(b,span){color:#203c3e!important;-webkit-text-fill-color:#203c3e!important}

#app .yard-v2 .yard-tab-label{color:inherit;-webkit-text-fill-color:currentColor}
@media(max-width:600px){#app .yard-refit-picker{max-height:180px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}}

/* Explicit light contract for new refit controls and both legendary offers. */
#app#app .local-service-yard .location-page-toolbar .yard-v2-tabs{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}
#app#app .local-service-yard .yard-refit-picker button.yard-refit-choice{background:#fffaf0!important;border-color:#dfd3b5!important;color:#203c3e!important;-webkit-text-fill-color:#203c3e!important}
#app#app .local-service-yard .yard-refit-picker button.yard-refit-choice.active{background:#e5f0e9!important;border-color:#7ca6a0!important}
#app#app .local-service-yard .yard-refit-choice :is(b,span,small){color:#203c3e!important;-webkit-text-fill-color:#203c3e!important}
#app#app .local-service-tavern .mystic-offer dl :is(dt,dd){color:#203c3e!important;-webkit-text-fill-color:#203c3e!important;line-height:1.35}
#app#app .local-service-tavern .mystic-offer dl div{display:grid;gap:4px;padding:10px;background:#eef4ef;border:1px solid #d2dfd4}
#app#app .local-service-tavern .mystic-offer dt{font-size:13px}
#app#app .local-service-tavern .mystic-offer dd{font-size:20px;font-weight:700}
#app#app .local-service-tavern .mystic-offer .eyebrow{color:#526d69!important;-webkit-text-fill-color:#526d69!important}
@media(max-height:450px){#app#app .local-service-yard .location-page-toolbar{position:static!important}}

/* Mobile route editing: stop planning first, setup on demand, actions above navigation. */
.route-settings-toggle{display:none}
@media(max-width:800px){
 #app .route-planner-workspace-header{display:block;padding:10px 14px;border-bottom:1px solid #ded2b3}
 #app .route-planner-workspace-header>div>.eyebrow{display:none}
 #app .route-planner-workspace-header h2{font-size:24px;margin:0 0 8px}
 #app .route-settings-toggle{display:grid;grid-template-columns:minmax(0,1fr) 24px;gap:3px 8px;align-items:center;box-sizing:border-box;width:100%;min-height:54px;padding:8px 12px;text-align:left;border:1px solid #c9d9d2;border-radius:9px;background:#edf4ee;color:#203c3e}
 #app .route-settings-toggle>span{font-size:15px;font-weight:700}
 #app .route-settings-toggle>small{grid-column:1;font-size:12px;line-height:1.35;overflow-wrap:anywhere;color:#526d69}
 #app .route-settings-toggle>b{grid-column:2;grid-row:1/3;text-align:center;font-size:24px}
 #app .route-planner-workspace:not(.route-settings-open) .route-planner-settings{display:none}
 #app .route-planner-workspace-fields{margin-top:10px;gap:8px;grid-template-columns:1fr}
 #app .route-planner-settings .route-shipyard-policy{margin:10px 0 0;max-width:none}
 #app .route-planner-workspace>.route-rail-actions{position:sticky;bottom:0;z-index:5;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:5px 8px;padding:8px 12px;background:#fffaf0;border-top:1px solid #ded2b3;box-shadow:0 -3px 10px #203c3e12}
 #app .route-planner-workspace>.route-rail-actions .panel-note{grid-column:1/-1;grid-row:2;font-size:11px;line-height:1.25;margin:0}
 #app .route-planner-workspace>.route-rail-actions .button{grid-row:1;min-height:44px;font-size:14px;padding:9px 8px;min-width:0}
 #app .route-planner-workspace>.route-rail-actions .primary{grid-column:2}
 #app .route-planner-workspace>.route-rail-actions [data-route-cancel]{grid-column:1}
 #app .route-planner-steps{position:sticky;top:0;z-index:4;background:#fffaf0;padding:0 12px}
 #app .route-stop-row{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;padding:6px 8px}
 #app .route-stop-row-actions{display:flex;justify-content:flex-end;gap:4px}
 #app .route-stop-row-actions button{box-sizing:border-box;min-width:44px;min-height:44px;padding:6px;font-size:20px;border:1px solid #ded2b3;border-radius:8px;background:#fffaf0;color:#1b6266}
 #app .route-stop-select{min-height:44px}
}
.route-map-mobile-focus,.route-map-mobile-toolbar{display:none}
@media(max-width:800px){
 #app .route-map-workspace{display:flex;flex-direction:column;height:auto;min-height:0}
 #app .route-map-workspace-canvas{flex:none;box-sizing:border-box;height:clamp(240px,calc(100dvh - 320px),600px);min-height:0;scroll-margin-top:48px}
 #app .route-map-workspace-canvas>.route-map-card{inset:48px 8px 8px;min-height:0}
 #app .route-map-workspace-canvas .route-planner-map{height:100%;min-height:0}
 #app .route-map-mobile-focus{display:block}
 #app .route-map-mobile-toolbar{position:absolute;top:4px;left:8px;right:8px;height:40px;display:flex;justify-content:flex-end;align-items:center}
 #app .route-map-mobile-toolbar .button{min-height:40px;padding:6px 12px;font-size:13px;background:#fffaf0;color:#203c3e}
 #app .route-route-strip{scroll-margin-top:48px}
}
@media(max-width:800px){
 #app .fullscreen-main-view--route-planner{scroll-padding-top:54px;scroll-padding-bottom:90px}
 #app .route-map-candidate-workspace{left:16px;right:16px;bottom:64px;z-index:4;background:#fffaf0;color:#203c3e;border:1px solid #ded2b3;box-shadow:0 4px 18px #203c3e22}
 #app .route-map-candidate-workspace .button{min-height:44px;width:100%}
}
@media(max-width:800px) and (max-height:450px){
 #app .route-planner-steps{position:static}
 #app .route-route-strip .route-stop-rail{max-height:none;overflow:visible}
 #app .route-route-strip .route-section-heading{position:static}
 #app .route-planner-workspace>.route-rail-actions .panel-note{display:none}
 #app .fullscreen-main-view--route-planner{scroll-padding-top:8px;scroll-padding-bottom:68px}
}
/* Ship information uses whole scene images; crew details have one clear row each. */
#app .map-selection-ship-art{height:auto!important;aspect-ratio:auto;overflow:visible;background:transparent}
#app .map-selection-ship-art img{width:100%;height:auto!important;max-height:none;object-fit:contain;object-position:center;border-radius:9px}
#modal-root .ship-detail-modal .ship-route-menu-button{display:flex;align-items:center;justify-content:center;gap:12px;min-height:64px}
#modal-root .ship-detail-modal .ship-route-menu-button img{width:52px;height:52px;object-fit:contain;flex-shrink:0}
@media(max-width:800px){
 #modal-root#modal-root .modal.ship-detail-modal .ship-detail-pane .ship-personnel-summary{grid-template-columns:minmax(0,1fr)!important;gap:10px!important;padding:10px!important}
 #modal-root#modal-root .ship-personnel-summary .ship-personnel-column{display:grid;grid-template-columns:62px minmax(0,1fr);align-items:center;gap:10px;min-width:0;padding:8px 0}
 #modal-root#modal-root .ship-personnel-summary .ship-personnel-cutout{width:62px;height:62px;object-fit:contain}
 #modal-root#modal-root .ship-personnel-summary .ship-personnel-column>div{min-width:0}
}
.port-location-leader{fill:none;stroke:#f7edc4;stroke-width:1.2;stroke-dasharray:2 2;vector-effect:non-scaling-stroke;opacity:.8;pointer-events:none}
.port-location-anchor{fill:#f7edc4;stroke:#355f64;stroke-width:.7;vector-effect:non-scaling-stroke;pointer-events:none}
.port-location-leader{stroke-dasharray:none;stroke-width:.8;opacity:.55}
.route-maintenance-quick{display:none}
.route-stop-actions-toggle{min-width:44px;min-height:44px;border:1px solid #ded2b3;border-radius:8px;background:#fffaf0;color:#1b6266;font-size:22px}
.route-stop-row-actions[hidden]{display:none!important}
@media(max-width:800px){
 #app .route-maintenance-quick{display:flex;align-items:center;gap:8px;min-height:44px;margin-top:6px;padding:5px 10px;border:1px solid #c9d9d2;border-radius:8px;background:#edf4ee;color:#203c3e;font-size:13px}
 #app .route-maintenance-quick[aria-pressed="false"]{background:#fffaf0}
 #app .route-maintenance-quick img{width:28px;height:28px;object-fit:contain}
 #app .route-stop-row{flex:0 0 auto!important;height:auto;min-height:0;grid-template-columns:minmax(0,1fr) 44px;padding:4px 6px;gap:3px 6px}
 #app .route-stop-select{padding:4px 6px;min-height:44px}
 #app .route-stop-select b{font-size:15px;line-height:1.2}
 #app .route-stop-select small{font-size:11px;line-height:1.2}
 #app .route-stop-row-actions{grid-column:1/-1}
 #app .route-trade-workspace>.route-stop-rail{max-height:min(32dvh,230px);min-height:0;overflow:auto;overscroll-behavior:contain}
}
@media(max-width:800px){#app .route-map-mobile-toolbar{justify-content:space-between;gap:8px}}

/* A producer can also need its own goods. Keep the local need visible. */
#app#app .world-main.view-marketplace .market-city-demand{margin:4px 0 8px;font-size:12px;line-height:1.4;color:#526e6c!important;-webkit-text-fill-color:#526e6c!important}

#app#app .personnel-payroll-note{color:#526e6c!important;-webkit-text-fill-color:#526e6c!important;font-size:13px;line-height:1.45;margin:10px 0}

/* Mobile ship selection: readable essentials first, harbor actions on demand. */
#app .map-selection-panel--readable{position:fixed!important;inset:var(--ship-card-top) 12px var(--ship-card-bottom)!important;width:auto!important;max-width:480px!important;height:max-content;max-height:calc(100dvh - var(--ship-card-top) - var(--ship-card-bottom))!important;margin:auto;display:flex;flex-direction:column;overflow:hidden!important;padding:0!important;background:#fffaf0!important;color:#243e42;box-shadow:0 12px 36px #102f3f50;border:1px solid #d5c7a5;border-radius:16px;z-index:30}
#app .map-selection-panel--readable .ship-card-heading{flex:none;display:flex;align-items:center;gap:12px;padding:14px;background:#fffaf0;border-bottom:1px solid #e5dcc6}
#app .map-selection-panel--readable h3{flex:1;min-width:0;margin:0;font-size:28px;line-height:1.15;overflow-wrap:anywhere;color:#243e42}
#app .map-selection-panel--readable .map-selection-close{flex:none;display:grid;place-items:center;width:52px;height:52px;min-width:52px;min-height:52px;padding:0;border:1px solid #d5c7a5;border-radius:10px;background:#fffef9;color:#243e42;font-size:30px}
#app .map-selection-panel--readable .ship-card-content{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 14px 14px;scroll-padding:12px}
#app .map-selection-panel--readable .map-selection-ship-type{font-size:17px;line-height:1.4;margin:0 0 4px;color:#526e6c}
#app .map-selection-panel--readable .ship-card-location{font-size:19px;font-weight:700;line-height:1.35;color:#243e42;margin:0 0 10px}
#app .map-selection-panel--readable .map-selection-ship-art{display:flex;align-items:center;justify-content:center;height:clamp(96px,19dvh,168px)!important;margin:0 0 12px;background:#edf3ee;border-radius:10px;overflow:hidden}
#app .map-selection-panel--readable .map-selection-ship-art img{width:auto!important;max-width:100%;height:auto!important;max-height:100%!important;object-fit:contain;border-radius:0}
#app .map-selection-panel--readable .map-selection-ship-stats{gap:6px;margin:0 0 12px}
#app .map-selection-panel--readable .map-selection-ship-stats span{padding:10px 2px;gap:6px;font-size:16px;line-height:1.25;color:#526e6c;background:#fffef9}
#app .map-selection-panel--readable .map-selection-ship-stats b{font-size:22px;line-height:1.2;color:#243e42;white-space:nowrap}
#app .map-selection-panel--readable .map-selection-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:0}
#app .map-selection-panel--readable .button,#app .map-selection-panel--readable summary{min-height:56px;font-size:19px;line-height:1.3;font-weight:700;padding:12px;box-sizing:border-box;white-space:normal}
#app .map-selection-panel--readable .ship-card-harbor{margin-top:10px;border:1px solid #d5c7a5;border-radius:10px;background:#fffef9}
#app .map-selection-panel--readable summary{display:flex;align-items:center;justify-content:space-between;list-style:none;cursor:pointer;color:#243e42}
#app .map-selection-panel--readable summary::-webkit-details-marker{display:none}
#app .map-selection-panel--readable summary span{font-size:27px;line-height:1}
#app .map-selection-panel--readable details[open] summary span{transform:rotate(45deg)}
#app .map-selection-panel--readable details .map-selection-actions{padding:0 10px 10px}
#app .map-selection-panel--readable details .button:not(:disabled){background:#fffaf0;color:#243e42;border:1px solid #d5c7a5}
#app .map-selection-panel--readable :is(button,summary):focus-visible{outline:3px solid #19676b;outline-offset:2px}
@media(max-height:740px){#app .map-selection-panel--readable .map-selection-ship-art{height:104px!important}#app .map-selection-panel--readable .ship-card-heading{padding:10px 14px}}
