/* A compact inspector leaves the island visible on phones. Desktop keeps its
   existing building window; only the mobile inspector uses these classes. */
@media (max-width:650px), (max-width:950px) and (max-height:550px){
 .game-sheet.building-compact{display:flex;flex-direction:column;width:calc(100% - 20px);max-width:430px;bottom:max(102px,calc(env(safe-area-inset-bottom) + 84px));max-height:min(350px,48dvh,calc(100% - 120px));padding:8px 12px 12px;border-width:3px;border-radius:18px;overflow:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
 .game-sheet.building-compact[hidden]{display:none}
 body.preview-mode .game-sheet.building-compact{bottom:max(86px,calc(env(safe-area-inset-bottom) + 70px))}
 .game-sheet.building-compact.building-expanded{max-height:min(460px,58dvh,calc(100% - 120px))}
 .building-sheet-grip{height:3px;width:31px;margin:0 auto 5px;border-radius:3px;background:#c9c2bc;flex-shrink:0}
 .game-sheet.building-compact .sheet-heading{position:static;flex-shrink:0;gap:9px;padding:0;margin:0 0 5px;box-shadow:none;align-items:center}
 .building-sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;padding:0 1px 1px;scrollbar-width:thin}
 .building-compact-heading>img{width:46px;height:48px;flex:0 0 46px;object-fit:contain}
 .building-compact-title{flex:1;min-width:0}
 .game-sheet.building-compact .sheet-heading small{font-size:8px;letter-spacing:1.2px;margin:0 0 3px}
 .game-sheet.building-compact .sheet-heading h2{font-size:22px;line-height:1.1;overflow-wrap:anywhere}
 .game-sheet.building-compact .round-close{width:44px;height:44px;align-self:flex-start;background:transparent;padding:12px;color:#827789;touch-action:manipulation}
 .game-sheet.building-compact .round-close .ui-icon{width:20px;height:20px}
 .building-compact .building-production-state{font-size:10px;color:#7e7484;font-weight:400;margin:3px 0 0;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .building-cost-line{display:flex;align-items:center;gap:9px;min-height:23px;flex-wrap:wrap}
 .building-cost-line>small{font-size:9px;color:var(--ui-muted);white-space:nowrap}
 .building-compact .inline-costs{gap:10px;align-items:center}
 .building-compact .inline-costs .cost{font-size:11px;gap:3px}
 .building-compact .inline-costs .ui-icon{width:15px;height:15px}
 .building-compact .build-problem{font-size:11px;color:#9d614e;line-height:1.4;margin:5px 0}
 .building-compact .build-problem.is-ready{display:none}
 .building-compact .assignment-row.compact{margin:3px 0 6px;padding:0;min-height:44px;border:0;gap:4px;font-size:12px}
 .building-compact .assignment-row.compact button{width:44px;height:44px;font-size:21px;flex-shrink:0;touch-action:manipulation;background:#ebe5ec;border-radius:10px}
 .building-compact .assignment-row.compact b{min-width:24px;font-size:13px;font-variant-numeric:tabular-nums}
 .building-quick-actions{display:grid;flex-shrink:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:6px;padding-top:9px;border-top:1px solid var(--ui-line);background:var(--ui-paper)}
 .building-quick-actions:has(>button:only-child){grid-template-columns:1fr}
 .building-compact .building-quick-actions .action-button{width:100%;min-height:44px;font-size:12px;padding:9px 8px;gap:6px;margin:0;box-shadow:none;border:1px solid transparent;border-radius:10px;touch-action:manipulation}
 .building-quick-actions .ui-icon{width:18px;height:18px;flex-shrink:0}
 .building-compact .building-quick-actions .building-move-action{background:#eee8f0;color:var(--ui-purple);border-color:#dcd1e4}
 .building-extra{margin-top:4px}
 .building-extra>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:8px 2px;list-style:none;cursor:pointer;touch-action:manipulation;font-size:11px;color:#82758a}
 .building-extra>summary::-webkit-details-marker{display:none}
 .building-extra>summary>span{font-size:19px;line-height:1;transition:transform .15s}
 .building-extra[open]>summary>span{transform:rotate(180deg)}
 .building-extra-content{border-top:1px solid #e1d9dc;padding:10px 2px 5px}
 .building-extra-content p{font-size:12px;line-height:1.6;color:#83778a;margin:0}
 .building-extra-content .text-button{min-height:44px;font-size:11px;margin:7px 0 0;color:#9b6863;border:0;text-decoration:underline;text-underline-offset:4px;touch-action:manipulation}
 .building-compact button:focus-visible,.building-extra summary:focus-visible{outline:2px solid #8e7cac;outline-offset:2px}
}
@media (max-width:950px) and (max-height:550px) and (orientation:landscape){
 .game-sheet.building-compact{left:auto;right:max(10px,env(safe-area-inset-right));transform:none;width:min(360px,calc(100% - 24px));max-height:calc(100dvh - 105px);bottom:max(92px,calc(env(safe-area-inset-bottom) + 76px))}
 .game-sheet.building-compact.building-expanded{max-height:calc(100dvh - 105px)}
 .building-compact .building-sheet-grip{display:none}
 .game-sheet.building-compact .sheet-heading small{display:none}
 .building-compact-heading>img{width:38px;height:40px;flex-basis:38px}
 body.preview-mode .game-sheet.building-compact{bottom:max(78px,calc(env(safe-area-inset-bottom) + 64px))}
}
@media (prefers-reduced-motion:reduce){.building-extra>summary>span{transition:none}}
