/* A separate phone/tablet layout; the desktop captain's deck stays intact. */
.helm,.standing-summary{display:contents}.mobile-dock,.inventory-toggle{display:none}
@media(max-width:950px){
 :root{font-size:18px;--mobile-helm:84px;--mobile-dock:74px;scroll-padding-top:calc(var(--mobile-helm) + env(safe-area-inset-top) + 16px);scroll-padding-bottom:calc(var(--mobile-dock) + env(safe-area-inset-bottom) + 16px)}
 body{-webkit-text-size-adjust:100%;background-attachment:scroll;line-height:1.5}body.sidebar-is-open{overflow:hidden}
 .shell{display:block}main#workspace{padding:0 14px calc(100px + env(safe-area-inset-bottom));min-width:0}
 #workspace :is(p,li,label),#modal :is(p,li,label){font-size:18px;line-height:1.65}
 #workspace small,#modal small{font-size:16px;line-height:1.45}
 #workspace button,#sidebar button,#modal button{font-size:18px;line-height:1.35;min-height:48px;min-width:44px}
 #workspace :is(input,select,textarea),#modal :is(input,select,textarea){font-size:18px;line-height:1.45;min-height:52px;padding:12px;width:100%;max-width:100%;scroll-margin-block:110px}
 #workspace input:is([type=checkbox],[type=radio]),#modal input:is([type=checkbox],[type=radio]){width:22px;min-width:22px;height:22px;min-height:22px;padding:0;flex-shrink:0;accent-color:#b58336}
 #workspace :is(.eyebrow,.duration,.costs,.coordinate,.rule-note,.training-estimate,.queue,.mission-warning,.mission-estimate,.tab-strip,.plan-rules,.ranking-rules){font-size:16px;line-height:1.5;letter-spacing:0}
 #workspace :is(h1,h2,h3,h4),#modal :is(h2,h3,h4){overflow-wrap:anywhere}
 #workspace :is(.primary,.secondary,.text-button),#modal :is(.primary,.secondary,.text-button){padding:12px 16px;font-size:18px;min-height:48px;white-space:normal}
 #workspace .primary,#modal .primary{font-weight:600}
 #workspace :is(.form-error,.empty p,.report p,.card-explanation p),#modal .form-error{font-size:18px;line-height:1.6}
 #workspace summary,#modal summary{min-height:48px;display:flex;align-items:center;font-size:18px;line-height:1.5;cursor:pointer;gap:8px;padding:10px 0}
 .topbar{position:relative;top:auto;display:block;height:auto;min-height:0;margin:0 -14px;padding:calc(var(--mobile-helm) + env(safe-area-inset-top) + 14px) 14px 14px;border-bottom-width:4px;z-index:40}
 .helm{position:fixed;inset:0 0 auto;z-index:60;display:grid;grid-template-columns:48px minmax(0,1fr) 56px;gap:10px;align-items:center;height:calc(var(--mobile-helm) + env(safe-area-inset-top));padding:calc(8px + env(safe-area-inset-top)) 12px 8px;background:linear-gradient(90deg,#1a100a4f,#45271933,#1a100a77),var(--timber) center/500px;border-bottom:2px solid #c39953;box-shadow:0 4px 13px #001b2877}
 #workspace #mobile-menu{display:grid;width:48px;height:48px;min-width:48px;padding:0;font-size:29px;color:#ffe6ae;background:#0b4845;border:1px solid #d1ae6b;border-radius:4px}
 .current-island{grid-column:2;grid-row:1;min-width:0;gap:0}.current-island>span,.header-world-badge{display:none!important}
 .current-island small{font:16px/18px var(--font-body);letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#f2d7a5;margin:0}
 #workspace #active-island{font:25px/1.2 var(--title);min-height:44px;padding:4px 25px 4px 0;border:0;max-width:none;width:100%;color:#ffe8b1;background:transparent}
 .topbar #account{grid-column:3;grid-row:1;justify-content:center;position:relative;gap:0;width:56px;min-width:0}
 .captain-label{display:none}.captain-button:after{display:none}.captain-portrait{width:52px;height:52px}.captain-button{min-width:52px;min-height:52px;justify-content:center}
 .player-menu{position:fixed;top:calc(var(--mobile-helm) + env(safe-area-inset-top) + 8px);right:12px;width:calc(100vw - 24px);max-width:390px;max-height:calc(var(--game-height,100dvh) - var(--mobile-helm) - var(--mobile-dock) - 30px);overflow-y:auto;padding:14px;z-index:90}
 .player-menu-header{padding:6px 4px 14px;gap:14px}.player-menu-header strong{font-size:28px}.player-menu-header small{font-size:16px}.player-menu>button{min-height:52px;padding:12px;font-size:17px}
 .player-menu>button svg{width:24px;height:24px}
 body[data-player=guest] .helm{grid-template-columns:48px minmax(0,1fr) 48px}
 body[data-player=guest] .topbar #account{width:48px}body[data-player=guest] .topbar #account>[data-auth=login]{position:absolute;inset:0;width:48px;min-height:48px;font-size:0;padding:0}body[data-player=guest] .topbar #account>[data-auth=login]:after{content:'\2192';font:28px var(--font-body)}body[data-player=guest] .topbar #account>[data-auth=register]{display:none}
 .island-command-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding-top:0;min-width:0}
 .topbar .resources{grid-column:1/-1;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;flex:none;margin:0;padding:0}
 .topbar .inventory-section-label{display:none}
 .topbar .resource{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:0;padding:10px 9px 12px;min-height:94px;min-width:0}
 .resource-copy,.resource small{display:contents}.resource .resource-label{display:block!important;order:1;font:16px/20px var(--font-body);color:#62421e;letter-spacing:0;max-width:100%}
 .resource-icon{position:absolute;right:5px;top:8px;width:25px;height:25px;opacity:.5}
 .resource strong{order:2;font:bold 23px/28px var(--font-body);letter-spacing:-.6px;margin:3px 0 0;max-width:100%;white-space:nowrap}
 .resource .rate{order:3;font:16px/20px var(--font-body);color:#285d3b;font-weight:600;margin:0;letter-spacing:0}
 #workspace #inventory-toggle{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) 22px;gap:1px 10px;align-items:center;text-align:left;min-height:58px;padding:8px 12px;background:#0a4542;color:#ffe7af;border:1px solid #c7a462;border-radius:3px}
 #inventory-toggle>span:first-child{font-size:18px;font-weight:600}#mobile-harbor-total{grid-column:1;font-size:16px;color:#dce1c5}.inventory-chevron{grid-column:2;grid-row:1/3;font-size:24px;justify-self:center;transition:transform .15s}.inventory-open .inventory-chevron{transform:rotate(180deg)}
 .topbar:not(.inventory-open) #harbor-summary,.topbar:not(.inventory-open) #header-status{display:none}
 #harbor-summary{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;flex:none;min-height:0;min-width:0;padding:0;background:none;border:0;box-shadow:none}
 #workspace .header-ship{display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:34px auto;gap:5px 5px;align-items:center;justify-items:start;padding:8px!important;border:1px solid #a7894d!important;border-radius:3px!important;background:#0d4241!important;min-width:0;min-height:82px}
 .header-ship .ship-miniature{grid-row:1;grid-column:1;width:34px;height:34px;object-fit:contain;padding:1px}.header-ship-copy{display:contents}.header-ship strong{grid-row:1;grid-column:2;font:bold 22px/1 var(--font-body);min-width:0;justify-self:center}.header-ship small{display:block;grid-row:2;grid-column:1/-1;font:16px/1.4 var(--font-body);white-space:normal;overflow-wrap:anywhere;margin:0;text-align:left}
 #workspace .header-army{grid-column:1/-1;display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:12px;min-height:52px;padding:8px 12px;background:#0d4241;border:1px solid #a7894d;border-radius:3px;min-width:0}.header-army .garrison-label{display:block;order:-1;font:16px/1.5 var(--font-body);margin:0;color:#f4ddb0}.header-army .troop-tokens{gap:18px;margin:0}.header-army .troop-tokens img{width:24px;height:32px}.header-army .troop-tokens span{font-size:18px;gap:6px}
 #header-status{grid-column:1/-1;flex:none;display:flex;justify-content:flex-start;gap:12px;padding:10px 12px;min-height:48px}.topbar #header-status svg{width:24px;height:24px}.topbar #header-status>div{display:flex;gap:8px 14px;flex-wrap:wrap;align-items:center}.topbar #header-status strong,.topbar #header-status small{font:16px/1.5 var(--font-body);margin:0}
 .page-heading{padding:22px 0 18px;gap:10px;align-items:center;flex-wrap:wrap}.view-emblem .painted-icon{width:48px;height:48px}.page-title-block{min-width:0;flex:1}.page-heading h1{font-size:34px;line-height:1.05}.page-heading .eyebrow{display:none}.world-meta{max-width:none;flex-basis:100%;justify-content:flex-start;padding-left:58px;gap:8px;font-size:16px;line-height:1.4}.world-meta .divider,#server-clock{display:none}.world-meta .live-dot{width:7px;height:7px}
 .sidebar{display:none;position:fixed;inset:0 auto 0 0;width:min(352px,calc(100vw - 32px));max-width:none;height:var(--game-height,100dvh);padding:calc(16px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));border-right:6px solid #684523;z-index:110;box-shadow:14px 0 50px #00131be6;overscroll-behavior:contain}.sidebar.open{display:flex}.sidebar:after{display:none}.sidebar .brand{font-size:33px;padding-right:36px;gap:10px}.sidebar .brand>span>span{font-size:38px}.sidebar .brand-crest{width:70px;height:80px}.sidebar .brand small{display:none}
 #sidebar #sidebar-close{display:grid;position:absolute;right:10px;top:calc(10px + env(safe-area-inset-top));width:48px;height:48px;padding:0;font-size:30px;z-index:3;background:#0a4743;color:#ffe2aa;border:1px solid #cda45e}
 #sidebar #navigation .nav-item{min-height:54px;font:17px/1.3 var(--font-body);padding:5px 12px;gap:12px}.sidebar #navigation .nav-item .nav-label{font:inherit}.sidebar #navigation .nav-item .painted-icon{width:42px;height:42px}.nav-group-label{font-size:16px;letter-spacing:1px;line-height:1.5;margin:18px 10px 6px}.sidebar .world-label{font-size:16px;letter-spacing:1px;padding:12px 0}.world-label>span:last-child{font-size:16px}.sidebar .sidebar-section,.sidebar .sidebar-section .eyebrow{font-size:16px;letter-spacing:0}.my-islands button{min-height:56px;font-size:18px;padding:10px}.my-islands small{font-size:16px;line-height:1.5}.sidebar .sidebar-bottom>.nav-item{font-size:18px!important;min-height:52px}.sidebar .legal-links{font-size:16px;line-height:1.5}.sidebar .legal-links a{display:flex;align-items:center;min-height:48px}.sidebar-backdrop{position:fixed;inset:0;z-index:100;background:#00151bc4;border:0;display:block}
 #mobile-dock{position:fixed;inset:auto 0 0;z-index:75;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:calc(var(--mobile-dock) + env(safe-area-inset-bottom));padding:5px 8px calc(5px + env(safe-area-inset-bottom));gap:4px;border-top:2px solid #c59b56;background:linear-gradient(#073f3fef,#052c30fa),var(--timber) center/500px;box-shadow:0 -4px 20px #00192366}
 #mobile-dock button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:60px;padding:5px 2px;font:16px/1.2 var(--font-body);color:#d7d9bc;background:transparent;border:1px solid transparent;border-radius:5px}.mobile-dock svg{width:25px;height:25px;stroke-width:1.6}.mobile-dock button.active{color:#ffe1a0!important;background:#d8b87022!important;border-color:#cda464!important}.mobile-dock i{position:absolute;top:4px;right:17px;width:8px;height:8px;border-radius:50%;background:#f1bb63;box-shadow:0 0 0 2px #0b3a3c}
 .map-layout{display:flex;flex-direction:column;gap:20px}.map-card{width:100%;height:65dvh;min-height:480px;max-height:740px;border-width:4px}.map-toolbar{top:12px;left:12px;right:12px;gap:8px}.map-toolbar .segmented{padding:3px;gap:3px}.map-toolbar .segmented button,#workspace .map-toolbar>.icon-button{width:48px;height:48px;min-width:48px;padding:11px}.map-toolbar svg{width:24px;height:24px}
 .map-controls{left:12px;bottom:124px;padding:3px}.map-controls button{width:48px;height:48px;padding:11px;font-size:27px!important}.map-controls svg{width:24px;height:24px}.map-controls>span{margin:3px 5px}.map-region{top:98px;left:10px;right:10px;font-size:25px;opacity:.7}.map-region small{display:none}.map-compass{right:17px;top:163px;font-size:58px}.map-compass>span{font-size:16px}.map-compass>small{font-size:16px}
 .map-legend{left:12px;right:12px;bottom:12px;display:grid;grid-template-columns:1fr 1fr;gap:7px 12px;padding:10px;background:#08343ce8;border:1px solid #acaa7855}.map-legend span{font:16px/20px var(--font-body)}.map-legend .dot{width:7px;height:7px}.chart-overview-wrap{right:12px;bottom:96px;padding:5px}.chart-overview-wrap canvas{width:126px;height:87px}.chart-overview-wrap>span{display:none}.map-scale{display:none}
 .search-box{position:absolute;inset:78px 12px auto;max-height:calc(100% - 95px);overflow:auto;padding:16px;z-index:6;width:auto}.search-box label{margin-top:0}.search-box #search-results button{display:block;width:100%;text-align:left;margin-top:8px;padding:12px}.search-box #search-results small{display:block;margin-top:4px;font-size:16px}
 .island-detail{position:relative;inset:auto;width:100%;max-height:none;display:block;overflow:hidden}.island-art{height:180px;min-height:0;border-right:0;border-bottom:3px solid #a57c3e}.island-art .tag{font-size:16px;letter-spacing:0;padding:8px 12px;top:12px;left:12px}.detail-body{padding:20px}.detail-body h2{font-size:34px;margin:8px 0 12px}.detail-body .coordinate{font-size:16px}.detail-body .captain-stamp{font-size:18px}.detail-body .primary{width:100%;margin-top:18px}.detail-body .island-stat-icons{font-size:18px;gap:24px}.detail-body .island-stat-icons svg{width:22px;height:22px}.detail-body .ship-tokens{gap:14px;margin:18px 0}.detail-body .ship-token{min-height:82px;flex:1}.detail-body .ship-token .atlas-token{width:56px;height:56px}.detail-body .ship-token strong{font-size:22px}.detail-body .protection{font-size:16px;margin-top:16px}.detail-body .text-button{font-size:18px}.guest-callout>small{font-size:16px}.starting-kit{justify-content:space-between;gap:12px}.starting-kit b{font-size:20px}.starting-kit svg{width:24px;height:24px}
 .content-page{min-height:45vh}.scene-banner{min-height:180px;padding:24px 20px;margin-bottom:20px}body[data-view=island] .scene-banner{min-height:160px}.scene-banner>span{font-size:16px;letter-spacing:.6px}.scene-banner h3{font-size:36px;margin:8px 0}.scene-banner p{font-size:18px;line-height:1.5}.content-intro{display:flex;flex-wrap:wrap;align-items:center;gap:14px;margin:18px 0}.content-intro h3{font-size:27px}.content-intro .secondary,.content-intro .primary{margin:0}.content-intro>button{width:100%}.content-intro>div{width:100%}
 .illustrated-cards,.progress-cards,.troop-cards,.cards{grid-template-columns:minmax(0,1fr);gap:20px}.illustrated-card,.ship-cards .illustrated-card{display:block;min-width:0}.card-painting,.ship-cards .card-painting{height:auto;aspect-ratio:1.65;border-right:0;border-bottom:3px solid #a87b3c}.legacy-building{height:auto;aspect-ratio:1.65;object-fit:cover}.card-info,.ship-cards .card-info{padding:20px;min-width:0}.card-info h3,.ship-cards .card-info h3{font-size:31px;line-height:1.2;min-height:0;padding-right:0;margin-bottom:10px}.card-info .level,.ship-cards .card-info .level{position:static;display:block;font-size:22px;line-height:1.3;margin:0 0 8px;padding:0;background:none;border:0}.card-info .level small{font-size:16px}.card-info .card-explanation{margin:8px 0 12px}.card-info .card-explanation summary{position:static!important;width:auto;height:auto;min-height:44px;min-width:44px;display:inline-flex;justify-content:center;gap:8px;padding:8px 12px;font-size:18px}.card-info .card-explanation summary:after{content:'Infos';font:16px var(--font-body)}.card-explanation p{padding:12px 0 2px}.card-info .costs,.progress-card .costs,.troop-card .costs{display:flex;flex-wrap:wrap;gap:10px 18px;font:18px/1.5 var(--font-body);margin:10px 0}.costs img{width:24px;height:24px}.costs>span{gap:6px}.card-info .duration{display:flex;gap:8px;align-items:center;font-size:16px;margin:14px 0}.duration svg{width:20px;height:20px}.card-info button{width:100%;min-height:50px;font-size:18px}.ship-cards .card-info form{display:grid;grid-template-columns:minmax(90px,.6fr) minmax(0,1fr);gap:12px;align-items:center}.ship-cards .card-info form button{grid-column:1/-1}.ship-strength{gap:20px;flex-wrap:wrap;font-size:18px;margin:16px 0}.ship-strength svg{width:22px;height:22px}
 .progress-card>img{height:210px;min-height:0;object-fit:contain}.progress-card>div{padding:20px}.progress-card h3,.troop-card h3{font:31px/1.2 var(--title);min-height:0}.progress-card .level,.troop-card .level{position:static;display:block;font-size:18px;margin:0 0 12px;text-align:left}.progress-card p,.troop-card p{min-height:0;font-size:18px}.progress-card .primary{min-height:50px;font-size:18px}.troop-card{display:block}.troop-card>img{height:240px;min-height:0;max-height:none}.troop-card>div{padding:20px}.troop-card input{min-height:52px}.troop-tokens span{font-size:18px}
 .queue{flex-wrap:wrap;gap:12px;padding:16px!important;font-size:18px!important}.queue>span{flex:1;min-width:0}.queue time{font-size:18px;font-weight:600}.queue svg{width:22px;height:22px;flex-shrink:0}.plan-shortcut{display:flex;width:100%;align-items:center;justify-content:center;gap:10px;margin-bottom:18px}
 .tab-strip,.ranking-tabs{display:flex;flex-wrap:wrap;gap:8px;overflow:visible}.tab-strip button,.ranking-tabs button{min-height:48px;font-size:18px;padding:10px 12px;flex:1 1 auto}.fleet-overview,.captain-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.fleet-overview-card{display:flex;flex-direction:column;align-items:flex-start;padding:14px;gap:8px;min-width:0}.fleet-overview-card>img{width:58px;height:58px}.fleet-overview-card span{font-size:18px}.fleet-overview-card strong{font-size:27px}.fleet-overview-card small{font-size:16px}.painted-fleet-row{display:grid;grid-template-columns:84px minmax(0,1fr);padding:16px;gap:14px;margin-bottom:18px}.fleet-painting{grid-column:1;grid-row:1;min-height:84px}.fleet-painting>img{width:84px;height:84px}.fleet-order{grid-column:2;grid-row:1}.fleet-order h3{font-size:29px}.fleet-order small,.fleet-order .fleet-captain{font-size:16px}.painted-fleet-row .fleet-route{grid-column:1/-1;grid-row:auto}.fleet-route-port{font-size:18px;overflow-wrap:anywhere}.fleet-time{grid-column:1/-1;grid-row:auto;text-align:left;padding:12px 0 0;border-top:1px solid #b08b4860}.fleet-time time{font-size:24px}.fleet-time small{font-size:16px}.painted-guest-card{display:block}.painted-guest-art{height:190px;min-height:190px}.painted-guest-copy{padding:22px}.painted-guest-copy h3{font-size:33px}.painted-guest-copy .primary{width:100%}.painted-guest-kit{flex-wrap:wrap;gap:16px}.painted-guest-kit strong{font-size:24px}.painted-guest-kit small{font-size:16px}
 .battle-card{padding:18px}.battle-card header{align-items:flex-start;gap:10px}.battle-card header>span{font-size:18px;letter-spacing:0}.battle-card h3{font-size:31px}.battle-card h4{font-size:24px}.battle-card .battle-forces{grid-template-columns:1fr;gap:18px}.battle-forces small{font-size:16px;letter-spacing:1px}.versus{display:none}.battle-forces section{padding:14px;border:1px solid #b18a4d66}.battle-ships{gap:12px}.battle-ships>div{max-width:88px}.battle-ships strong{font-size:22px}.battle-round{font-size:18px;line-height:1.6}.battle-round>span{width:100%}.battle-actions{display:flex;flex-direction:column;gap:12px}.battle-actions button{width:100%}.fort-health{font-size:18px;line-height:1.5}.battle-history li{flex-direction:column;gap:3px;font-size:18px}.battle-playback>div{display:flex;flex-direction:column;align-items:stretch;gap:12px}.battle-playback label{max-width:none;width:100%;font-size:18px}.battle-playback select{margin-top:8px}.battle-playback button{width:100%}.battle-playback>small{font-size:16px}.battle-archive .battle-roster{grid-template-columns:1fr}
 .report{padding:20px}.report h3{font-size:28px;line-height:1.3}.report small{font-size:16px}.report p{margin-top:12px}.help-grid{display:grid;grid-template-columns:1fr;gap:20px}.help-card{padding:20px;margin:0}.help-card h3{font-size:29px}.help-card ol{padding-left:23px}.help-card li{margin:10px 0}.empty{padding:30px 20px}.empty h3{font-size:31px}.empty button{margin-top:20px;width:100%}
 .captain-standing{padding:20px;gap:16px}.standing-identity{min-width:0;flex:1}.standing-portrait{width:64px;height:72px}.standing-identity h3{font-size:29px}.standing-identity small,.standing-position small,.standing-score small{font-size:16px}.standing-position strong,.standing-score strong{font-size:30px}.captain-stat{padding:14px}.captain-stat span{font-size:16px}.captain-stat strong{font-size:24px}.painted-ranking-table{overflow-x:auto;scrollbar-width:thin}.painted-ranking-table table{min-width:520px}.painted-ranking-table th,.painted-ranking-table td{padding:14px 12px;font-size:18px}.ranking-captain{font-size:24px}.ranking-identity{gap:10px}.ranking-captain small{font-size:16px}.ranking-portrait{width:46px;height:52px}.ranking-score-value{font-size:20px}.ranking-message{min-width:48px}
 .plan-options{grid-template-columns:1fr;gap:14px}.plan-building-card{display:grid;grid-template-columns:88px minmax(0,1fr);gap:10px;padding:14px}.plan-building-icon{width:88px;height:88px;grid-row:1/3}.plan-building-info{padding:0}.plan-building-info h4{font-size:24px}.plan-building-info .costs{font-size:18px;flex-wrap:wrap;gap:8px}.plan-building-info .costs img{width:20px;height:20px}.plan-options .plan-building-card>button{grid-column:1/-1;margin:5px 0 0;width:100%;font-size:18px;min-height:48px}.harbor-build-plan,.route-create-panel{padding:20px;border-width:3px}.plan-count-seal{min-width:58px;min-height:58px}.plan-count-seal strong{font-size:22px}.plan-count-seal small{font-size:16px}.build-plan li{font-size:18px;gap:10px;padding:14px 0}.build-plan li strong{font-size:18px}.build-plan li small{font-size:16px}.plan-controls,.route-actions{display:flex;flex-wrap:wrap;gap:10px}.plan-controls button,.route-actions button{flex:1;min-width:110px}.route-journey{flex-wrap:wrap;gap:16px}.route-port{min-width:0;flex:1}.route-port>strong{font-size:25px}.route-port>span{font-size:16px;letter-spacing:0}.route-vessel{flex-basis:100%;order:3}.route-cargo{font-size:18px}.route-create-panel .input-grid{grid-template-columns:1fr}.route-create-panel summary{font-size:27px}.route-panel{padding:20px}
 .tavern-page .tavern-toolbar{flex-wrap:wrap;gap:14px}.tavern-page .chat-tabs{flex-wrap:wrap;gap:8px}.tavern-page .chat-tabs button{font-size:18px;min-height:48px}.tavern-page .chat-messages{height:55dvh;min-height:320px;padding:14px;scroll-padding-bottom:14px}.tavern-page .chat-message{padding:14px;max-width:100%;gap:10px}.tavern-page .chat-message p{font-size:18px}.tavern-page .chat-message small{font-size:16px}.tavern-page .chat-compose{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:14px}.tavern-page .chat-compose button{width:100%;min-height:50px;font-size:18px}.tavern-page .chat-compose textarea{font-size:18px;min-height:100px}.tavern-page .chat-compose small{font-size:16px}.tavern-page .chat-rules{font-size:16px}.brotherhood-page .crew-member-actions{width:100%;justify-content:flex-start}.brotherhood-page .member-row{padding:16px;flex-direction:column;align-items:stretch;gap:14px}.brotherhood-page .crew-member b{font-size:20px}.brotherhood-page .crew-member small{font-size:16px}.brotherhood-page .crew-member-actions button{font-size:18px;min-height:48px}.brotherhood-page .community-controls{padding:16px}.brotherhood-page .community-controls form{display:flex;flex-direction:column;align-items:stretch;width:100%;max-width:none}.brotherhood-page .community-controls label{font-size:18px}.brotherhood-page .community-controls button{width:100%;font-size:18px;min-height:48px}.brotherhood-page .crew-create{display:block;padding:20px}.brotherhood-page .crew-create-standard{width:76px;height:76px;margin-bottom:16px}.brotherhood-page .crew-create .primary{width:100%;margin-top:12px}.brotherhood-page .crew-card-content{padding:20px}.brotherhood-page .crew-banner>span:last-child{font-size:16px;letter-spacing:.5px}.brotherhood-page .brotherhood-card h3{font-size:33px}.brotherhood-page .brotherhood-card p{font-size:18px}.brotherhood-page .community-actions button{font-size:18px;min-height:48px}.brotherhood-page .brotherhood-grid{gap:20px}.brotherhood-page .brotherhood-rules{padding:12px 16px}.brotherhood-page .brotherhood-rules summary{font-size:18px}
 .account-page .account-profile{padding:22px;min-height:0}.account-profile-main{gap:16px;flex-wrap:wrap}.account-page .account-profile h2{font-size:36px}.account-page .account-eyebrow{font-size:16px;letter-spacing:.4px}.account-page .account-profile p{font-size:18px}.account-profile-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.account-profile-actions button{flex:1;min-width:110px;font-size:18px!important;min-height:48px}.account-page .account-seal{width:80px;height:90px}.account-page .account-signed-in{font-size:16px}.account-stat-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:0;padding:8px}.account-stat-strip>div{min-height:90px;padding:12px;gap:9px;min-width:0}.account-stat-strip strong{font-size:23px}.account-stat-strip small{font-size:16px}.account-panel-grid{display:flex;flex-direction:column;gap:20px}.account-page .account-card{padding:20px;min-width:0}.account-page .account-card h3{font-size:28px}.account-page .account-card p{font-size:18px;line-height:1.65}.account-page .account-card label{font-size:18px}.account-page .account-card button{font-size:18px;min-height:48px}.account-page .account-card>header{gap:12px;align-items:flex-start}.account-email-layout{grid-template-columns:1fr;gap:24px}.account-page .account-email-caption,.account-page .account-email-badge,.account-email-verification small{font-size:16px}.account-email-address{font-size:19px}.account-page .account-email-form-note,.account-page .account-email-delivery{font-size:16px!important}.account-page .account-email-verification button{width:100%;font-size:18px}.account-page .account-session{padding:14px 0;gap:10px;flex-wrap:wrap}.account-page .account-session strong{font-size:18px}.account-page .account-session small,.account-current-tag{font-size:16px}.account-page .account-session button{width:100%}.account-session-icon{width:36px;min-width:36px}.account-page #refresh-account{width:48px;height:48px;padding:0;font-size:26px}.account-page .account-contact-link{font-size:18px;overflow-wrap:anywhere;min-height:48px;display:flex;align-items:center}.account-privacy-link{display:inline-flex;align-items:center;min-height:48px;font-size:18px}
 #modal{position:fixed;inset:auto 0 0;margin:0;max-width:none;width:100%;max-height:calc(var(--game-height,100dvh) - 16px - env(safe-area-inset-top));border-radius:16px 16px 0 0;border-width:3px;overflow:auto;overscroll-behavior:contain;scroll-padding-block:24px;box-shadow:0 -12px 55px #00151bd9}
 .modal-inner{padding:22px 20px calc(24px + env(safe-area-inset-bottom));min-width:0}.modal-top{align-items:flex-start;gap:14px;margin-bottom:18px}.modal-top h2{font-size:31px;line-height:1.15}.modal-top>[data-close]{width:48px;height:48px;min-width:48px;padding:0;font-size:30px}.modal-top>div{min-width:0}#modal .eyebrow{font-size:16px;line-height:1.5;letter-spacing:.4px}#modal label{margin-top:18px}#modal .check-label{gap:12px;align-items:flex-start;font-size:18px;line-height:1.6}#modal .check-label input{margin-top:3px}#modal .auth-tabs button{min-height:48px;font-size:18px}#modal .primary{width:100%;min-height:52px;margin-top:18px}#modal .input-grid{grid-template-columns:1fr;gap:14px}#modal .voyage-ships{grid-template-columns:1fr;gap:12px}#modal .voyage-ships>div{display:grid;grid-template-columns:64px minmax(0,1fr) 92px;gap:12px;align-items:center;padding:14px}#modal .voyage-ships .atlas-token{width:64px;height:64px}#modal .voyage-ships label{font-size:18px;margin:0}#modal .voyage-ships label span{display:block;font-size:16px;line-height:1.5;margin-top:4px}#modal .voyage-ships input{width:92px;min-height:52px;text-align:center;padding:12px 6px}#modal .voyage-estimate{display:flex;flex-direction:column;align-items:flex-start;gap:14px;padding:16px;font-size:18px}#modal .voyage-estimate svg{width:24px;height:24px}#modal .voyage-destination{padding:14px}#modal .voyage-destination strong{font-size:25px}#modal .voyage-destination small{font-size:16px}#modal .troop-cargo .input-grid{grid-template-columns:1fr 1fr}#modal .recovery-code{font-size:19px;line-height:1.7;overflow-wrap:anywhere}
 #modal.avatar-dialog{max-height:calc(var(--game-height,100dvh) - 12px - env(safe-area-inset-top));width:100%;max-width:none}.avatar-dialog .modal-inner{padding:20px 14px calc(20px + env(safe-area-inset-bottom))}.avatar-picker-intro{display:block}.avatar-filters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:18px}.avatar-filters button{font-size:18px;min-height:48px;padding:10px 8px}.avatar-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:16px 0;margin:0;max-height:44dvh;overflow:auto;overscroll-behavior:contain}.avatar-choice{min-width:0;min-height:120px;padding:5px}.avatar-choice img{width:100%;height:auto;aspect-ratio:1;object-fit:cover}.avatar-choice span{font:16px/1.5 var(--font-body);white-space:normal;overflow-wrap:anywhere;display:block;padding:6px 2px}.avatar-picker-footer{display:flex;flex-wrap:wrap;gap:12px;position:static;padding-top:16px;margin-top:0}.avatar-picker-footer>span{font-size:16px}.avatar-picker-footer .form-error{max-width:none;width:100%;flex-basis:100%;order:2}.avatar-picker-footer #avatar-save{width:100%;font-size:18px;min-height:52px;order:3}.avatar-picker-intro #avatar-preview{gap:14px}.avatar-picker-intro #avatar-preview strong{font-size:25px}.avatar-picker-intro #avatar-preview small{font-size:16px}
 .activity-bar{margin-top:24px;padding:18px;gap:12px;flex-wrap:wrap}.activity-title{font-size:18px}.activity-title .badge{font-size:16px}.activity-detail{font-size:18px;line-height:1.6;flex-basis:100%;order:2}.activity-bar>.text-button{width:100%;order:3;font-size:18px}.toast{bottom:calc(var(--mobile-dock) + env(safe-area-inset-bottom) + 12px);left:12px;right:12px;max-width:none;width:auto;transform:none;font-size:18px;line-height:1.5;padding:16px;z-index:140}.connection{font-size:18px;padding:16px;line-height:1.5}.skip:focus{top:8px;z-index:160;font-size:18px;min-height:48px}
}
@media(min-width:600px) and (max-width:950px){
 :root{--mobile-helm:88px;--mobile-dock:78px}main#workspace{padding-left:24px;padding-right:24px}.topbar{margin-left:-24px;margin-right:-24px;padding-left:24px;padding-right:24px}.helm{padding-left:24px;padding-right:24px;grid-template-columns:52px minmax(0,1fr) 64px;gap:16px}.current-island select{font-size:29px}.current-island small{font-size:16px}.island-command-strip{max-width:840px;margin:0 auto}.topbar .resource{min-height:90px;padding-left:18px}.resource-icon{width:38px;height:38px;right:12px;top:14px;opacity:.9}.resource strong{font-size:27px}.resource .resource-label,.resource .rate{font-size:18px}.illustrated-cards,.progress-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.ship-cards{grid-template-columns:1fr}.ship-cards .illustrated-card{display:grid;grid-template-columns:40% minmax(0,1fr)}.ship-cards .card-painting{height:100%;aspect-ratio:auto;border-right:3px solid #a87b3c;border-bottom:0}.map-card{height:66dvh;min-height:560px}.map-legend{grid-template-columns:repeat(4,minmax(0,1fr))}.map-controls{bottom:90px}.chart-overview-wrap{bottom:72px}.island-detail{display:grid;grid-template-columns:36% minmax(0,1fr)}.island-art{height:100%;min-height:320px;border-right:3px solid #a57c3e;border-bottom:0}.mobile-dock button{font-size:18px!important}.plan-options{grid-template-columns:repeat(2,minmax(0,1fr))}.troop-card{display:grid;grid-template-columns:40% minmax(0,1fr)}.troop-card>img{height:100%;max-height:460px}.account-stat-strip{grid-template-columns:repeat(4,minmax(0,1fr))}.account-profile-main{flex-wrap:nowrap}.avatar-gallery{grid-template-columns:repeat(5,minmax(0,1fr))}#modal .voyage-ships{grid-template-columns:1fr}#modal{max-width:720px;left:50%;right:auto;transform:translateX(-50%)}
}
@media(max-width:374px){
 .helm{padding-left:8px;padding-right:8px;gap:8px;grid-template-columns:48px minmax(0,1fr) 52px}.current-island small{font-size:16px}.current-island #active-island{font-size:23px}.resource strong{font-size:22px}.resource-icon{width:22px;height:22px;right:4px}.resource .resource-label{font-size:16px}.topbar .resource{padding-left:8px;padding-right:6px}.resource .rate{font-size:16px}.header-ship .ship-miniature{width:29px;height:32px}#workspace .header-ship{grid-template-columns:29px minmax(0,1fr);gap:4px}.header-ship strong{font-size:21px}.header-ship small{font-size:16px}.modal-inner{padding-left:16px;padding-right:16px}#modal .voyage-ships>div{grid-template-columns:48px minmax(0,1fr) 78px;gap:10px;padding:12px 10px}#modal .voyage-ships .atlas-token{width:48px;height:48px}#modal .voyage-ships input{width:78px}.avatar-choice{min-height:110px}
}
@media(prefers-reduced-motion:reduce){.inventory-chevron{transition:none}}

/* Mobile content geometry and explicit overrides for older compact selectors. */
@media(max-width:950px){
 #resources .resource small .resource-label{font:16px/20px var(--font-body);letter-spacing:0;display:block!important}
 .topbar .resources{order:0}#workspace #inventory-toggle{order:1}#harbor-summary{order:2}#header-status{order:3}
 #workspace .plan-shortcut{float:none;clear:both;margin:0 0 18px;width:100%}
 #workspace .content-intro{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;clear:both}
 #workspace .content-intro h3{width:100%;min-width:0;max-width:100%;font-size:28px;line-height:1.3}
 #workspace .content-intro>button{width:100%}
 #workspace .content-intro>p{font-size:18px}
 #workspace #read-reports{font-size:18px;min-height:48px}
 #workspace .account-page .account-eyebrow{font-size:16px;line-height:1.5;letter-spacing:.4px}
 #workspace .painted-ranking-table td:nth-child(3),#workspace .painted-ranking-table td:nth-child(3):before{font-size:16px;line-height:1.5}
 #workspace .ranking-crew,#workspace .ranking-you{font-size:16px;line-height:1.5}
 #workspace .tavern-page .chat-compose label{font-size:18px}
 #workspace .tavern-page .chat-message time{font-size:16px}
 #workspace .captain-standing{display:grid;grid-template-columns:64px minmax(0,1fr);gap:18px 16px;align-items:center;padding:20px}
 .standing-medallion{grid-column:1;grid-row:1}.standing-identity{grid-column:2;grid-row:1;min-width:0;width:100%}
 #workspace .standing-identity .eyebrow{display:block;font-size:16px;line-height:1.5;letter-spacing:0;margin-bottom:8px}
 #workspace .standing-identity h3{font-size:30px;line-height:1.2}
 #workspace .standing-identity p{font-size:18px;line-height:1.5;margin-top:8px}
 .standing-summary{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;border-top:1px solid #deb56866;padding-top:16px}
 .standing-summary .standing-position,.standing-summary .standing-score{margin:0;padding:0;border:0;min-width:0;text-align:left}
 .standing-summary small{font-size:16px;letter-spacing:0}.standing-summary strong{font-size:30px;line-height:1.3}
 .painted-ranking-table table{min-width:0;width:100%}
 body[data-player=guest] .topbar #account>[data-auth=login]:after{content:'Konto';font:16px var(--font-body)}
}

.stock-detail{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:24px 0}.stock-detail-row{display:flex;align-items:center;gap:12px;padding:14px;background:#d4b76c22;border:1px solid #bca06655;min-width:0}.stock-detail-row img{width:44px;height:44px;object-fit:contain}.stock-detail-row span,.stock-detail-row strong,.stock-detail-row small{display:block}.stock-detail-row strong{font:24px/1.5 var(--font-body)}.stock-detail-note{font-size:16px}
@media(max-width:950px){#workspace .topbar .resource{padding:10px 9px 12px;min-height:94px;min-width:0;cursor:pointer;text-align:left;font-size:18px}#workspace .resource:focus-visible{outline:3px solid #ffe5a0;outline-offset:3px}#modal .stock-detail{grid-template-columns:1fr;gap:12px}#modal .stock-detail-row{padding:16px;gap:16px}#modal .stock-detail-row img{width:52px;height:52px}#modal .stock-detail-row span{font-size:18px}#modal .stock-detail-row strong{font-size:26px}#modal .stock-detail-row small,#modal .stock-detail-note{font-size:16px}}

@media(max-width:950px){#workspace #content-page>.content-intro p{font-size:18px;line-height:1.65}#workspace #chat-form>label{font-size:18px;line-height:1.6}}

@media(max-width:950px){#modal .voyage-ships>div{color:#4d2e18}#modal .voyage-ships label,#modal .voyage-ships label span,#modal .voyage-ships small{color:#51321d}#modal .voyage-ships input{color:#402713;background:#fff0c9;border-color:#976e3d;font-size:20px}}

@media(max-width:950px){.map-controls{flex-direction:column}.map-controls>span{width:auto;height:1px}}
@media(max-width:950px) and (max-height:600px) and (orientation:landscape){
 :root{--mobile-helm:68px;--mobile-dock:66px}
 .current-island small{display:none}.helm{padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:8px}
 .map-card{height:calc(var(--game-height,100dvh) - var(--mobile-helm) - var(--mobile-dock) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:180px;max-height:none}
 .map-controls{flex-direction:row;bottom:12px;left:12px}.map-controls>span{width:1px;height:32px;margin:8px 3px}
 .map-legend,.map-region,.map-compass{display:none}.chart-overview-wrap{bottom:12px;right:12px}
 #mobile-dock button{min-height:54px}.map-toolbar{top:10px}
}

@media(max-width:950px){#modal .modal-top>button[data-close]{display:grid;place-items:center;width:48px;height:48px;min-width:48px;padding:0;font-size:28px;line-height:1;border:1px solid #bd9b5b;background:#0a4844;color:#ffe6b1;border-radius:4px}}

@media(max-width:950px){.header-harbor-caption{display:none}.current-island small #header-coordinates{font-size:16px}}

/* Five readable island classes; compact circular symbols match the chart. */
@media(max-width:950px){
 .map-legend{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 10px;padding:9px}
 .map-legend>.legend-item{min-height:20px;gap:6px;white-space:normal}
 .map-legend .legend-label{font:16px/20px var(--font-body)}
 .map-legend .legend-marker{flex-basis:20px;width:20px;height:20px;border-radius:50%;transform:none}
 .map-legend .legend-marker svg{width:14px;height:14px}
 .map-legend .legend-free .legend-marker svg{width:20px;height:20px}
 .map-legend>.legend-item:last-child{grid-column:1/-1}
}
@media(max-width:639px) and (orientation:portrait){
 .map-controls{bottom:148px}.chart-overview-wrap{bottom:142px}
}
@media(min-width:640px) and (max-width:950px){
 .map-legend{grid-template-columns:repeat(3,minmax(0,1fr))}
 .map-legend>.legend-item:last-child{grid-column:auto}
}
@media(min-width:640px) and (max-width:950px) and (min-height:601px){
 .map-controls{bottom:112px}.chart-overview-wrap{bottom:96px}
}

/* Keep long ship names intact even when a phone reserves room for a scrollbar. */
@media(max-width:950px){
 #workspace .header-ship{padding-inline:6px!important}
 #workspace .header-ship small{font-size:15px;white-space:nowrap;overflow-wrap:normal}
}

/* Keep portrait selection and its save action together; only the gallery scrolls. */
@media(max-width:950px){
 #modal.avatar-dialog .modal-inner{display:flex;flex-direction:column;max-height:calc(var(--game-height,100dvh) - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:hidden}
 #modal.avatar-dialog .modal-top,#modal.avatar-dialog .avatar-picker-intro,#modal.avatar-dialog .avatar-picker-footer{flex-shrink:0}
 #modal.avatar-dialog #avatar-form{display:flex;flex-direction:column;min-height:0;overflow:hidden}
 #modal.avatar-dialog .avatar-gallery{flex:1 1 auto;min-height:80px}
 #modal.avatar-dialog .avatar-picker-footer .form-error:empty{display:none}
}

/* Short visits: keep the next command close to its cost and effect. */
@media(max-width:950px){
 #workspace .topbar{padding-top:calc(var(--mobile-helm) + env(safe-area-inset-top) + 8px);padding-bottom:10px}
 #workspace .island-command-strip{gap:6px}
 #workspace .topbar .resource{min-height:64px;padding:7px 9px}
 #workspace .topbar .resource strong{font-size:23px;line-height:26px;margin-top:1px}
 #workspace .topbar .resource-icon{width:22px;height:22px;right:5px;top:7px}
 #workspace .topbar #resources .rate{display:none!important}
 #workspace #inventory-toggle{grid-template-columns:minmax(0,1fr) 20px;min-height:48px;padding:8px 12px;gap:0 8px}
 #workspace #inventory-toggle>span:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #workspace #inventory-toggle #mobile-harbor-total{grid-column:1;grid-row:1;font-size:18px;line-height:1.3}
 #workspace #inventory-toggle .inventory-chevron{grid-column:2;grid-row:1;font-size:22px}

 #workspace .scene-banner,
 body[data-view=island] #workspace .scene-banner{min-height:78px;padding:12px 15px;margin-bottom:12px}
 #workspace .scene-banner>span{display:none}
 #workspace .scene-banner h3{font-size:29px;line-height:1.1;margin:0}
 #workspace .scene-banner p{font-size:16px;line-height:1.35;margin:5px 0 0}
 body[data-view=island] #workspace .scene-banner p{display:none}
 #workspace .content-intro{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;margin:10px 0}
 #workspace .content-intro h3{width:auto;flex:1 1 130px;font-size:25px;line-height:1.2}
 #workspace .content-intro>button{width:auto;flex:0 1 auto;font-size:16px;padding:10px 12px;min-height:48px}
 #workspace .plan-shortcut{min-height:48px;margin:0 0 8px;padding:8px 12px;font-size:18px}
 #workspace .queue{gap:8px;padding:10px 12px!important;margin:10px 0;font-size:18px!important;line-height:1.35}
 #workspace .queue time{white-space:nowrap}

 #workspace .illustrated-cards,
 #workspace .progress-cards,
 #workspace .troop-cards{grid-template-columns:minmax(0,1fr);gap:12px}
 #workspace .building-card.illustrated-card,
 #workspace .progress-card,
 #workspace .troop-card{position:relative;display:grid;grid-template-columns:72px minmax(0,1fr);align-items:start;gap:12px;padding:12px;border-width:3px;overflow:hidden}
 #workspace .building-card .card-painting,
 #workspace .building-card .legacy-building,
 #workspace .progress-card>img,
 #workspace .troop-card>img{width:72px;height:72px;min-height:0;max-height:72px;aspect-ratio:1;margin:0;padding:0;border:1px solid #a87b3c66;object-fit:contain;align-self:start}
 #workspace .card-info,
 #workspace .progress-card>div,
 #workspace .troop-card>div{position:static;display:flex;flex-direction:column;gap:5px;min-width:0;padding:0;background:none;border:0}
 #workspace .card-info:before{display:none}
 #workspace .card-info h3,
 #workspace .progress-card h3,
 #workspace .troop-card h3{order:0;min-height:0;margin:0;padding:0;font-size:24px;line-height:1.15;overflow-wrap:normal}
 #workspace .card-info .level,
 #workspace .progress-card .level,
 #workspace .troop-card .level{order:1;position:static;margin:0;padding:0;min-height:0;border:0;box-shadow:none;background:none;font-size:18px;line-height:1.3}
 #workspace .card-info .level small{font-size:16px}
 #workspace .card-info .building-effect{order:2;font-size:16px;line-height:1.35}
 #workspace .card-info .card-explanation{order:3;position:static;margin:0;min-height:0}
 #workspace .card-info .card-explanation summary{position:absolute!important;inset:96px auto auto 12px;width:72px;min-width:48px;min-height:48px;height:auto;padding:8px 4px;gap:4px;font-size:16px;line-height:1.3}
 #workspace .card-info .card-explanation summary:after{font-size:16px}
 #workspace .card-info .card-explanation p{margin:0;padding:4px 0;font-size:18px;line-height:1.4}
 #workspace .card-info .costs,
 #workspace .progress-card .costs,
 #workspace .troop-card .costs{font-size:18px;line-height:1.4;gap:5px 9px;margin:2px 0;flex-wrap:wrap}
 #workspace .card-info>.costs{order:4}
 #workspace .costs img{width:20px;height:20px}
 #workspace .card-info>.duration{order:5}
 #workspace .card-info .duration,
 #workspace .progress-card .duration,
 #workspace .training-estimate{display:flex;align-items:center;gap:5px;margin:0;font-size:16px;line-height:1.4}
 #workspace .card-info>button{order:6}
 #workspace .card-info button,
 #workspace .progress-card button,
 #workspace .troop-card button{min-height:48px;margin:3px 0 0;padding:10px 9px;font-size:18px;line-height:1.25;width:100%}
 #workspace .card-info .prerequisite-link,
 #workspace .progress-card .prerequisite-link,
 #workspace .troop-card .prerequisite-link{font-size:18px;min-height:48px}
 #workspace .ship-cards .card-info .ship-strength{order:2;margin:1px 0;font-size:16px;line-height:1.35;gap:8px;flex-wrap:wrap}
 #workspace .ship-cards .card-info .ship-strength svg{width:18px;height:18px}
 #workspace .ship-cards .card-info>div[id^=ship-cost]{order:4}
 #workspace .ship-cards .card-info>.prerequisite-link{order:4}
 #workspace .ship-cards .card-info form{order:5;display:grid;grid-template-columns:78px minmax(0,1fr);gap:6px 8px;align-items:center;margin:2px 0 0}
 #workspace .ship-cards form>.sr-only{position:static;display:block;grid-column:1/-1;width:auto;height:auto;clip-path:none;overflow:visible;white-space:normal;font-size:18px;margin:0;line-height:1.3;color:#51321d}
 #workspace .ship-cards .card-info form input{width:78px;min-height:48px;margin:0;padding:9px 6px;font-size:18px}
 #workspace .ship-cards .card-info form .duration{font-size:16px;text-align:left}
 #workspace .ship-cards .card-info form button{grid-column:1/-1;margin:0}
 #workspace .progress-card p,
 #workspace .troop-card p{order:2;margin:1px 0;min-height:0;font-size:18px;line-height:1.4}
 #workspace .progress-card .prerequisite-link,
 #workspace .troop-card .prerequisite-link{order:3}
 #workspace .progress-card .costs{order:4}
 #workspace .progress-card .duration{order:5}
 #workspace .progress-card>div>.primary{order:6}
 #workspace .troop-card .ship-strength{order:3;margin:2px 0;font-size:16px;line-height:1.35;gap:9px;flex-wrap:wrap}
 #workspace .troop-card>div>div[id^=troop-cost]{order:4}
 #workspace .troop-card form{order:5;display:grid;grid-template-columns:minmax(0,1fr) 78px;gap:6px 8px;align-items:center;margin:0}
 #workspace .troop-card form label{margin:0;font-size:18px;line-height:1.3}
 #workspace .troop-card form input{width:78px;min-height:48px;margin:0;padding:9px 6px;font-size:18px}
 #workspace .troop-card form .training-estimate{grid-column:1/-1}
 #workspace .troop-card form button{grid-column:1/-1;margin:0}

 /* Counts are already present in the mobile filters and harbour status. */
 #workspace .fleet-overview{display:none}
 #workspace .fleet-overview-card{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:7px;padding:9px;min-height:66px}
 #workspace .fleet-overview-card>img{width:28px;height:34px}
 #workspace .fleet-overview-card strong{font-size:22px;line-height:1.1}
 #workspace .fleet-overview-card span{font:16px/1.2 var(--font-body);margin-top:2px}
 #workspace .painted-fleet-row{grid-template-columns:54px minmax(0,1fr);gap:9px 10px;padding:12px;margin-bottom:12px}
 #workspace .fleet-painting{min-height:60px}
 #workspace .fleet-painting>img{width:54px;height:60px}
 #workspace .fleet-mission-ribbon{display:none}
 #workspace .fleet-order h3{font-size:25px;line-height:1.15;margin:0 0 5px}
 #workspace .fleet-captain{gap:6px;font-size:16px}
 #workspace .fleet-captain>img{width:24px;height:24px}
 #workspace .fleet-order .painted-ship-tokens{gap:6px;margin-top:5px;flex-wrap:wrap}
 #workspace .fleet-order .painted-ship-token>img{width:30px;height:30px}
 #workspace .fleet-order .painted-ship-token strong{font-size:20px}
 #workspace .fleet-order .troop-tokens{gap:10px;margin-top:5px}
 #workspace .fleet-order .troop-tokens img{width:20px;height:28px}
 #workspace .fleet-order .troop-tokens span{font-size:18px}
 #workspace .fleet-cargo{gap:8px;font-size:18px;margin-top:5px;flex-wrap:wrap}
 #workspace .fleet-cargo img{width:20px;height:20px}
 #workspace .painted-fleet-row .fleet-route{padding:0}
 #workspace .fleet-route-port{font-size:18px;line-height:1.3}
 #workspace .fleet-route .voyage-progress{margin:9px 8px}
 #workspace .fleet-time{display:grid;grid-template-columns:minmax(0,1fr) 132px;align-items:center;gap:2px 8px;padding:8px 0 0}
 #workspace .fleet-time>small{grid-column:1;margin:0;font-size:16px;line-height:1.25}
 #workspace .fleet-time>small:first-child{grid-row:1}
 #workspace .fleet-time>strong{grid-column:1;grid-row:2;font-size:23px;line-height:1.2}
 #workspace .fleet-time>small:nth-of-type(2){grid-row:3}
 #workspace .fleet-time>.text-button{grid-column:2;grid-row:1/4;min-height:48px;padding:9px;font-size:18px}

 #workspace .battle-card{padding:12px}
 #workspace .battle-card h3{font-size:28px;margin:5px 0 10px}
 #workspace .battle-card h4{font-size:22px;line-height:1.15;margin:5px 0}
 #workspace .battle-card .battle-round{gap:4px;padding-bottom:10px;font-size:18px;line-height:1.35}
 #workspace .battle-card .battle-forces{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0;align-items:start}
 #workspace .battle-forces section{padding:8px;min-width:0}
 #workspace .battle-forces small{font-size:16px;line-height:1.3;letter-spacing:0}
 #workspace .battle-ships{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 #workspace .battle-ships>div{min-width:0;max-width:none}
 #workspace .battle-ships strong{font-size:20px;line-height:1.3}
 #workspace .battle-forces .troop-tokens{gap:7px;justify-content:center;flex-wrap:wrap;margin-top:7px}
 #workspace .battle-forces .troop-tokens img{width:18px;height:28px}
 #workspace .battle-forces .troop-tokens span{font-size:18px;gap:3px}
 #workspace .fort-health{padding:8px;gap:7px;font-size:18px;line-height:1.35}
 #workspace .battle-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
 #workspace .battle-actions button{width:100%;min-width:0;min-height:48px;padding:10px 8px;font-size:18px}
 #workspace .battle-actions button:only-child{grid-column:1/-1}
 #workspace .battle-playback{margin:14px 0 8px}
 #workspace .battle-playback canvas{aspect-ratio:3/1;object-fit:contain}
 #workspace .battle-playback>div{display:grid;grid-template-columns:minmax(0,1fr) 112px;align-items:end;gap:8px;margin:8px 0}
 #workspace .battle-playback label{min-width:0;width:100%;max-width:none;font-size:18px;line-height:1.3}
 #workspace .battle-playback select{min-height:48px;margin:4px 0 0;padding:8px;font-size:18px}
 #workspace .battle-playback button{width:100%;min-width:0;min-height:48px;padding:8px;font-size:16px}
 #workspace .battle-playback>small{font-size:16px;line-height:1.35}
 #workspace .battle-history{margin-top:8px}

 #workspace .plan-options{gap:10px;margin-top:14px}
 #workspace .plan-building-card{grid-template-columns:60px minmax(0,1fr);gap:8px;padding:10px}
 #workspace .plan-building-icon{width:60px;height:60px}
 #workspace .plan-building-info .costs{font-size:18px;gap:5px}
 #workspace .report{padding:14px;margin-bottom:12px}
 #workspace .report h3{font-size:26px;line-height:1.2;margin-top:8px}
 #workspace .report p{font-size:18px;line-height:1.45;margin-top:8px}

 /* A contract title keeps its column even beside the leave action. */
 #workspace .brotherhood-page .crew-contract-header{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px;align-items:center}
 #workspace .brotherhood-page .crew-contract-header .crew-standard{grid-column:1;grid-row:1;width:64px;height:64px}
 #workspace .brotherhood-page .crew-contract-header>div{grid-column:2;grid-row:1;min-width:0;width:100%}
 #workspace .brotherhood-page .crew-contract-header h3{width:100%;min-width:0;flex:none;font-size:28px;line-height:1.15;margin:3px 0;overflow-wrap:normal}
 #workspace .brotherhood-page .crew-contract-header>button{grid-column:1/-1;width:100%;margin:0}
}

/* Leave the centre of the phone's chart free for the selected island. */
@media(max-width:639px) and (orientation:portrait){
 .chart-overview-wrap{top:78px;right:12px;bottom:auto;padding:4px}
 .chart-overview-wrap canvas{width:92px;height:64px}
 .map-region{top:86px;left:12px;right:120px;font-size:21px;line-height:1.2;text-align:left}
 .map-compass{display:none}
}

@media(min-width:600px) and (max-width:950px){
 #workspace .illustrated-cards:not(.ship-cards),
 #workspace .progress-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
