:root{--paper:#faf7eb;--ink:#283e36;--olive:#69784c;--wood:#786148;--stitch:#b7ad8f}
.v4,dialog{color:var(--ink)}
.v4 .workspace{background:#e9e4d2}
.v4 .white-panel,.v4 .make-card,.v4 .goal-panel,.v4 .inspector,dialog{background:var(--paper);border-color:#bfb59a}
.v4 .make-card,.v4 .goal-panel,.v4 .next-action{border:1px solid #c7bea5;outline:1px dashed #ddd4bc;outline-offset:-5px;border-radius:12px;padding:20px}
.v4 .make-catalog{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr));gap:16px;margin-top:16px}
.v4 .make-card{display:flex;flex-direction:column;gap:10px;min-width:0}.v4 .make-card h3{font-size:18px;margin:0}.v4 .make-card>p{margin:0}
.v4 .make-card .card-actions{margin-top:auto}.card-actions{display:flex;flex-wrap:wrap;gap:8px}
.v4 p,.v4 .inspector p,.v4 .dialog-content p,dialog p{font-size:16px;line-height:1.8}
.v4 button,.v4 select,.v4 input{font:inherit;font-size:14px;min-height:44px;max-width:100%}.v4 button{white-space:normal}.v4 button:focus-visible,.v4 a:focus-visible,.v4 summary:focus-visible{outline:3px solid #537b9b;outline-offset:3px}
.v4 .primary{background:#355b46;color:#fffdf5;border:1px solid #284b39;box-shadow:0 2px 0 #233e2c}.v4 .soft-button{background:#f2efdf;color:#354e40;border:1px solid #b3bca5}.v4 .text-button{text-decoration:underline;text-underline-offset:3px}
.v4 .section-tabs{display:flex;overflow:auto;gap:8px}.v4 .section-tabs button{flex:none}.v4 .section-tabs .selected{background:#e2e8cf;border-bottom:3px solid #52704a}
.v4 .making-toolbar{display:flex;gap:12px;flex-wrap:wrap}.v4 .making-toolbar label{flex:1;min-width:180px;font-size:14px}.v4 .making-toolbar input,.v4 .making-toolbar select{display:block;width:100%;border:1px solid #aab39b;border-radius:6px;padding:9px;background:#fffdf7}
.work-reasons{border-left:3px solid #937544;background:#f4efdf;padding:10px 12px}.work-reasons ol{list-style:none;margin:0;padding:0}.work-reasons li{display:grid;gap:3px;margin:0 0 8px;font-size:14px;line-height:1.6}.work-reasons li:last-child{margin-bottom:0}.work-reasons strong{color:#6f5030}.work-reasons summary{font-size:14px;cursor:pointer;min-height:44px;padding-top:10px}
.ingredient-list{padding:0;list-style:none}.ingredient-list li{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px;padding:12px 0;border-bottom:1px dashed #c7bda5}.ingredient-list li>div{display:grid;gap:4px;font-size:14px}.ingredient-list strong{font-size:16px}.source-row{padding:10px 0;border-bottom:1px dashed #c7bda5}.source-row strong{font-size:18px}
.goal-panel{margin-bottom:16px}.goal-panel h2{font-size:18px!important}.goal-panel summary{min-height:44px;padding:10px 0;font-size:14px;cursor:pointer}.next-action{margin-top:20px}.completion-note{display:flex;flex-wrap:wrap;gap:10px;padding:16px;border:1px solid #879d72;border-radius:10px;background:#eef2dc;margin-bottom:16px}.completion-note>div{flex:1 1 260px}.completion-note p{margin:6px 0}.raft-progress{margin:20px 0;padding-top:12px;border-top:1px dashed #b5ab91}.raft-progress ol{padding:0;list-style:none;display:grid;gap:10px}.raft-progress li{display:flex;flex-direction:column;align-items:flex-start;border-left:3px solid #879e74;padding:10px 12px;background:#f0f1e2;font-size:14px;gap:7px}
.v4 .bottom-nav{grid-template-columns:repeat(6,minmax(0,1fr));border-top:3px solid #907c5c}.v4 .bottom-nav b{font-size:14px}.v4 .common-header{border-bottom:3px solid #907c5c}.v4 .resourcebar{display:flex;gap:7px}.v4 .resource{display:flex;align-items:center;font-size:14px;min-height:44px}.v4 .resource strong{font-size:16px}
.v4 .map-viewport{padding:8px;border:5px solid #80674b;border-radius:10px;background:#eee9d9;box-shadow:inset 0 0 0 2px #d1c5a8}.v4 .supplied-map{outline:2px dashed #e4dcc2;outline-offset:-5px;border-radius:3px}.v4 .island-art{filter:none}

.v4 .companion-sidebar{padding:8px;border-top:2px solid #bcaf91;border-right:0;background:#f0ecdc}.v4 .companion-sidebar h2{display:none}.v4 .companion-list,.v4.has-guest .companion-list{display:flex;flex-direction:row;overflow-x:auto;overflow-y:hidden;gap:8px;scrollbar-gutter:auto}.v4 .companion-card{flex:1 0 180px;min-width:0}.v4 .order-nui,.v4.has-guest .order-nui{grid-template-columns:36px minmax(0,1fr);padding:7px;min-height:78px}.v4 .order-nui b,.v4.has-guest .order-nui b{font-size:14px}.v4 .order-nui>.nui,.v4.has-guest .order-nui>.nui{width:36px!important;height:40px!important}.v4 .order-nui .order-work{font-size:12px;line-height:1.45}.v4 .companion-details,.v4.has-guest .companion-details{font-size:12px;min-height:44px}.v4 .crew-warning{grid-column:1/-1;color:#8a4027;font-size:13px}.v4 .activity-badge{font-size:12px}
@media(min-width:901px){
 .v4 .workspace,.v4.has-guest .workspace{display:grid;grid-template-columns:minmax(0,1fr) 340px;grid-template-rows:minmax(0,1fr) auto}
 .v4 #main-content{grid-column:1;grid-row:1;padding:20px}.v4 .inspector{grid-column:2;grid-row:1/3;padding:20px}
 .v4 .companion-sidebar{grid-column:1;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) 225px;gap:12px;max-height:200px}.v4 .advance-panel{margin:0;border:0;padding:0;align-self:center}.v4 .advance-panel>b{font-size:12px}.v4 .advance{font-size:13px}.v4 .advance-panel small{font-size:11px}
 .v4 .map-section>.section-heading{min-height:0;margin-bottom:8px}.v4 .map-section .screen-instruction{margin:4px 0 8px;font-size:14px}.v4 .island-forecast{padding:8px;margin-bottom:8px}


 .v4 .view-map .supplied-map .island-art{object-fit:contain}
 .v4 .map-section>.section-heading .eyebrow{display:none}
 .v4 .map-section>.section-heading h1{font-size:22px;margin:0}
 .v4 .map-section>.section-heading>div{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap}
 .v4 .map-section .screen-instruction{margin:0;font-size:14px}
}
@media(max-width:900px){
 .v4 .workspace{display:flex;flex-direction:column}.v4 #main-content{order:0;flex:1;padding:12px 12px 60px}.v4 .companion-sidebar{order:1;max-height:210px;flex:none}.v4 .companion-card{flex:0 0 200px}.v4 .companion-list{max-height:132px}.v4 .advance-panel>b{font-size:11px}.v4 .advance-panel .advance{min-height:44px;font-size:12px}
 .v4 .inspector{order:2;bottom:calc(62px + env(safe-area-inset-bottom));max-height:76dvh}.v4 .inspector.is-open{display:block}.v4 .sheet-toggle{bottom:calc(76px + env(safe-area-inset-bottom));font-size:14px;min-height:44px}.v4 .resourcebar{flex-wrap:nowrap;overflow-x:auto;padding:5px 8px}.v4 .resource{flex:0 0 auto;font-size:12px;padding:5px 8px;min-height:40px}.v4 .bottom-nav{height:calc(62px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom)}
 .v4 .topbar .brand small b{font-size:10px}.v4 .map-viewport{padding:3px;border-width:3px}.v4 .make-card{padding:16px}.v4 .making-toolbar label{min-width:140px}.v4.event-active .companion-sidebar{display:none}.v4.event-active .inspector{position:static;display:block;max-height:none}.v4.event-active #main-content{padding-bottom:0}
}
@media(max-width:900px){
 .v4 .sheet-toggle{position:static;order:2;flex:none;align-self:stretch;margin:5px 8px;box-shadow:none;border-radius:8px;min-height:44px;padding:9px 14px}
 .v4 .companion-sidebar{max-height:196px}.v4 .companion-list{max-height:126px}.v4 .advance-panel .advance{max-width:none}
 .v4 .inspector{bottom:calc(62px + env(safe-area-inset-bottom))}.v4{grid-template-rows:auto minmax(0,1fr) calc(62px + env(safe-area-inset-bottom))}
 .v4 .sheet-close{width:100%;margin:0 0 14px;background:var(--paper);font-size:14px;min-height:44px;box-shadow:0 -14px 0 14px var(--paper)}
}

/* Ver 0.8: cloth/paper/wood skin. Rules below own camp geometry and shared surfaces. */
:root{--paper:#faf5e8;--ink:#4c392a;--olive:#6c7752;--wood:#8c6b4c;--stitch:#c4b59a}
.cloth-ui{background:#9bb8c2;color:var(--ink)}
.cloth-ui .workspace{gap:8px;padding:8px;background:repeating-linear-gradient(0deg,#9ebcc840 0 1px,transparent 1px 4px),#9db9c5}
.cloth-ui #main-content{background:#f8f1e1;border:1px solid #b8a185;border-radius:15px;box-shadow:inset 0 0 0 5px #e8dcc4,inset 0 0 0 6px #cbbda2}
.cloth-ui .inspector,.cloth-ui .companion-sidebar{border:1px solid #b8a185;border-radius:14px;box-shadow:inset 0 0 0 4px #eee4cf;background:#faf5e8}
.cloth-ui .common-header{background:#faf5e8;border-bottom:3px solid #b8a185;box-shadow:0 2px 4px #71513728}
.cloth-ui .brand,.cloth-ui .day-number,.cloth-ui h1,.cloth-ui h2,.cloth-ui h3{color:#543a26}
.cloth-ui .primary,dialog .primary{background:#6c7752;border-color:#54603e;color:#fffdf3;box-shadow:0 2px 0 #4b5436,inset 0 0 0 2px #ffffff25;border-radius:10px}
.cloth-ui .soft-button,dialog .soft-button{background:#f0ead9;border:1px solid #bdae91;color:#574630;border-radius:8px}
.cloth-ui .section-tabs .selected{background:#e2e6cf;border-color:#6c7752;color:#354027}
.cloth-ui .bottom-nav{border-top:2px solid #9a7f5c;background:#f7f0df;gap:10px;padding:6px 16px}
.cloth-ui .bottom-nav button{border:1px dashed #b5a88b;border-radius:9px;color:#604933}
.cloth-ui .bottom-nav button.active{background:#73805a;color:#fffef5;box-shadow:inset 0 0 0 3px #94a17a;border-color:#e0dec4}
.cloth-ui .order-nui{background:none}.cloth-ui .companion-card{background:#f7f2e3;border:1px dashed #baaf90}.cloth-ui .companion-card.selected{background:#edf0dd;border:2px solid #7a855d}
.cloth-ui .order-nui .order-work{color:#4d573d}.cloth-ui .companion-details{background:#eee8d7;color:#5a593f}.cloth-ui .activity-badge{background:#e6e7d5;color:#4b5a38}
.cloth-ui .map-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0}.cloth-ui .map-controls small{font-size:13px}

.cloth-ui .map-viewport{padding:0;border:3px solid #9c8763;box-shadow:none;background:#84adc0}
.cloth-ui .supplied-map{outline:none;border-radius:0}
.cloth-ui .map-shade,.cloth-ui .map-frame.rainy::before{pointer-events:none}
.cloth-ui .exploration-fog{z-index:3;opacity:1}
.cloth-ui .map-pin .pin-name{background:#fbf4df;color:#523e29;box-shadow:0 2px 2px #442d2840;border:1px solid #8b7d63;border-radius:5px;padding:4px 8px}
.cloth-ui .map-pin.locked .pin-name{background:#e7dfc9;color:#70634c;border-style:dashed}.cloth-ui .map-pin.selected .pin-name{background:#73805a;color:white;border-color:#f3cd74}
.cloth-ui .plan-marker{position:absolute;z-index:7;transform:translate(-50%,calc(-50% + var(--marker-offset)));font-size:11px;min-height:23px;padding:3px 5px;border:1px solid #748050;background:#f4f3e1;display:flex;gap:5px;white-space:nowrap;line-height:1.3;box-shadow:0 1px 3px #40352850;max-width:150px;border-radius:5px}
.cloth-ui .plan-marker.draft{border:2px dashed #ad772d;background:#fff5d7}.cloth-ui .plan-marker b{font-size:10px}
.cloth-ui{grid-template-columns:minmax(0,1fr)}.cloth-ui .common-header,.cloth-ui .workspace,.cloth-ui .bottom-nav{min-width:0;max-width:100%}
.cloth-ui .map-nui{transition:none}.cloth-ui .map-nui>.nui{height:calc(100% - 34px);flex:0 0 calc(100% - 34px);object-fit:contain}.cloth-ui .map-nui-label{font-size:11px;color:#493c29;background:#faf7e9;flex:none}.cloth-ui .map-nui-label small{font-size:10px}
.cloth-ui .camp-hub>.section-heading{margin-bottom:6px;min-height:44px;align-items:center}.cloth-ui .camp-hub>.section-heading h1{font-size:22px;margin:0}.cloth-ui .camp-hub>.section-heading .eyebrow,.cloth-ui .camp-hub>.section-heading p{display:none}
.cloth-ui .camp-scene{min-height:0;background:transparent;padding:0;border:0;border-radius:0;overflow:visible}
.cloth-ui .camp-scene-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:5px 12px;padding:0 0 10px;background:none}
.cloth-ui .camp-scene-heading h2{font-size:16px;margin:0}.cloth-ui .camp-scene-heading p,.cloth-ui .camp-scene-heading>span{font-size:13px;margin:0}.cloth-ui .camp-scene-heading>span{display:none}
.cloth-ui .camp-viewport{overflow:auto;max-width:100%;border:3px solid #9c8763;border-radius:12px;overscroll-behavior:contain;background:#ecdfbc}
.cloth-ui .camp-art-frame.grown-camp{position:relative;width:100%;min-width:650px;aspect-ratio:auto;height:clamp(265px,calc(100dvh - 505px),620px);min-height:0;margin:0;border:0;border-radius:0;overflow:hidden}
.cloth-ui .camp-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 50%;filter:none}
.cloth-ui .camp-shade{position:absolute;inset:0;pointer-events:none;background:none;z-index:1}
.cloth-ui .grown-camp.night .camp-shade{background:#26354650}.cloth-ui .grown-camp.evening .camp-shade{background:#c88e2820}
.cloth-ui .camp-facility{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:end;transform:translate(-50%,-50%);width:18%;height:34%;min-height:0;margin:0;padding:0;background:none;border:0;border-radius:8px;box-shadow:none;z-index:2;color:#4d3824;animation:none}
.cloth-ui .camp-facility:hover,.cloth-ui .camp-facility:focus-visible{transform:translate(-50%,-50%);background:#fff4c33a;outline:2px solid #a68449;outline-offset:1px}
.cloth-ui .facility-art{position:relative;display:block;width:100%;height:calc(100% - 32px);flex:0 0 calc(100% - 32px);min-height:0}
.cloth-ui .facility-art .scene-sprite{position:static;width:100%;height:100%;object-fit:contain;transform:none;filter:none;animation:none}
.cloth-ui .facility-art .installed-sail{position:absolute;width:65%;height:85%;left:17%;top:0;pointer-events:none}
.cloth-ui .camp-facility .facility-label{position:static;transform:none;display:block;width:max-content;max-width:100%;margin:0;background:#fff9eaea;border:1px solid #c5b694;border-radius:4px;box-shadow:none;padding:3px 4px;font-size:13px;line-height:1.25;white-space:normal;text-align:center}
.cloth-ui .facility-label b{display:block;font-size:10px;color:#656044}
.cloth-ui .camp-facility .facility-progress{position:absolute;bottom:-4px;width:75%;height:4px;background:#ded2b9;overflow:hidden;border-radius:3px}.cloth-ui .facility-progress i{display:block;height:100%;background:#8f925a}
.cloth-ui .construction-site{display:grid;place-items:center;width:100%;height:100%;font-size:40px;border:2px dashed #b7996c;border-radius:10px;background:#fbf0d460}
.cloth-ui .camp-residents{display:contents}
.cloth-ui .camp-character.camp-resident{position:absolute;width:15%;height:23%;min-width:0;min-height:0;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:end;flex-direction:column;gap:0;background:none;border:0;box-shadow:none;padding:0;z-index:4;animation:none}
.cloth-ui .camp-character.camp-resident>.nui{width:70%;height:79%;object-fit:contain;margin:0;transform:none;filter:none}
.cloth-ui .grown-camp.has-human{--camp-equipment-scale:.76}
.cloth-ui .has-human .camp-facility{width:calc(18% * var(--camp-equipment-scale))}
.cloth-ui .camp-character.camp-resident.camp-human{left:87%!important;top:auto!important;bottom:1.5%;width:24%;height:73%;transform:translateX(-50%);justify-content:end}
.cloth-ui .camp-character.camp-resident.camp-human>.nui{width:100%;height:calc(100% - 25px);flex:0 0 calc(100% - 25px);object-fit:contain;object-position:center bottom}
.cloth-ui .camp-character.camp-resident.camp-human>span{flex:none;font-size:13px;line-height:1.4;max-width:100%;white-space:normal;text-align:center}
.cloth-ui .camp-character.camp-resident.camp-human:hover,.cloth-ui .camp-character.camp-resident.camp-human:focus-visible{transform:translateX(-50%)}
.cloth-ui .camp-resident>span{font-size:12px;line-height:1.4;white-space:nowrap;background:#faf6e9f0;padding:2px 6px;border-radius:5px}
.cloth-ui .camp-character:hover,.cloth-ui .camp-character:focus-visible{outline:2px solid #b1975d;outline-offset:2px;border-radius:10px}
.cloth-ui .camp-equipment-heading h3{font-size:18px;margin:16px 0 6px}.cloth-ui .camp-equipment-heading p,.cloth-ui .camp-scroll-note{font-size:13px;line-height:1.6;margin:6px 0 10px}
.cloth-ui .camp-building-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));gap:8px;margin:0}
.cloth-ui .camp-building-list button{display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;padding:10px;background:#faf5e6;border:1px dashed #bdae8f;border-radius:8px;min-height:58px;color:#52432e}
.cloth-ui .camp-building-list button span{display:grid;gap:3px;font-size:14px}.cloth-ui .camp-building-list small,.cloth-ui .camp-building-list b{font-size:12px}.cloth-ui .camp-building-list b{flex:none}
.cloth-ui .camp-conversation,.cloth-ui .camp-additions,.cloth-ui .camp-resident-list{margin-top:18px;padding:12px;border:1px dashed #bdae8f;border-radius:8px;background:#f8f1de}
.cloth-ui summary{cursor:pointer;min-height:44px;padding:10px 0}.cloth-ui .camp-additions button{display:inline-grid;justify-items:center;width:180px;font-size:13px;background:transparent}.cloth-ui .camp-additions canvas{width:140px;height:120px}
.cloth-ui .camp-quick-actions{display:grid;gap:8px}.cloth-ui .inspector .chore-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.cloth-ui .inspector .animal-grid{display:block}.cloth-ui .inspector .animal-card{margin:14px 0}
.cloth-ui .inspector .section-tabs{gap:4px;flex-wrap:wrap}.cloth-ui .inspector .section-tabs button{flex:1 1 40%;min-width:0}
.cloth-ui .tent-home-art{width:100%;max-width:340px}.cloth-ui .tent-home-art canvas{width:100%;height:200px}
.cloth-ui .recipe-category{color:#707453;font-size:13px}.cloth-ui .replacement-notice{background:#f7e9c5;border-left:3px solid #b79855;padding:10px}
.cloth-ui .equipment-focus{padding:12px;border:1px dashed #929d71;background:#eef0dd}
.cloth-ui .map-viewport:focus-visible,.cloth-ui .camp-viewport:focus-visible{outline:3px solid #537b9b;outline-offset:2px}
.tutorial-environment{background:#a7bdc6;color:#4c392a}.tutorial-environment .tutorial-app-header,.tutorial-fixed-status{background:#faf3e2;color:#4c392a}.tutorial-environment .tutorial-main,.tutorial-environment .tutorial-roadmap,.tutorial-environment .tutorial-panel{background:#faf5e8;border-color:#b8a185}.tutorial-environment .primary{background:#6c7752;color:white}.tutorial-environment .tutorial-choice{border-color:#bbae90;background:#faf4e4;color:#57442d}.tutorial-environment .tutorial-choice.selected{background:#e6ead8;border-color:#73805a}
.tutorial-map .exploration-fog{opacity:1;z-index:1;pointer-events:none}.tutorial-map .tutorial-pin{z-index:2}
dialog{background:#faf5e8;color:#4c392a;border:2px solid #a98f70;border-radius:18px;box-shadow:inset 0 0 0 5px #eee1c8,0 10px 40px #42362840}
dialog button,dialog select{min-height:44px;font:inherit}dialog .dialog-header{background:#eee6d1;border-bottom:1px dashed #b6a584}.speech>div,.opening-dialogue article{background:#efeedc}
@media(min-width:901px){.cloth-ui #main-content{padding:18px}.cloth-ui .inspector{padding:18px}.cloth-ui .workspace{grid-template-columns:minmax(0,1fr) 335px;grid-template-rows:minmax(0,1fr) auto}.cloth-ui .camp-scroll-note{display:none}}
@media(min-width:1600px){.cloth-ui .workspace{grid-template-columns:minmax(0,1fr) 360px}}
@media(max-width:900px){.cloth-ui .workspace{padding:5px;gap:5px}.cloth-ui #main-content{padding:12px 12px 24px}.cloth-ui .camp-art-frame.grown-camp{min-width:650px}.cloth-ui .plan-marker{font-size:10px;min-height:22px}.cloth-ui .bottom-nav{gap:4px;padding:4px}.cloth-ui .bottom-nav button{min-height:46px}.cloth-ui .bottom-nav b{font-size:12px}.cloth-ui .inspector{box-shadow:0 -8px 30px #56463240;padding:14px;max-height:78dvh}.cloth-ui .companion-sidebar{max-height:none;padding:5px}.cloth-ui .companion-list{max-height:none}.cloth-ui .companion-card{flex-basis:195px}.cloth-ui .map-controls{gap:5px}.cloth-ui .map-controls button{min-height:36px;font-size:12px}.cloth-ui .map-controls small{display:block;width:100%;font-size:12px}.cloth-ui .camp-scroll-note{display:block}}

.cloth-ui .compact-camp .camp-facility{height:52%;width:calc(var(--compact-width,23%) * var(--camp-equipment-scale,1));top:43%}.cloth-ui .compact-camp .facility-art{flex:0 0 calc(100% - 36px);height:calc(100% - 36px)}
@media(max-width:900px){.cloth-ui .camp-art-frame.grown-camp{height:350px}.cloth-ui .camp-scene-heading{gap:3px}.cloth-ui .camp-scene-heading p{font-size:12px}.cloth-ui .camp-facility .facility-label{font-size:12px}.cloth-ui .camp-hub>.section-heading h1{font-size:20px}}

.cloth-ui .completion-note{padding:10px;margin-bottom:10px}.cloth-ui .completion-note p{font-size:14px;line-height:1.55;margin:4px 0}

.cloth-ui .map-controls{position:relative}.cloth-ui .map-conditions summary{min-height:44px;padding:10px;font-size:13px;border:1px dashed #b6a383;border-radius:8px;background:#f4eedf}.cloth-ui .map-conditions .island-forecast{position:absolute;left:0;top:100%;z-index:15;width:min(540px,100%);box-shadow:0 5px 12px #3e39294a;background:#faf5e8;font-size:14px}.cloth-ui .map-controls small{font-size:12px}

.tutorial-environment .tutorial-app-header button{color:#5b4630;min-height:44px}.tutorial-environment .tutorial-workspace{background:#fbf5e6;border:2px solid #c1b195;box-shadow:inset 0 0 0 5px #ede4cc}.tutorial-environment .tutorial-visual{background:#eee8d5;border:1px dashed #b6a582}.tutorial-environment .tutorial-dialogue,.tutorial-environment .tutorial-number-guide{background:#e8ebdc;color:#48533b}

.embedded-storage>.section-heading{justify-content:flex-end;margin:8px 0}.embedded-storage>.section-heading>.soft-button{min-height:44px}
.save-export-text{display:block;width:100%;max-width:100%;min-height:150px;margin:8px 0 12px;padding:10px;font:13px/1.5 monospace;color:#4c392a;background:#fffdf6;border:1px solid #b8a185;border-radius:6px;resize:vertical}

/* Short touch layouts need a usable work area before the crew and time controls. */
@media(max-width:900px) and (max-height:740px){
 .cloth-ui:not(.event-active) .workspace{overflow-y:auto;overscroll-behavior-y:contain}
 .cloth-ui:not(.event-active) #main-content{flex:1 0 360px;min-height:360px}

}
@media(max-width:900px){
 .cloth-ui .topbar .weather-summary{flex:0 0 94px}
 .cloth-ui .weather-summary summary{gap:4px;white-space:nowrap;min-height:44px}
 .cloth-ui .map-section>.section-heading{display:grid;grid-template-columns:1fr auto;gap:5px 8px;margin-bottom:8px;min-height:0}
 .cloth-ui .map-section>.section-heading>div{display:contents}
 .cloth-ui .map-section>.section-heading .eyebrow{display:none}
 .cloth-ui .map-section>.section-heading h1{grid-row:1;grid-column:1;font-size:22px;margin:0}
 .cloth-ui .map-section>.section-heading .chip{grid-row:1;grid-column:2;font-size:11px;padding:5px 8px}
 .cloth-ui .map-section .screen-instruction{grid-row:2;grid-column:1/-1;font-size:13px;margin:5px 0}
 .cloth-ui .map-controls button{min-height:44px;padding:8px 10px}
}

/* Standard map view fits the available work area; zoom keeps all map layers together. */
.cloth-ui .view-map .map-viewport{width:100%;height:300px;min-height:0;max-height:none;margin:0;overflow:hidden;scrollbar-gutter:auto}
.cloth-ui .view-map .map-viewport .map-frame{width:100%;min-width:0;min-height:0;max-width:none;max-height:none;aspect-ratio:3/2;margin-inline:auto;border:0;box-shadow:none}
.cloth-ui .view-map .map-pin{width:max-content;min-width:0;max-width:none;min-height:0}
.cloth-ui .view-map .map-pin .pin-name{font-size:var(--map-label-size,12px);padding:3px 5px;line-height:1.25}
.cloth-ui .view-map .map-overview .map-pin .pin-name{padding:2px 3px}
.cloth-ui .view-map .map-overview .map-nui-label{font-size:9px;min-width:0;padding:1px 2px;line-height:1.2}
.cloth-ui .view-map .map-overview .map-nui-label small{font-size:9px}
.cloth-ui .view-map .map-overview .map-nui>.nui{height:calc(100% - 14px);flex-basis:calc(100% - 14px)}
.cloth-ui .view-map .map-overview .plan-marker{font-size:9px;min-height:18px;padding:1px 3px}

.cloth-ui .map-section>.section-heading .screen-instruction{margin:0;grid-column:1/-1;line-height:1.5}
/* Offset only the observatory label in the overview; its geographic anchor stays fixed. */
.cloth-ui .view-map .map-overview .map-pin[data-area="station"]{transform:translate(calc(-100% - 10px),-50%)}
.cloth-ui .view-map .map-overview .map-pin[data-area="station"]::after{content:'';position:absolute;left:100%;top:50%;width:10px;height:1px;background:#6b654e;pointer-events:none}

.cloth-ui .view-map .map-overview .map-nui-label small{display:none}

@media(max-width:900px){.cloth-ui .map-conditions summary{font-size:12px;padding:10px 6px}}
.cloth-ui .view-map .map-mini .map-nui-label{display:none}
.cloth-ui .view-map .map-mini .map-nui>.nui{height:100%;flex-basis:100%}
.cloth-ui .view-map .map-nui{min-height:0}

.cloth-ui .marker-guides line{stroke:#875923;stroke-width:.4;stroke-dasharray:1 .6;opacity:.9}

/* Always-visible status values and the same food-return action in page and detail. */
.cloth-ui .crew-vitals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 10px;padding:3px 8px 6px;line-height:1.45}
.cloth-ui .crew-vital{display:flex;align-items:baseline;justify-content:space-between;gap:4px;min-width:0;font-size:.8125rem}
.cloth-ui .crew-vital b{font-size:.875rem;font-variant-numeric:tabular-nums;color:#263e35}
.cloth-ui .crew-vital.needs-care{border-bottom:1px dashed #925031;color:#783e25}
.cloth-ui .vitals-scale{grid-column:1/-1;font-size:.75rem;text-align:right;color:#60604e;line-height:1.2}
.cloth-ui .companion-card{flex-basis:210px;display:flex;flex-direction:column}
.cloth-ui .companion-details{margin-top:auto}
.cloth-ui .companion-sidebar{max-height:none}
.cloth-ui .food-back{flex:0 1 auto;margin-bottom:10px}
.cloth-ui .food-stock-card{display:flex;flex-direction:column;gap:8px;min-width:0}
.cloth-ui .food-stock-card .food-item{width:100%;height:100%}
.cloth-ui .food-stock-card>.soft-button{margin-top:auto}
.cloth-ui .food-expiry,.cloth-ui .expiry-date,dialog .food-expiry,dialog .expiry-date{display:block;font-size:.8125rem;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.cloth-ui .expires-soon,dialog .expires-soon{font-weight:700;color:#813e21;background:#fff0d9;border-left:3px solid #a56032;padding:4px 6px}
.cloth-ui .item>span:nth-child(2){min-width:0;white-space:normal}
.cloth-ui .ration-result,.cloth-ui .ration-forecast{border:1px solid #acb895;border-radius:9px;padding:12px;margin:14px 0;background:#f2f4e5}
.cloth-ui .ration-result{border-width:2px;background:#edf1dd}
.cloth-ui .ration-stats{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.875rem}
.cloth-ui .ration-stats caption{text-align:left;font-weight:700;line-height:1.5;margin:0 0 8px}
.cloth-ui .ration-stats th,.cloth-ui .ration-stats td{padding:7px 3px;text-align:right;border-bottom:1px solid #ced3bc;overflow-wrap:anywhere}
.cloth-ui .ration-stats th:first-child{text-align:left;width:25%}
.cloth-ui .ration-stats td strong{font-size:1rem;font-variant-numeric:tabular-nums}
.cloth-ui .ration-stats td small{display:block;font-size:.75rem;line-height:1.5}
.cloth-ui .food-hub .section-heading{flex-wrap:wrap}
.cloth-ui .building-summary{padding:12px;border-left:3px solid #7b8559;background:#eff1df}
@media(max-width:900px){
 .cloth-ui .bottom-nav{grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}
 .cloth-ui .bottom-nav button{flex-direction:column;gap:2px;padding:3px 1px;line-height:1.25}
 .cloth-ui .bottom-nav b{font-size:.75rem;white-space:nowrap}
 .cloth-ui .companion-card{flex-basis:210px}
 .cloth-ui .companion-list{max-height:none}
}
