*{box-sizing:border-box} :root{font-family:var(--font-ui);color:#263e35;background:#eef2ed;font-synthesis:none}body{margin:0}button,a,canvas{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button{border:0}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #dd6c3e;outline-offset:4px}button:hover{filter:brightness(.97)}.header{height:92px;padding:0 38px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #d4ded5;background:#f7f8f3}.brand{display:flex;gap:13px;align-items:center;color:inherit;text-decoration:none}.brand h1{font-size:21px;letter-spacing:-1px;margin:0 0 3px}.brand span{font-size:11px;letter-spacing:.25px;color:#728277}.header-actions{display:flex;gap:26px;align-items:center}.connection{font-size:12px;color:#738074}.connection.connected:before{content:'';width:6px;height:6px;background:#54856a;border-radius:100%;display:inline-block;margin-right:7px}.quiet-button{background:transparent;font-size:12px;color:#4d6255}.quiet-button span{display:inline-grid;place-items:center;width:19px;height:19px;border:1px solid #819083;border-radius:50%;margin-left:6px}main{height:calc(100dvh - 92px);min-height:660px;display:grid;grid-template-columns:minmax(0,1fr) 298px}.world-stage{position:relative;overflow:hidden;background:#e5ede7;min-width:0}.world-heading{position:absolute;top:32px;left:37px;z-index:2;pointer-events:none}.eyebrow{font-size:10px;letter-spacing:2px;color:#6c8573;font-weight:600}.world-heading h2{font-size:30px;letter-spacing:-1.3px;margin:7px 0 8px;font-weight:750}.world-heading h2 span{font-size:11px;vertical-align:middle;letter-spacing:0;color:#718a76;border:1px solid #bbcebd;padding:4px 6px;margin-left:8px;border-radius:4px}.world-heading p{font-size:11px;color:#718376;margin:0}.world-controls{position:absolute;top:32px;right:26px;display:flex;flex-direction:column;border-radius:10px;overflow:hidden;box-shadow:0 2px 10px #35473710;z-index:3}.world-controls button{width:34px;height:33px;background:#f9faf5;color:#4b6656;font-size:20px}.world-controls button+button{border-top:1px solid #e2e8de}canvas{width:100%;height:100%;display:block;touch-action:none;cursor:crosshair}.map-caption{position:absolute;left:35px;bottom:203px;display:flex;flex-direction:column;gap:9px;pointer-events:none;color:#819383;font-size:9px;letter-spacing:.2px}.north{font-size:15px;font-weight:600;color:#6d8476}.tile-detail{position:absolute;right:25px;bottom:203px;font-size:10px;color:#5b7666;background:#edf3eacf;padding:8px 11px;border-radius:5px;pointer-events:none}.onboarding{position:absolute;bottom:133px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 40px);display:flex;gap:13px;align-items:center;background:#fafbf6;border:1px solid #dce4d7;border-radius:12px;padding:15px 38px 15px 17px;box-shadow:0 5px 18px #283e3010}.step-number{display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:#edf0e6;color:#6e855c;font-size:12px}.onboarding strong{font-size:12px}.onboarding p{font-size:10px;color:#7b8777;margin:5px 0 0}.onboarding button:not(.dismiss){white-space:nowrap;background:#edf1e8;border-radius:7px;color:#536949;padding:10px 12px;font-size:10px;margin-left:15px}.onboarding .dismiss{position:absolute;right:8px;top:5px;background:none;font-size:16px;color:#99a28e}.toolbar{position:absolute;bottom:49px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:5px;padding:8px;background:#293e34;border-radius:14px;box-shadow:0 8px 23px #24422c20;width:max-content}.tool{display:flex;align-items:center;gap:9px;color:#cad5c9;background:transparent;padding:14px;border-radius:8px;font-size:12px}.tool svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}.tool.active{background:#ec865a;color:#fff9ef}.tool kbd{font:9px monospace;background:#ffffff12;padding:2px 4px;border-radius:3px;color:#ffffff80;margin-left:1px}.bag{border-left:1px solid #526153;padding:0 13px 0 19px;margin-left:4px;min-width:113px;position:relative}.bag>span{font-size:9px;color:#bac8b4;display:block;margin-bottom:2px}.bag strong{font-size:15px;color:#fff6e6;display:block}.bag strong b{font-weight:600}.bag small{font-size:10px;color:#b2bda9;font-weight:400}#bag-slots{display:flex;gap:3px;margin-top:5px}#bag-slots i{width:7px;height:4px;background:#586956;border-radius:1px}#bag-slots i.full{background:#eea575}.input-hint{position:absolute;bottom:23px;left:0;right:0;text-align:center;color:#829281;font-size:10px;pointer-events:none}.input-hint span{padding:0 10px;color:#a1aea0}.sidebar{display:flex;flex-direction:column;background:#f8f9f4;border-left:1px solid #d4ded5;padding:31px 25px 20px;overflow-y:auto}.section-label{display:flex;align-items:center;justify-content:space-between;font-size:10px;font-weight:600;letter-spacing:.3px;color:#748474}.section-label>span:not(.live-dot){font-size:10px;font-weight:400;color:#849281}.live-dot{width:6px;height:6px;border-radius:50%;background:#82a07b}.together-title{display:flex;align-items:baseline;gap:7px;margin:12px 0 15px}.together-title strong{font-size:33px;line-height:1;letter-spacing:-2px;font-weight:600}.together-title h2{font-size:15px;font-weight:500;margin:0}.players{display:flex;flex-wrap:wrap;gap:6px}.player{font-size:10px;display:flex;gap:5px;align-items:center;background:#edf0e7;padding:6px 8px;border-radius:5px}.player i{height:7px;width:7px;border-radius:50%}.together p{font-size:10px;line-height:1.7;color:#899381;margin:12px 0}.share-button{width:100%;display:flex;justify-content:space-between;padding:11px 13px;border:1px solid #dbe2d4;border-radius:7px;background:transparent;color:#63755d;font-size:10px}.project-card{margin:26px 0;background:#eaf0df;border:1px solid #dee6cf;border-radius:10px;padding:18px}.project-card h2{font-size:21px;line-height:1.5;letter-spacing:-.7px;margin:15px 0 10px}.project-card p{font-size:11px;line-height:1.8;color:#7c886b;margin:0 0 22px}.project-meter{display:flex;justify-content:space-between;font-size:9px;color:#738460}.project-meter b{font-weight:600}.progress-track{height:4px;border-radius:3px;background:#dbe3cd;margin-top:8px;overflow:hidden}#basin-progress{background:#6d9b81;height:100%;width:0;transition:width .5s}.project-card button{margin-top:18px;padding:0;display:flex;width:100%;justify-content:space-between;color:#566d47;background:none;font-size:10px}.activity{flex:1;min-height:90px}.activity ol{list-style:none;padding:0;margin:17px 0 10px}.activity li{position:relative;padding:0 0 17px 19px;font-size:10px;line-height:1.6;color:#73836e}.activity li:before{content:'';position:absolute;left:2px;top:6px;width:5px;height:5px;background:#c1cdb7;border-radius:50%}.activity li:not(:last-child):after{content:'';position:absolute;left:4px;top:14px;bottom:2px;width:1px;background:#e2e7d9}.activity li strong{font-weight:500;color:#425f43}.activity li small{display:block;color:#97a08e;font-size:9px;margin-top:3px}.activity li.milestone{color:#48887b}.activity li.milestone:before{background:#60a699}.activity li.empty-history{padding:0;color:#96a28c;font-size:11px;line-height:1.8}.activity li.empty-history:before{display:none}.world-footer{border-top:1px solid #e0e5da;padding-top:15px;display:flex;flex-direction:column;gap:5px;font-size:9px;color:#a1aa99}.world-footer span:first-child{color:#788b6e}.toast{position:absolute;top:31px;left:50%;transform:translate(-50%,-20px);opacity:0;background:#293e34;color:#fff9eb;padding:13px 20px;border-radius:9px;max-width:80%;font-size:12px;box-shadow:0 5px 18px #24422c20;transition:opacity .2s,transform .2s;pointer-events:none;z-index:5}.toast.show{opacity:1;transform:translate(-50%,0)}.loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#e5ede7ed;z-index:8;color:#48604a}.loading strong{font-size:20px}.loading p{font-size:12px}.loading button,.primary-button{padding:12px 20px;background:#e88558;color:#fff;border-radius:8px}.loading[hidden]{display:none}dialog{border:1px solid #dbe4d5;border-radius:18px;padding:38px;width:450px;max-width:calc(100% - 30px);color:#2e4937;background:#f8faf3;box-shadow:0 25px 100px #162e2850}dialog::backdrop{background:#1f35294a;backdrop-filter:blur(4px)}.dialog-close{position:absolute;right:16px;top:12px;background:none;color:#87927d;font-size:24px}dialog h2{font-size:27px;letter-spacing:-1px;margin:14px 0}dialog p{font-size:12px;line-height:1.9;color:#7c8a72}dialog ol{padding:0;list-style:none;counter-reset:steps;margin:28px 0}dialog li{counter-increment:steps;margin:18px 0;padding-left:35px;position:relative}dialog li:before{content:counter(steps);position:absolute;left:0;background:#e7eddd;color:#7c8f68;border-radius:50%;width:24px;height:24px;display:grid;place-items:center;font-size:11px}dialog li strong{display:block;font-size:13px;margin-bottom:5px}dialog li span{font-size:11px;color:#77856c;line-height:1.7}dialog .help-note{font-size:10px;background:#eef2e5;padding:13px;border-radius:7px}.primary-button{width:100%;font-size:12px;margin-top:12px}[hidden]{display:none!important}@media(min-width:1600px){main{grid-template-columns:minmax(0,1fr) 330px}.sidebar{padding:35px}.world-heading{top:40px;left:45px}}@media(max-width:1050px){main{grid-template-columns:minmax(0,1fr) 256px}.sidebar{padding:26px 19px}.header{padding:0 25px}.toolbar{gap:1px}.tool{padding:13px 10px;gap:6px}.tool kbd{display:none}.bag{padding-left:12px}.world-heading{left:25px}.onboarding{gap:10px}.onboarding button:not(.dismiss){margin-left:3px;padding:9px}}@media(max-width:760px){.header{height:72px;padding:0 18px}.brand{gap:10px}.brand img{width:34px;height:34px}.brand h1{font-size:18px}.brand span{font-size:9px}.header-actions{gap:10px}.quiet-button{font-size:0}.quiet-button span{font-size:12px}.connection{font-size:10px}main{height:auto;min-height:0;display:block}.world-stage{height:calc(100dvh - 72px);min-height:580px}.world-heading{top:24px;left:20px}.world-heading h2{font-size:25px}.world-heading p{font-size:10px}.world-heading .eyebrow{font-size:9px}.world-controls{top:23px;right:17px}.world-controls button{width:31px;height:32px}.sidebar{display:grid;grid-template-columns:1fr 1fr;gap:23px;padding:26px 22px;overflow:visible;border-left:0;border-top:1px solid #d4ded5}.project-card{margin:0}.activity{grid-column:1/-1}.world-footer{grid-column:1/-1}.onboarding{bottom:124px;padding:12px 27px 12px 12px;gap:8px;max-width:calc(100% - 24px)}.onboarding strong{font-size:11px}.onboarding p{font-size:9px}.onboarding button:not(.dismiss){font-size:9px;padding:8px;margin:0}.step-number{display:none}.toolbar{bottom:46px;padding:7px;gap:1px;border-radius:12px}.tool{padding:13px 10px;gap:6px;font-size:11px}.tool svg{width:18px;height:18px}.bag{min-width:91px;padding:0 7px 0 12px;margin-left:2px}.bag>span{font-size:8px}#bag-slots{gap:2px}#bag-slots i{width:6px}.input-hint{bottom:22px;font-size:9px}.input-hint span{padding:0 5px}.map-caption{left:20px;bottom:190px;font-size:8px}.tile-detail{right:15px;bottom:184px;font-size:9px;max-width:190px}.toast{top:150px;font-size:11px;width:max-content;max-width:88%}.project-card h2{font-size:18px}.project-card{padding:15px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* Select a cell, then use the shovel commands or leave a shared request. */
.secondary-button{width:100%;padding:12px;background:#e9efdf;color:#536949;border-radius:8px;font-size:12px}
.markers-open{position:absolute;top:145px;left:35px;z-index:3;background:#f8faf3;color:#536f55;border:1px solid #d4dfcd;border-radius:7px;padding:10px 12px;font-size:11px}.markers-open b{padding-left:8px}.selection-panel{position:absolute;bottom:128px;left:50%;transform:translateX(-50%);width:480px;max-width:calc(100% - 32px);padding:12px 15px;background:#f8faf3;border:1px solid #d4dfcd;border-radius:12px;z-index:3;box-shadow:0 4px 14px #2c442412}.selection-info{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}.selection-info strong{font-size:12px}.selection-info span{font-size:11px;color:#6d8064}.selection-actions{display:flex;gap:8px}.selection-actions button{min-height:42px;border-radius:7px;padding:9px 12px;font-size:12px}.place-marker{background:#e9efdf;color:#5a7150;flex:1}.perform-shovel{background:#e88558;color:#fff9ed;flex:1.2;font-weight:600}.perform-shovel:disabled{background:#d6dacf;color:#68735f;cursor:default;opacity:1}.selection-panel.stale{border:2px solid #da985c}.precision-controls{display:none}.onboarding{bottom:247px;width:480px;max-width:calc(100% - 32px);padding:12px 30px 12px 14px;gap:9px}.onboarding>div{min-width:0;flex:1}.onboarding p{line-height:1.6}.onboarding button:not(.dismiss){margin-left:0;font-size:10px}.map-caption,.tile-detail{bottom:324px}.moment{position:absolute;top:25px;left:50%;transform:translateX(-50%);z-index:6;background:#285f5a;color:#f4fff6;border:1px solid #96cbb6;border-radius:12px;padding:15px 18px;display:flex;flex-direction:column;gap:7px;max-width:calc(100% - 30px);width:410px;box-shadow:0 6px 20px #29432f20}.moment strong{font-size:16px}.moment span{font-size:11px;line-height:1.6}.moment button{align-self:flex-start;padding:8px 0;background:none;color:#d9edc6;font-size:11px}.activity .history-location{padding:0;color:inherit;background:transparent;text-align:left;font-size:inherit;line-height:inherit}.activity .history-location:hover{text-decoration:underline}.marker-entry{padding:13px 0;border-top:1px solid #dfe7d5;display:flex;align-items:center;gap:10px}.marker-entry .marker-jump{flex:1;text-align:left;background:none;padding:4px;color:#3d644b}.marker-entry strong{font-size:13px;display:block}.marker-entry span{font-size:11px;line-height:1.7;display:block;color:#728369;margin-top:4px}.marker-entry .marker-cancel{font-size:11px;color:#8f674b;background:#f2eadd;border-radius:6px;padding:10px}.marker-empty{color:#728369;font-size:12px;padding:20px 0;line-height:1.8}#markers-dialog{max-height:80dvh;overflow:auto}.world-controls button{min-width:40px;min-height:40px}
@media(max-width:760px){.world-stage{min-height:690px}.world-heading{top:19px}.world-heading p{display:none}.markers-open{top:99px;left:20px;font-size:11px;padding:10px}.onboarding{top:145px;bottom:auto;max-width:calc(100% - 30px);padding:10px 27px 10px 12px;min-height:60px}.onboarding strong{font-size:12px}.onboarding p{font-size:10px}.onboarding button:not(.dismiss){font-size:10px;min-height:40px;white-space:normal;max-width:94px}.selection-panel{bottom:126px;padding:10px 12px;max-width:calc(100% - 24px)}.selection-info strong{font-size:12px}.selection-info span{font-size:11px;line-height:1.45}.selection-actions button{min-height:44px;font-size:12px;padding:8px}.precision-controls{display:flex;gap:8px;margin:8px 0}.precision-controls button{flex:1;min-width:44px;height:44px;background:#edf1e5;color:#536e52;border:1px solid #dce4cf;border-radius:7px;font-size:22px}.map-caption{bottom:321px;font-size:9px}.tile-detail{display:none}.moment{top:143px;padding:12px 15px}.moment strong{font-size:14px}.toast{top:215px}.tool{min-height:48px}.world-controls{right:16px;top:19px}.world-controls button{min-width:40px;min-height:40px}.sidebar{grid-template-columns:1fr}.activity,.world-footer{grid-column:auto}.project-card{margin:0}.header-actions .connection{max-width:93px;font-size:9px}.input-hint{font-size:9px}}
@media(max-width:370px){.brand span{display:none}.header{padding:0 12px}.selection-actions button{font-size:11px}.toolbar .tool{padding:12px 8px}.bag{min-width:82px}.onboarding{max-width:calc(100% - 24px)}}

.tool:disabled{cursor:default;opacity:.4}.selection-info{min-height:36px}
.first-dig-hint{position:absolute;z-index:3;display:flex;align-items:center;transform:translate(-50%,-100%);background:#fff7e8;border:1px solid #dfb58b;border-radius:8px;box-shadow:0 3px 10px #35473712;white-space:nowrap}.first-dig-hint:after{content:'';position:absolute;left:50%;top:100%;height:18px;border-left:1px solid #dd8353;pointer-events:none}.first-dig-hint button{background:transparent;color:#9b5c37;font-size:12px;min-height:44px;padding:0 11px}.first-dig-hint #dig-hint-dismiss{padding:0;width:36px;color:#9f8c74;font-size:18px;border-left:1px solid #ead9c2}.onboarding .dismiss{min-width:30px;min-height:30px}
.selection-panel{padding:6px 10px;border-radius:10px}.selection-bar{display:flex;align-items:center;gap:12px}.selection-bar .selection-info{flex:1;min-width:0;min-height:0;margin:0}.selection-bar .selection-info strong{font-size:12px}.selection-bar #selection-preview{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.selection-panel.has-notice #selection-preview{position:static;width:auto;height:auto;margin:4px 0 0;overflow:visible;clip-path:none;white-space:normal;line-height:1.5}.request-open{min-height:40px;flex-shrink:0;padding:8px 11px;border-radius:6px;background:#e9efdf;color:#5a7150;font-size:11px}.request-open:disabled{cursor:default;opacity:.5}.onboarding{bottom:196px}#request-dialog h2{font-size:22px}#request-dialog .selection-actions button{min-height:44px;font-size:12px;border-radius:8px;padding:12px}.selection-panel .precision-controls{margin:5px 0 2px}
@media(max-width:760px){.selection-panel{padding:5px 8px}.selection-bar{gap:6px}.request-open{min-height:40px;padding:8px;font-size:10px}.onboarding{bottom:auto}.selection-panel .precision-controls button{height:40px;min-height:44px}}
@media(min-width:761px){.world-stage:has(.selection-panel.has-notice) .onboarding{bottom:250px}}
/* The map keeps its actions; the pocket holds the growing block catalog. */
.controls-dock{position:absolute;bottom:49px;left:50%;transform:translateX(-50%);width:480px;max-width:calc(100% - 24px);background:#293e34;border-radius:14px;box-shadow:0 8px 23px #24422c20;z-index:3}
.controls-dock .toolbar{position:static;transform:none;width:100%;box-shadow:none;padding:7px;gap:3px}
.controls-dock .tool{flex:1;justify-content:center;white-space:nowrap;min-width:0;padding:12px 10px;gap:6px}
.controls-dock .tool kbd{display:none}
.controls-dock .bag{min-width:102px;max-width:140px;padding:3px 8px 3px 12px;flex-shrink:0}
.inventory-open{background:transparent;color:#edf4e9;text-align:left;border-radius:0 6px 6px 0;min-height:48px}
.inventory-open:hover{background:#ffffff09}
.inventory-open>span:first-child{display:flex;align-items:center;justify-content:space-between;gap:6px}
.inventory-open strong{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-size:12px;line-height:1.4}
.inventory-open #bag-material{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:70px}
.inventory-open strong small{white-space:nowrap}
.inventory-open #bag-slots{margin-bottom:0}
.selection-panel{bottom:124px}
.onboarding{bottom:193px}
.map-caption,.tile-detail{bottom:265px}
.sidebar{padding:22px 20px 18px;gap:20px}
.sidebar>section,.sidebar>#inventory-mount,.sidebar>footer{flex-shrink:0;min-width:0}
.together-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.together-title{margin:0;gap:4px;align-items:center}
.together-title .live-dot{margin-right:3px}
.together-title strong{font-size:23px;letter-spacing:-1px}
.together-title h2{font-size:12px}
.together .share-button{width:auto;gap:5px;min-height:32px;padding:5px 6px;border:0;font-size:10px;white-space:nowrap}
.together .players{gap:5px;max-height:60px;overflow-y:auto}
.together .player{padding:5px 6px;font-size:9px}
.together p{font-size:10px;margin:8px 0 0;line-height:1.6}
.inventory-panel{padding:14px;background:#fffef9;border:1px solid #d9e2d2;border-radius:12px;outline:none}
.inventory-panel:focus-visible{outline:3px solid #dd6c3e;outline-offset:3px}
.inventory-heading{display:flex;align-items:center;gap:8px;min-height:28px;margin-bottom:12px}
.inventory-heading h2{margin:0;flex:1;font-size:16px;letter-spacing:-.4px;line-height:1.4}
#inventory-total{font-size:11px;color:#72836a;white-space:nowrap;font-variant-numeric:tabular-nums}
#inventory-close{display:none;background:#edf1e7;color:#536d53;border-radius:8px;font-size:25px;min-width:44px;min-height:44px;padding:0}
.inventory-filters{display:flex;gap:6px;margin-bottom:12px}
.inventory-navigation{flex-shrink:0}
.inventory-search-row{display:flex;align-items:center;position:relative;margin-bottom:8px;min-width:0}
#inventory-search{width:100%;min-width:0;min-height:44px;padding:10px 44px 10px 12px;border:1px solid #dce4d3;border-radius:8px;background:#f8faf4;color:#435b40;font:inherit;font-size:14px;outline-offset:2px}
#inventory-search::placeholder{color:#849179}
#inventory-search::-webkit-search-cancel-button{display:none}
@media(max-width:1100px){#inventory-search{font-size:16px}}
#inventory-search-clear{position:absolute;right:0;top:0;width:44px;min-height:44px;padding:0;background:transparent;color:#687e5d;font-size:23px;border-radius:8px}
#inventory-results:not(.sr-only){flex-shrink:0;margin:0 0 8px;font-size:11px;color:#72836a}
.inventory-filters button{padding:7px 10px;min-height:32px;background:transparent;color:#7d8a73;border-radius:6px;font-size:11px}
.inventory-filters button[aria-pressed=true]{background:#eaf0e1;color:#415f42;font-weight:600}
.inventory-types{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:-4px 0 12px;flex-shrink:0}
.inventory-types:has(>button:nth-child(5):last-child){grid-template-columns:repeat(6,minmax(0,1fr))}
.inventory-types:has(>button:nth-child(5):last-child)>button{grid-column:span 2}
.inventory-types:has(>button:nth-child(5):last-child)>button:nth-child(n+4){grid-column:span 3}
.inventory-types button{padding:6px 2px;min-width:0;min-height:36px;border:1px solid #e1e8d9;border-radius:7px;background:#f8faf4;color:#738568;font:inherit;font-size:12px;white-space:nowrap}
.inventory-types button[aria-pressed=true]{border-color:#90aa7c;background:#eaf0e1;color:#385a3c;box-shadow:inset 0 0 0 1px #90aa7c}
.inventory-types button:focus-visible{outline:3px solid #dd6c3e;outline-offset:2px}
.material-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;gap:6px;max-height:304px;overflow-y:auto;overflow-anchor:none;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b9c9b1 transparent;padding:3px;margin:-3px}
.material-choice{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:85px;padding:7px 3px 6px;border:1px solid #e2e8da;border-radius:8px;background:#f5f7f0;color:#435b40;font-size:11px}
.material-choice[aria-pressed=true]{background:#f9efdf;border-color:#d99b6e;box-shadow:inset 0 0 0 1px #d99b6e;color:#6c4b32}
.material-choice[aria-pressed=true]:after{content:'✓';position:absolute;top:4px;left:5px;font-size:10px;color:#b67749}
.material-choice .material-preview{display:block;width:42px;height:36px;flex-shrink:0;touch-action:pan-y;cursor:pointer;pointer-events:none}
.material-choice .material-name{display:block;max-width:100%;white-space:normal;word-break:keep-all;overflow-wrap:anywhere;padding:0 2px;line-height:1.3;text-align:center}
.material-variants{position:absolute;top:4px;right:4px;color:#687c60;background:#e5ebde;border-radius:4px;padding:1px 3px;font-size:10px;line-height:14px}
.material-colors{grid-column:1/-1;min-width:0;padding:7px 6px 8px;background:#edf2e6;border:1px solid #d5dfcc;border-radius:9px}
.material-grid[data-color-view="true"]{max-height:352px}
.material-colors-back{position:sticky;top:0;z-index:2;display:block;width:100%;min-height:44px;margin:-3px 0 1px;padding:5px 4px;background:#edf2e6;color:#58714d;font-size:12px;text-align:left;border-radius:5px}
.material-colors-heading{display:flex;align-items:center;gap:8px;min-height:36px;margin:0 1px 9px;color:#466242}
.material-colors-heading>div{display:flex;flex-direction:column;gap:2px}
.material-colors-heading>.material-favorite{margin-left:auto}
.material-colors-heading>.material-preview{width:42px;height:35px;flex-shrink:0;pointer-events:none}
.material-colors-heading strong{font-size:15px;font-weight:400;line-height:1.3}
#material-color-selected{font-size:11px;color:#687e5d;white-space:nowrap}
.material-color-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.material-color-choice{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:44px;min-height:56px;gap:2px;padding:4px 1px;border:1px solid #d6dfce;border-radius:6px;background:#fffef8;color:#53694a;touch-action:manipulation}
.material-color-choice .material-preview{display:block;width:31px;height:26px;pointer-events:none;touch-action:pan-y}
.material-color-choice .material-name{font-size:10px;line-height:1.2;letter-spacing:-.3px;white-space:nowrap;max-width:100%}
.material-color-choice[aria-pressed=true]{background:#fff3e2;border-color:#b87b4b;box-shadow:inset 0 0 0 1px #b87b4b;color:#6d482c}
.material-color-choice[aria-pressed=true]:after{content:'✓';position:absolute;top:0;left:3px;font-size:12px;line-height:16px;color:#81512f}
.material-color-choice:focus-visible{outline:3px solid #dd6c3e;outline-offset:1px;z-index:1}
.material-choice .material-count{position:absolute;right:5px;top:4px;min-width:15px;line-height:15px;text-align:center;border-radius:4px;background:#e5ebdc;color:#647555;font-size:10px;font-weight:600;font-variant-numeric:tabular-nums}
.material-choice[aria-pressed=true] .material-count{background:#e7d6b8;color:#725133}
.material-choice.is-empty .material-count{background:transparent;color:#99a28e}
.inventory-selection{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:12px;padding-top:8px;border-top:1px solid #e4e9dd}
.material-favorite{flex-shrink:0;min-width:44px;min-height:44px;padding:0;border-radius:8px;border:1px solid #dce4d3;background:#f8faf4;color:#7c8d70;font-size:24px;line-height:1}
.material-favorite[aria-pressed=true]{color:#a76c36;border-color:#d8b78b;background:#fbf0db}
.material-favorite:focus-visible{outline:3px solid #dd6c3e;outline-offset:2px}
#inventory-selected{color:#7a8770;font-size:10px;line-height:1.5}
.material-find{padding:6px 0 6px 5px;min-height:36px;background:transparent;color:#527151;font-size:11px;white-space:nowrap;flex-shrink:0}
.inventory-note{margin:3px 0 0;color:#8c9682;font-size:10px;line-height:1.5}
.inventory-empty{margin:0;padding:22px 8px;text-align:center;color:#7d8972;font-size:11px;line-height:1.8}
.inventory-empty p{margin:0}
#inventory-search-reset{margin-top:8px;padding:8px 12px;min-height:44px;background:#eaf0e1;color:#415f42;border-radius:7px}
.project-card{margin:0;padding:14px;background:#eef2e6;border-radius:9px}
.project-card h2{font-size:17px;line-height:1.45;margin:9px 0 6px;letter-spacing:-.5px}
.project-card h2 br{display:none}
.project-card p{font-size:10px;line-height:1.7;margin:0 0 12px}
.project-card button{margin-top:11px;min-height:24px}
.activity{flex:0 0 auto;min-height:90px}
.activity ol{margin:12px 0 0}
.activity li{padding:0 0 12px 15px}
.world-footer{padding-top:12px}
#inventory-dialog{width:500px;padding:0;overflow:hidden}
#inventory-dialog .inventory-panel{border:0}
html:has(dialog[open]){overflow:hidden}
@media(min-width:761px){main{min-height:0}.sidebar{min-height:0}.world-stage:has(.selection-panel.has-notice) .onboarding{bottom:246px}}
@media(min-width:1600px){.sidebar{padding:26px;gap:22px}}
@media(min-width:761px) and (max-width:1050px){.sidebar{padding:20px 13px}.inventory-panel{padding:11px}.material-grid{gap:5px}.material-choice{font-size:10px}.together-title h2{font-size:11px}}
@media(max-width:760px){
  .controls-dock{bottom:46px}
  .controls-dock .toolbar{padding:6px;gap:1px}
  .controls-dock .tool{padding:12px 6px;font-size:11px;gap:5px}
  .controls-dock .bag{padding:2px 5px 2px 8px;min-width:93px;max-width:115px}
  .inventory-open strong{font-size:11px;gap:5px}
  .inventory-open #bag-material{max-width:49px}
  .inventory-open strong small{font-size:9px}
  .selection-panel{bottom:123px}
  .onboarding{bottom:auto}
  .map-caption{bottom:311px}
  .sidebar{padding:23px 22px;gap:20px}
  #inventory-mount{display:none}
  #inventory-dialog{position:fixed;inset:auto 0 0;width:min(100%,560px);max-width:100%;max-height:min(80dvh,640px);margin:0 auto;border:1px solid #d4dfcc;border-bottom:0;border-radius:20px 20px 0 0;box-shadow:0 -10px 50px #18352833}
  #inventory-dialog::backdrop{background:#1f352966;backdrop-filter:blur(2px)}
  #inventory-dialog-content{max-height:min(80dvh,640px)}
  #inventory-dialog .inventory-panel{display:flex;flex-direction:column;max-height:min(80dvh,640px);padding:16px 18px calc(18px + env(safe-area-inset-bottom));border-radius:0}
  #inventory-dialog .inventory-heading{flex-shrink:0;margin-bottom:10px}
  #inventory-dialog .inventory-heading h2{font-size:19px}
  #inventory-dialog #inventory-total{font-size:12px;margin-right:7px}
  #inventory-close{display:block}
  .inventory-filters{flex-shrink:0}
  .inventory-filters button{min-height:44px;padding:10px 14px;font-size:12px}
  .inventory-types button{min-height:44px;font-size:14px}
  .material-grid{min-height:0;max-height:min(42dvh,360px);flex:0 1 auto;gap:8px}
  .material-choice{min-height:96px;font-size:12px;padding:10px 5px 8px}
  .material-choice .material-preview{width:51px;height:44px}
  .material-choice .material-count{top:7px;right:7px;min-width:18px;line-height:18px;font-size:11px}
  .material-choice[aria-pressed=true]:after{top:6px;left:7px;font-size:12px}
  .inventory-selection{flex-shrink:0;margin-top:14px;padding-top:8px}
  #inventory-selected{font-size:11px}
  .material-find{min-height:44px;padding-left:10px;font-size:12px}
  .inventory-note{flex-shrink:0;font-size:11px;margin-top:3px}
}
@media(max-width:370px){.controls-dock .tool svg{width:15px;height:15px}.controls-dock .tool{font-size:10px;padding:12px 4px;gap:3px}.controls-dock .bag{min-width:85px;max-width:97px;padding-left:6px}.inventory-open #bag-material{max-width:41px}}

/* Shared places and a free block palette keep building actions close to the map. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.world-links{position:absolute;top:145px;left:35px;z-index:3;display:flex;align-items:center;gap:7px}
.world-links .markers-open{position:static}
.places-map-open{display:none}
.controls-dock .tool{font-size:11px;padding:12px 8px}
.controls-dock .bag{min-width:88px;max-width:104px;padding-left:10px}
.inventory-open strong{margin-top:4px}
.inventory-open #bag-material{max-width:72px}
.selection-panel{bottom:129px;padding:9px 10px}
.selection-options{display:flex;align-items:center;gap:6px;margin-top:7px}
.selection-options>button{flex:1;min-width:0;min-height:36px;padding:7px 9px;border-radius:6px;font-size:11px;white-space:nowrap;background:#edf1e6;color:#5a7150}
.selection-options .undo-button{flex:0 1 auto;margin-left:auto;background:transparent;color:#6c7f65}
.selection-options>button:disabled{cursor:default;opacity:.45}
.onboarding{bottom:230px}
.places-card{margin:0;border-top:1px solid #dde5d5;padding-top:16px}
.places-heading{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-bottom:8px}
.places-heading h2{font-size:14px;letter-spacing:-.3px;margin:0}
.places-heading>button{flex-shrink:0;font-size:10px;background:transparent;color:#708267;padding:6px 0;min-height:30px}
.place-entry{display:flex;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid #e3e9dc;min-width:0}
.place-entry:last-child{border-bottom:0}
.place-jump{display:block;flex:1;min-width:0;background:transparent;text-align:left;color:#3e6047;padding:5px 0}
.place-jump strong{display:block;font-size:12px;font-weight:600;line-height:1.5;overflow-wrap:anywhere}
.place-jump span,.place-jump small{display:block;font-size:10px;line-height:1.7;color:#84917b;margin-top:3px;overflow-wrap:anywhere}
.place-jump:hover strong{text-decoration:underline;text-underline-offset:3px}
.place-remove{flex-shrink:0;min-width:40px;min-height:40px;padding:7px;border-radius:7px;font-size:10px;background:#f0ebdf;color:#8a6d50}
.place-empty{font-size:11px;line-height:1.8;margin:14px 0 3px;color:#87947d}
dialog{max-height:calc(100dvh - 36px);overflow-y:auto}
.dialog-close{min-width:44px;min-height:44px;right:8px;top:5px;display:grid;place-items:center;border-radius:8px}
#place-dialog h2,#places-dialog h2{font-size:24px}
#place-form label{display:block;font-size:12px;color:#5b7255;margin:20px 0 8px}
#place-name{width:100%;min-height:46px;border:1px solid #ccd9c2;border-radius:8px;background:#fffef9;color:#314c36;padding:10px 12px;font:inherit;font-size:14px}
#place-name:focus-visible{outline:3px solid #dd6c3e;outline-offset:3px}
#place-name::placeholder{color:#99a58e}
#place-form .help-note{margin:12px 0}
#place-error{color:#a35b3f;font-size:12px;line-height:1.6;margin:12px 0 0}
#place-share{margin-top:8px}
.place-link{display:block;text-align:center;min-height:44px;padding:12px 8px;margin-top:4px;border-radius:7px;color:#5b7858;font-size:12px;line-height:20px;text-underline-offset:3px}
#places-dialog .place-entry{padding:12px 0}
#places-dialog .place-jump strong{font-size:14px}
#places-dialog .place-jump span,#places-dialog .place-jump small{font-size:11px}
@media(min-width:761px){.world-stage:has(.selection-panel.has-notice) .onboarding{bottom:280px}}
@media(max-width:760px){
  .world-links{top:99px;left:20px}
  .world-stage{min-height:480px}
  .places-map-open{display:block;min-height:40px;padding:9px 10px;border:1px solid #d4dfcd;border-radius:7px;background:#f8faf3;color:#536f55;font-size:11px}
  .controls-dock .tool{flex-direction:column;gap:5px;padding:8px 3px;min-height:60px;font-size:10px;line-height:1.3}
  .controls-dock .tool svg{width:18px;height:18px}
  .controls-dock .bag{min-width:79px;max-width:91px;padding:3px 5px 3px 8px}
  .inventory-open strong{font-size:12px;margin-top:6px}
  .inventory-open #bag-material{max-width:68px}
  .selection-panel{bottom:137px;padding:8px}
  .selection-options{gap:4px;margin-top:6px}
  .selection-options>button{min-height:40px;padding:6px;font-size:10px}
  .selection-panel .precision-controls{gap:5px;margin:5px 0 0}
  .onboarding{bottom:auto}
  .map-caption{bottom:329px}
  .places-heading h2{font-size:16px}
  .places-heading>button{font-size:11px;min-height:40px}
  .place-jump{min-height:44px}
  .place-jump strong{font-size:13px}
  .place-jump span,.place-jump small{font-size:11px}
  dialog{padding:28px 23px}
  #place-name{font-size:16px}
}
@media(max-width:760px) and (max-height:650px){
  .map-caption{display:none}
  .world-heading{top:14px}
  .world-heading h2{font-size:20px;margin:4px 0 0}
  .world-links{top:76px}
}

/* Surface range stays beside the paint command, with a fixed-height preview status. */
.material-pick{flex-shrink:0;min-height:40px;padding:6px 8px;background:#e9efdf;color:#536e52;border-radius:7px;font-size:12px;white-space:nowrap}
.material-pick:disabled{opacity:.5;cursor:default}
body:is([data-edit-shape="line"],[data-edit-shape="rectangle"]) .first-dig-hint{display:none}
#precision-toggle{display:none}
.brush-bar{display:flex;align-items:center;gap:6px;min-height:48px;padding:1px 8px 2px;border-bottom:1px solid #516253}
.brush-controls{display:flex;align-items:center;flex:1;gap:9px;min-width:0;color:#d1dccb}
.brush-heading{flex-shrink:0;font-size:10px;white-space:nowrap}
.brush-sizes{display:flex;flex-shrink:0;gap:3px}
.brush-sizes button{min-width:44px;min-height:44px;padding:6px 8px;border-radius:7px;background:transparent;color:#c0cfb8;font-size:11px;font-variant-numeric:tabular-nums}
.brush-sizes button[aria-pressed=true]{background:#f1edda;color:#435b40;font-weight:600}
.brush-sizes button:disabled{cursor:default}
#brush-summary{flex:1;min-width:0;font-size:10px;line-height:1.5;color:#b8c9b0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.controls-dock .tool{min-height:48px;padding:8px;white-space:normal}
.controls-dock .tool>span{min-width:0;line-height:1.3;overflow-wrap:anywhere}
.controls-dock .tool svg{flex-shrink:0}
.selection-panel{bottom:177px}
.onboarding{bottom:278px}
.map-caption,.tile-detail{bottom:313px}
@media(min-width:761px){.world-stage:has(.selection-panel.has-notice) .onboarding{bottom:328px}}
@media(max-width:760px){
  .brush-controls{flex:0 0 auto;gap:0}
  .brush-heading,#brush-summary{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
  .brush-sizes button{padding:6px;font-size:11px}
  .brush-bar .precision-controls{display:flex;flex:1;min-width:0;gap:5px;margin:0}
  .brush-bar .precision-controls button{min-width:32px;min-height:44px;height:44px;padding:0;border:0;background:#415747;color:#d1dfc7;border-radius:7px;font-size:20px}
  .controls-dock .tool{min-height:64px;padding:7px 3px;gap:4px}
  .controls-dock .tool>span{line-height:1.2}
  .selection-panel{bottom:185px}
  .onboarding{bottom:auto}
  .map-caption{bottom:377px}
}

/* Account status stays in the header so it does not cover the map controls. */
.header-actions{gap:17px}
.account-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:106px;min-height:44px;padding:7px 12px;border:1px solid #d5dfce;border-radius:9px;background:#edf2e7;color:#486148}
.account-button strong{font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.account-button>span{font-size:9px;color:#77876c;white-space:nowrap;font-variant-numeric:tabular-nums}
.account-button:disabled{cursor:default}
#account-dialog h2{font-size:24px;overflow-wrap:anywhere;padding-right:12px}
#account-dialog .account-energy{display:flex;flex-direction:column;gap:7px;background:#edf2e4;border:1px solid #dce5d1;border-radius:10px;padding:18px;margin:19px 0}
#account-dialog .account-energy strong{font-size:27px;letter-spacing:-.7px;font-variant-numeric:tabular-nums}
#account-dialog .account-energy span{color:#77886d;font-size:12px}
#account-dialog .primary-button,#account-dialog .secondary-button{min-height:44px}
#account-dialog #account-browse{margin-top:8px;background:transparent}
#account-error{color:#a35b3f;font-size:12px}
#google-login:disabled{opacity:1;background:#e5e9de;color:#819078;cursor:default}
@media(max-width:760px){
  .header-actions{gap:7px}
  .header-actions .connection{display:none}
  .account-button{min-width:84px;min-height:44px;padding:5px 8px}
  .account-button strong{font-size:11px}
  .account-button>span{font-size:8px}
  .header-actions .quiet-button{min-width:34px;min-height:44px;padding:4px}
  .header-actions .quiet-button span{margin-left:0}
}
@media(max-width:370px){
  .header-actions{gap:3px}
  .account-button{min-width:76px;padding:5px}
  .brand{gap:7px}
  .brand h1{font-size:17px}
}

/* Earth navigation shares one compact row with local places and work requests. */
.world-heading{right:94px;max-width:560px}
.world-heading-meta{display:flex;align-items:center;gap:10px;min-width:0}
.world-heading-meta .eyebrow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:1px}
.map-mode{flex-shrink:0;padding:4px 7px;border:1px solid #cad9c6;border-radius:5px;color:#66816b;background:#f3f7ecbc;font-size:9px;line-height:1.2;white-space:nowrap}
.world-heading h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.world-heading p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.world-controls button{min-width:44px;min-height:44px}
.world-links{top:132px;left:35px;right:84px;flex-wrap:wrap;gap:6px}
.world-links>button{min-height:44px;padding:10px 12px;border:1px solid #d4dfcd;border-radius:7px;background:#f8faf3;color:#536f55;font-size:11px;white-space:nowrap}
.world-links .atlas-open{background:#edf3e6;border-color:#cbdcc3;color:#42694b}
.world-links .capital-open{background:#fffdf5}
.nav-short{display:none}
.region-open{position:absolute;left:50%;bottom:44px;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:24px;max-width:calc(100% - 32px);min-width:188px;min-height:48px;padding:12px 20px;border:1px solid #d88655;border-radius:10px;background:#e88558;color:#fff9ed;box-shadow:0 7px 20px #29432f20;font-size:13px;z-index:3}
.region-open[hidden]{display:none}
.world-stage[data-map-mode="atlas"] .controls-dock,.world-stage[data-map-mode="atlas"] .selection-panel,.world-stage[data-map-mode="atlas"] .input-hint,.world-stage[data-map-mode="atlas"] .first-dig-hint,.world-stage[data-map-mode="atlas"] .onboarding,.world-stage[data-map-mode="atlas"] .tile-detail,.world-stage[data-map-mode="atlas"] #markers-open{display:none}
.world-stage[data-map-mode="atlas"] .map-caption{bottom:26px;max-width:calc(100% - 280px)}
.world-stage[data-map-mode="atlas"] .map-caption .north{display:none}
.world-stage[data-map-mode="atlas"]~.sidebar #inventory-mount{display:none}
.discovery-panel{border-top:1px solid #dde5d5;padding-top:16px}
.discovery-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:14px}
.discovery-heading h2{font-size:14px;margin:0;letter-spacing:-.3px}
.discovery-heading>span{font-size:9px;color:#89967d;white-space:nowrap}
.discovery-group+.discovery-group{margin-top:15px}
.discovery-group h3{display:flex;align-items:center;gap:6px;margin:0 0 7px;color:#708466;font-size:11px;font-weight:500}
.discovery-list{display:grid;gap:5px;max-height:186px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.discovery-list>button,.discovery-list>a{display:block;min-width:0;width:100%;min-height:48px;text-align:left;padding:9px 11px;border:1px solid #e0e7d7;border-radius:8px;background:#f1f5e9;color:#466448;text-decoration:none;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.discovery-list strong{display:block;font-size:12px;font-weight:600}
.discovery-list span,.discovery-list small{display:block;color:#809173;font-size:10px;line-height:1.5;margin-top:3px}
.discovery-empty{margin:0;padding:8px 0;color:#89967e;font-size:11px;line-height:1.7}
#capital-dialog{width:500px;overflow-y:auto}
#capital-dialog h2{font-size:25px;margin-bottom:9px}
#capital-hint{margin:0 0 17px;color:#7a8b70;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
#capital-search{width:100%;min-height:48px;padding:11px 13px;border:1px solid #ccd9c2;border-radius:8px;background:#fffef9;color:#314c36;font:inherit;font-size:15px}
#capital-search::placeholder{color:#94a18a}
#capital-search:focus-visible{outline:3px solid #dd6c3e;outline-offset:3px}
.capital-home{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:44px;margin:9px 0 15px;padding:10px 12px;border-radius:7px;background:#e9efdf;color:#58714f;font-size:12px;text-align:left}
.capital-results{display:grid;gap:6px;max-height:min(48dvh,400px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:3px;margin:-3px}
.capital-results>button,.capital-result{display:block;width:100%;min-height:52px;padding:11px 13px;text-align:left;border:1px solid #e0e7d7;border-radius:8px;background:#fffef9;color:#3f6246;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.capital-results strong{display:block;font-size:14px;font-weight:600}
.capital-results span,.capital-results small{display:block;margin-top:3px;color:#85947a;font-size:11px;line-height:1.5}
.capital-results>button[aria-current="true"],.capital-results>button[aria-pressed="true"]{border-color:#d89c6c;background:#faf0e1}
.capital-empty{margin:0;padding:20px 9px;color:#7f8e74;text-align:center;font-size:12px;line-height:1.7}
@media(max-width:760px){
  .world-heading{left:16px;right:158px;max-width:none}
  .world-heading-meta{gap:6px}
  .world-heading-meta .eyebrow{font-size:9px;letter-spacing:.3px}
  .map-mode{padding:3px 5px;font-size:8px}
  .world-heading h2{margin:6px 0 0;font-size:24px}
  .world-controls{right:12px;top:22px;flex-direction:row}
  .world-controls button+button{border-top:0;border-left:1px solid #e2e8de}
  .world-links{top:98px;left:12px;right:12px;gap:5px}
  .world-links>button{padding:8px;font-size:10px}
  .world-links .markers-open b{padding-left:3px}
  .world-links .nav-long{display:none}
  .world-links .nav-short{display:inline}
  .region-open{bottom:31px;min-height:48px;width:calc(100% - 32px);max-width:360px;justify-content:space-between}
  .world-stage[data-map-mode="atlas"] .map-caption{display:flex;left:16px;bottom:96px;max-width:calc(100% - 32px);font-size:10px;line-height:1.7;color:#56756c}
  .discovery-heading h2{font-size:16px}
  .discovery-heading>span{font-size:10px}
  .discovery-group h3{font-size:12px}
  .discovery-list{max-height:216px}
  .discovery-list>button,.discovery-list>a{min-height:52px;padding:11px 12px}
  .discovery-list strong{font-size:13px}
  .discovery-list span,.discovery-list small{font-size:11px}
  #capital-dialog{max-width:calc(100% - 24px);padding:28px 18px 20px}
  #capital-search{font-size:16px}
  .capital-results{max-height:45dvh}
}
@media(max-width:760px) and (max-height:650px){
  .world-heading{top:12px}
  .world-heading h2{font-size:20px;margin-top:4px}
  .world-links{top:76px}
  .world-controls{top:16px}
  #capital-dialog{padding-top:22px}
  #capital-hint{margin-bottom:10px}
  .capital-home{margin-bottom:10px}
  .capital-results{max-height:38dvh}
}

.view-rotation{position:absolute;right:26px;top:174px;display:flex;z-index:3;border-radius:10px;overflow:hidden;box-shadow:0 2px 10px #35473710;touch-action:manipulation}
.view-rotation button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:44px;min-height:48px;background:#f9faf5;color:#4b6656}
.view-rotation button+button{border-left:1px solid #e2e8de}
.view-rotation svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.view-rotation span{font-size:10px;line-height:1}
.view-rotation button:hover{background:#eaf0e2}
.view-rotation button:focus-visible{outline:2px solid #d77c4f;outline-offset:-3px}
@media(max-width:760px){.view-rotation{right:12px;top:144px}}
@media(max-width:760px) and (max-height:650px){.view-rotation{top:122px}}

/* The geographic atlas fills the stage; the local canvas keeps its layout size. */
#atlas-map{display:none;position:absolute;inset:0;z-index:1;min-width:0;min-height:0;background:#b9d7d5;font-family:inherit}
.world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] #atlas-map{display:block}
.world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] #world{visibility:hidden;pointer-events:none}
#atlas-map .maplibregl-canvas{cursor:inherit}
#atlas-map .maplibregl-canvas:focus-visible{outline-offset:-4px}
.world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] .world-heading{text-shadow:0 1px 5px #f7faf4,0 1px 12px #f7faf4}
.world-stage[data-map-mode="atlas"] .map-caption{z-index:2}
.world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] .map-caption{bottom:58px;max-width:calc(100% - 70px);padding:6px 9px;border:1px solid #d9e3d1;border-radius:6px;background:#f8faf3eb;color:#56756c;line-height:1.7}
.world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] .region-open{bottom:108px}
.world-stage[data-map-mode="atlas"] .world-controls,.world-stage[data-map-mode="atlas"] .world-links,.world-stage[data-map-mode="atlas"] .region-open{touch-action:manipulation}
#atlas-map-status{display:none;position:absolute;top:190px;left:35px;right:84px;z-index:3;width:fit-content;max-width:calc(100% - 119px);padding:9px 12px;border:1px solid #decda9;border-radius:8px;background:#fff9eaf2;color:#816747;font-size:11px;line-height:1.7;overflow-wrap:anywhere;pointer-events:none}
.world-stage[data-map-mode="atlas"] #atlas-map-status:not(:empty){display:block}
#atlas-map-status[hidden]{display:none}
#atlas-artwork-status{display:none;position:absolute;top:190px;left:35px;right:84px;z-index:3;width:fit-content;max-width:calc(100% - 119px);padding:9px 12px;border:1px solid #d2dfcb;border-radius:8px;background:#f8faf3ed;color:#687f65;font-size:11px;line-height:1.7;overflow-wrap:anywhere;pointer-events:none}
.world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] #atlas-artwork-status:not(:empty){display:block}
.world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] #atlas-map-status:not(:empty):not([hidden])~#atlas-artwork-status{display:none}
#atlas-artwork-status[data-state="error"]{border-color:#e0d0b5;background:#fff9eded;color:#8b704b}

/* Marker transforms belong to MapLibre; only their visual contents change on hover. */
#atlas-map .atlas-capital,#atlas-map .atlas-activity,#atlas-map .atlas-cluster{display:flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px;max-width:200px;padding:10px 12px;border:1px solid #ccd9c6;border-radius:10px;background:#fffdf5f5;color:#385d4c;font-family:inherit;font-size:11px;font-weight:600;line-height:1.4;box-shadow:0 3px 10px #244e4220;cursor:pointer;touch-action:manipulation;user-select:none}
#atlas-map .atlas-capital{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#atlas-map .atlas-capital::before{content:"";flex:0 0 7px;height:7px;border:1px solid #6d886e;border-radius:50%;background:#fffef6}
#atlas-map .atlas-activity{width:44px;padding:0;border-color:#72a98a;border-radius:50%;background:#eaf8e9f5;color:#346847;font-size:0}
#atlas-map .atlas-activity::before{content:"";flex:0 0 8px;height:8px;border-radius:50%;background:#579c6e;box-shadow:0 0 0 3px #75b38524}
#atlas-map .atlas-activity.is-built:not(.is-active){border-color:#d6b086;background:#fff4dcf5;color:#876437}
#atlas-map .atlas-activity.is-built:not(.is-active)::before{background:#ba9052;box-shadow:0 0 0 3px #bb925322}
#atlas-map .atlas-capital span,#atlas-map .atlas-activity span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#atlas-map .atlas-cluster{border:2px solid #eef4e7;border-radius:50%;background:#486d58;color:#fffdf0;font-size:13px;font-variant-numeric:tabular-nums}
#atlas-map .atlas-cluster.is-built:not(.is-active){background:#9a7748}
#atlas-map .atlas-capital:hover,#atlas-map .atlas-activity:hover,#atlas-map .atlas-cluster:hover{filter:none;box-shadow:0 3px 14px #244e4240}
#atlas-map .atlas-capital[aria-pressed="true"],#atlas-map .atlas-activity[aria-pressed="true"]{border-color:#d57845;background:#fff0dc}
#atlas-map .atlas-current{width:18px;height:18px;border:3px solid #fffdf4;border-radius:50%;background:#e78355;box-shadow:0 0 0 5px #e7835533,0 2px 8px #4c573444;pointer-events:none}
#atlas-map .atlas-current.is-detail{width:18px;height:18px;border:2px solid #c87649;background:transparent;box-shadow:0 0 0 1px #fffdf4b3;pointer-events:none}

#atlas-map .maplibregl-popup{max-width:min(300px,calc(100vw - 40px))!important;font-family:inherit}
#atlas-map .maplibregl-popup-content{padding:16px;border:1px solid #d5dfcb;border-radius:12px;background:#fffdf4;color:#365342;box-shadow:0 7px 25px #294b3f26}
#atlas-map .maplibregl-popup-close-button{top:3px;right:3px;min-width:44px;min-height:44px;border-radius:8px;color:#7b8b74;font-size:22px;touch-action:manipulation}
#atlas-map .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,#atlas-map .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,#atlas-map .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{border-top-color:#fffdf4}
#atlas-map .maplibregl-popup-anchor-top .maplibregl-popup-tip,#atlas-map .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,#atlas-map .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{border-bottom-color:#fffdf4}
#atlas-map .maplibregl-popup-anchor-left .maplibregl-popup-tip{border-right-color:#fffdf4}
#atlas-map .maplibregl-popup-anchor-right .maplibregl-popup-tip{border-left-color:#fffdf4}
#atlas-map .atlas-popup{min-width:178px;max-width:100%;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
#atlas-map .atlas-popup strong,#atlas-map .atlas-popup h3{display:block;margin:0 28px 4px 0;color:#355641;font-size:14px;font-weight:600;line-height:1.6}
#atlas-map .atlas-popup p,#atlas-map .atlas-popup small,#atlas-map .atlas-popup>span{display:block;margin:0 0 11px;color:#7a8b71;font-size:11px;line-height:1.6}
#atlas-map .atlas-popup button:not(.maplibregl-popup-close-button),#atlas-map .atlas-popup a{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:44px;margin-top:10px;padding:10px 14px;border-radius:8px;background:#e88558;color:#fff9ed;font-family:inherit;font-size:12px;font-weight:600;line-height:1.6;text-decoration:none;touch-action:manipulation}

/* Attribution gets its own bottom row, below the legend and the region CTA. */
#atlas-map .maplibregl-ctrl-bottom-right{right:0;bottom:0;max-width:100%;z-index:4}
#atlas-map .maplibregl-ctrl-bottom-right .maplibregl-ctrl{max-width:100%;margin:0}
#atlas-map .maplibregl-ctrl-attrib{max-width:100%;padding:0 8px;border-radius:7px 0 0;background:#f8faf3f2;color:#687f70;font-family:inherit;font-size:10px;line-height:1.5}
#atlas-map .maplibregl-ctrl-attrib a{display:inline-flex;align-items:center;min-height:44px;padding:0 3px;color:#4b6e5b;text-underline-offset:3px}
#atlas-map .maplibregl-ctrl-attrib a:focus-visible{outline-offset:-3px}
#atlas-map .maplibregl-ctrl-attrib-button{width:44px;height:44px;background-position:center;background-size:24px;background-repeat:no-repeat;touch-action:manipulation}
#atlas-map .maplibregl-ctrl-attrib-button:focus-visible{outline:3px solid #dd6c3e;outline-offset:-4px}
#atlas-map .maplibregl-ctrl-attrib.maplibregl-compact{box-sizing:border-box;min-width:44px;min-height:44px;padding:0 44px 0 0}
#atlas-map .maplibregl-ctrl-attrib.maplibregl-compact-show{padding-left:8px;padding-right:48px}
@media(max-width:760px){
  #atlas-map-status{top:156px;left:12px;right:12px;max-width:calc(100% - 24px);font-size:10px}
  #atlas-artwork-status{top:156px;left:12px;right:12px;max-width:calc(100% - 24px);font-size:10px}
  .world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] .map-caption{left:12px;bottom:58px;max-width:calc(100% - 24px);padding:5px 8px;font-size:9px}
  .world-stage[data-map-mode="atlas"][data-map-engine="maplibre"] .region-open{bottom:112px}
  #atlas-map .atlas-capital{max-width:164px;padding:9px 10px;font-size:10px}
  #atlas-map .maplibregl-popup-content{padding:14px}
  #atlas-map .maplibregl-ctrl-attrib{font-size:9px}
}
@media(max-width:760px) and (max-height:650px){
  #atlas-map-status{top:132px}
  #atlas-artwork-status{top:132px}
}

/* One shared island uses the canvas at every scale; Earth remains compatible. */
body[data-world-kind="island"] [data-earth-only],body[data-world-kind="earth"] [data-island-only]{display:none!important}
body[data-world-kind="island"] .world-stage::before{content:"";position:absolute;inset:0 0 auto;height:180px;z-index:1;background:linear-gradient(180deg,#e5ede7fa 0%,#e5ede7ed 34%,#e5ede799 66%,#e5ede700 100%);pointer-events:none}
.world-links .island-overview{background:#edf3e6;border-color:#cbdcc3;color:#42694b}
body[data-world-kind="island"] .map-mode{background:#f3f7ecdf;color:#658067}
body[data-world-kind="island"] .world-links{right:84px}
body[data-world-kind="island"] .world-links>button{touch-action:manipulation}
@media(max-width:760px){
  body[data-world-kind="island"] .world-links{right:12px;flex-wrap:nowrap}
  body[data-world-kind="island"] .world-stage::before{height:170px}
  body[data-world-kind="island"] .world-links>button{min-width:0;flex-shrink:0}
  body[data-world-kind="island"] .map-caption{max-width:calc(100% - 32px)}
  body[data-island-overview="true"] .selection-panel,body[data-island-overview="true"] .controls-dock{visibility:hidden;pointer-events:none}
}

/* Previews are part of the place button, while the name remains its label. */
.place-jump:has(.place-preview){display:grid;grid-template-columns:96px minmax(0,1fr);gap:0 10px;align-items:center;min-height:70px}
.place-jump .place-preview{grid-column:1;grid-row:1/4;width:96px;height:70px;border:1px solid #d8e2cf;border-radius:8px;background:#e5ede7;object-fit:contain;pointer-events:none;touch-action:auto;cursor:inherit}
.place-jump>.place-preview~*{grid-column:2;min-width:0}
.place-jump .place-copy{grid-row:1/4;min-width:0}
.place-jump .place-copy strong{margin:0}
.place-jump .place-copy span,.place-jump .place-copy small{margin-top:3px}
@media(max-width:760px){
  .place-jump:has(.place-preview){grid-template-columns:72px minmax(0,1fr);column-gap:9px;min-height:56px}
  .place-jump .place-preview{width:72px;height:56px;border-radius:7px}
}

/* One contextual editor follows the selected land; secondary views replace its body. */
.world-stage,#selection-panel,#recent-work{overflow-anchor:none}
#world{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
#recent-work{
  display:flex;align-items:flex-end;justify-content:flex-end;gap:10px;position:absolute;left:50%;
  bottom:calc(var(--edit-hud-height,0px) + max(24px,env(safe-area-inset-bottom)) + 8px);
  transform:translateX(-50%);width:480px;max-width:calc(100% - 24px);padding:8px;
  border:1px solid #cbd8c7;border-radius:10px;background:#f3f8ec;box-shadow:0 4px 14px #29432f1c;z-index:4;
}
#recent-work[hidden],#recent-work [hidden]{display:none!important}
#recent-work-copy{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0;padding:2px 0}
#recent-work-summary{color:#314e36;font-size:13px;font-weight:600;line-height:1.4;overflow-wrap:anywhere;word-break:keep-all}
#recent-work #undo-status{display:block;margin:0;color:#5e7359;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:keep-all}
#recent-work #undo-status:empty{display:none}
#recent-work #undo{display:flex;flex:0 0 108px;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:108px;min-height:44px;margin:0;padding:4px 8px;border:1px solid #b9cdb0;border-radius:8px;background:#e6efde;color:#365630;font-family:var(--font-game);font-size:13px;font-weight:300;line-height:1.2;touch-action:manipulation}
#recent-work #undo-cost{display:block;color:#536f4b;font-family:var(--font-ui);font-size:11px;font-weight:400;line-height:1.2;white-space:nowrap}
#recent-work #undo:disabled,#recent-work #undo[aria-disabled="true"]{opacity:1;background:#eef1e9;border-color:#d4ddcd;color:#75836b;cursor:default}
#recent-work #undo:disabled #undo-cost,#recent-work #undo[aria-disabled="true"] #undo-cost{color:#75836b}
#recent-work[data-blocked="true"]{background:#f4f6ef;border-color:#d4ddcd}
/* Keep the button anchored while only the completion copy and its backdrop fold away. */
#recent-work[data-expanded="false"]{background:transparent;border-color:transparent;box-shadow:none;pointer-events:none}
#recent-work[data-expanded="false"] #recent-work-copy{display:none}
#recent-work[data-expanded="false"] #undo{pointer-events:auto;box-shadow:0 3px 10px #29432f14}
#selection-panel{
  display:block;position:absolute;left:50%;bottom:max(24px,env(safe-area-inset-bottom));
  transform:translateX(-50%);width:480px;max-width:calc(100% - 24px);padding:8px;
  border:1px solid #cbd8c7;border-radius:12px;background:#f8faf3;
  box-shadow:0 5px 18px #29432f1c;z-index:3;
}
#selection-panel.stale{border-color:#b86b3d;box-shadow:0 0 0 1px #b86b3d,0 5px 18px #29432f1c}
#selection-panel[hidden],#selection-panel [hidden]{display:none!important}
body[data-edit-hud="closed"] #selection-panel,.world-stage[data-map-mode="atlas"] #selection-panel{display:none}
#selection-panel .selection-bar{display:flex;align-items:center;gap:4px;min-height:44px;margin:0 0 6px;padding:0;grid-area:auto}
#selection-panel .selection-info{display:flex;flex:1;min-width:0;min-height:0;gap:2px;margin:0;padding:0 4px}
#selection-panel .selection-info strong{font-size:13px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#314c36}
#selection-panel #selection-preview{
  display:block;position:static;width:auto;height:auto;margin:0;padding:0;overflow:hidden;
  clip-path:none;white-space:nowrap;text-overflow:ellipsis;color:#5e7359;font-size:12px;line-height:1.4;
}
#selection-panel #selection-preview:empty{display:none}
#selection-panel .selection-bar>button{flex-shrink:0;min-width:44px;min-height:44px;padding:6px;border-radius:7px;background:transparent;color:#405b42;touch-action:manipulation}
#selection-panel #scope-toggle{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;max-width:100px;height:44px;padding:3px 18px 3px 7px;border:1px solid #d3ddcc;background:#edf2e6;font-size:13px;white-space:nowrap}
#selection-panel .scope-caption{font-family:var(--font-ui);font-size:10px;font-weight:400;line-height:1.2;color:#63785b}
#selection-panel .scope-chevron{position:absolute;right:5px;top:50%;transform:translateY(-50%);font:400 12px/1 var(--font-ui);color:#63785b;pointer-events:none}
#selection-panel #scope-toggle[aria-expanded="true"] .scope-chevron{transform:translateY(-50%) rotate(180deg)}
#selection-panel #scope-value{font-size:13px;font-weight:300;line-height:1.2}
#selection-panel #edit-back{min-width:68px;padding:6px 8px;border:1px solid #d3ddcc;background:#edf2e6;font-size:13px;line-height:1.3;white-space:nowrap}
#selection-panel #scope-toggle[aria-expanded="true"],#selection-panel #edit-more[aria-expanded="true"]{background:#dfe9d7;border-color:#7b9270}
#selection-panel #edit-more{font-size:23px;line-height:1}
#selection-panel #edit-close{font-size:24px;line-height:1;color:#61755a}
#selection-panel #edit-tools{display:block;position:static;inset:auto;transform:none;width:auto;max-width:none;padding:0;background:none;box-shadow:none;border:0;border-radius:0}
#selection-panel .toolbar{display:grid;grid-template-columns:minmax(44px,1fr) minmax(44px,1.08fr) minmax(44px,1.36fr) minmax(44px,.9fr) 52px;position:static;inset:auto;transform:none;width:100%;padding:0;gap:4px;background:none;border:0;border-radius:0;box-shadow:none}
#selection-panel .tool,#selection-panel .tool.active{
  position:relative;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:5px;
  min-width:0;min-height:54px;margin:0;padding:8px 5px;border:1px solid #d5dfcf;border-radius:8px;
  background:#edf2e7;color:#314e36;font-size:14px;line-height:1.3;white-space:normal;
}
#selection-panel .tool>span{min-width:0;line-height:1.35;word-break:keep-all;overflow-wrap:normal}
#selection-panel .tool svg{width:18px;height:18px;flex-shrink:0}
#selection-panel .tool kbd{display:none}
body[data-edit-hud="range"] #selection-panel .tool[aria-pressed="true"]{border-color:#657e57;background:#dfead7;box-shadow:inset 0 0 0 1px #657e57}
body[data-edit-hud="range"] #selection-panel .tool[aria-pressed="true"]::after{content:'✓';position:absolute;top:2px;right:4px;color:#3e5f35;font:700 10px/1 var(--font-ui)}
#selection-panel .tool:disabled{opacity:.45;cursor:default}
#selection-panel #inventory-open{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:0;max-width:none;min-height:54px;margin:0;padding:2px 4px;border:1px solid #d5dfcf;border-radius:8px;background:#f7f8ef;color:#435e3e}
#selection-panel #bag-preview{display:block;flex:0 0 auto;width:34px;height:28px;max-width:none;margin:0;object-fit:contain;pointer-events:none;touch-action:auto;cursor:inherit}
#selection-panel #inventory-open strong{display:block;max-width:100%;margin:0;color:#314e36;line-height:1.2}
#selection-panel #bag-material{display:block;max-width:100%;font-size:14px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#selection-panel #material-pick{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:54px;margin:0;padding:4px 3px;border:1px solid #d3ddcb;border-radius:8px;background:#edf2e7;color:#405d3b;font-size:13px;line-height:1.3;white-space:normal;word-break:keep-all;touch-action:manipulation}
#selection-panel #material-pick-label{display:block;max-width:100%;line-height:1.3}
body[data-material-sampling="true"] #selection-panel #material-pick,#selection-panel #material-pick[aria-pressed="true"]{background:#dfead7;border-color:#657e57;box-shadow:inset 0 0 0 1px #657e57;color:#314e36}
#selection-panel #line-panel{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px;margin:6px 0 0;padding:6px 0 0;border-top:1px solid #dce4d5}
#selection-panel #line-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#selection-panel #line-reset,#selection-panel #line-apply{min-width:0;min-height:44px;padding:8px 10px;border-radius:7px;font-size:14px;line-height:1.4;touch-action:manipulation}
#selection-panel #line-reset{background:#e8efdf;color:#405d3b}
#selection-panel #line-apply{background:#e88558;color:#352719;font-weight:300}
#selection-panel #line-apply:disabled{opacity:1;background:#e0e5d8;color:#69765f;cursor:default}
#selection-panel #line-reset:disabled{cursor:default}
#selection-panel #scope-panel,#selection-panel #edit-extras{position:absolute;right:0;bottom:calc(100% + 8px);width:min(360px,calc(100vw - 24px));max-width:100%;max-height:min(320px,calc(100dvh - 190px));overflow-y:auto;overscroll-behavior:contain;padding:8px;border:1px solid #cbd8c7;border-radius:10px;background:#f8faf3;box-shadow:0 5px 18px #29432f26;z-index:6;pointer-events:auto}
#selection-panel #brush-controls{display:flex;flex-direction:column;align-items:stretch;gap:4px;min-width:0;color:#405d3b}
#selection-panel .brush-heading{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#selection-panel .brush-sizes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;width:100%;min-width:0}
#selection-panel .brush-sizes button{min-width:44px;min-height:44px;padding:6px;border:1px solid #d3ddcb;border-radius:7px;background:#eef3e7;color:#405d3b;white-space:nowrap;font-size:14px}
#selection-panel #brush-square{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding-top:3px;padding-bottom:3px;line-height:1.2}
#selection-panel #brush-square small{font-family:var(--font-ui);font-size:10px;font-weight:400;line-height:1.2;color:#5e7359}
#selection-panel .brush-sizes button[aria-pressed="true"]{background:#dfead7;border-color:#657e57;box-shadow:inset 0 0 0 1px #657e57;color:#314e36}
#selection-panel #brush-summary{display:block;position:static;width:auto;height:auto;margin:0;padding:0;overflow:hidden;clip-path:none;white-space:nowrap;text-overflow:ellipsis;color:#5e7359;font-size:12px;line-height:1.4}
#selection-panel #edit-extras{display:grid;grid-template-columns:1fr 2fr;gap:6px}
#selection-panel .edit-extras-heading{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
#selection-panel .edit-extras-heading strong{padding-left:4px;font-size:13px;font-weight:400;color:#405d3b}
#selection-panel #edit-back{min-width:64px;min-height:44px;touch-action:manipulation}
#selection-panel #precision-toggle{display:block;grid-column:1;min-width:0;min-height:44px;padding:6px 8px;border:1px solid #d3ddcb;border-radius:7px;background:#edf2e7;color:#405d3b;font-size:13px;touch-action:manipulation}
#selection-panel #precision-toggle[aria-expanded="true"]{background:#dfead7;border-color:#657e57}
#selection-panel .selection-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-column:2;gap:5px;margin:0;padding:0}
#selection-panel .selection-options>button{display:block;min-width:0;min-height:44px;margin:0;padding:6px 4px;border:1px solid #d3ddcb;border-radius:7px;background:#edf2e7;color:#405d3b;font-size:13px;line-height:1.4;white-space:normal;word-break:keep-all}
#selection-panel #precision-controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-column:1/-1;gap:5px;margin:0;padding:0}
#selection-panel #precision-controls button{min-width:44px;min-height:44px;height:44px;padding:0;border:1px solid #cbd8c4;border-radius:7px;background:#edf2e7;color:#405d3b;font-size:22px;line-height:1}
body:not([data-edit-hud="closed"]) .input-hint{display:none}
body[data-edit-hud="closed"] .input-hint{bottom:24px;color:#536e55}
body[data-edit-hud="closed"] .map-caption,body[data-edit-hud="closed"] .tile-detail{bottom:28px}
body[data-edit-hud="single"] .map-caption,body[data-edit-hud="single"] .tile-detail{bottom:154px}
body:is([data-edit-hud="range"],[data-edit-hud="more"]) .map-caption,
body:is([data-edit-hud="range"],[data-edit-hud="more"]) .tile-detail{bottom:216px}
@media(max-width:760px){
  #selection-panel{left:12px;right:12px;bottom:max(20px,env(safe-area-inset-bottom));transform:none;width:auto;max-width:none;padding:6px}
  #selection-panel .selection-bar{gap:2px;margin-bottom:5px}
  #selection-panel .selection-info{padding:0 2px}
  #selection-panel .selection-info strong{font-size:12px}
  #selection-panel #selection-preview{font-size:11px}
  body[data-edit-hud="range"] #selection-panel .selection-bar{display:grid;grid-template-columns:minmax(0,1fr) auto 44px 44px;column-gap:2px;row-gap:0}
  body[data-edit-hud="range"] #selection-panel .selection-info{display:contents}
  body[data-edit-hud="range"] #selection-panel .selection-info strong{grid-column:1;grid-row:1;padding-left:2px}
  body[data-edit-hud="range"] #selection-panel #selection-preview{grid-column:1/-1;grid-row:2;white-space:normal;overflow:visible;text-overflow:clip;padding:0 2px;overflow-wrap:anywhere}
  body[data-edit-hud="range"] #selection-panel #scope-toggle{grid-column:2;grid-row:1}
  body[data-edit-hud="range"] #selection-panel #edit-more{grid-column:3;grid-row:1}
  body[data-edit-hud="range"] #selection-panel #edit-close{grid-column:4;grid-row:1}
  body[data-edit-hud="range"][data-material-sampling="true"] #selection-panel .selection-bar{grid-template-columns:minmax(0,1fr) 44px}
  body[data-edit-hud="range"][data-material-sampling="true"] #selection-panel #edit-close{grid-column:2}
  #selection-panel #scope-toggle{padding:3px 17px 3px 6px;max-width:84px;font-size:12px}
  #selection-panel #scope-value{font-size:12px}
  #selection-panel .toolbar{grid-template-columns:minmax(44px,1fr) minmax(44px,1.08fr) minmax(44px,1.3fr) minmax(44px,.85fr) 44px}
  #selection-panel .tool,#selection-panel .tool.active{flex-direction:column;gap:1px;min-height:62px;padding:3px 2px;font-size:13px}
  #selection-panel .tool>span{line-height:1.3}
  #selection-panel #inventory-open{min-height:62px;padding:4px 2px}
  #selection-panel #material-pick{min-height:62px;padding:3px 2px;font-size:12px}
  #selection-panel #bag-material{font-size:13px}
  #selection-panel #line-panel{grid-template-columns:78px minmax(0,1fr);gap:5px;margin-top:5px;padding-top:4px}
  #selection-panel #line-reset,#selection-panel #line-apply{padding:7px 6px;font-size:13px}
  #selection-panel .brush-sizes{gap:4px}
  #selection-panel .brush-sizes button{font-size:13px}
  #selection-panel .selection-options>button{font-size:12px}
}

/* Short landscape screens keep the map and every editing action in one viewport. */
@media(max-width:1100px) and (max-height:450px) and (orientation:landscape){
  .header{height:52px;padding:0 12px}
  .header .brand{gap:8px}
  .header .brand h1{font-size:20px;line-height:1.15;margin-bottom:1px}
  .header .brand span{font-size:10px;line-height:1.2}
  .header .header-actions{gap:6px}
  .header .account-button{min-height:44px;padding:3px 8px}
  .header-actions #help-open{width:44px;min-width:44px;min-height:44px;flex:0 0 44px;font-size:0}
  .header-actions #help-open span{font-size:12px}
  main{display:block;height:auto;min-height:0}
  .world-stage{height:calc(100dvh - 52px);min-height:0}
  .sidebar{overflow:visible;border-left:0;border-top:1px solid #d4ded5}
  #inventory-mount{display:none}
  body[data-world-kind="island"] .world-stage::before{height:100px}
  body[data-world-kind="island"] .world-links{top:8px;left:12px;right:auto;gap:5px;flex-wrap:nowrap}
  body[data-world-kind="island"] .world-links>button{min-height:44px;padding:6px 8px;font-size:12px}
  body[data-world-kind="island"] .world-controls{top:8px;right:12px;flex-direction:row}
  body[data-world-kind="island"] .world-controls button{width:44px;height:44px;min-width:44px;min-height:44px}
  body[data-world-kind="island"] .world-controls button+button{border-top:0;border-left:1px solid #e2e8de}
  body[data-world-kind="island"] #view-rotation{top:8px;right:152px}
  body[data-world-kind="island"] #view-rotation button{height:44px;min-height:44px;gap:1px}
  body[data-world-kind="island"] .world-heading{display:flex;align-items:center;gap:8px;top:54px;left:12px;right:12px;max-width:none}
  body[data-world-kind="island"] .world-heading #world-title{order:-1;margin:0;font-size:17px;line-height:18px;white-space:nowrap}
  body[data-world-kind="island"] .world-heading-meta{gap:6px}
  body[data-world-kind="island"] .world-heading-meta .eyebrow{font-size:10px;line-height:18px}
  body[data-world-kind="island"] .world-heading-meta .map-mode{padding:1px 5px;font-size:10px;line-height:14px}
  body[data-world-kind="island"] #world-subtitle{display:none}
  #selection-panel{left:12px;right:12px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-width:760px;margin:0 auto;padding:5px;transform:none}
  #selection-panel .selection-bar,body[data-edit-hud="range"] #selection-panel .selection-bar{display:flex;gap:3px;margin-bottom:4px;min-height:44px}
  #selection-panel .selection-info,body[data-edit-hud="range"] #selection-panel .selection-info{display:flex;flex-direction:column;gap:1px;padding:0 3px}
  #selection-panel .selection-info strong,body[data-edit-hud="range"] #selection-panel .selection-info strong{font-size:12px;line-height:1.3;padding:0}
  #selection-panel #selection-preview,body[data-edit-hud="range"] #selection-panel #selection-preview{font-size:11px;line-height:1.25;padding:0;white-space:normal;overflow:visible;overflow-wrap:anywhere}
  body[data-edit-hud="range"] #selection-panel #edit-tools{display:grid;grid-template-columns:minmax(0,1fr) 192px;gap:6px;align-items:stretch}
  #selection-panel .toolbar{grid-template-columns:minmax(44px,1fr) minmax(44px,1.08fr) minmax(44px,1.3fr) minmax(44px,1fr) 44px}
  #selection-panel .tool,#selection-panel .tool.active{flex-direction:row;gap:3px;min-height:44px;padding:3px;font-size:12px;line-height:1.25}
  #selection-panel .tool svg{width:15px;height:15px}
  #selection-panel .tool>span{line-height:1.25}
  #selection-panel #inventory-open{flex-direction:row;gap:2px;min-height:44px;padding:2px}
  #selection-panel #bag-preview{width:28px;height:23px}
  #selection-panel #bag-material{font-size:12px}
  #selection-panel #material-pick{min-height:44px;padding:2px;font-size:12px}
  #selection-panel #line-panel{grid-template-columns:56px minmax(0,1fr);gap:4px;margin:0;padding:0;border-top:0}
  #selection-panel #line-reset,#selection-panel #line-apply{padding:4px;font-size:12px;line-height:1.25;min-height:44px}
  #selection-panel #edit-extras{gap:5px;padding:8px}
  #selection-panel #precision-toggle{grid-column:1}
  #selection-panel .selection-options{grid-column:2}
  #selection-panel #precision-controls{grid-column:1/-1}
  #recent-work{left:auto;right:18px;bottom:calc(var(--edit-hud-height,0px) + max(8px,env(safe-area-inset-bottom)) + 6px);transform:none;max-width:108px;width:108px;padding:0;border:0;background:transparent;box-shadow:none}
  #recent-work #recent-work-copy{display:none}
  #recent-work #undo{box-shadow:0 3px 10px #29432f14}
  #inventory-dialog{position:fixed;inset:auto 0 0;width:min(100%,640px);max-width:100%;max-height:calc(100dvh - 12px);margin:0 auto;border-radius:14px 14px 0 0}
  #inventory-dialog-content{max-height:calc(100dvh - 12px)}
  #inventory-dialog .inventory-panel{display:flex;flex-direction:column;max-height:calc(100dvh - 12px);padding:8px 12px calc(8px + env(safe-area-inset-bottom));border-radius:0}
  #inventory-dialog .inventory-heading{flex-shrink:0;min-height:44px;margin-bottom:4px}
  #inventory-dialog .inventory-heading h2{font-size:20px}
  #inventory-dialog #inventory-close{display:block;min-width:44px;min-height:44px}
  #inventory-dialog .inventory-filters{flex-shrink:0;margin-bottom:6px}
  #inventory-dialog .inventory-filters button{min-height:44px;padding:6px 12px}
  #inventory-dialog .material-grid{flex:1 1 auto;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(88px,auto);min-height:88px;max-height:none;gap:6px}
  #inventory-dialog .inventory-navigation{display:grid;grid-template-columns:minmax(120px,1fr) auto;gap:6px 10px;margin-bottom:6px}
  #inventory-dialog .inventory-search-row{margin:0}
  #inventory-dialog #inventory-results{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  #inventory-dialog .inventory-navigation .inventory-filters{margin:0}
  #inventory-dialog .inventory-types{grid-column:1/-1;margin:0;grid-template-columns:repeat(5,minmax(0,1fr))}
  #inventory-dialog .inventory-types button{grid-column:auto;min-height:44px;font-size:14px}
  #inventory-dialog .material-choice{height:88px;min-height:88px;gap:2px;padding:4px}
  #inventory-dialog .material-choice .material-preview{width:42px;height:36px}
  #inventory-dialog .material-choice .material-name{font-size:15px;line-height:1.25}
  #inventory-dialog .inventory-selection{flex-shrink:0;margin-top:6px;padding-top:5px}
  #inventory-dialog .inventory-note{flex-shrink:0;font-size:11px;line-height:1.35;margin-top:3px}
}

@media(min-width:480px) and (max-width:1100px) and (max-height:450px) and (orientation:landscape){
  #inventory-dialog .material-color-grid{grid-template-columns:repeat(8,minmax(0,1fr))}
}

/* A short, location-based request; all user text stays plain text. */
#request-dialog{width:440px;max-width:calc(100% - 24px)}
#request-dialog h2{font-size:24px;padding-right:20px;line-height:1.4}
#request-form label{display:block;font-size:12px;margin:18px 0 8px;color:#5b7255}
#request-text{width:100%;min-height:46px;border:1px solid #ccd9c2;border-radius:8px;background:#fffef9;color:#314c36;padding:10px 12px;font:inherit;font-size:16px}
#request-text:focus-visible{outline:3px solid #dd6c3e;outline-offset:3px}
#request-text[aria-invalid="true"]{border-color:#b15b3f}
.request-meta{display:flex;justify-content:space-between;gap:8px;margin:8px 0 16px;font-size:11px;line-height:1.6;color:#728369}
#request-count{white-space:nowrap;font-variant-numeric:tabular-nums}
#request-copy{padding:14px;background:#edf2e7;border-radius:8px;color:#36513e;font-size:16px;line-height:1.8;overflow-wrap:anywhere;white-space:pre-wrap}
#request-manage .primary-button{flex:2;width:auto;margin:0;min-height:44px}
#request-manage .secondary-button{flex:1;width:auto;margin:0;min-height:44px}
#request-error{color:#a35b3f;font-size:12px;line-height:1.6;margin:12px 0 0}
#request-save{min-height:44px}
.marker-entry .marker-jump{min-width:0;min-height:44px}
.marker-entry strong{overflow-wrap:anywhere;line-height:1.6}
.marker-entry .marker-cancel{flex-shrink:0;min-width:44px;min-height:44px}
@media(max-width:370px){#request-dialog{padding:24px 18px}#request-dialog h2{font-size:21px}.request-meta{font-size:10px}}

.world-links #changes-open{color:#396e63;background:#eef8f0;border-color:#bcd5c7}
#changes-open b{font-weight:400;padding-left:3px}
#changes-dialog{width:440px;max-width:calc(100% - 24px)}
#changes-title{padding-right:28px;font-size:24px}
#changes-summary{font-size:13px;line-height:1.7;color:#6d8064}
#changes-list{display:grid;gap:8px;margin:14px 0}
.change-entry{display:grid;gap:5px;width:100%;padding:13px 15px;min-height:76px;text-align:left;border:1px solid #dce6d3;border-radius:9px;background:#f4f7ed;color:#426549}
.change-entry strong{font-size:17px;font-weight:400;overflow-wrap:anywhere;line-height:1.4}
.change-entry span{font-size:13px;color:#688360}
.change-entry small{font-size:12px;color:#628276}
.change-entry:hover{background:#eaf2e2;border-color:#a7c094}
.change-entry:focus-visible{outline:3px solid #dd6c3e;outline-offset:2px}
#changes-close,#changes-more,#changes-retry{min-height:44px;min-width:44px}
#changes-close{position:sticky;top:0;float:right;z-index:2;margin:-14px -14px 0 0;background:#f8faf3;border-radius:7px}
#changes-limited{padding:8px 10px;border-radius:6px;background:#f3eedf}
@media(max-width:760px){body[data-world-kind="island"] .world-links{flex-wrap:wrap}#changes-dialog{padding:24px 18px}}

@media(max-width:760px) and (min-height:451px){
  #inventory-dialog,#inventory-dialog-content,#inventory-dialog .inventory-panel{max-height:min(calc(100dvh - 24px),700px)}
  #inventory-dialog .inventory-filters{gap:3px;margin-bottom:6px}
  #inventory-dialog .inventory-filters button{flex:1;padding:8px 4px;white-space:nowrap}
  #inventory-dialog .inventory-types,#inventory-dialog .inventory-types:has(>button:nth-child(5):last-child){grid-template-columns:repeat(5,minmax(0,1fr));margin:0 0 10px}
  #inventory-dialog .inventory-types>button{grid-column:auto;font-size:12px}
  #inventory-dialog .inventory-selection{margin-top:8px;padding-top:6px}
}
