/* Compact browsing and optional item actions; the room keeps its working space. */
#arrange-drawer {display:flex;flex-direction:column;gap:10px;overflow:hidden;min-height:0;box-sizing:border-box}
#arrange-drawer > :not(.arrange-items) {flex-shrink:0}
#arrange-drawer .drawer-head {align-items:center;padding-bottom:10px;gap:12px}
#arrange-drawer .drawer-head h2 {font-size:27px;margin:2px 0 0}
#arrange-drawer .drawer-head .icon-button {width:44px;min-height:44px;flex:0 0 44px}
#arrange-drawer .drawer-intro {margin:0;font-size:12px}
#arrange-drawer .backpack-search {margin:0;display:block}
#arrange-drawer .backpack-search > span {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#arrange-drawer .backpack-search input {min-height:44px;font-size:16px;padding:9px 12px}
#arrange-drawer .backpack-filters {border:1px solid #c7cfcb;border-radius:12px;background:#ffffff8c;max-height: min(42dvh,240px);overflow:auto;overscroll-behavior:contain}
#arrange-drawer .backpack-filters summary {display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 11px;cursor:pointer;list-style:none;font-size:13px;font-weight:800}
#arrange-drawer .backpack-filters summary::-webkit-details-marker {display:none}
#arrange-drawer .backpack-filters summary > span {flex:0 0 auto}
#backpack-filter-summary {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#54656c;font-size:11px;font-weight:600}
#backpack-result-count {margin-left:auto;flex:0 0 auto;color:#54656c;font-size:11px;font-weight:600}
.backpack-filter-fields {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px;padding:0 11px 10px}
.backpack-filter-fields label {display:grid;gap:4px;min-width:0;color:#54656c;font-size:11px;font-weight:750}
.backpack-filter-fields select {display:block;width:100%;min-width:0;min-height:44px;padding:8px;border:1px solid #bcc8c6;border-radius:9px;background:#fff;color:#173245;font:inherit;font-size:16px}
.backpack-filter-fields button {grid-column:1/-1;min-height:44px;border:0;border-radius:9px;background:#183b4b;color:#fff;font:inherit;font-size:13px;font-weight:750;cursor:pointer}
#arrange-drawer #arrange-items {flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;padding:0 2px 8px 0;align-content:start;grid-auto-rows:max-content}
#arrange-drawer .backpack-empty {margin:0;font-size:13px;padding:8px}
#arrange-drawer .backpack-request {margin:0;padding:9px 12px;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #c7cfcb;border-radius:11px;background:transparent;text-align:left;color:#304d5a}
#arrange-drawer .backpack-request strong {font-size:12px}
#arrange-drawer .backpack-request span {font-size:11px;color:#66747b}
#mh018-actions {display:contents}
.mh018-actions-heading {display:none}
#mh018-actions-toggle[hidden],#mh018-door-toggle[hidden],#backpack-type-field[hidden] {display:none!important}
#app #decorate-panel[data-mh018-grouped="true"] :is(#mh018-actions-toggle,#mh018-door-toggle) {position:relative;flex:0 0 44px;display:grid;place-items:center;grid-template-columns:1fr;gap:0;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;padding:0;border-radius:13px;pointer-events:auto;overflow:visible}
#app #decorate-panel[data-mh018-grouped="true"] :is(#mh018-actions-toggle,#mh018-door-toggle)[aria-expanded="true"] {border-color:var(--gold);background:#21465a}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions {display:none}
#app #decorate-panel[data-mh018-grouped="true"][data-mh018-actions-open="true"] #mh018-actions {position:absolute;right:calc(100% + 10px);bottom:0;top:auto;display:grid;gap:6px;width:min(260px,calc(100vw - 84px));max-height:calc(100dvh - 86px);overflow:auto;padding:9px;border:1px solid #bbd2d23d;border-radius:15px;background:#102e42f5;box-shadow:0 8px 24px #07182738;pointer-events:auto;overscroll-behavior:contain}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions .mh018-actions-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;color:#f5dfaa;font-size:12px}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions #mh018-actions-close {display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;flex:0 0 44px;font-size:24px;background:transparent;border:0;color:#f6e9ce}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions :is(#decorate-shop,#decorate-service,#decorate-save-product,#decorate-remove) {display:flex;flex:none;align-items:center;justify-content:space-between;gap:8px;width:100%;min-width:0;max-width:none;height:auto;min-height:44px;padding:10px 12px;border-radius:10px;font-size:13px;line-height:1.3;text-align:left;background:#ffffff0b;color:#f6f4ec;pointer-events:auto}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions button .mh010-action-label {position:static;transform:none;width:auto;max-width:none;text-align:left;text-shadow:none;color:inherit;font-size:13px;line-height:1.3;font-weight:700;pointer-events:none}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions button span[aria-hidden="true"] {flex:0 0 24px;width:24px;height:auto;font-size:20px;color:var(--gold-light)}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions #decorate-remove {color:#f4b9ab}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions .mh010-quick-services {position:static;display:grid;gap:6px;width:100%;max-width:none;max-height:none;padding:0;margin:2px 0;overflow:visible;background:transparent;border:0;box-shadow:none;pointer-events:auto}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions .mh010-quick-services button {display:flex;align-items:center;gap:8px;min-height:44px;padding:9px;text-align:left;font-size:12px;background:#ffffff0c}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions .mh010-quick-services strong {font-size:12px}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions .mh010-quick-services small {font-size:11px}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-actions [hidden] {display:none!important}
#app #decorate-panel[data-mh018-grouped="true"] .mh010-door-route {display:none}
#app #decorate-panel[data-mh018-grouped="true"][data-mh018-door-open="true"] .mh010-door-route:not([hidden]) {position:absolute;display:grid;right:calc(100% + 10px);bottom:0;top:auto;width:min(250px,calc(100vw - 84px));max-width:none;padding:12px;gap:7px;border:1px solid #bbd2d23d;border-radius:14px;background:#102e42f5;box-shadow:0 8px 24px #07182738;pointer-events:auto;color:#f4dfab}
#app #decorate-panel[data-mh018-grouped="true"] .mh010-door-route select {width:100%;min-width:0;min-height:44px;font-size:16px;padding:8px;border:1px solid #7d969f;border-radius:9px;background:#eaf0eb;color:#163447}
#app :is(#backpack-filters summary,.backpack-filter-fields button,.backpack-filter-fields select,#mh018-actions button,#mh018-actions-toggle,#mh018-door-toggle):focus-visible {outline:3px solid var(--gold);outline-offset:2px}
@media(max-width:760px) {
 #arrange-drawer {padding:14px 14px calc(12px + env(safe-area-inset-bottom));gap:8px;height:min(86dvh,820px);max-height:calc(100dvh - env(safe-area-inset-top));top:auto;bottom:0}
 #arrange-drawer .drawer-intro {display:none}
 #arrange-drawer .drawer-head {padding-bottom:6px}
 #arrange-drawer .drawer-head h2 {font-size:24px}
 #arrange-drawer .drawer-head small {display:none}
}
@media(orientation:landscape) and (max-height:520px) {
 #app .drawer {top:0;bottom:0;left:auto;right:0;width:min(430px,48vw);height:100%;max-height:100%;padding:max(9px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(9px,env(safe-area-inset-bottom)) 12px;border-radius:16px 0 0 16px;box-sizing:border-box}
 #app .drawer .drawer-head {gap:10px;padding-bottom:7px;align-items:center}
 #app .drawer .drawer-head h2 {font-size:23px}
 #app .drawer .drawer-head small {display:none}
 #app .drawer .drawer-head .icon-button {width:44px;min-height:44px;flex:0 0 44px}
 #app .drawer .drawer-intro {font-size:12px;margin:9px 0}
 #app #arrange-drawer {gap:6px;overflow:hidden}
 #app #arrange-drawer .drawer-intro {display:none}
 #app #arrange-drawer #arrange-items {grid-template-columns:minmax(0,1fr)}
 #app #arrange-drawer .inventory-pick {display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:6px}
 #app #arrange-drawer .inventory-pick .arrange-visual {grid-row:span 2;width:76px;height:66px;aspect-ratio:auto}
 #app #arrange-drawer .inventory-pick strong {font-size:12px}
 #app #arrange-drawer .inventory-pick em {justify-self:start;font-size:11px;padding:5px 8px}
 #app #arrange-drawer .inventory-tags {margin:4px 0;gap:4px}
 #app #arrange-drawer .backpack-request span {display:none}
 .home-account-dialog {max-height:calc(100dvh - 20px);margin-block:auto}
}
@media(orientation:landscape) and (max-height:300px) {
 #app #decorate-panel[data-mh018-grouped="true"] {display:grid;grid-template-columns:44px 44px;width:92px;max-width:92px;gap:4px}
 #app #decorate-panel[data-mh018-grouped="true"] button .mh010-action-label {display:none}
 #app #decorate-panel[data-mh018-grouped="true"] #mh018-actions button .mh010-action-label {display:block}
}

/* Edge-aligned controls: one landscape rail with Backpack as the corner. */
#app .topbar #info-button {width:44px;min-width:44px;height:44px;min-height:44px;padding:10px;display:grid;place-items:center;border-radius:13px}
#app #info-button > span {display:none}
#app #info-button .mh018-menu-icon {width:24px;height:24px;fill:none;stroke:var(--gold-light);stroke-width:2;stroke-linecap:round}
#app .location-tools {left:max(8px,env(safe-area-inset-left));transform:none;width:auto;justify-content:flex-start;flex-wrap:wrap;max-width:calc(100% - 16px)}
#app .location-tools #decorate-button {order:0}
#app .location-tools .mh008-add-wall-orbit {order:1}
#app .location-tools #room-chip {order:2}
#app .location-tools #map-button {order:3}
#app .location-tools #walk-backpack-button {order:4}
#app #decorate-panel[data-mh018-grouped="true"] {bottom:calc(160px + env(safe-area-inset-bottom));max-height:calc(100dvh - 280px)}
#app #decorate-panel[data-mh018-grouped="true"] #decorate-remove {color:#f4b9ab;order:4}
#app #decorate-panel[data-mh018-grouped="true"] #decorate-undo {order:5}
#app #decorate-panel[data-mh018-grouped="true"][data-mh018-actions-open="true"] #mh018-actions {width:min(230px,calc(100vw - 84px));max-height:calc(100dvh - 285px)}
@media(orientation:landscape) and (max-height:520px) {
 #app .topbar {top:max(6px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right))}
 #app .topbar-actions {gap:6px}
 #app .topbar-actions > button {width:44px;min-width:44px;height:44px;min-height:44px;padding:0;display:grid;place-items:center;border-radius:13px;box-sizing:border-box}
 #app .topbar-actions > button[hidden] {display:none}
 #app .topbar-actions .list-button span {display:none}
 #app .topbar-actions .list-button strong {width:30px;height:30px}
 #app:has(#decorate-panel[data-mh018-grouped="true"]:not([hidden])) .topbar-actions {padding-right:50px}
 #app .location-tools {top:max(56px,calc(env(safe-area-inset-top) + 56px));gap:6px}
 #app .location-tools :is(#decorate-button,.mh008-add-wall-orbit) {min-height:44px;border-radius:13px}
 #app #decorate-panel[data-mh018-grouped="true"] {top:max(6px,env(safe-area-inset-top));bottom:auto;right:max(8px,env(safe-area-inset-right));left:auto;transform:none;display:flex;flex-direction:column;grid-template-columns:none;width:44px;max-width:44px;gap:6px;max-height:none}
 #app #decorate-panel[data-mh018-grouped="true"] .decorate-actions,#app #decorate-panel[data-mh018-grouped="true"] .decorate-utilities {display:contents}
 #app #decorate-panel[data-mh018-grouped="true"] > .decorate-copy {display:none}
 #app #decorate-panel[data-mh018-grouped="true"] #decorate-catalog {order:0}
 #app #decorate-panel[data-mh018-grouped="true"] #decorate-style {order:1}
 #app #decorate-panel[data-mh018-grouped="true"] #mh018-door-toggle {order:1}
 #app #decorate-panel[data-mh018-grouped="true"] #mh018-actions-toggle {order:2}
 #app #decorate-panel[data-mh018-grouped="true"] button .mh010-action-label {display:none}
 #app #decorate-panel[data-mh018-grouped="true"] #mh018-actions button .mh010-action-label {display:block}
 #app #decorate-panel[data-mh018-grouped="true"][data-mh018-actions-open="true"] #mh018-actions,
 #app #decorate-panel[data-mh018-grouped="true"][data-mh018-door-open="true"] .mh010-door-route:not([hidden]) {top:50px;bottom:auto;right:calc(100% + 6px);max-height:calc(100dvh - 165px)}
}
@media(orientation:landscape) and (max-height:330px) {
 #app .controls {right:calc(64px + env(safe-area-inset-right))}
}
#app #decorate-panel[data-mh018-grouped="true"] :is(#mh018-actions-toggle,#mh018-door-toggle) {background:rgba(7,24,44,.88);border:1px solid rgba(255,255,255,.16);color:var(--gold-light)}
#app #decorate-panel[data-mh018-grouped="true"] :is(#mh018-actions-toggle,#mh018-door-toggle)[aria-expanded="true"] {border-color:var(--gold);background:#21465a}

/* Left navigation stays compact: Orbit above Map, Wall alongside Orbit. */
#app #room-chip {display:none!important}
#app .location-tools {display:grid;grid-template-columns:max-content max-content;align-items:start;gap:6px}
#app .location-tools #decorate-button {grid-column:1;grid-row:1}
#app .location-tools .mh008-add-wall-orbit {grid-column:2;grid-row:1}
#app .location-tools #map-button {grid-column:1;grid-row:2;min-height:44px;border-radius:13px}
#app .location-tools #walk-backpack-button {grid-column:2;grid-row:2}

/* Direct item actions and a comfortable landscape thumb position. */
#app #decorate-shop,#app #mh018-actions-toggle,#app #mh018-actions {display:none!important}
#app #decorate-panel[data-mh018-grouped="true"] #decorate-service {order:2}
#app #decorate-panel[data-mh018-grouped="true"] #decorate-save-product {order:3}
#app #decorate-panel[data-mh018-grouped="true"] .mh010-quick-services:not([hidden]) {position:absolute;right:calc(100% + 8px);bottom:0;top:auto;width:min(250px,calc(100vw - 80px));max-height:calc(100dvh - 290px);overflow:auto;pointer-events:auto;background:#102e42f5;border-radius:14px;padding:9px;box-sizing:border-box}
@media(orientation:landscape) and (max-height:520px) {
 #app .controls {left:33.333%;right:auto;bottom:max(8px,env(safe-area-inset-bottom));transform:translateX(-50%);width:max-content;justify-content:center;padding:0}
 #app #decorate-panel[data-mh018-grouped="true"] .mh010-quick-services:not([hidden]) {top:50px;bottom:auto;max-height:calc(100dvh - 115px)}
}
@media(orientation:landscape) and (max-height:330px) {
 #app #decorate-panel[data-mh018-grouped="true"] {gap:4px}
}

/* Pop-outs paint above rail labels; Undo holds infrequent removal/reset tools. */
#mh018-history[hidden],#mh018-history-toggle[hidden] {display:none!important}
#app #decorate-panel[data-mh018-grouped="true"] #mh018-history-toggle {position:relative;display:grid;place-items:center;flex:0 0 44px;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;padding:0;gap:0;order:5;border:1px solid #ffffff29;border-radius:13px;background:#07182ce0;color:var(--gold-light);pointer-events:auto}
#app #decorate-panel[data-mh018-grouped="true"] :is(.mh010-quick-services,#mh018-history,.mh010-door-route,.reset-room-confirm) {z-index:50}
#app #decorate-panel[data-mh018-grouped="true"]:has(.mh010-quick-services:not([hidden]),#mh018-history:not([hidden]),.mh010-door-route:not([hidden]),.reset-room-confirm:not([hidden])) :is(#decorate-catalog,#decorate-style,#decorate-service,#decorate-save-product,#mh018-history-toggle,#mh018-door-toggle) > .mh010-action-label {visibility:hidden}
#app #decorate-panel #mh018-history {position:absolute;right:calc(100% + 8px);bottom:0;width:min(240px,calc(100vw - 80px));max-height:calc(100dvh - 260px);overflow:auto;display:grid;gap:6px;box-sizing:border-box;padding:9px;border:1px solid #bbd2d23d;border-radius:14px;background:#102e42;box-shadow:0 8px 24px #07182738;pointer-events:auto}
#app #decorate-panel #mh018-history .mh018-history-heading {display:flex;align-items:center;justify-content:space-between;color:#f5dfaa;font-size:12px}
#app #decorate-panel #mh018-history #mh018-history-close {width:44px;min-height:44px;padding:0;background:transparent;color:white;border:0;font-size:24px;display:block}
#app #decorate-panel #mh018-history :is(#decorate-undo,#decorate-remove,#decorate-reset) {position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none;display:flex!important;flex:none;align-items:center;justify-content:space-between;grid-template-columns:none!important;width:100%!important;max-width:none!important;min-width:0!important;min-height:44px!important;height:auto;padding:10px 12px!important;font-size:13px!important;border-radius:10px!important;order:initial;color:#f6f4ec!important;background:#ffffff0b!important;box-sizing:border-box}
#app #decorate-panel #mh018-history button .mh010-action-label {display:block;position:static;transform:none;width:auto;max-width:none;color:inherit;font-size:13px;text-shadow:none;text-align:left;visibility:visible}
#app #decorate-panel #mh018-history button span[aria-hidden="true"] {display:block!important;flex:0 0 24px;font-size:20px!important;color:var(--gold-light)}
#app #decorate-panel #mh018-history :is(#decorate-remove,#decorate-reset) {color:#f4b9ab!important}
#app #decorate-panel[data-mh018-grouped="true"] .reset-room-confirm:not([hidden]) {position:absolute;right:calc(100% + 8px);bottom:0;width:min(280px,calc(100vw - 80px));max-height:calc(100dvh - 240px);overflow:auto;box-sizing:border-box;pointer-events:auto}
@media(orientation:landscape) and (max-height:520px) {
 #app #decorate-panel[data-mh018-grouped="true"] :is(#mh018-history,.reset-room-confirm:not([hidden])) {top:50px;bottom:auto;max-height:calc(100dvh - 115px)}
}
