/* ARCA 0.48.1: CSS-only UI corrections, scoped to the live shell. */
:root,:root[data-theme="dark"]{
  --mint:#8aa495;--green:#869f8a;--shell-accent:#819b82;--shell-screen-text:#b4c2b0;
  --ui-accent:#859b87;--crt:#93a791;--crt-bright:#b8c8b7;
  --ui-highlight:#abc0ad;--pix-accent:#859b87;--shell-key-text:#c4cec3;
}
:root[data-theme="light"]{
  --mint:#496d5c;--green:#55755f;--shell-accent:#58715a;--shell-screen-text:#344c3a;
  --ui-accent:#58745e;--crt:#4f6b55;--crt-bright:#344e3b;
  --ui-highlight:#416c50;--pix-accent:#58745e;
  --shell-key-text:#354b3a;
}
/* Stop dark-only component islands from leaking into light mode. */
:root[data-theme="light"] #game-shell :is(.scene-choice,.scene-module,.research-evidence,.v24-hub-list,.v9-option-list,.v10-projects,.v17-card-list,.v29-unified,.regional-guide-v478,.pda-camp-step,.pda-camp-services,.camp478,.v24-hub,.pda-status-top,.pda-route-story){color:var(--shell-text)!important;border-color:var(--shell-line)!important}
:root[data-theme="light"] #game-shell :is(.scene-choice,.scene-module,.camp478,.v29-unified,.research-card,.v17-card,.project-row,.v24-hub,.v9-option-list>div,.pda-camp-services){background:var(--shell-panel)!important}
:root[data-theme="light"] #game-shell :is(.field-terminal,.terminal-display,.terminal-screen,.chat-panel,.pda-chat-room,.gift-modal){color:var(--ui-text)!important}
:root[data-theme="light"] #game-shell :is(.pda-chat-notice,.gift-modal,.pda-screen-stack .chat-panel,.private-message p,.local-line477,.pda-camp-shortcuts){background:var(--map-paper)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
/* Physical keys: inherit the active theme, including HOME on white theme. */
:root #game-shell .terminal-dock button,
:root #game-shell .terminal-dock #terminal-nav-home{background:linear-gradient(160deg,var(--shell-key),var(--shell-metal))!important;color:var(--shell-key-text)!important;border-color:var(--shell-metal-edge)!important}
:root[data-theme="light"] #game-shell .terminal-dock button,
:root[data-theme="light"] #game-shell .terminal-dock #terminal-nav-home{background:linear-gradient(160deg,#d6d9c9,#adb5a5)!important;color:#354b3b!important;border-color:#889883!important}
:root #game-shell .terminal-dock :is(svg,svg path){stroke:currentColor!important}
/* Center every actual icon in its control, not at its baseline/bottom corner. */
#game-shell :is(#notice-chat477,#notice-close477,#gift-close477,.pda-icon-action,.pda-contact-actions button,.pda-app-heading .terminal-subtabs button,.terminal-dock button,.pda-bag-actions button,.mini-map-controls button,.map-zoom-tools button,#chat-room-back,.dialog-close){display:inline-flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;line-height:1!important;box-sizing:border-box;vertical-align:middle}
#game-shell :is(#notice-chat477,#notice-close477,#gift-close477,.pda-icon-action,.pda-contact-actions button,.pda-app-heading .terminal-subtabs button,.pda-bag-actions button) svg{display:block!important;position:static!important;flex:none!important;margin:0 auto!important;transform:none!important;stroke:currentColor!important}
#game-shell .notice-head button{width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;padding:5px!important;flex:0 0 28px!important}
#game-shell .notice-head svg{width:17px!important;height:17px!important}
/* Compact typography with readable Korean word wrapping. */
#game-shell :is(.pda-route-story p,.regional-guide-v478 p,.research-card p,.camp478-note,.v17-card p,.scene-module small,.module-caption,.local-line477,.private-message p){overflow-wrap:break-word;word-break:keep-all;line-break:auto;line-height:1.48!important;font-size:calc(10px * var(--type-scale,1))!important}
#game-shell :is(.scene-choice,.scene-module,.research-card,.v24-hub,.v17-card,.camp478) {min-width:0;overflow-wrap:break-word;word-break:keep-all}
/* Support status indication and vertically centered bag capacity. */
#game-shell #support-condition{display:inline-flex!important;align-items:center!important;min-height:25px;border:1px solid var(--shell-line)!important;border-left:3px solid var(--shell-accent)!important;background:var(--shell-raised)!important;color:var(--shell-text)!important;padding:3px 7px!important;margin:5px 0 4px!important;border-radius:2px;max-width:100%;font-size:9px!important}
#game-shell #support-condition.condition-critical{border-left-color:var(--shell-danger)!important;color:var(--shell-danger)!important}
#game-shell #left-bag-space{display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;min-height:34px;padding:6px 10px!important;line-height:1.3!important;white-space:nowrap}
/* Journal dates and compact chronological entries, non-sticky. */
:root #game-shell [data-terminal-screen="journal"] .log-day{display:block!important;position:static!important;top:auto!important;z-index:auto!important;background:transparent!important;padding:2px 0!important;margin:10px 0 5px!important;line-height:1.3!important}
:root #game-shell [data-terminal-screen="journal"] .log-day span{display:inline-block!important;padding:1px 5px!important;background:var(--ui-text)!important;color:var(--map-paper)!important;font-size:9px!important}
:root #game-shell [data-terminal-screen="journal"] .log-line{display:flex!important;flex-direction:column!important;gap:0!important;margin:0 0 5px!important;padding:0!important;line-height:1.35!important;position:static!important}
:root #game-shell [data-terminal-screen="journal"] .log-time{display:block!important;position:static!important;font:8px/1.25 var(--mono)!important;color:var(--ui-sub)!important;opacity:.78;white-space:nowrap;margin:0 0 1px!important;padding:0!important}
:root #game-shell [data-terminal-screen="journal"] .log-body{display:block!important;font-size:calc(10px * var(--type-scale,1))!important;line-height:1.44!important;padding:0!important;white-space:pre-wrap;overflow-wrap:break-word;word-break:keep-all}
/* Fogged map; data for never visited areas isn't rendered as a route/label. */
.pan-map [mask^="url(#fog-clear-"]{image-rendering:pixelated}
:root #route-map-detail:empty{display:none!important}
:root .pda-route-title481{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
:root .pda-route-title481 h4{font-size:12px!important;margin:0!important}
:root .pda-route-title481 small{font-size:9px!important;color:var(--ui-sub)}
:root .route-observation481{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:9px 0 5px;border-top:1px solid var(--ui-border);font-size:10px}
:root .route-observation481 span{font-size:9px!important;color:var(--ui-sub)!important}
:root .route-description481{margin:4px 0 12px}
:root .route-description481>strong{font-size:10px!important;display:block;margin:0 0 4px}
:root .route-description481>p{margin:0 0 4px!important}
:root #regional-guide-v478{padding-top:10px;border-top:1px solid var(--ui-border);margin-top:9px}
:root .regional-stats481{display:flex;flex-wrap:wrap;gap:3px 9px;font:9px/1.3 var(--mono);padding:4px 0}
:root .regional-stats481>span{white-space:nowrap}
:root .recommended-table{font-size:9px!important;margin:5px 0!important}
:root .recommended-table caption{font-size:9px!important;padding-bottom:3px}
:root .recommended-table :is(th,td){padding:3px 5px!important;font-size:9px!important}
/* Consistent one-column shared research evidence. */
#game-shell #colony-research :is(.research-list,.research-evidence-list,.v17-card-list,.v10-projects){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
#game-shell #colony-research .research-evidence{display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:7px 0;min-width:0}
#game-shell #colony-research :is(.research-title,.research-card,.research-evidence-name){overflow-wrap:break-word;word-break:keep-all;min-width:0}
#game-shell #colony-research :is(.research-cost,.research-effect,.v17-card small){font-size:9px!important;line-height:1.45!important}
#game-shell #colony-research :is(.research-card,.early-project,.v17-card)+:is(.research-card,.early-project,.v17-card){margin-top:10px!important}
#game-shell :is(.v24-hub-list,.v29-unified,.camp478-header,.v24-hub-list>div){min-width:0!important;white-space:normal!important;overflow-wrap:break-word;word-break:keep-all}
#game-shell .v24-hub-list :is(strong,b,span,small,p){min-width:0;max-width:100%;writing-mode:horizontal-tb!important;overflow-wrap:break-word!important;word-break:keep-all!important}
#game-shell .v29-unified{display:flex!important;flex-direction:row!important;flex-wrap:wrap;gap:6px;align-items:center}
#game-shell .v29-unified span{flex:1 1 150px;min-width:0}
/* One-row equal action choices on usable widths; desktop and mobile. */
#game-shell #primary-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;align-items:stretch!important}
#game-shell #primary-actions .scene-choice{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:34px!important;padding:6px 3px!important;font-size:clamp(9px,1vw,11px)!important;line-height:1.2!important;white-space:nowrap!important;text-align:center!important;letter-spacing:0!important;width:100%!important}
/* Secondary actions are short horizontal icon+title lines; explanation can wrap. */
#game-shell .scene-module-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
#game-shell .scene-module{display:flex!important;flex-direction:row!important;align-items:center!important;flex-wrap:wrap!important;justify-content:flex-start!important;gap:3px 7px!important;min-height:37px!important;padding:7px 9px!important;text-align:left!important}
#game-shell .scene-module strong{font-size:11px!important;line-height:1.35!important;white-space:nowrap!important;min-width:0}
#game-shell .scene-module small{font-size:9px!important;line-height:1.35!important;flex:1 1 115px}
/* Chat date separators and bottom-edge Kakao-style timestamps. */
#game-shell .chat-date481{margin:14px auto 10px!important;text-align:center;font:9px/1.4 var(--pixel);color:var(--ui-sub);width:max-content;max-width:100%;border:1px solid var(--ui-border);border-radius:20px;padding:3px 12px}
#game-shell .chat-bubble-row481{display:flex;align-items:flex-end;gap:5px;max-width:100%;min-width:0}
#game-shell .chat-bubble-row481>p{min-width:0;max-width:calc(100% - 47px);flex:0 1 auto}
#game-shell .chat-time481{font:8px/1.3 var(--mono);color:var(--ui-sub);white-space:nowrap;flex:none;padding:0 0 3px}
#game-shell .private-message.mine .chat-bubble-row481{flex-direction:row-reverse}
#game-shell .private-message.mine .chat-message-core481{text-align:right}
#game-shell .private-message.mine .chat-bubble-row481>p{text-align:left}
#game-shell .gift-message477 .chat-time481{display:block;text-align:right;margin-top:3px}
/* Automatic vault expansion button and locally scoped stock. */
#game-shell #vault-upgrade481{width:100%;margin-top:10px;min-height:32px;font-size:10px}
#game-shell [data-scene="campmanage"]>.panel,#game-shell [data-scene="archive"]>.panel{margin:6px 0 13px}
#game-shell #camp-circle-v478{display:none!important}
@media(max-width:740px){#game-shell #primary-actions .scene-choice{font-size:9px!important;padding:6px 2px!important}#game-shell .scene-module-grid{grid-template-columns:minmax(0,1fr)!important}#game-shell .scene-module small{flex:1 1 100px}}

/* Map detail is canonical; previous regional guide is not rendered twice. */
#game-shell #regional-guide-v478{display:none!important}
#game-shell .route-recommended481{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px;padding:7px 0 8px;margin-top:5px;border-bottom:1px solid var(--ui-border);font-size:10px}
#game-shell .route-recommended481>strong{font-size:10px!important}
#game-shell .route-recommended481 .regional-stats481{padding:0;gap:3px 11px}
#game-shell .route-unknown481{font-size:9px;color:var(--ui-sub)}
#game-shell .pda-route-story{padding:5px 0 7px!important;margin:8px 0 8px!important;background:transparent!important}
#game-shell .scene-inline-icon481{display:inline-flex;align-items:center;justify-content:center;width:16px;min-width:16px;line-height:1;font-size:14px;color:var(--shell-accent)}
#game-shell .scene-module small{flex-basis:100%!important;margin-left:23px;font-size:9px!important}
#game-shell #colony-research .v23-early-work{padding-top:15px!important;margin-top:16px!important;border-top:1px solid var(--shell-line)}
#game-shell #colony-research .v23-early-work .module-caption{font-size:9px!important}
#game-shell #work-hub-v24 :is(.v24-hub-list,.v24-hub-row){display:block;white-space:normal!important;overflow-wrap:break-word;word-break:keep-all}
/* Never overflow the fixed three-button primary deck, even on narrow phones. */
@media(max-width:370px){#game-shell #primary-actions{gap:3px!important}#game-shell #primary-actions .scene-choice{font-size:8px!important;letter-spacing:-.025em!important}}

#game-shell .vault-warning481{font-size:9px!important;line-height:1.5!important;color:var(--shell-muted)!important;padding:8px 1px;overflow-wrap:break-word;word-break:keep-all}
