/* Warm salvage village. Scoped to the shelter: the expedition atlas stays separate. */
body[data-view="base"]{--paper-100:#f7efd9;--paper-50:#fffaeb;--color-border:#dac9a4;--color-text-secondary:#655f4c;--color-accent:#a9472b;--radius-control:14px;background:var(--paper-100);font-family:"Trebuchet MS","Segoe UI",sans-serif}
body[data-view="base"] .app-shell{max-width:1700px;padding-top:max(8px,var(--tg-content-safe-area-inset-top,0px),env(safe-area-inset-top))}
body[data-view="base"] .topbar{min-height:56px;height:auto}
body[data-view="base"] :is(.brand-kicker,.top-actions .world-link,.saved,.atlas-heading-status){display:none}
body[data-view="base"] .atlas-page-heading{padding:12px 0 16px}
body[data-view="base"] .atlas-page-title{font-size:32px;letter-spacing:-1px;font-weight:800}
body[data-view="base"] .atlas-page-description{font-size:14px}
body[data-view="base"] .atlas-kicker{font-size:10px}
body[data-view="base"] .content-grid{display:flex;flex-direction:column;min-height:0}
body[data-view="base"] .world-panel{width:100%;height:calc(100dvh - 250px);min-height:490px;max-height:900px;border:3px solid #9aaf76;border-radius:26px;box-shadow:0 6px 0 #81966133;order:0}
body[data-view="base"] :is(.sidebar-left,.sidebar-right){display:none;width:100%;height:auto;min-height:0;overflow:visible}
body[data-view="base"].details-open .sidebar-left{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));order:2}
body[data-view="base"].details-open .sidebar-right{display:flex;order:1}
body[data-view="base"] .sidebar-right .inspector-panel{display:none}
body[data-view="base"].inspector-open .sidebar-right{display:flex;order:1}
body[data-view="base"].inspector-open .inspector-panel{display:block}
body[data-view="base"] .sidebar-right :is(.activity-panel,.save-panel){display:none}
body[data-view="base"].details-open :is(.activity-panel,.save-panel){display:flex}
body[data-view="base"] .atlas-supply{padding:10px 16px;margin-bottom:12px;border-radius:18px;background:#fff9e9;box-shadow:0 3px 0 #dbc79d55}
body[data-view="base"] .atlas-supply :is(.panel-heading,h2,.capacity-line){display:none}
body[data-view="base"] .atlas-supply .resources{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
body[data-view="base"] .resource{grid-template-columns:28px 1fr auto;gap:6px}
body[data-view="base"] .res-name{font-size:12px}.res-count{font-variant-numeric:tabular-nums}
body[data-view="base"] .res-rate{font-size:11px}
body[data-view="base"] .building-toolbar{display:none;bottom:76px;border-radius:20px 20px 0 0;background:#fff9ebf5;box-shadow:0 -6px 24px #52634322;padding:16px}
body[data-view="base"].catalog-open .building-toolbar{display:block}
body[data-view="base"] .building-card{width:110px;min-height:110px;border-radius:16px;background:#f4e8c9}
body[data-view="base"] .building-name{font-size:13px}
body[data-view="base"] .building-cost{font-size:12px;color:#655539}
body[data-view="base"] .building-card.is-selected{background:#e1edbf;border-color:#638440}
body[data-view="base"] .world-hint{bottom:82px;font-size:12px;letter-spacing:0;white-space:normal;max-width:calc(100% - 24px);background:#fff9e9eb;color:#354b34;border:0;border-radius:12px;left:12px}
body[data-view="base"].catalog-open .world-hint{bottom:265px}
.shelter-actions{position:absolute;bottom:12px;left:12px;right:12px;display:flex;gap:10px;z-index:4}
.shelter-actions button{min-height:50px;border:2px solid #fff0ba;border-radius:16px;padding:10px 18px;font-size:16px;font-weight:800;color:#fff9e9;background:#a9472b;box-shadow:0 4px 0 #693e2c}
.shelter-actions button+button{background:#fff7df;color:#40523b;border-color:#e6d5a9;box-shadow:0 4px 0 #8a986c}
.shelter-close{float:right;min-height:44px;padding:8px 16px;border-radius:12px;background:#e5edce;color:#354b34;border:1px solid #a6b781}
body[data-view="base"] button{touch-action:manipulation}
body[data-view="base"] button:active{filter:brightness(.9)}
body[data-view="base"] button:focus-visible{outline:3px solid #255c70;outline-offset:3px}
body[data-view="base"] .world-tools{gap:2px;border-radius:14px;background:#fff8e6ec;padding:3px}
body[data-view="base"] .world-location{font-size:11px;background:#fff8e6ed;letter-spacing:0;padding:10px;border-radius:12px}
body[data-view="base"] .world-location small{display:none}
body[data-view="base"] .atlas-nav{background:#354e42}
body[data-view="base"] .atlas-nav-link small{font-size:12px}
body[data-view="base"] :is(.action-btn,.stepper button,.ghost-button){min-height:44px;min-width:44px;font-size:13px}
body[data-view="base"] :is(.person-name strong,.person-name small,.inspector-type,.inspector-data,.event-text,.quest-help){font-size:14px}
body[data-view="base"] .person-health{font-size:12px}
body[data-view="base"] .resident-job{font-size:16px;min-height:44px}
body[data-view="base"].build-celebrate .world-panel{box-shadow:0 0 0 5px #eec266}
@media(max-width:760px){
 body[data-view="base"] .app-shell{padding-inline:8px;padding-bottom:calc(88px + max(env(safe-area-inset-bottom),var(--tg-content-safe-area-inset-bottom,0px)))}
 body[data-view="base"] .topbar{padding:4px 2px;gap:4px;min-height:44px}
 body[data-view="base"] .brand{display:none}
 body[data-view="base"] .top-metrics{order:0;flex-basis:auto;flex:1;border:0;padding:0;margin:0;gap:8px}
 body[data-view="base"] .metric{flex-direction:column;align-items:start;gap:0}
 body[data-view="base"] .metric span{font-size:10px}
 body[data-view="base"] .metric strong{font-size:14px}
 body[data-view="base"] .atlas-page-heading{padding:8px 2px 10px}
 body[data-view="base"] .atlas-page-title{font-size:25px}
 body[data-view="base"] .atlas-page-description{display:none}
 body[data-view="base"] .atlas-kicker{font-size:9px;margin-bottom:3px}
 body[data-view="base"] .atlas-supply{padding:8px 10px;margin-bottom:8px}
 body[data-view="base"] .atlas-supply .resources{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 body[data-view="base"] .resource{grid-template-columns:22px minmax(0,1fr) auto;gap:3px}
 body[data-view="base"] .res-icon{width:22px;height:24px;grid-row:1}
 body[data-view="base"] .res-count{font-size:15px;grid-column:auto}
 body[data-view="base"] .res-name{font-size:10px}
 body[data-view="base"] .res-rate{display:none}
 body[data-view="base"] .world-panel{height:calc(100dvh - 280px);min-height:380px;border-radius:22px;max-height:none}
 body[data-view="base"] .world-topbar{top:8px;left:8px;right:8px;gap:4px}
 body[data-view="base"] .world-location{max-width:calc(100% - 155px);font-size:10px;padding:8px}
 body[data-view="base"] .world-tool{min-width:44px;width:44px;height:44px}
 body[data-view="base"] .world-tools>span{display:none}
 body[data-view="base"] .world-hint{font-size:11px;padding:7px 9px}
 .shelter-actions button{padding:8px 10px;font-size:14px;flex:1}
 body[data-view="base"] .toolbar-header .eyebrow{display:none}
 body[data-view="base"] .building-toolbar{padding:10px}
 body[data-view="base"] .toolbar-header h3{font-size:16px}
 body[data-view="base"] .minor-btn{min-width:44px;min-height:44px}
 body[data-view="base"].inspector-open .inspector-panel{position:fixed;z-index:25;bottom:calc(80px + env(safe-area-inset-bottom));left:8px;right:8px;width:auto;max-height:58dvh;overflow:auto;min-height:0;border:2px solid #b6b98d;box-shadow:0 -8px 32px #354e4240;border-radius:22px;padding:16px}
 body[data-view="base"] .atlas-nav{height:calc(72px + max(env(safe-area-inset-bottom),var(--tg-content-safe-area-inset-bottom,0px)));padding-bottom:max(8px,env(safe-area-inset-bottom),var(--tg-content-safe-area-inset-bottom,0px))}
 body[data-view="base"] .atlas-nav-link small{font-size:11px}
}
@media(max-height:500px) and (orientation:landscape){body[data-view="base"] .world-panel{height:70dvh;min-height:300px}}
@media(prefers-reduced-motion:reduce){body[data-view="base"] *{scroll-behavior:auto!important;transition:none!important}}
body[data-view="base"] .world-hint{display:block}
body[data-view="base"] .world-panel{height:calc(100dvh - 300px)}
@media(max-width:760px){
 body[data-view="base"] .resource{grid-template-columns:24px 1fr;text-align:center}
 body[data-view="base"] .res-count{grid-column:2;grid-row:1;text-align:right}
 body[data-view="base"] .res-name{grid-column:1/-1;grid-row:2;font-size:11px;text-align:left}
 body[data-view="base"] .world-panel{height:calc(100dvh - 308px);min-height:350px}
}
@media(max-height:500px) and (orientation:landscape){
 body[data-view="base"] .atlas-page-heading{padding:6px 0}
 body[data-view="base"] :is(.atlas-kicker,.atlas-page-description){display:none}
 body[data-view="base"] .topbar{min-height:44px}
 body[data-view="base"] .world-panel{height:65dvh;min-height:300px}
}
/* Day planning stays a short, readable sheet on phones. */
body[data-view="base"] .day-dialog{position:fixed;inset:0;margin:auto;width:min(520px,calc(100% - 16px));max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:20px;border:2px solid #c5b386;border-radius:24px;background:#fff9e9;color:#354335;box-shadow:0 20px 80px #233b4255;overflow:auto;overscroll-behavior:contain}
.day-dialog::backdrop{background:#24382dd9}
.day-dialog h2{font-size:26px;line-height:1.15;margin:8px 0 12px;letter-spacing:-.5px}
.day-dialog p{font-size:14px;line-height:1.5;margin:8px 0}
.day-dialog .day-kicker{font-size:11px;letter-spacing:1px;color:#8a462b;font-weight:bold}
.day-dialog .day-note{color:#655f4c;font-size:13px}
.day-resources{display:grid;gap:8px;margin:16px 0}
.day-resource{padding:10px 12px;background:#f3ecd5;border-radius:14px}
.day-resource>div{display:flex;justify-content:space-between;gap:12px;font-size:15px}
.day-resource b{font-variant-numeric:tabular-nums;white-space:nowrap}
.day-resource p{margin:4px 0 0;font-size:13px}
.day-resource.is-warning{box-shadow:inset 3px 0 #b04b2d}
.day-dialog .day-overflow{color:#8b3828;font-weight:bold}
.day-warning{padding:12px;background:#f9dfc5;border-radius:12px;color:#793121}
.day-good{padding:12px;background:#e6edce;border-radius:12px;color:#354e2f}
.day-risk{padding:12px;border:1px dashed #b4ad8a;border-radius:14px}
.day-stories h3{font-size:18px;margin-top:20px}
.day-stories p{border-left:3px solid #bbca96;padding-left:10px}
.day-footer{display:flex;gap:8px;margin-top:16px;flex-wrap:wrap}
.day-dialog button{min-height:48px;min-width:44px;border-radius:14px;padding:10px 14px;font:700 14px "Segoe UI",sans-serif;cursor:pointer}
.day-primary{background:#a9472b;color:#fff9eb;border:2px solid #a9472b;flex:1}
.day-secondary{background:#eee7cf;color:#354335;border:1px solid #c5b386;flex:1}
.day-people{width:100%;margin-top:12px}
.day-dialog button:focus-visible{outline:3px solid #255c70;outline-offset:2px}
body.day-open{overflow:hidden}
@media(max-width:360px){body[data-view="base"] .day-dialog{padding:16px}.day-dialog h2{font-size:24px}.day-resource>div{font-size:14px}.day-footer{flex-direction:column}}
body[data-view="base"] .building-card{width:138px}
body[data-view="base"] .building-cost{white-space:normal;text-align:left;font:11px/1.5 "Segoe UI",sans-serif}
body[data-view="base"] .building-cost span{display:block}
.day-dialog .day-footer{position:sticky;bottom:-20px;z-index:2;margin:16px -20px -20px;padding:12px 20px 20px;background:#fff9e9;border-top:1px solid #d9cba7;box-shadow:0 -6px 12px #fff9e9}
@media(max-width:360px){.day-dialog .day-footer{bottom:-16px;margin:16px -16px -16px;padding:10px 16px 16px}}
body[data-view="base"] .atlas-nav{overflow-y:auto}
body[data-view="base"] :is(.atlas-nav-link,.atlas-emblem){flex-shrink:0}
.day-dialog{scroll-padding-bottom:160px}
.day-choice{padding:12px;margin:12px 0;background:#e9edda;border-radius:14px}
.day-choice h3{font-size:17px;margin:0 0 8px}
.day-choice label{display:block;font-size:13px;margin-bottom:8px}
.day-choice select{width:100%;min-height:48px;font:16px "Segoe UI",sans-serif;color:#354335;background:#fff9e9;border:1px solid #aaa985;border-radius:10px;padding:8px}
.day-choice p{font-size:13px}
body[data-view="base"] .building-role{display:block;font:11px/1.5 "Segoe UI",sans-serif;color:#4d6045;margin-top:4px;text-align:left}
.building-cost-legend{font-size:12px;color:#655f4c;margin:4px 0 8px}
body[data-view="base"].catalog-open .world-hint{display:none}
/* The map belongs to document flow: it must never float over the journal or people. */
body[data-view="base"] .world-panel{position:relative;top:auto;z-index:0}
body[data-view="base"].journal-open :is(.world-panel,.sidebar-left,.inspector-panel,.save-panel){display:none!important}
body[data-view="base"].journal-open .sidebar-right{display:flex;order:0}
body[data-view="base"].journal-open .activity-panel{display:flex;min-height:240px;scroll-margin-top:16px}
body[data-view="base"].journal-open .activity{max-height:none;overflow:visible}
body[data-view="base"] .activity-panel>.shelter-close{align-self:flex-end;flex:none}
body[data-view="base"] .activity-panel h2{scroll-margin-top:20px}
body[data-view="base"] .event-text{overflow-wrap:anywhere}
body[data-view="base"] .resident-portrait{width:52px;height:52px;flex:none;display:block;border-radius:16px}
body[data-view="base"] .resident-portrait.is-large{width:88px;height:88px;float:left;margin:0 16px 12px 0}
body[data-view="base"] .resident-detail{display:flow-root}
body[data-view="base"] .resident-voice{font-size:14px;line-height:1.5;color:#615842;margin:8px 0}
body[data-view="base"] .resident-condition{font-size:14px;color:#415d37;font-weight:700;clear:both;margin:12px 0}
body[data-view="base"] .resident-filters{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
body[data-view="base"] .resident-filters button{min-height:44px;padding:8px 12px;border-radius:12px;border:1px solid #aeb68f;background:#fff9e9;color:#40523b;font-size:14px}
body[data-view="base"] .resident-filters button[aria-pressed="true"]{background:#405d46;color:#fff9e9;border-color:#405d46}
body[data-view="base"] .resident-line{min-height:76px;align-items:center}
body[data-view="base"] .person-name{min-width:0}
body[data-view="base"] .person-name small{white-space:normal;line-height:1.4}
body[data-view="base"] .roster-empty{font-size:15px;color:#615842;margin:16px 0}
body[data-view="base"] .resident-bars label{font-size:13px}
body[data-view="base"] .skill-cloud span{font-size:12px}
@media(min-width:761px){body[data-view="base"] .resident-roster{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}}
@media(max-width:380px){body[data-view="base"] .resident-line{display:grid;grid-template-columns:48px minmax(0,1fr);gap:8px}body[data-view="base"] .resident-line .resident-portrait{width:48px;height:48px;grid-row:span 2}body[data-view="base"] .person-health{grid-column:2}}
body[data-view="base"] .resident-line{flex:0 0 auto;height:auto}
body[data-view="base"] .person-name small{overflow:visible;text-overflow:clip}
body[data-view="base"] .shelter-actions button{min-width:0;font-size:13px;padding-inline:10px}
body.outing-open{overflow:hidden}
.outing-select{display:block;width:100%;min-height:48px;margin:8px 0;border:1px solid #b4ad8a;border-radius:12px;padding:8px;background:#fff9e9;color:#354335;font-size:16px}
.outing-site{display:grid;grid-template-columns:minmax(105px,34%) 1fr;gap:12px;align-items:center;margin:12px 0;padding:10px;border:1px solid #c8c99b;border-radius:16px;background:linear-gradient(135deg,#f0efcf,#e2e8c9)}
.outing-site-map{display:block;width:100%;aspect-ratio:10/7;border:1px solid #b7bd8f;border-radius:10px;background:#d9e2bd}
.site-ground{fill:#d9e2bd}.site-contour{fill:none;stroke:#a1b77d;stroke-width:.22;stroke-dasharray:.5 .35}.site-trail{fill:none;stroke:#c9a875;stroke-width:.3;stroke-linecap:round;stroke-dasharray:.5 .35}.site-building{fill:#ad7658;stroke:#805b44;stroke-width:.08}.site-tone-1{fill:#cba06d}.site-tone-2{fill:#8c9c78}.site-water{fill:none;stroke:#83b9c1;stroke-width:.75;stroke-linecap:round}.site-lot{fill:#c8ba94;stroke:#aa9974;stroke-width:.12;stroke-dasharray:.3 .2}.site-loot{fill:#f1d279;stroke:#8f6e38;stroke-width:.1}.site-marker{fill:#bd5131}.site-ring{fill:none;stroke:#fff4d2;stroke-width:.12}
.outing-site figcaption{display:grid;gap:4px;min-width:0}.outing-site figcaption strong{font-size:14px;line-height:1.2}.outing-site figcaption span{font-size:12px;line-height:1.35;color:#5b6048}.outing-site figcaption small{font-size:11px;color:#795d3e}
@media(max-width:360px){.outing-site{grid-template-columns:1fr 1fr;gap:8px;padding:8px}.outing-site figcaption strong{font-size:13px}.outing-site figcaption span{font-size:11px}}
.land-directions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:14px 0}
.day-dialog .land-choice{display:grid;grid-template-columns:32px 1fr;grid-template-rows:auto auto;align-items:center;min-height:72px;text-align:left;border:1px solid #c8bd98;background:#f5efda;color:#354335}
.day-dialog .land-choice:disabled{opacity:.7}.day-dialog .land-choice.is-open{background:#e0ebcf;border-color:#98ad7c;color:#405b3f}
.land-compass{grid-row:1/3;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#e4ddc5;font-size:20px}
.land-choice strong{font-size:13px;line-height:1.2}.land-choice small{font-size:11px;line-height:1.25;font-weight:500}.land-cost{display:grid;gap:3px;padding:10px 12px;border-radius:12px;background:#f0e8cd;font-size:13px}.land-cost small{font-size:12px;color:#655f4c}.land-notice{min-height:24px;color:#526346}
@media(max-width:360px){.land-directions{gap:7px}.day-dialog .land-choice{grid-template-columns:25px 1fr;min-height:68px;padding:8px}.land-compass{width:23px;height:23px}}
.outing-party{border:1px solid #c5b386;border-radius:16px;padding:8px;margin:16px 0}
.outing-party legend{font-weight:700;font-size:15px;padding:0 8px}
.outing-party label{display:flex;align-items:center;gap:12px;min-height:64px;padding:10px 6px;border-bottom:1px solid #e0d5b7;cursor:pointer}
.outing-party label:last-child{border:0}
.outing-party input{width:24px;height:24px;flex:none;accent-color:#405d46}
.outing-party small{display:block;font-size:13px;line-height:1.5;margin-top:3px}
.outing-party label:has(input:disabled){opacity:.65;cursor:default}
#outing-dialog details{padding:12px 0}#outing-dialog summary{cursor:pointer;min-height:44px;font-weight:700;padding:10px 0}
#outing-dialog button:disabled{opacity:.55;cursor:default}
body.defense-open{overflow:hidden}
body[data-view="base"] .defense-entry{background:transparent;border:0;cursor:pointer;color:inherit;padding:0;min-height:44px;min-width:44px;text-align:left}
body[data-view="base"] .defense-entry:hover{background:#e5edce;border-radius:8px}
.defense-signal{position:absolute;z-index:2;top:72px;left:12px;max-width:calc(100% - 24px);min-height:44px;border:1px solid #c6ad75;border-radius:12px;background:#fff6dceb;color:#70402c;padding:8px 12px;font-size:13px;font-weight:700;cursor:pointer}
.defense-signal[hidden]{display:none}
.defense-actions{display:grid;gap:8px;margin:12px 0}
.defense-row-actions,.defense-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
#defense-dialog h3{font-size:18px;margin:18px 0 10px}
#defense-dialog button:disabled{opacity:.55;cursor:default}
#defense-dialog .day-resource>div{flex-wrap:wrap}
/* Telegram stable viewport and content insets, with browser fallbacks. */
body.guide-open{overflow:hidden}
body.help-open{overflow:hidden}
dialog#help-modal{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;color:inherit}
dialog#help-modal .modal{max-height:calc(var(--game-viewport,100dvh) - 32px);overflow:auto}
body[data-view="base"] button.world-hint{min-height:44px;padding:9px 12px;pointer-events:auto;text-align:left;font-weight:700;z-index:5;text-transform:none}
body[data-view="base"] button.world-hint:disabled{opacity:1;cursor:default}
#guide-dialog p{line-height:1.55;margin:12px 0}
.guide-steps{padding-left:24px;line-height:1.5}
.guide-steps li{margin:12px 0}
#guide-dialog .day-footer button{min-height:48px}
:root{--game-viewport:100dvh;--game-safe-top:0px;--game-safe-bottom:0px;--game-content-safe-top:0px;--game-content-safe-bottom:0px}
body.account-open{overflow:hidden}
body[data-view="base"] .app-shell{padding-top:max(8px,env(safe-area-inset-top),var(--game-safe-top),var(--game-content-safe-top))}
body[data-view="base"] #connection-status{font:700 10px/1.3 "Segoe UI",sans-serif;max-width:76px;min-height:44px;min-width:44px;padding:4px 6px;border:1px solid #c5b386;border-radius:12px;background:#fff9e9;color:#40523b}
#account-dialog button{display:block;width:100%;margin-top:12px}
body[data-view="base"] .day-dialog{max-height:calc(var(--game-viewport) - 32px - max(env(safe-area-inset-top),var(--game-safe-top),var(--game-content-safe-top)) - max(env(safe-area-inset-bottom),var(--game-safe-bottom),var(--game-content-safe-bottom)))}
@media(max-width:760px){body[data-view="base"] .world-panel{height:calc(var(--game-viewport) - 308px);min-height:350px}body[data-view="base"] .atlas-nav{height:calc(72px + max(env(safe-area-inset-bottom),var(--game-safe-bottom),var(--game-content-safe-bottom)));padding-bottom:max(8px,env(safe-area-inset-bottom),var(--game-safe-bottom),var(--game-content-safe-bottom))}body[data-view="base"] .app-shell{padding-bottom:calc(88px + max(env(safe-area-inset-bottom),var(--game-safe-bottom),var(--game-content-safe-bottom)))}body[data-view="base"].inspector-open .inspector-panel{bottom:calc(80px + max(env(safe-area-inset-bottom),var(--game-safe-bottom),var(--game-content-safe-bottom)));max-height:calc(var(--game-viewport)*.58)}}
@media(max-height:500px) and (orientation:landscape){body[data-view="base"] .world-panel{height:65dvh;min-height:300px}}
body[data-view="base"] .app-shell{padding-left:max(8px,env(safe-area-inset-left),var(--game-safe-left,0px),var(--game-content-safe-left,0px));padding-right:max(8px,env(safe-area-inset-right),var(--game-safe-right,0px),var(--game-content-safe-right,0px))}
body[data-view="base"] .day-dialog{max-width:min(720px,calc(100vw - 24px - max(var(--game-safe-left,0px),var(--game-content-safe-left,0px)) - max(var(--game-safe-right,0px),var(--game-content-safe-right,0px))))}
@media(max-width:400px){
 body[data-view="base"] .topbar{min-height:50px}
 body[data-view="base"] .top-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 8px}
 body[data-view="base"] .top-metrics .metric{flex-direction:row;align-items:center;justify-content:space-between;min-width:0;min-height:21px;padding:0}
 body[data-view="base"] .metric span{margin:0;font-size:10px}
 body[data-view="base"] .top-actions{gap:4px}
 body[data-view="base"] #connection-status{width:72px;max-width:72px;overflow-wrap:normal}
}
@media(max-width:760px){
 body[data-view="base"] .top-metrics{gap:4px;min-width:0}
 body[data-view="base"] .metric{min-width:0}
 body[data-view="base"] .metric span{font-size:10px;letter-spacing:0;white-space:nowrap}
 body[data-view="base"] .world-panel{height:calc(var(--game-viewport) - 332px - max(var(--game-safe-top),var(--game-content-safe-top)) - max(var(--game-safe-bottom),var(--game-content-safe-bottom)));min-height:350px}
}
@media(max-height:500px) and (orientation:landscape){body[data-view="base"] .world-panel{height:65dvh;min-height:300px}}
