/* buildings index (scope bx) */
.grid[data-s~=bx]{list-style:none;padding:0;margin:0;display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
.grid[data-s~=bx]:has(.func){grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.func[data-s~=bx]{display:flex;gap:14px;align-items:flex-start;grid-column:span 2;scroll-margin-top:16px}
.func[data-s~=bx] h3[data-s~=bx]{margin:0 0 .3em}
.func[data-s~=bx] p[data-s~=bx]{margin:0 0 .4em}
.tile[data-s~=bx]{height:100%;box-sizing:border-box;display:grid;grid-template-rows:96px minmax(2.6em,auto) auto;justify-items:center;align-items:start;gap:8px;text-align:center;color:inherit}
.tile[data-s~=bx] .pic[data-s~=bx]{width:96px;height:96px;display:grid;place-items:center}
.tile[data-s~=bx] .pic[data-s~=bx] img[data-s~=bx]{width:100%;height:100%;object-fit:contain}
.tile[data-s~=bx] strong[data-s~=bx]{line-height:1.3}
.tile[data-s~=bx]:hover{text-decoration:none;border-color:var(--accent)}
.thumb[data-s~=bx]{flex:none;width:80px;height:80px}
.thumb[data-s~=bx] img[data-s~=bx]{width:100%;height:100%;object-fit:contain}
.small[data-s~=bx]{font-size:.85rem}
@media(max-width:560px){.func[data-s~=bx]{grid-column:auto}}

/* building page: details box, state art, totals, requirements, level table */
.bld-about-body{display:flex;gap:20px;align-items:flex-start}
.bld-pics{display:flex;flex-wrap:wrap;gap:12px;flex:none}
.bld-pics>img,.bld-pic-fc>img{width:160px;height:160px;object-fit:contain}
.bld-pic-fc{position:relative}
.bld-pic-fc .hexa{position:absolute;inset-inline-end:0;bottom:0}
.bld-facts{display:grid;gap:10px;min-width:0;flex:1 1 280px}
.bld-facts p{margin:0}
.bld-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.bld-max{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.bld-max .hexa{width:38px;height:31px}
.bld-art{display:grid;justify-items:center;gap:8px;min-height:140px}
.bld-art>img{width:140px;height:140px;object-fit:contain}
.bld-art .lv{font-weight:800;font-size:1.1rem;padding:2px 12px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border)}
.bld-fc{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}
.bld-troop{display:inline-flex;align-items:center;gap:8px}
.bld-troop img{flex:none;object-fit:contain}
.bld-lvcell{display:inline-flex;align-items:center;gap:8px}
.bld-table .hexa{width:34px;height:28px}
.bld-table .hexa.plain.base{font-size:.6rem}
.bld-totals{display:flex;flex-wrap:wrap;gap:8px 24px;margin:4px 0;font-variant-numeric:tabular-nums}
.bld-totals strong{font-size:1.15rem}
.bld-req{margin:12px 0 16px}
.bld-req h3{margin:0 0 8px}
.bld-req ul{margin:0;padding-inline-start:1.2em}
@media(max-width:640px){.bld-about-body{flex-direction:column}
.bld-pics>img,.bld-pic-fc>img{width:120px;height:120px}}
.small[data-s~=bd]{font-size:.8rem}
th[data-s~=bd].wrap-cell{text-align:start}
td[data-s~=bd].wrap-cell{white-space:normal;text-align:start;min-width:160px;font-size:.85rem}
