/* Touch surfaces share one readable treatment; original artwork stays in content. */
body.naval-mobile{--naval-ui-font:system-ui,-apple-system,"Segoe UI",sans-serif;--font-body:var(--naval-ui-font);--font-display:var(--naval-ui-font);--ink:#f2e4c8;--muted-ink:#c5d3d1;--paper:#142b31;--paper-dark:#12343b;--paper-border:#b59c67;--paper-image:none;--touch-ink:#f2e4c8;--touch-surface:#12343b;--touch-raised:#12343b;--touch-line:#b59c67;font-family:var(--naval-ui-font);-webkit-text-size-adjust:100%;text-size-adjust:100%}
body.naval-mobile-adapting :is(#hud,#initiative,#ownedFleet,body>header){visibility:hidden!important}
body.naval-mobile :is(#preparation,#fireTree,#missionMap,dialog,#inspect,#battleJournal,#instructions,#ammoMenu,#sailMenu,.ship-ability-info,#hover,#boardingLoot,#pwaChrome,.ship-appearance-editor){font-family:var(--naval-ui-font)!important;color:var(--touch-ink)}
body.naval-mobile :is(#preparation,#fireTree,#missionMap,dialog,#inspect,#battleJournal,#instructions,#ammoMenu,#sailMenu,.ship-ability-info,#hover,#boardingLoot,#pwaChrome,.ship-appearance-editor) :is(h1,h2,h3,p,span,small,button,input,select,b,strong,label,li,dt,dd,em){font-family:var(--naval-ui-font)!important;letter-spacing:0;text-shadow:none}
body.naval-mobile :is(dialog,#inspect,#battleJournal,#instructions,#ammoMenu,#sailMenu,.ship-ability-info,#hover,#boardingLoot,#prepPopover,#prepTooltip,.mobile-port-item-details,.ship-appearance-editor,.ft-instance-menu){background:var(--touch-surface)!important;background-image:none!important;border:1px solid var(--touch-line)!important;border-radius:4px;box-shadow:0 8px 24px #020f1570;color:var(--touch-ink)!important}
body.naval-mobile :is(dialog,#inspect,#battleJournal,#instructions,#ammoMenu,#sailMenu,.ship-ability-info,#hover,#boardingLoot,#prepPopover,#prepTooltip,.mobile-port-item-details,.ship-appearance-editor,.ft-instance-menu) :is(p,span,small,b,strong,label,li,dt,dd,em){color:var(--touch-ink)!important;font-size:16px!important;line-height:1.35!important;text-shadow:none!important}
body.naval-mobile :is(dialog,#inspect,#battleJournal,#instructions,#ammoMenu,#sailMenu,.ship-ability-info,#hover,#boardingLoot,#prepPopover,#prepTooltip,.ship-appearance-editor,.ft-instance-menu) :is(h1,h2,h3){color:var(--touch-ink)!important;font-size:20px!important;line-height:1.2!important;font-weight:650!important;text-transform:none!important}
body.naval-mobile :is(#preparation,#fireTree,#missionMap,dialog,#inspect,#battleJournal,#instructions,#ammoMenu,#sailMenu,.ship-ability-info,#hover,#boardingLoot,#pwaChrome,.ship-appearance-editor,#mainMenu) :is(button,input,select),body.naval-mobile :is(#pwaInstall,#pwaSavesOpen,#menuAppTools button){min-height:44px;border:1px solid var(--touch-line)!important;border-image:none!important;border-radius:4px!important;background:var(--touch-raised)!important;background-image:none!important;clip-path:none!important;color:var(--touch-ink)!important;font-family:var(--naval-ui-font)!important;font-size:16px!important;font-weight:600!important;line-height:1.25!important;letter-spacing:0!important;text-shadow:none!important;box-shadow:none!important;filter:none}
body.naval-mobile :is(#preparation,#fireTree,#missionMap,dialog,#inspect,#battleJournal,#instructions,#ammoMenu,#sailMenu,.ship-ability-info,#hover,#boardingLoot,#pwaChrome,.ship-appearance-editor,#mainMenu) button:disabled{opacity:.48;cursor:default}
body.naval-mobile :is(#preparation,#fireTree,#missionMap,dialog,#inspect,#battleJournal,#ammoMenu,#sailMenu,.ship-ability-info) button:is([aria-pressed=true],[aria-selected=true],.active,.current){border-color:#d3b46f!important;background:#29494b!important;color:#fff1cc!important}
body.naval-mobile :is(#preparation,#fireTree,#missionMap,dialog,#inspect,#battleJournal,#ammoMenu,#sailMenu,.ship-ability-info,#pwaChrome,.ship-appearance-editor,#mainMenu) :focus-visible{outline:2px solid #e3c884!important;outline-offset:2px!important}
body.naval-mobile :is(#pwaPackSize,#pwaDownloadStatus,#pwaStorage h2,#pwaInstallHelp h2,#pwaHelpSteps li){color:var(--touch-ink)!important;font:600 16px/1.35 var(--naval-ui-font)!important}
body.naval-mobile :is(#pwaStorage,#pwaInstallHelp)::backdrop{background:#061820e6}
body.naval-mobile #pwaSavesOpen{background:var(--touch-raised)!important;color:var(--touch-ink)!important;text-decoration:none}
body.naval-mobile :is(#preparation,#fireTree,#missionMap,#inspect,#battleJournal,dialog,#pwaChrome,.ship-appearance-editor) img:is([src$="/close.png"],[src$="/left.png"],[src$="/right.png"]),body.naval-mobile #pwaInstall img{filter:brightness(0) invert(.93)}
body.naval-mobile :is(.mobile-port-item-details,.mf-detail-panel,.prep-bottom,.prep-posts,.officer-candidate){--ink:var(--touch-ink);--muted-ink:#c5d3d1}
body.naval-mobile :is(#preparation,#fireTree,#missionMap) :is(.mobile-port-slot-caption,.ft-stats small,.ft-caption span,.prep-equipment h2,.prep-posts h2){color:var(--touch-ink)!important}
body.naval-mobile #toast{background:#142b31;color:#f2e4c8;border:1px solid #b59c67;border-radius:4px;font:600 16px/1.35 var(--naval-ui-font);box-shadow:0 4px 18px #020f1560;max-width:calc(100vw - 24px);box-sizing:border-box}
body.naval-mobile ::selection{background:#c5ac71;color:#102930}
body.naval-mobile input{caret-color:#f2e4c8}

body.naval-mobile #preparation .prep-officer-info :is(small,.officer-level){color:var(--touch-ink)!important}
body.naval-mobile #preparation .port-fleet-type-slot{height:24px!important;overflow:visible!important}
body.naval-mobile :is(.fullscreen-button,.global-sound-button,#sound,#menuSound){background:var(--touch-surface)!important;background-image:none!important;border:1px solid var(--touch-line)!important;border-radius:4px!important;box-shadow:none!important;clip-path:none!important;color:var(--touch-ink)!important}
body.naval-mobile :is(.fullscreen-button,.global-sound-button,#sound,#menuSound)::before,body.naval-mobile :is(.fullscreen-button,.global-sound-button,#sound,#menuSound)::after{display:none!important}

body.naval-mobile #missionMap :is(.mission-map-heading,#mapMissionDock[data-anchored]){background:var(--touch-surface)!important;background-image:none!important;color:var(--touch-ink)!important;border:1px solid var(--touch-line);border-radius:4px;box-shadow:none!important}
body.naval-mobile #missionMap .mission-map-heading{padding:4px;box-sizing:border-box;height:52px}
body.naval-mobile #missionMap :is(.mission-map-heading h1,.map-currencies b,.map-mission-summary h2,.map-mission-index,.map-mission-state,.map-enemies figcaption,.mf-enemy-pages span){color:var(--touch-ink)!important;font-family:var(--naval-ui-font)!important;text-shadow:none!important}
body.naval-mobile #missionMap .mission-map-heading h1{font-size:16px!important;line-height:1.2!important}
body.naval-mobile #missionMap .map-mission-summary h2{font-size:20px!important;line-height:1.2!important}
body.naval-mobile #missionMap .map-mission-point{border-radius:50%!important;color:var(--touch-ink)!important}
body.naval-mobile #missionMap .map-mission-point.selected{background:#29494b!important}
body.naval-mobile #missionMap .map-mission-point.locked{color:#ccd4ca!important}
body.naval-mobile #fireTree .ft-detail-title{padding-top:2px}

body.naval-mobile :is(#inspect,#hover,#instructions,#boardingLoot,.ship-ability-info){left:50%!important;right:auto!important;width:min(680px,calc(100vw - 16px))!important;min-width:0!important;max-width:calc(100vw - 16px)!important;padding:12px!important;box-sizing:border-box!important;transform:translateX(-50%)!important;margin:0!important}
body.naval-mobile #inspect .close-inspect{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
body.naval-mobile #missionMap .map-place-labels{color:#3e3526!important}
body.naval-mobile #missionMap .map-place-labels text{color:#3e3526!important}

body.naval-mobile :is(#closeAmmo,#closeHelp,.ship-ability-info-close,.ship-ability-choice-help){width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important}
body.naval-mobile.mobile-battle-v3 #hud #mbShipHost .ship-ability-cost{right:0!important;bottom:0!important;min-width:20px!important;height:20px!important;padding:0 2px!important;border-width:1px!important}

/* Hidden world labels must not trigger Chrome mobile shrink-to-fit. */
body.naval-mobile #shipLabels{width:var(--naval-vw)!important;height:var(--naval-vh)!important;overflow:hidden!important;contain:layout paint!important}

/* Color choices retain their actual palette; closing a service restores port chrome. */
body.naval-mobile :is(#preparation,.ship-appearance-editor) .appearance-swatch{background:var(--sail-color)!important}
body.naval-mobile :is(#preparation,.ship-appearance-editor) .appearance-colors label{font-size:0!important;line-height:0!important}
body.naval-mobile.naval-port-focus .ship-appearance-editor>a{min-height:44px;display:flex;align-items:center;box-sizing:border-box}

/* Touch actions carry their own names; keyboard prompts belong to desktop. */
.help-action-label{display:none}
body.naval-mobile :is(kbd,.command-key,[data-keyboard-hint]){display:none!important}
body.naval-mobile #instructions .help-action-label{display:block;font:600 16px/20px var(--naval-ui-font)!important}
body.naval-mobile #instructions .help-icons button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:44px!important;min-height:76px!important;padding:8px!important;touch-action:manipulation}
body.naval-mobile #instructions .help-icons img{width:32px;height:32px;margin:0}
body.naval-mobile button{touch-action:manipulation}

/* Keep touch actions readable and outside close/header hit areas. */
body.naval-mobile:is(.main-menu,.choosing-mission)>:is(.global-sound-button,.fullscreen-button){display:none!important}
body.naval-mobile #inspect .inspect-orbit{gap:8px;padding-right:52px;box-sizing:border-box}
body.naval-mobile #inspect .inspect-orbit button{flex:0 0 44px!important;width:44px!important;min-width:44px!important;height:44px!important}
body.naval-mobile #inspect .inspect-orbit span{flex:1;min-width:0;font:600 16px/20px var(--ui-font,Arial,sans-serif)!important}
body.naval-mobile #inspect .inspect-orbit span:after{content:none}
body.naval-mobile #missionMap .mission-map-stage{top:72px!important}
