/* Approved common phone layout. Original assets, action handlers and engine quotes
   are retained. Browser chrome is handled by visualViewport/dvh; installed clients
   get the extra space naturally, with OS-provided safe-area insets. */
.phone-refined #phone-shell{box-sizing:border-box;height:var(--mobile-viewport-height,100dvh)!important;max-width:none;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);overflow:hidden;background:#292330}
.phone-refined #phone-scroll,.phone-refined #phone-scroll>#phone-play{height:100%;min-height:0}
.phone-refined #phone-faithful .mini.dense{--players-band:78px;display:grid;width:100%;height:100%;max-width:none;transform:none;grid-template-columns:minmax(0,1fr);grid-template-rows:44px var(--players-band) 32px 32px minmax(0,1fr) 54px 88px 48px;gap:0;padding:0;background-size:cover;overflow:hidden;border-radius:0}
.phone-refined #phone-faithful .mini-header{grid-column:1;grid-row:1;padding:0 8px;gap:5px}
.phone-refined #phone-faithful .logo{width:145px;max-width:46%;height:35px}
.phone-refined #phone-faithful .round{width:auto;height:32px;min-width:76px;flex-direction:row;gap:4px;border-radius:8px;padding:3px 6px;font-size:11px;box-shadow:none}
.phone-refined #phone-faithful .round strong{font-size:16px}
.phone-refined #phone-faithful .mini-header .menu{width:44px;height:44px;min-height:44px;padding:6px}
.phone-refined #phone-faithful .players{grid-column:1;grid-row:2;display:grid;grid-template-columns:none!important;grid-auto-flow:column;grid-auto-columns:minmax(72px,1fr);overflow-x:auto;overflow-y:hidden;gap:4px;padding:4px 5px;scrollbar-width:thin;overscroll-behavior-x:contain;min-height:0}
.phone-refined #phone-faithful .player{height:100%;min-height:0;min-width:0;padding:3px 2px;display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;gap:2px}
.phone-refined #phone-faithful .player-line{height:auto;display:flex;flex-direction:row;justify-content:center;gap:2px;font:11px/1.1 Georgia,serif}
.phone-refined #phone-faithful .player-line img{height:14px;width:14px}
.phone-refined #phone-faithful .mobile-player-name{display:block;position:static;width:100%;max-width:100%;min-width:0;align-self:stretch;text-align:center;font:11px/1.1 Georgia,serif;color:#f1e1bd;min-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phone-refined #phone-faithful .player-stats{height:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;font:11px/1.1 system-ui,sans-serif}
.phone-refined #phone-faithful .player-stats>span{display:flex;align-items:center;justify-content:center;gap:2px;min-width:0}
.phone-refined #phone-faithful .player-stats .sw-symbol{width:12px;height:12px}
.phone-refined #phone-faithful .player-production{height:auto;display:block;margin:0;padding:2px 0 0;border-top:1px solid #b59b5e66;min-width:0}
.phone-refined #phone-faithful .player-production>small{display:none}
.phone-refined #phone-faithful .production-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;margin:0;font:11px/1.1 system-ui,sans-serif}
.phone-refined #phone-faithful .production-value{display:flex;align-items:center;justify-content:center;gap:1px;min-width:0}
.phone-refined #phone-faithful .production-resource,.phone-refined #phone-faithful .production-choice-symbol{display:flex;align-items:center;justify-content:center;width:auto;min-width:0;height:12px}
.phone-refined #phone-faithful .production-resource .sw-symbol{width:11px;height:11px}
.phone-refined #phone-faithful .production-choice-symbol .sw-symbol{width:8px;height:10px}
.phone-refined #phone-faithful .production-amount{font:11px/1.1 system-ui,sans-serif}
.phone-refined #phone-faithful .turn-strip{grid-column:1;grid-row:3;display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;min-height:32px;height:32px;padding:1px 6px;gap:4px;font:11px/1.1 Georgia,serif;white-space:nowrap;position:relative;z-index:3}
.phone-refined #phone-faithful .turn-strip>.company-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phone-refined #phone-faithful .turn-strip .company-symbol{width:15px;height:15px}
.phone-refined #phone-faithful .action-counter{flex:none;font-size:11px;gap:2px}
.phone-refined #phone-faithful .counter-values{font-size:11px}
.phone-refined #phone-faithful .turn-strip .online-compact-state{display:flex;flex-wrap:nowrap;gap:4px;min-height:28px;margin:0;padding:1px 3px;max-width:45%;border:0;border-radius:3px;background:transparent;font:11px/1.1 Georgia,serif!important;overflow:hidden}
.phone-refined #phone-faithful .online-compact-state>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phone-refined #phone-faithful .landscape-round{display:none}
.phone-refined #phone-faithful .mobile-event-row{grid-column:1;grid-row:4;display:flex;min-width:0;min-height:32px;overflow:hidden}
.phone-refined #phone-faithful .event{flex:1;display:flex;align-items:center;gap:5px;padding:2px 7px;min-width:0;min-height:32px;height:32px;font:11px/1.1 Georgia,serif;background:#725a414d;color:#35271c;overflow:hidden;text-align:left}
.phone-refined #phone-faithful .event>img{display:block!important;width:23px;height:23px;flex:0 0 23px;object-fit:cover;border-radius:50%;border:1px solid #a88750}
.phone-refined #phone-faithful .event>span:not(.event-cost){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phone-refined #phone-faithful .event .event-cost{flex:none;display:flex;gap:2px;align-items:center;margin-left:auto}
.phone-refined #phone-faithful .event-cost .sw-symbol{width:15px;height:15px}
.phone-refined #phone-faithful .mobile-next-event{min-width:60px;min-height:32px;font:11px Georgia,serif;padding:2px 5px;margin:0;background:#efdbb54d;color:#463222;border:1px solid #b59560;border-radius:4px;box-shadow:none}
.phone-refined #phone-faithful .middle{display:contents}
.phone-refined #phone-faithful main.board{grid-column:1;grid-row:5;width:100%;height:100%;min-height:0;min-width:0;display:grid;grid-template-columns:repeat(var(--mobile-columns,3),minmax(0,1fr));grid-template-rows:repeat(var(--mobile-rows,var(--world-rows)),minmax(106px,1fr))!important;gap:6px 5px;padding:7px 6px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;align-items:stretch}
.phone-refined #phone-faithful .board>.world{position:relative;height:100%;min-height:0;display:grid;grid-template-rows:minmax(38px,1fr) 22px 18px;align-items:stretch;padding:0;overflow:visible;border-radius:6px}
/* Follow the planet silhouette, using the desktop selection glow. */
.phone-refined #phone-faithful .board > .world:is(.selected, :focus-visible) {
  outline: none;
  box-shadow: none;
}
.phone-refined #phone-faithful .board > .world:is(.selected, :focus-visible) :is(.live-puck, .unknown-art) {
  filter: drop-shadow(0 0 2px #9fe9fa) drop-shadow(0 0 8px #36b5db88) drop-shadow(0 7px 6px #0009);
}
.phone-refined #phone-faithful .terrain-wrap{height:auto;min-height:38px;display:flex;align-items:center;justify-content:center;position:relative}
.phone-refined #phone-faithful .live-puck{display:block;flex:none;height:var(--mobile-art-height,42px);width:auto;aspect-ratio:var(--puck-ratio);max-width:calc(100% - 24px);max-height:none;transform:none;background-image:url(visuals/faithful/pucks.webp)}
.phone-refined #phone-faithful .unknown-art{height:var(--mobile-art-height,44px);width:calc(var(--mobile-art-height,44px)*1.35);max-width:calc(100% - 22px);max-height:none;object-fit:contain;padding:0;transform:none}
.phone-refined #phone-faithful .world-name{grid-row:2;position:relative;inset:auto;width:100%;max-width:140px;height:22px;min-height:22px;align-self:center;display:flex;align-items:center;justify-content:center;margin:auto;padding:2px 5px 3px;gap:2px;font:11px/1 Georgia,serif;background:var(--sw-plaque) center/100% 100% no-repeat;white-space:nowrap}
.phone-refined #phone-faithful .world-name .sw-symbol{width:11px;height:11px}
.phone-refined #phone-faithful .mobile-world-meta{grid-row:3;position:static;display:flex;align-items:center;justify-content:center;min-height:18px;height:18px;padding:0;margin:0;width:100%;background:none;border:0}
.phone-refined #phone-faithful .mobile-world-meta.empty{visibility:hidden}
.phone-refined #phone-faithful .infrastructure-marks{height:17px;min-height:17px;max-width:100%;gap:3px;padding:1px 4px;font-size:10px}
.phone-refined #phone-faithful .infrastructure-role{gap:2px}
.phone-refined #phone-faithful .infrastructure-symbol,.phone-refined #phone-faithful .infrastructure-symbol svg{width:12px;height:12px}
.phone-refined #phone-faithful .infrastructure-role img{width:12px;height:12px}
.phone-refined #phone-faithful .board .trait-face{position:absolute;top:0;left:0;right:auto;bottom:auto;display:flex;flex-direction:column;align-items:center;gap:1px;width:27px;height:43px;padding:0;margin:0;background:none!important;border:0!important;box-shadow:none!important;transform:none;z-index:3}
.phone-refined #phone-faithful .board .trait-face>img{position:static;width:23px;height:23px;object-fit:cover;border-radius:50%;display:block}
.phone-refined #phone-faithful .board .trait-face>b{position:static;width:auto;height:auto;background:none!important;padding:0;font:10px/1 Georgia,serif;white-space:nowrap;display:flex;gap:1px;color:#36291f}
.phone-refined #phone-faithful .board .trait-face>b .sw-symbol{width:11px;height:11px}
.phone-refined #phone-faithful .board .trait-number,.phone-refined #phone-faithful .board .trait-tooltip{display:none}
.phone-refined #phone-faithful .board .planet-research-badge{position:absolute;top:0;right:0;left:auto;bottom:auto;display:flex;flex-direction:column;align-items:center;justify-content:start;width:29px;height:43px;gap:1px;font:10px/1.2 Georgia,serif;color:#382b22;background:none!important;border:0!important;box-shadow:none!important;margin:0;padding:0;transform:none;z-index:3}
.phone-refined #phone-faithful .board .world>.planet-research-badge>.research-deck-mark{width:16px;height:23px;flex:0 0 auto}
.phone-refined #phone-faithful .occupants{bottom:3px;left:4%;right:4%;display:flex;flex-wrap:wrap;justify-content:center;gap:1px;z-index:2}
.phone-refined #phone-faithful .occupants .unit-token{height:21px;min-width:18px;padding:0;background:none;border:0;outline:0;box-shadow:none}
.phone-refined #phone-faithful .occupants .unit-token img{height:21px;width:21px;object-fit:contain}
.phone-refined #phone-faithful .inspector{grid-column:1;grid-row:6;padding:4px 7px;min-width:0;min-height:0;overflow:hidden;border-inline:0}
.phone-refined #phone-faithful .mobile-context{display:flex;align-items:center;justify-content:space-between;gap:7px;min-height:44px;height:44px;width:100%}
.phone-refined #phone-faithful .mobile-context>.detail-name{display:flex;align-items:center;gap:3px;min-width:0;min-height:44px;font:16px/1.2 Georgia,serif;padding:2px 1px;text-align:left;white-space:nowrap}
.phone-refined #phone-faithful .mobile-context>.production{display:flex;align-items:center;font:11px Georgia,serif;gap:2px;min-width:0;white-space:nowrap}
.phone-refined #phone-faithful .mobile-tasks{flex:none;min-height:44px;display:flex;align-items:center;gap:6px;padding:5px 9px;background:#ead1a7;border:1px solid #ad8550;border-radius:6px;font:13px Georgia,serif;box-shadow:inset 0 1px #fff5}
.phone-refined #phone-faithful .actionbar{grid-column:1;grid-row:7;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:minmax(0,1fr);height:100%;gap:4px;margin:0;padding:3px 5px;align-items:stretch}
.phone-refined #phone-faithful .actionbar:before{inset:0;transform:none;background:var(--sw-dock) center/100% 100% no-repeat}
.phone-refined #phone-faithful .action{height:100%;width:100%;min-width:0;max-width:none;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:32px minmax(0,1fr);gap:1px;padding:0;align-items:center;justify-items:center;background:none;border:0;box-shadow:none;overflow:visible;filter:none}
.phone-refined #phone-faithful .action-circle{width:32px;height:32px;border-width:2px;margin:0;position:static;transform:none;overflow:hidden;flex:none}
.phone-refined #phone-faithful .action-circle .mobile-action-illustration{width:100%;height:100%;display:block;transform:none}
.phone-refined #phone-faithful .action-caption{position:static;inset:auto;width:100%;height:100%;min-height:0;display:grid;grid-template-rows:minmax(22px,1fr) 15px;align-items:center;gap:0;padding:3px 3px 4px;background:#efdcba;border:1px solid #aa8450;border-radius:6px;overflow:hidden;box-shadow:inset 0 1px #fff6}
.phone-refined #phone-faithful .action-label{position:static;width:100%;height:auto;min-height:0;display:flex;align-items:center;justify-content:center;font:500 11px/1.05 Georgia,serif;white-space:normal;overflow-wrap:normal;hyphens:manual;text-align:center;padding:0;margin:0;letter-spacing:0}
.phone-refined #phone-faithful .cost{position:static;width:100%;height:15px;min-width:0;display:flex;align-items:center;justify-content:center;gap:2px;font:11px/1 system-ui,sans-serif;white-space:nowrap;flex-wrap:nowrap;margin:0;padding:0}
.phone-refined #phone-faithful .cost .sw-symbol{height:11px;width:11px}
.phone-refined #phone-faithful .footer{grid-column:1;grid-row:8;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));min-height:0;height:48px;padding:1px 3px 3px;gap:2px}
.phone-refined #phone-faithful .footer button{height:44px;min-height:44px;padding:2px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;font:11px/1.1 Georgia,serif;min-width:0}
.phone-refined #phone-faithful .footer .sw-symbol{width:18px;height:18px}
.phone-refined #phone-faithful .footer .research-deck-mark{width:13px;height:18px;flex:0 0 auto}
.phone-refined #phone-faithful .footer .findings-count{display:none}
/* Bottom sheets: only the body scrolls. Nested native panels size to content. */
.phone-refined #phone-faithful .overlay{position:absolute;inset:0;z-index:20;display:flex;align-items:flex-end;justify-content:center;padding:0;background:#211a2b80;overflow:hidden}
.phone-refined #phone-faithful .sheet{width:min(540px,100%);max-width:100%;max-height:100%;height:auto;min-height:0;margin:0;padding:0;border:1px solid #ad8751;border-radius:15px 15px 0 0;background:#f3e2c2;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 -8px 20px #211a2b40}
.phone-refined #phone-faithful .sheet-head{position:relative;display:flex;align-items:center;gap:7px;margin:0;padding:7px 10px;min-height:58px;flex:none;background:#efdbb7;border-bottom:1px solid #ba9968}
.phone-refined #phone-faithful .sheet-head h3{flex:1;min-width:0;margin:0;font:19px/1.2 Georgia,serif}
.phone-refined #phone-faithful .sheet-head h3 small{display:block;font:12px/1.2 Georgia,serif;margin-top:4px;color:#6e573e}
.phone-refined #phone-faithful .sheet-head .close,.phone-refined #phone-faithful .sheet-back{display:flex;align-items:center;justify-content:center;position:static;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;font-size:24px;border:1px solid #b18c58;border-radius:50%;background:#efdcba;box-shadow:none}
.phone-refined #phone-faithful .sheet-back{font-size:30px;border:0;background:none}
.phone-refined #phone-faithful .sheet-body{overflow:auto;overscroll-behavior:contain;min-height:0;min-width:0;padding:12px 13px 17px;font:14px/1.45 Georgia,serif;scrollbar-width:thin}
.phone-refined #phone-faithful .sheet-body section{height:auto!important;min-height:0!important;padding:0;margin:10px 0}
.phone-refined #phone-faithful .sheet-body :is(#research,#selected,#history,#trade){margin:0!important;padding:0!important;min-height:0!important;height:auto!important;background:none!important}
.phone-refined #phone-faithful .sheet-body :is(h2,h3,h4){margin:10px 0 8px;line-height:1.25}
.phone-refined #phone-faithful .sheet-body h3{font-size:18px}
.phone-refined #phone-faithful .sheet-body :is(button,input,select,summary){min-height:44px;font-size:14px}
.phone-refined #phone-faithful .sheet-body :is(input,select){font-size:16px;max-width:100%}
.phone-refined #phone-faithful .sheet-body .mobile-world-summary{border:0;padding:0;background:none}
.phone-refined #phone-faithful .sheet-body .mobile-detail-notes{border-block:1px solid #bc9e73;margin:10px 0;padding:8px 0}
.phone-refined #phone-faithful .sheet-body .trait-panel{background:none!important}
.phone-refined #phone-faithful .sheet-body .world-lore img{max-width:100%;height:auto}
.phone-refined #phone-faithful .mobile-task-list,.phone-refined #phone-faithful .mobile-menu-list{display:flex;flex-direction:column;gap:8px}
.phone-refined #phone-faithful .mobile-task-list button,.phone-refined #phone-faithful .mobile-menu-list>button{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;background:linear-gradient(#f8e9ca,#ead1a8);border:1px solid #b28d58;border-radius:7px;padding:9px 10px;margin:0;font:16px/1.25 Georgia,serif;text-align:left}
.phone-refined #phone-faithful .mobile-task-list button>span:last-child{margin-left:auto}
.phone-refined #phone-faithful .mobile-task-list .sw-symbol,.phone-refined #phone-faithful .mobile-menu-list>button .sw-symbol{width:26px;height:26px}
.phone-refined #phone-faithful .mobile-menu-list label{display:block;margin-top:6px}
.phone-refined #phone-faithful .mobile-menu-list select{display:block;width:100%;margin:5px 0 0}
.phone-refined #phone-faithful .mobile-vehicle-tabs{display:flex;gap:7px;border-bottom:1px solid #b69768;padding-bottom:10px;margin-bottom:10px}
.phone-refined #phone-faithful .mobile-vehicle-tabs button{flex:1;display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;border:1px solid #aa8452;border-radius:6px;background:#e9d0a7;color:#493326}
.phone-refined #phone-faithful .mobile-vehicle-tabs button[aria-selected=true]{background:#285e66;border-color:#285e66;color:#fff0d2}
.phone-refined #phone-faithful .mobile-vehicle-tabs .sw-symbol{width:29px;height:29px}
.phone-refined #phone-faithful .sheet-body #research .phone-vehicle-hidden{display:none!important}
.phone-refined #phone-faithful .sheet-body .vehicle-deployment .row{display:flex;align-items:stretch}
.phone-refined #phone-faithful .sheet-body .vehicle-deployment .row>button{flex:1;width:100%;max-width:none;min-height:70px}
.phone-refined #phone-faithful .sheet-body .vehicle-deployment .deployment-label .sw-symbol{width:27px;height:27px}
/* Reserve a separate close lane for the native dialogs, including research cards. */
.phone-refined #modal[open]{box-sizing:border-box;width:min(560px,calc(100vw - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px) - 16px));max-width:none;max-height:calc(var(--phone-visible-height,100dvh) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 16px);padding:64px 14px 16px!important;overflow:hidden;background:#f3e2c2;border:1px solid #ad8751;border-radius:13px;box-shadow:0 12px 24px #211a2b50}
.phone-refined #modal[open]>.close{position:absolute;top:10px!important;right:12px!important;bottom:auto!important;left:auto!important;z-index:10;transform:none;margin:0;width:44px;height:44px;min-height:44px}
.phone-refined #modalbody{max-height:calc(var(--phone-visible-height,100dvh) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 104px);overflow:auto;overscroll-behavior:contain;min-width:0;padding:0 2px 3px;margin:0}
.phone-refined #modalbody :is(section,.research-reveal,.research-collection){min-height:0;height:auto}
.phone-refined #modalbody h2{font-size:23px;line-height:1.25;margin-top:0}
.phone-refined #modalbody .company-summary{padding:0;margin:0;background:none;border:0}
.company-summary-heading{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.company-summary-heading>img{width:52px;height:52px;object-fit:contain;border-radius:6px}
.company-summary-heading h2{margin:0}
.company-summary-resources{display:flex;align-items:center;justify-content:space-around;gap:10px;margin:10px 0 14px;font:20px/1.2 Georgia,serif}
.company-summary-resources>span{display:flex;align-items:center;gap:5px}
.company-summary-resources .sw-symbol{width:26px;height:26px}
.phone-refined #modalbody .company-summary .stat{min-height:40px;padding:8px 0;font-size:14px;line-height:1.3;gap:10px}
.phone-refined #modalbody .company-summary .stat b{display:flex;align-items:center;justify-content:end;gap:3px;font-size:14px;flex-wrap:wrap}
.phone-refined #modalbody .company-summary .stat .sw-symbol{width:19px;height:19px}
.phone-refined #modalbody .company-symbol{max-width:25px;max-height:25px;object-fit:contain}
@media(max-width:360px){.phone-refined #phone-faithful .mobile-context>.production{display:none}.phone-refined #phone-faithful .mobile-context>.detail-name{font-size:14px}.phone-refined #phone-faithful .players{grid-auto-columns:minmax(70px,1fr)}.phone-refined #phone-faithful .cost{gap:1px;font-size:10px}.phone-refined #phone-faithful .cost .sw-symbol{width:10px;height:10px}}
/* Landscape: selected-world context stays visible beside the five main actions. */
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape]{grid-template-columns:180px minmax(0,1fr);grid-template-rows:28px var(--players-band) 32px minmax(0,1fr) 54px 44px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mini-header{grid-column:1/-1;grid-row:1}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .logo{height:24px;width:120px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .round{height:24px;min-width:70px;font-size:11px;margin-right:0}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .round strong{font-size:14px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mini-header .menu{display:none}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .players{grid-column:1/-1;grid-row:2;grid-auto-columns:minmax(95px,1fr);padding:2px 5px;gap:5px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .player{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:14px 15px 14px;gap:1px 4px;padding:2px 5px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .player-line{grid-column:1;grid-row:1;justify-content:start;font-size:11px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mobile-player-name{grid-column:2;grid-row:1;text-align:right;max-width:100%}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .player-stats{grid-column:1/-1;grid-row:2}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .player-production{grid-column:1/-1;grid-row:3;padding-top:1px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .turn-strip{grid-column:1;grid-row:3;font-size:11px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mobile-event-row{grid-column:2;grid-row:3}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mini-header .online-compact-state{display:flex;gap:5px;position:static;margin-left:auto;max-width:45%;justify-content:end;padding-right:8px;border:0;background:none;color:#f2dfbd;font-size:11px!important;height:28px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] main.board{grid-column:1/-1;grid-row:4;grid-template-rows:repeat(var(--mobile-rows,2),minmax(82px,1fr))!important;gap:4px 10px;padding:4px 9px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .board>.world{grid-template-rows:minmax(38px,1fr) 20px 16px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .world-name{height:20px;min-height:20px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mobile-world-meta{height:16px;min-height:16px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .inspector{grid-column:1;grid-row:5;padding:4px 3px;overflow:hidden}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mobile-context{gap:3px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mobile-context>.production{display:none}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .detail-name{font-size:12px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .mobile-tasks{font-size:12px;padding:4px 5px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .actionbar{grid-column:2;grid-row:5;padding:3px 5px;gap:4px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .actionbar:before{display:none}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .action{display:grid;grid-template-columns:29px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:2px;border:1px solid #ad8754;border-radius:6px;background:#efdcba;padding:3px;overflow:hidden}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .action-circle{width:28px;height:28px;border-width:1px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .action-caption{border:0;background:none;border-radius:0;box-shadow:none;grid-template-rows:minmax(20px,1fr) 15px;padding:1px 1px;overflow:hidden}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .action-label{font-size:11px;line-height:1.05}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .footer{grid-column:1/-1;grid-row:6;height:44px;padding:0 3px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .footer button{height:44px;flex-direction:row;gap:6px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true]{grid-template-columns:260px minmax(0,1fr);grid-template-rows:0 50px 30px minmax(64px,1fr) 52px 44px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .mini-header{visibility:hidden;pointer-events:none;height:0;overflow:hidden}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .landscape-round{display:inline;font-size:11px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .action-counter>span:first-child{display:none}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .turn-strip .online-compact-state{position:static;color:#463321;font-size:10px!important;max-width:115px;min-height:26px;height:26px;gap:3px;padding:0}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .inspector{position:absolute;bottom:44px;left:0;width:180px;height:52px;z-index:4}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .actionbar{grid-column:1/-1;margin-left:180px}

.phone-refined #phone-faithful .footer .research-deck-mark{display:inline-block;position:relative;box-sizing:border-box;border:1px solid #d5ae66;border-radius:3px;background:#102b43;box-shadow:inset 0 0 0 1px #416079}
.phone-refined #phone-faithful .footer .research-deck-mark::after{content:"";position:absolute;width:11px;height:12px;left:50%;top:50%;transform:translate(-50%,-50%);background:url("brand/starwoven-header-06.webp") no-repeat left center;background-size:auto 8.4px}
/* Keep two-digit production readable; smaller screens scroll the company row. */
.phone-refined #phone-faithful .has-player-names .players{grid-auto-columns:minmax(100px,1fr)}
.phone-refined #phone-faithful .has-player-names .production-amount{font-size:10px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .players{grid-auto-columns:minmax(110px,1fr)}

.phone-refined #phone-faithful .mini-header .online-compact-state .async-deadline{color:#f2dfbd;background:none}
/* The common phone view owns its event row; desktop ribbons must never float
   over its map, including widths where desktop styles also match. */
body.phone-refined :is(#desktop-event-ribbon,#phone-event-ribbon,#desktop-shell){display:none!important}
.phone-refined #phone-faithful main.board{grid-template-rows:repeat(var(--mobile-rows,var(--world-rows)),minmax(var(--mobile-row-min,0px),1fr))!important}
.phone-refined #phone-faithful .terrain-wrap{min-height:0}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape]{width:calc(100% / var(--mobile-map-scale,1));height:calc(100% / var(--mobile-map-scale,1));transform:scale(var(--mobile-map-scale,1));transform-origin:top left}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] main.board{grid-template-rows:repeat(var(--mobile-rows,2),minmax(var(--mobile-row-min,0px),1fr))!important}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true]{grid-template-rows:0 46px 28px minmax(0,1fr) 48px 44px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] :is(.turn-strip,.mobile-event-row,.event,.mobile-next-event){min-height:28px;height:28px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .inspector{height:48px;padding-block:2px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-low-height=true] .board{padding-block:2px}
.phone-refined #phone-faithful .mini[data-map-layout=horizontal] .board>.world{grid-template-columns:var(--mobile-terrain-width) minmax(0,1fr);grid-template-rows:minmax(18px,1fr) minmax(16px,1fr);gap:0 6px;align-items:center}
.phone-refined #phone-faithful .mini[data-map-layout=horizontal] .terrain-wrap{grid-column:1;grid-row:1/span 2;height:100%;width:100%}
.phone-refined #phone-faithful .mini[data-map-layout=horizontal] .world-name{grid-column:2;grid-row:1;align-self:end;padding-inline:2px;max-width:100%}
.phone-refined #phone-faithful .mini[data-map-layout=horizontal] .mobile-world-meta{grid-column:2;grid-row:2;align-self:start}
.phone-refined #phone-faithful .mini[data-map-layout=horizontal] .planet-research-badge{right:auto;left:calc(var(--mobile-terrain-width) - 29px)}
.phone-refined #phone-faithful .mini[data-map-layout=horizontal] :is(.trait-face,.planet-research-badge){top:0;height:100%;max-height:43px}
.phone-refined #phone-faithful .board>.world{grid-template-rows:minmax(0,1fr) 22px 18px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .board>.world{grid-template-rows:minmax(0,1fr) 20px 16px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape][data-map-layout=horizontal] .board>.world{grid-template-rows:minmax(18px,1fr) minmax(16px,1fr)}
.phone-refined #phone-faithful .mini[data-low-height=true] .player{grid-template-rows:12px 12px 12px;gap:0 4px;padding:1px 3px}
.phone-refined #phone-faithful .mini[data-low-height=true] .player-line{height:12px;line-height:12px}
.phone-refined #phone-faithful .mini[data-low-height=true] .player-line img{width:11px;height:11px}
.phone-refined #phone-faithful .mini[data-low-height=true] .player-production{padding-top:0;border-top:0}
/* Global desktop header decoration must not create a phone-sized hit layer. */
.phone-refined #phone-faithful .mini-header{position:relative;min-height:0;height:100%;margin:0;overflow:hidden;z-index:1}
.phone-refined #phone-faithful .mini-header::before,.phone-refined #phone-faithful .mini-header::after{content:none!important;pointer-events:none!important}
.phone-refined #phone-faithful .mini[data-low-height=true] .mini-header{height:0}
.phone-refined #phone-faithful .mini[data-low-height=true] .action-caption{grid-template-rows:minmax(18px,1fr) 12px;padding:0}
.phone-refined #phone-faithful .mini[data-low-height=true] .cost{height:12px;font-size:10px}
@media(orientation:landscape) and (max-width:700px){
 .phone-refined #phone-faithful .mini[data-refined-orientation=landscape]{grid-template-columns:150px minmax(0,1fr)}
 .phone-refined #phone-faithful .mini[data-low-height=true]{grid-template-columns:260px minmax(0,1fr)}
 .phone-refined #phone-faithful .mini[data-low-height=true] .inspector{width:150px}
 .phone-refined #phone-faithful .mini[data-low-height=true] .actionbar{margin-left:150px}
 .phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .action{grid-template-columns:24px minmax(0,1fr);padding:2px;gap:1px}
 .phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .action-circle{width:24px;height:24px}
 .phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .cost{font-size:10px;gap:1px}
 .phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .cost .sw-symbol{width:10px;height:10px}
}
.phone-refined #phone-faithful .mini-header .online-compact-state{margin:0 0 0 auto;min-height:26px;height:26px;padding:0 4px;flex-wrap:nowrap;overflow:hidden}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .board :is(.trait-face,.planet-research-badge){height:32px;max-height:32px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .board .trait-face>img{width:19px;height:19px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .board .world>.planet-research-badge>.research-deck-mark{height:19px}
.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .board :is(.trait-face,.planet-research-badge){min-height:0!important}

/* Annotation footprint is shared with the live solver, including a clear gap. */
.phone-refined #phone-faithful .board :is(.trait-face,.planet-research-badge){width:32px;font-weight:bold;font-size:11px;text-shadow:0 0 3px #fff8e8,1px 1px 1px #fff8e8,-1px -1px 1px #fff8e8}
.phone-refined #phone-faithful .board .trait-face>b{font-weight:bold;font-size:11px}
.phone-refined #phone-faithful .live-puck{max-width:calc(100% - var(--mobile-note-inset,76px))}
.phone-refined #phone-faithful .mini[data-map-layout=horizontal] .planet-research-badge{left:calc(var(--mobile-terrain-width) - 32px)}

.phone-refined #phone-faithful .mini[data-refined-orientation=landscape] .board :is(.trait-face,.planet-research-badge){height:36px;max-height:36px}

/* Shared PC artwork, painted within the existing mobile icon slots only. */
#phone-faithful .mobile-workshop-icon{position:relative;display:inline-grid;place-items:center;flex:none;pointer-events:none;vertical-align:middle}
#phone-faithful .mobile-workshop-icon :is(.workshop-card-art,.workshop-medallion-art){position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
#phone-faithful .mobile-workshop-icon .workshop-card-art>img{position:absolute;inset:3% 0;width:100%;height:94%;object-fit:contain;border-radius:2px}
#phone-faithful .mobile-workshop-icon .workshop-medallion-art{border-radius:50%;background:radial-gradient(circle at 30% 20%,#334652,#0e2230);box-shadow:inset 0 0 0 1px #af8a43;color:#efcb7c}
#phone-faithful .mobile-workshop-icon .workshop-medallion-art>svg{width:80%;height:80%}
#phone-faithful .mobile-workshop-icon .workshop-research-art{position:absolute;inset:0;pointer-events:none}
#phone-faithful .mobile-workshop-icon .workshop-research-art>img{position:absolute;object-fit:contain;max-width:none}
#phone-faithful .mobile-workshop-icon .workshop-art-drone{width:56.25%;height:73.33%;top:0;right:0}
#phone-faithful .mobile-workshop-icon .workshop-art-rover{width:62.5%;height:83.33%;bottom:0;left:0}
.phone-refined #phone-faithful .mini-header .menu{display:grid;place-items:center}
.phone-refined #phone-faithful .sheet-body #desktop-tools{display:flex;flex-wrap:wrap;align-items:center;gap:10px;width:100%;margin:0;padding:0;background:none}
.phone-refined #phone-faithful .sheet-body #desktop-tools .language-label{display:flex;flex-wrap:wrap;gap:8px;max-width:100%}

/* The approved Cosmic window uses one continuous surface behind its header. */
html[data-ui-runtime=web] body.phone-refined[data-board-background=cosmic] #phone-faithful .sheet-head{background:transparent!important}
