:root{color-scheme:dark;--bg:#171a27;--surface:#252a3c;--surface2:#30364b;--border:#44495e;--text:#f6ead0;--muted:#aaaec2;--gold:#efbe72;--rust:#b87742;--mint:#8fdaa7;--red:#ffa5a4;--purple:#c7b8ef}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse at 50% -30%,#393047,var(--bg) 55%);color:var(--text);font-family:system-ui,-apple-system,'Malgun Gothic',sans-serif;font-size:14px;line-height:1.48}button,input,select{font:inherit}button{touch-action:manipulation;cursor:pointer;color:#fff3d9;font-weight:750;background:#855638;border:1px solid #ca9160;border-bottom:3px solid #583928;border-radius:7px;padding:10px 12px;transition:filter .12s}button:active{transform:translateY(1px);border-bottom-width:2px}button:hover{filter:brightness(1.13)}button:disabled{opacity:.42;filter:none;cursor:not-allowed}.primary{background:#aa692e;border-color:#ffd08a}.secondary{background:#383d51;border-color:#5b637d;border-bottom-color:#282b3d}.good{background:#26674f;border-color:#499d7d}.danger{background:#783b46;border-color:#b76b72}.tiny{font-size:11px;padding:6px 9px}.head{position:sticky;top:0;z-index:10;background:#222537ec;border-bottom:2px solid #59463e;backdrop-filter:blur(8px)}.head-inner{max-width:1150px;margin:auto;padding:10px 14px;display:flex;align-items:center;justify-content:space-between;gap:8px}.brand{display:flex;align-items:center;gap:10px}.brand .logo{font-size:30px;filter:drop-shadow(0 1px 4px #f5a93999)}.brand-title{font-size:22px;color:#f9cc84;font-weight:900;letter-spacing:.04em}.brand-title small{font-size:10px;font-weight:500;color:#abb0c9;letter-spacing:normal}.brand-desc,.foot{font-size:11px;color:var(--muted)}.head-right{display:flex;flex-direction:column;align-items:flex-end;gap:4px}.save-state{font-size:10px;color:var(--mint)}.pill,.tag{display:inline-block;border:1px solid #6c6380;background:#343347;border-radius:20px;padding:3px 9px;font-size:11px;color:#fbd9a3}.tag.ok{color:var(--mint);border-color:#537964}.tag.bad{color:var(--red);border-color:#85515a}.shell{max-width:1150px;margin:auto;padding:12px}.summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.stat{background:#242a3b;border:1px solid #48506a;border-radius:8px;padding:10px 12px;min-width:0}.stat span{display:block;color:var(--muted);font-size:11px}.stat strong{display:block;color:#ffe0a5;font-size:16px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}.nav{display:flex;gap:6px;overflow-x:auto;scrollbar-width:thin;position:sticky;top:62px;z-index:9;background:var(--bg);padding:10px 0}.nav button{flex:none;background:#30364a;border-color:#555e76;border-bottom-color:#24293e;padding:9px 13px;white-space:nowrap}.nav button.active{background:#946133;border-color:#f4bd6b}.notices:empty{display:none}.toast{margin:0 0 10px;border-left:4px solid var(--gold);background:#3b3441;padding:11px;border-radius:5px}.cols{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(315px,1fr);gap:12px;align-items:start}.panel{border:1px solid var(--border);background:var(--surface);border-radius:10px;padding:14px;margin:0 0 12px;box-shadow:0 3px 0 #10142033}.panel h2{margin:0 0 10px;color:#f7cb85;font-size:18px}.panel h3{margin:0 0 8px;color:#f1c78a;font-size:15px}.panel p{margin:6px 0}.muted{color:var(--muted)}.sub{font-size:12px;color:var(--muted)}.green{color:var(--mint)}.red{color:var(--red)}.gold{color:var(--gold)}.big{font-size:18px;font-weight:850}.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.between{justify-content:space-between}.stack{display:grid;gap:9px}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.item{background:var(--surface2);border:1px solid #4c536a;padding:11px;border-radius:8px;min-width:0}.item h3{margin:0 0 5px}.item p{margin:5px 0}.item.selected{outline:2px solid var(--gold)}.scene-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0 8px}.scene-helper{color:#f1d8a3;font-size:12px;font-weight:750}.scene-wrap{background:#181622;border:4px solid #b07a4f;border-radius:6px;overflow:hidden;box-shadow:inset 0 0 0 2px #342732,0 4px 0 #11131c}.scene-viewport{width:100%;overflow:auto;scrollbar-width:thin;overscroll-behavior-x:contain}.scene{width:100%;height:auto;display:block;image-rendering:pixelated;image-rendering:crisp-edges;touch-action:pan-x pan-y;cursor:crosshair;user-select:none;-webkit-user-select:none}.scene-viewport.zoomed .scene{width:720px;max-width:none}.scene-status{background:#213b34;border:1px solid #497d64;color:#d2f4cf;min-height:39px;display:flex;align-items:center;padding:8px 10px;font-size:12px;line-height:1.4;margin-top:8px;border-radius:5px;font-weight:700}.furn-legend{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.furn-legend span{display:inline-block;background:#343245;border:1px solid #5d5566;border-radius:4px;font-size:11px;padding:4px 7px;color:#f2dfbd}.scene-tip{font-size:11px;color:#aeb6c6!important;margin-top:8px!important}.day-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0}.day-bar button{flex:1;min-width:150px;padding:12px;font-size:15px}.progress{height:9px;background:#151a29;border:1px solid #3a4157;border-radius:5px;overflow:hidden}.progress>i{height:100%;display:block;background:linear-gradient(90deg,#79ae7f,#d4d68d);max-width:100%}.meter{margin:6px 0}.meter .row{justify-content:space-between;font-size:11px;color:#c6c3ce;margin-bottom:3px}.thought{padding:9px;background:#433849;border-left:3px solid #ab8adb;border-radius:4px;font-size:12px;color:#efe0ff}.toolbar{display:flex;flex-wrap:wrap;gap:6px}.toolbar button{font-size:12px}.card-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.kpi-row{display:flex;justify-content:space-between;align-items:center;padding:5px 0;gap:10px;border-bottom:1px dashed #4a5267}.kpi-row:last-child{border:0}.kpi-row .label{color:#c8c5d2}.note{border-left:3px solid #d5aa5f;background:#3e3945;padding:9px 10px;border-radius:5px;margin:8px 0}.log{border-left:3px solid #a66b43;padding:7px 10px;background:#30374a;margin:6px 0;border-radius:3px 7px 7px 3px}.divider{border:0;border-top:1px solid #4d5367;margin:13px 0}.inputs label{display:block;color:#ccc6d0;font-size:12px;margin-bottom:4px}input,select{max-width:100%;background:#161c2b;border:1px solid #666d83;border-radius:5px;padding:10px;color:#fff0d8}.inputs input{width:100%}.overlay{position:fixed;inset:0;z-index:30;background:#080a13c9;display:flex;align-items:center;justify-content:center;padding:12px}.dialog{width:min(100%,600px);max-height:min(90vh,850px);overflow-y:auto;background:#272c3f;border:3px solid #b7834e;box-shadow:0 12px 0 #090c17,0 0 40px #0009;border-radius:10px;padding:18px}.dialog h2{margin:0 0 10px;color:#ffd596;font-size:20px}.dialog h3{margin:8px 0}.dialog p{margin:8px 0}.dialog .choices{display:grid;gap:9px;margin-top:15px}.dialog .choices button{text-align:left;padding:13px}.report-highlight{background:#353e4e;padding:13px;border:1px solid #777568;border-radius:8px}.report-highlight .profit{font-size:28px;font-weight:900}.act{font-size:12px;color:#d5e5b3;margin-top:4px}.city{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.district{background:#25364c;border:1px solid #4d7390;border-radius:8px;padding:12px;position:relative}.district.active{outline:2px solid var(--gold)}.district .sky{font-size:29px}.district h3{margin:4px 0}.district p{font-size:12px;color:#c2cddd}.bar-graph{display:flex;gap:4px;align-items:flex-end;height:100px;margin-top:8px;border-bottom:1px solid #566078}.bar-graph span{flex:1;position:relative;min-height:2px}.bar-graph em{position:absolute;bottom:-17px;left:50%;transform:translateX(-50%);font-size:8px;font-style:normal;color:#aeb1c5}.foot{text-align:center;padding:20px 0 14px}.hidden{display:none!important}@media(max-width:820px){.cols{grid-template-columns:1fr}.summary{grid-template-columns:repeat(3,minmax(0,1fr))}.nav{top:60px}.stat strong{font-size:15px}}@media(max-width:480px){.head-inner{padding:7px 10px}.brand-title{font-size:19px}.brand .logo{font-size:23px}.brand-desc{font-size:10px}.shell{padding:8px}.summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.stat{padding:8px 7px}.stat span{font-size:10px}.stat strong{font-size:13px}.nav{top:54px}.nav button{padding:8px 11px}.panel{padding:11px}.grid3{grid-template-columns:repeat(2,minmax(0,1fr))}.card-list{grid-template-columns:1fr}.dialog{padding:13px}.city{grid-template-columns:1fr 1fr}.district{padding:9px}}
/* Prevent an enlarged game canvas from expanding the entire phone page. */
.cols>section,.cols>aside,.panel,.scene-wrap,.scene-viewport{min-width:0;max-width:100%}
@media(max-width:820px){.cols{grid-template-columns:minmax(0,1fr)}}
@media(max-width:650px){.scene-viewport{overflow-x:auto;overflow-y:hidden}.scene-tools{gap:5px}.scene-helper{font-size:11px}}

.scene-tools,#zoomMap{scroll-margin-top:125px}

/* v4.5: regular collection + standalone share card */
.share-preview{max-width:440px;margin:8px auto 0;padding:8px;background:#151825;border:1px solid #685443;border-radius:10px}
.share-preview canvas{display:block;width:100%;height:auto;image-rendering:auto}
.unknown-regular{border-style:dashed;background:#242938}
.unknown-regular h3{color:#c3b1bc}

/* iOS Safari safe-area and native image save fallback */
html{-webkit-text-size-adjust:100%}body{padding-bottom:env(safe-area-inset-bottom,0px)}
button{-webkit-tap-highlight-color:transparent}
.overlay{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
.dialog{max-height:min(90dvh,850px);-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.ios-card{max-width:380px;margin:10px auto;padding:6px;border:1px solid #69576d;border-radius:8px;background:#1b2032}
.ios-card img{display:block;width:100%;height:auto;-webkit-touch-callout:default;user-select:auto;-webkit-user-select:auto;touch-action:auto}
@media(max-width:820px){input,select,textarea{font-size:16px;min-height:44px}}

/* v4.7: clearly visible management progression and worker fatigue */
#growthPanel{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0 4px}
.growth-line{display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:10px 12px;background:#252c3d;border:1px solid #65617a;border-radius:9px;min-width:0}
.growth-title{display:flex;flex-direction:column;min-width:135px;gap:2px;flex:1.6}
.growth-title b{font-size:14px;color:#ffe0a4}
.growth-title small{font-size:11px;color:#c5c7d5}
.growth-line .progress{flex:1.25;min-width:70px;height:12px}
.growth-line button{flex:none}
.fatigue-progress{margin:6px 0 7px}
.fatigue-progress>i.safe-meter{background:linear-gradient(90deg,#389f70,#84cf95)}
.fatigue-progress>i.caution-meter{background:linear-gradient(90deg,#c29c43,#edb55e)}
.fatigue-progress>i.danger-meter{background:linear-gradient(90deg,#bd5560,#f17d7b)}
.fatigue-card{margin:10px 0;padding:10px;border:1px solid #565873;background:#262d41;border-radius:8px}
.fatigue-mini{padding:5px 0 7px;font-size:12px}
.fatigue-mini .progress{height:8px}
.manager-class{border-color:#d4ac64;background:#373343}
.manager-class .progress{height:14px;margin:8px 0}
.manager-class .progress>i{background:linear-gradient(90deg,#c28c43,#f5d788)}
.recipe-card{display:flex;flex-direction:column;gap:8px}
.recipe-card h3{margin:0}
.recipe-locked{background:#2b2e40}
.recipe-unlocked{border-color:#64856b}
.recipe-meta{display:flex;justify-content:space-between;gap:7px;flex-wrap:wrap;font-size:12px;color:#d5d2df}
.recipe-meta span{padding:3px 6px;border-radius:5px;background:#25283b}
.recipe-level{display:flex;flex-direction:column;gap:3px}
.recipe-level b{color:#f6d394}
.recipe-level small{color:#bec4d7}
.recipe-button{width:100%;margin-top:auto;min-height:44px}
.growth-report{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:12px;margin:12px 0;background:#35354a;border-left:4px solid #e0b66e;border-radius:6px}
.growth-report span{color:#f4d399;font-weight:750}
#content{scroll-margin-top:122px}
@media(max-width:950px){#growthPanel{grid-template-columns:1fr}}
@media(max-width:540px){.recipe-grid{grid-template-columns:1fr}.growth-line{gap:6px;padding:8px}.growth-title{min-width:0;flex:1.5}.growth-line .progress{flex:1;min-width:54px}.growth-line button{font-size:11px;padding:7px}.recipe-card{padding:12px}}

.chapter-goal{background:#302f43;border:1px solid #74664d;border-radius:9px;padding:12px;margin:9px 0}.chapter-goal>.thought{margin:9px 0}.chapter-goal .meter{margin:10px 0}.chapter-goal .meter>.row{justify-content:space-between;font-size:12px}.district-locked{opacity:.70;border-style:dashed}.district .tag{white-space:normal}.chapter-goal .progress{height:10px}@media(max-width:480px){.chapter-goal{padding:10px}}

/* v1.0 embedded onboarding guide */
.guide-strip{border-color:#987447;background:linear-gradient(110deg,#38354a,#2b3444)}
.guide-strip p{margin:3px 0 0}.guide-main{scroll-margin-top:140px}.guide-step{display:flex;align-items:flex-start;gap:12px;background:#31374c;border:1px solid #526076;border-radius:10px;padding:15px;margin:12px 0}.guide-step>div{min-width:0;flex:1}.guide-step h3{margin-top:0}.guide-step p{line-height:1.62}.guide-step button{max-width:100%}.guide-number{display:flex;align-items:center;justify-content:center;flex:none;width:30px;height:30px;border-radius:50%;background:#8c5636;border:1px solid #e7b57f;font-weight:900}#stockPanel{scroll-margin-top:150px}#startDay{scroll-margin-top:145px}@media(max-width:480px){.guide-step{padding:11px;gap:9px}.guide-step button{width:100%}.guide-strip .row{align-items:flex-start}.guide-strip button{flex:1}}
