/* The estate is a painted map; building controls have no rectangular button plate. */
#dialog:has(.manor-root) .sheet{width:min(94vw,520px);height:94dvh;max-height:94dvh;padding:10px;overflow:hidden;display:flex;flex-direction:column}
#dialog:has(.manor-root) .sheet>header{flex:none;position:relative;top:0;padding:2px 2px 9px;margin:0 0 8px}
#dialog:has(.manor-root) #dialog-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.manor-map-frame{position:relative;display:flex;flex:1;min-height:0;align-items:center;justify-content:center;width:100%;overflow:hidden}
.sheet .manor-notice{flex:none;width:100%;margin:0 0 7px!important;padding:7px 10px!important;min-height:34px!important;text-align:left;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#263d32;border:1px solid #b49c6880}
.manor-resources{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:8px}
.manor-resource{display:grid;grid-template-columns:1fr auto;gap:2px 6px;border:1px solid #a58d5e55;border-radius:6px;background:#122526d9;padding:7px 9px;min-width:0}
.manor-resource small{font-size:11px;color:#d8c6a4;align-self:center}.manor-resource strong{font-size:16px;color:#ffe2a2;font-variant-numeric:tabular-nums}.manor-resource span{grid-column:1/-1;font-size:10px;color:#a9b9ac}
.manor-root{position:relative;flex:none;isolation:isolate;aspect-ratio:2/3;width:100%;max-width:100%;max-height:100%;margin:0;border:1px solid #b99c6266;border-radius:8px;overflow:hidden;background:#36463b}
.manor-ground{display:block;width:100%;height:100%;object-fit:contain;position:absolute;inset:0;pointer-events:none;user-select:none}
.sheet .manor-building{position:absolute;transform:translate(-50%,-50%);border:0!important;background:none!important;border-radius:0;padding:0;min-height:44px;display:grid;justify-items:center;gap:0;line-height:1.3;box-shadow:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.manor-building-art{display:block;width:100%;aspect-ratio:1;object-fit:contain;pointer-events:none;filter:drop-shadow(0 3px 2px #0a160a40)}
.manor-building-label{display:flex;align-items:center;justify-content:center;gap:5px;max-width:100%;padding:3px 7px;border:1px solid #baa16a99;border-radius:5px;background:#122420e8;color:#f7e6ba;font-size:12px;white-space:nowrap;box-shadow:0 2px 6px #07110870;margin-top:-14%;position:relative}
.manor-building-label small{font-size:10px;color:#d6c599;font-weight:400}.manor-building.has-enhancement::after{top:auto;bottom:16px;right:15%;width:7px;height:7px}.manor-building:focus-visible{outline:2px solid #f3d68e;outline-offset:1px}.manor-building:active .manor-building-art{filter:brightness(1.1) drop-shadow(0 3px 3px #07110880)}
.manor-map-hint{margin:7px 0 0;text-align:center;color:#c7c5af;font-size:10px;line-height:1.5;word-break:keep-all}
.manor-layer{position:absolute;inset:0;z-index:5;display:flex;align-items:center;padding:10px;background:#081510a8;backdrop-filter:blur(2px)}
.manor-detail{width:100%;max-height:100%;overflow:auto;overscroll-behavior:contain;border:1px solid #c4a571;border-radius:9px;background:linear-gradient(#102a25ec,#152621f5),url('./assets/stronghold/grounds.webp') center/cover;box-shadow:0 8px 24px #0008;padding:10px;color:#f0e4cc;touch-action:pan-y;scrollbar-width:thin}
.manor-detail-header{position:sticky;top:-10px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0 7px;margin-bottom:7px;background:#142b23;border-bottom:1px solid #b79d6255}
.manor-detail-header strong{font-size:14px}.manor-detail-header button{font-size:11px;min-height:34px;padding:4px 9px}.manor-description{margin:5px 0 10px;font-size:11px;line-height:1.65;color:#c3cbb9;word-break:keep-all}
.manor-comparison{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px}.manor-state{min-width:0;border:1px solid #a3906055;border-radius:6px;background:#0d211cd9;padding:7px;display:flex;flex-direction:column;gap:4px}.manor-state:last-child{border-color:#bcaa7180;background:#243427b5}.manor-state-label{font-size:10px;color:#d1bc86}.manor-state>strong{text-align:center;font-size:12px;color:#f4ddb0}.manor-preview{width:100%;height:clamp(58px,12vh,110px);object-fit:contain;display:block}.manor-stat{display:flex;justify-content:space-between;align-items:baseline;gap:4px;font-size:10px;line-height:1.5}.manor-stat span{color:#b9c5b6;word-break:keep-all}.manor-stat b{color:#eee1c3;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.manor-max{justify-content:center;align-items:center;text-align:center;font-size:11px;line-height:1.8;color:#c3cbb9}
.manor-cost{font-size:11px;color:#e2c785;text-align:center;margin:10px 0 4px;line-height:1.6}.manor-requirement{font-size:10px;color:#bfcbb9;text-align:center;line-height:1.6;margin:4px 0 8px}.manor-upgrade{width:100%;min-height:38px!important;font-size:12px;background-color:#40573c!important}.manor-upgrade:disabled{opacity:.45}.manor-detail .hold-heading{font-size:13px;margin:15px 0 7px;padding-top:11px;border-top:1px solid #a58d5e55}.manor-craft-progress{font-size:11px;color:#e9c58b;line-height:1.6;padding:7px;background:#40382375;border-radius:5px}
.manor-recipes{display:grid;gap:7px}.manor-recipe{display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:8px;row-gap:7px;align-items:center;padding:8px;border:1px solid #a7936355;border-radius:6px;background:#11221cdc}.manor-elixir-art{width:44px;height:44px;object-fit:contain}.manor-recipe-copy{display:grid;gap:4px;min-width:0}.manor-recipe-copy strong{font-size:12px;color:#e9d7a9}.manor-recipe-copy small{font-size:10px;color:#b9c7b3;line-height:1.5}.manor-recipe .hold-elixir-actions{grid-column:1/-1}.manor-detail .hold-elixir-actions button{min-height:36px;font-size:12px;padding:6px 8px}.manor-detail .hold-elixir-actions button:disabled{opacity:.4}.manor-confirm-art{display:block;width:88px;height:88px;object-fit:contain;margin:12px auto 8px}.manor-qi-gain{text-align:center;font-size:15px;color:#eacd8c;margin:8px 0}.manor-confirm-note{display:block;text-align:center;line-height:1.7;font-size:11px;color:#bfccb9;margin:8px 0 14px}.manor-detail .elixir-confirm-copy{font-size:13px;line-height:1.7;margin:9px 0;word-break:keep-all}
@media(max-height:600px){.manor-layer{padding:6px}.manor-preview{height:48px}.manor-detail{padding:8px}.manor-description{margin:4px 0 6px}.manor-state{padding:5px}.manor-resources{margin-bottom:5px}.manor-resource{padding:4px 7px}.manor-resource strong{font-size:13px}}

.manor-rename{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}.manor-name-input{flex:1;min-width:0;padding:9px;border:1px solid #aa956e;border-radius:5px;background:#14282b;color:#f4e6c8}.manor-discovery-pill{text-align:center;padding:14px;margin-bottom:14px;border:1px solid #c4a464;border-radius:9px;background:#223935}.manor-discovery-pill .manor-elixir-art{width:72px;height:72px}.manor-discovery-pill button{min-height:40px;padding:8px 25px}.manor-building.elixir-guide-target{position:absolute}

.sect-panel{display:grid;gap:12px;overflow-wrap:anywhere}.sect-section{display:flex;flex-wrap:wrap;gap:8px;border:1px solid #a9895b66;border-radius:8px;padding:12px}.sect-section h3,.sect-section p,.sect-section small,.sect-section>div{width:100%;margin:3px 0}.sect-section>div{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.sect-section label{display:grid;gap:5px;max-width:100%}.sect-section input{min-width:0;max-width:100%;padding:8px}.sect-section button{min-height:40px}.sect-member small{font-size:10px}

.manor-resources{flex:none}.sect-section textarea{width:100%;min-height:130px;resize:vertical;padding:8px;font:inherit;color:inherit;background:#152a25;border:1px solid #a9895b88}.sect-section label{flex-basis:100%}.sect-section input{width:100%}.sect-post{overflow-wrap:anywhere}.sect-post p{white-space:pre-wrap;line-height:1.8}.sect-post small,.sect-post-link small{display:block;color:#bfc8b6;font-size:11px}.sect-section .sect-post-link{width:100%;text-align:left;padding:10px}.sect-error{font-size:12px;color:#ebbb91}.sect-recipe{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px;border-bottom:1px solid #a9895b44}.sect-recipe small{flex:1}

.manor-funding{display:grid;gap:5px;min-width:0;width:100%;font-size:11px;color:#e7d099;margin:9px 0;overflow-wrap:anywhere}.manor-funding progress{display:block;width:100%;max-width:100%;height:12px;accent-color:#b9a25b;border:1px solid #a28c5480;border-radius:9px;overflow:hidden;background:#0a1917}.manor-funding progress::-webkit-progress-bar{background:#0a1917}.manor-funding progress::-webkit-progress-value{background:linear-gradient(90deg,#6e8955,#dbc47f);transition:width .25s}.manor-recipe>.manor-funding{grid-column:1/-1;margin:0}.manor-donation-label{display:grid;gap:8px;width:100%;min-width:0;font-size:12px;margin:12px 0}.manor-donation-amount{box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:10px;color:#f0e4cc;background:#10251f;border:1px solid #a89365;border-radius:5px;font:inherit}.manor-detail{min-width:0;max-width:100%;box-sizing:border-box;overflow-x:hidden;overflow-wrap:anywhere}.manor-detail .hold-elixir-actions{display:flex;flex-wrap:wrap;gap:7px;min-width:0}.manor-detail .hold-elixir-actions button{flex:1;min-width:0;overflow-wrap:anywhere}.manor-layer{min-width:0;min-height:0;box-sizing:border-box}
.manor-detail .hold-elixir-actions .manor-upgrade{width:auto}



#dialog-content>.estate-guide-footer{position:static;transform:none;flex:none;align-self:center;width:min(100%,360px);max-width:100%;max-height:30dvh;margin:8px 0 0;overflow:auto;pointer-events:auto}

/* Touch-first donation quantity: no numeric keyboard. */
.manor-donation-label{gap:4px}.manor-donation-quantity{display:block;font-size:23px;font-weight:700;line-height:1.4;color:#ffe3a0;font-variant-numeric:tabular-nums;text-align:center}
.manor-detail input.manor-donation-amount[type=range]{display:block;width:100%;min-height:44px;margin:2px 0;padding:0;border:0;background:transparent;appearance:none;-webkit-appearance:none;cursor:pointer;touch-action:pan-y;--donation-fill:0%}
.manor-donation-amount[type=range]::-webkit-slider-runnable-track{height:10px;border:1px solid #94845d;border-radius:8px;background:linear-gradient(to right,#cdb272 0 var(--donation-fill),#213831 var(--donation-fill) 100%)}
.manor-donation-amount[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:28px;height:28px;margin-top:-10px;border:2px solid #f2d9a0;border-radius:50%;background:#6c8a68;box-shadow:0 2px 5px #0008}
.manor-donation-amount[type=range]::-moz-range-track{height:10px;border:1px solid #94845d;border-radius:8px;background:#213831}.manor-donation-amount[type=range]::-moz-range-progress{height:10px;background:#cdb272}.manor-donation-amount[type=range]::-moz-range-thumb{width:26px;height:26px;border:2px solid #f2d9a0;border-radius:50%;background:#6c8a68}
.manor-donation-amount[type=range]:focus-visible{outline:2px solid #f2d9a0;outline-offset:3px;border-radius:8px}.manor-donation-amount[type=range]:disabled{opacity:.4;cursor:default}
.manor-donation-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:4px 0 10px}.manor-detail .manor-donation-presets button{min-height:40px;min-width:0;padding:7px 2px;font-size:12px}.manor-donation-presets button:disabled{opacity:.4}


/* Keep warehouse allocation actions in their own full-width grid column. */
.manor-warehouse-item{grid-template-columns:44px minmax(0,1fr) auto}.manor-warehouse-item>p{min-width:0;margin:0;line-height:1.5;overflow-wrap:anywhere}.manor-detail .manor-distribute-button,.sect-panel .sect-distribute-button{width:auto;min-width:64px;min-height:38px;flex:0 0 auto;white-space:nowrap;word-break:keep-all;overflow-wrap:normal;padding:8px 12px;line-height:1.4}
