/* Four normal-flow regions: header, flexible stage, fixed actions, inventory. */
.layout:has(>.house-screen:not([hidden])){padding:0}
#house-screen{width:100%;max-width:none;display:grid;grid-template-rows:40px minmax(0,1fr) 44px 128px;border:0;border-radius:0;box-shadow:none;overflow:hidden}
#house-screen.inventory-collapsed{grid-template-rows:40px minmax(0,1fr) 44px 32px}
#house-screen .house-header{padding:3px 12px;min-height:0;height:40px;gap:10px}
#house-screen .house-header h1{font-size:24px;line-height:1;margin:0}
#house-screen .house-header p{display:none}
#house-screen .house-header-actions{gap:7px}
#house-screen .house-back,#house-screen .house-header-actions .icon-button{height:36px;min-height:36px;margin:0;padding:5px 10px;font-size:12px;box-shadow:inset 0 1px #fff,0 2px #cdb895}
#house-screen .house-header-actions .icon-button{width:38px;min-width:38px;font-size:23px}
#house-screen .house-stage{margin:0;padding:0;min-height:0;min-width:0;overflow:hidden}
#house-action-row{position:relative;display:flex;align-items:center;min-width:0;overflow:hidden;height:44px;padding:3px 12px;background:#f7efdf;border-top:1px solid #ddceb5;border-bottom:1px solid #ddceb5;z-index:5}
#house-status{flex:1;min-width:0}
#house-status .house-hint{display:block;position:static;inset:auto;transform:none;margin:0;padding:0;min-height:0;width:auto;max-width:none;text-align:center;background:none;border:0;border-radius:0;box-shadow:none;font-size:12px;line-height:1.35;color:#5d513d;overflow:hidden;max-height:34px}
#house-status .house-welcome{position:static;inset:auto;display:flex;align-items:center;justify-content:center;gap:10px;max-width:none;margin:0;padding:0;border:0;background:none;box-shadow:none;font-size:12px;line-height:1.3;color:#5d6244}
#house-welcome>span{min-width:0;max-height:34px;overflow:hidden}
#house-welcome button{flex:none;min-height:36px;padding:5px 9px;font-size:12px;color:#536547;background:#edf0df;border:1px solid #c6cfb6;border-radius:9px;text-decoration:none}
#furniture-tools{position:static;inset:auto;transform:none;display:flex;align-items:center;justify-content:initial;gap:7px;width:100%;max-width:none;height:100%;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:none;z-index:auto}
.house-selected-copy{flex:1;min-width:0;overflow:hidden}
#furniture-tools strong{display:block;max-width:none;min-width:0;padding:0;font-size:12px;font-weight:600;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#534b38}
#house-action-message{display:block;font-size:11px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#6d5a44}
#house-action-message:empty{display:none}
#furniture-tools button{flex:none;min-width:72px;min-height:36px;height:36px;padding:4px 10px;font-size:12px;line-height:1.2}
#furniture-tools button>span:first-child{display:none}
#house-screen .house-inventory-area{height:128px;min-height:0;margin:0;padding:0 10px;background:#f6ecdc;border:0;overflow:hidden;box-shadow:none}
#house-screen .house-inventory-title{height:28px;min-height:28px;padding:0 3px;gap:8px}
#house-screen #house-inventory-toggle{min-height:28px;height:28px;font-size:17px;padding:0 2px;gap:9px}
#house-screen .house-inventory-title>span{font-size:11px}
#house-screen .house-inventory{height:100px;min-height:0;gap:7px;padding:0 2px 6px;overflow-y:hidden;overflow-x:auto;align-items:stretch}
#house-screen .inventory-item{flex:0 0 112px;height:94px;min-height:0;margin:0;padding:3px 5px;display:grid;grid-template-rows:45px 26px 14px;align-content:center;gap:0;border-radius:11px}
#house-screen .inventory-art{height:45px;min-height:0;padding:0 1px;align-self:center}
#house-screen .inventory-item strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:11px;line-height:1.2;font-weight:500;min-height:0;margin:0;align-self:center}
#house-screen .inventory-item small{display:block;min-height:0;font-size:10px;line-height:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#house-screen .inventory-item.pending small:after{content:''}
#house-screen .inventory-item.spotlight:after{font-size:8px;padding:1px 4px;top:3px;right:3px}
#house-screen.inventory-collapsed .house-inventory-area{height:32px;padding-bottom:0}
#house-screen.inventory-collapsed .house-inventory{display:none}
body:has(#house-screen:not([hidden]))>.toast{display:none}
@media(max-width:600px){
 #house-screen{grid-template-rows:50px minmax(0,1fr) 56px 146px;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
 #house-screen.inventory-collapsed{grid-template-rows:50px minmax(0,1fr) 56px 40px}
 #house-screen .house-header{height:50px;padding:3px 9px;gap:7px}
 #house-screen .house-header h1{font-size:23px}
 #house-screen .house-back,#house-screen .house-header-actions .icon-button{height:44px;min-height:44px;padding:6px 9px;font-size:11px}
 #house-screen .house-header-actions .icon-button{width:44px;min-width:44px;font-size:23px}
 #house-action-row{height:56px;padding:5px 7px}
 #house-status .house-hint,#house-status .house-welcome{font-size:11px;line-height:1.35}
 #house-welcome button{min-height:44px;font-size:11px;padding:5px 8px}
 #furniture-tools{gap:5px}
 #furniture-tools strong{font-size:11px}
 #furniture-tools button{min-width:44px;width:44px;min-height:44px;height:44px;padding:5px;font-size:20px}
 #furniture-tools button>span:first-child{display:inline}
 #furniture-tools button>span:last-child{display:none}
 #furniture-tools #furniture-done{font-size:11px;min-width:60px;width:60px}
 #house-screen .house-inventory-area{height:146px;padding:0 7px}
 #house-screen .house-inventory-title{height:40px;min-height:40px}
 #house-screen #house-inventory-toggle{height:40px;min-height:40px;font-size:17px}
 #house-screen .house-inventory{height:106px;padding-bottom:6px}
 #house-screen .inventory-item{flex-basis:104px;height:100px;grid-template-rows:48px 28px 15px;padding:3px 5px}
 #house-screen .inventory-art{height:48px}
 #house-screen .inventory-item strong{font-size:11px;line-height:1.25}
 #house-screen .inventory-item small{font-size:10px;line-height:15px}
 #house-screen.inventory-collapsed .house-inventory-area{height:40px}
}

/* The local test switch belongs to the compact header, not a fifth full-width row. */
[data-dev-mode="true"] body:has(#house-screen:not([hidden])){padding-top:0}
[data-dev-mode="true"] .layout:has(>#house-screen:not([hidden])){height:100dvh}
body:has(#house-screen:not([hidden]))>.dev-bar{left:128px;right:auto;top:3px;width:146px;height:34px;gap:6px;border:0;background:none;font-size:10px}
body:has(#house-screen:not([hidden]))>.dev-bar button{min-width:44px;height:32px;font-size:11px}
@media(max-width:600px){body:has(#house-screen:not([hidden]))>.dev-bar{left:113px;top:6px;width:87px;height:38px;gap:3px;font-size:8px;line-height:1.1}body:has(#house-screen:not([hidden]))>.dev-bar span{max-width:40px}body:has(#house-screen:not([hidden]))>.dev-bar button{min-width:42px;height:36px;padding:3px;font-size:10px}}
