/* Localized house UI: material art owns one visual layer; translated labels may wrap. */
.house-material-art-wrap{display:grid;place-items:center;overflow:hidden;line-height:1}
.house-material-art-wrap .house-material-art-image{display:block;width:100%;height:100%;object-fit:contain}
.house-material-art-wrap.fallback{font-size:16px;color:#aeb9b3}
.house-workshop-tab{min-height:58px;grid-template-rows:auto minmax(16px,auto);align-content:center}
.house-workshop-tab strong,.house-workshop-tab small{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.house-workshop-tab small{min-height:16px}
.house-forge-tabs{overflow:visible}
.house-pane-head h3{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.2}
@media(max-width:430px){.house-workshop-tab{min-height:62px;padding:7px 5px}.house-workshop-tab small{font-size:6.5px;line-height:1.25}}


/* Forge localization/layout hardening: translated copy must remain legible on narrow phones. */
.house-forge-tabs .house-workshop-tab{min-height:70px;padding:7px 6px}
.house-forge-tabs .house-workshop-tab strong{font-size:9px;line-height:1.2}
.house-forge-tabs .house-workshop-tab small{font-size:6.5px;line-height:1.35;min-height:2.7em;display:block}
.house-forge-materials-pane .house-pane-head h3{font-size:8px;line-height:1.25;letter-spacing:.02em}
.house-material-art-wrap{position:relative;display:grid!important;place-items:center;overflow:visible!important;flex:none}
.house-material-art-wrap .house-material-art-image{position:relative;z-index:1;display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}
.house-material-art-wrap.fallback{font-size:0}
.house-material-art-wrap.fallback::after{content:var(--house-material-fallback-icon);font-size:13px;line-height:1;color:#aeb9b3}
@media(max-width:430px){
  .house-forge-tabs .house-workshop-tab{min-height:74px;padding:6px 4px}
  .house-forge-tabs .house-workshop-tab strong{font-size:8px}
  .house-forge-tabs .house-workshop-tab small{font-size:5.8px;line-height:1.35}
  .house-forge-materials-pane .house-pane-head h3{font-size:7px}
}


/* Pixel-font multiline fix: translated forge tab subtitles need enough baseline
   separation; WaveVar2 glyphs are taller than their nominal CSS line box. */
.house-forge-tabs .house-workshop-tab{
  min-height:78px;
  grid-template-rows:auto auto;
  align-content:center;
  row-gap:7px;
}
.house-forge-tabs .house-workshop-tab small{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  max-width:100%;
  padding:1px 4px 3px;
  line-height:1.7;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:normal;
  word-break:normal;
}
@media(max-width:430px){
  .house-forge-tabs .house-workshop-tab{min-height:82px;row-gap:6px}
  .house-forge-tabs .house-workshop-tab small{
    min-height:30px;
    padding:1px 2px 3px;
    font-size:5.8px;
    line-height:1.75;
  }
}


/* Forge equipment tile footer: pixel-font rarity/level labels were vertically
   clipped by the icon-only tile's bottom edge on mobile. */
.house-gear-grid-forge .house-tile.icon-only{
  overflow:visible;
  padding-bottom:12px;
}
.house-gear-grid-forge .house-tile.icon-only .house-tile-rarity,
.house-gear-grid-forge .house-tile.icon-only .house-tile-level{
  bottom:4px;
  height:auto;
  min-height:8px;
  line-height:1.55;
  padding:1px 0 2px;
  overflow:visible;
  white-space:nowrap;
}
@media(max-width:430px){
  .house-gear-grid-forge .house-tile.icon-only{
    min-height:58px;
    height:58px;
    padding-bottom:13px;
  }
  .house-gear-grid-forge .house-tile.icon-only .house-tile-rarity,
  .house-gear-grid-forge .house-tile.icon-only .house-tile-level{
    bottom:3px;
    min-height:9px;
    font-size:5.5px;
    line-height:1.65;
    padding-bottom:2px;
  }
}


/* Compact station controls.
   Shared rules keep two-line mode tabs and icon-only equipment filters content-sized,
   while giving WaveVar2 enough line box to avoid glyph clipping. */
.house-workshop-tabs{
  gap:5px;
  padding:2px;
}
.house-workshop-tab{
  min-height:44px;
  height:auto;
  gap:2px;
  align-content:center;
  padding:6px 7px;
  overflow:visible;
}
.house-workshop-tab strong{
  min-height:12px;
  line-height:1.35;
  padding:1px 0;
  overflow:visible;
}
.house-workshop-tab small{
  min-height:10px;
  line-height:1.4;
  padding:1px 0;
  overflow:visible;
}
.house-forge-filters{
  align-self:start;
  gap:4px;
}
.house-forge-filter{
  width:34px;
  min-width:34px;
  height:34px;
  min-height:34px;
  line-height:1;
  overflow:visible;
}
@media(max-width:680px){
  .house-workshop-tab{
    min-height:40px;
    padding:5px 6px;
  }
  .house-workshop-tab strong{font-size:9px;line-height:1.4}
  .house-workshop-tab small{font-size:6.5px;line-height:1.45}
  .house-forge-browser{grid-template-columns:32px minmax(0,1fr)}
  .house-forge-filter{
    width:30px;
    min-width:30px;
    height:30px;
    min-height:30px;
    font-size:16px;
  }
}
@media(max-width:430px){
  .house-workshop-tab{
    min-height:38px;
    padding:4px 5px;
  }
  .house-workshop-tab strong{min-height:11px;font-size:8.5px;line-height:1.45}
  .house-workshop-tab small{min-height:9px;font-size:6px;line-height:1.5}
  .house-forge-browser{grid-template-columns:30px minmax(0,1fr);gap:4px}
  .house-forge-filter{
    width:28px;
    min-width:28px;
    height:28px;
    min-height:28px;
    font-size:15px;
    border-radius:7px;
  }
}


/* Forge mode tabs: content-sized controls. Earlier localization hardening grew
   these to 78/82px; keep enough line box for WaveVar2 without wasting panel height. */
.house-forge-tabs .house-workshop-tab{
  min-height:46px;
  grid-template-rows:auto auto;
  align-content:center;
  row-gap:2px;
  padding:5px 6px;
}
.house-forge-tabs .house-workshop-tab small{
  min-height:12px;
  padding:1px 3px 2px;
  line-height:1.45;
}
@media(max-width:430px){
  .house-forge-tabs .house-workshop-tab{
    min-height:44px;
    row-gap:2px;
    padding:4px 4px;
  }
  .house-forge-tabs .house-workshop-tab small{
    min-height:11px;
    padding:1px 2px 2px;
    font-size:5.8px;
    line-height:1.45;
  }
}


/* Mobile forge density: keep mode and equipment-type controls close to their
   actual content instead of spending scarce vertical viewport space. */
@media(max-width:430px){
  .house-forge-tabs{align-self:start;width:100%}
  .house-forge-tabs .house-workshop-tab{
    min-height:34px;
    height:34px;
    padding:3px 4px;
    row-gap:0;
  }
  .house-forge-tabs .house-workshop-tab strong{
    min-height:9px;
    font-size:8px;
    line-height:1.25;
    padding:0;
  }
  .house-forge-tabs .house-workshop-tab small{
    min-height:8px;
    font-size:5.5px;
    line-height:1.3;
    padding:0 2px 1px;
  }
  .house-forge-browser{grid-template-columns:26px minmax(0,1fr);gap:4px}
  .house-forge-filters{gap:3px}
  .house-forge-filter{
    width:26px;
    min-width:26px;
    height:26px;
    min-height:26px;
    font-size:14px;
    border-radius:7px;
  }
}


/* Forge mobile category rail: all equipment type selectors must remain visible.
   Decouple rail density from equipment-card sizing. */
@media(max-width:430px){
  .house-forge-filters{
    display:grid;
    grid-auto-flow:row;
    grid-auto-rows:22px;
    align-content:start;
    gap:2px;
    height:auto;
    min-height:0;
  }
  .house-forge-filter{
    width:22px;
    min-width:22px;
    height:22px;
    min-height:22px;
    max-height:22px;
    padding:0;
    font-size:12px;
    line-height:1;
    border-radius:6px;
  }
  .house-forge-browser{
    grid-template-columns:24px minmax(0,1fr);
    gap:3px;
    align-items:start;
  }
}


/* Forge category rail — real mobile fix.
   The game renders into a scaled desktop-sized UI, so viewport media queries
   do not reliably represent the visible phone size. Keep the rail compact
   unconditionally inside the forge and let the icons, not card height, size it. */
.house-layout-forge .house-forge-browser{
  grid-template-columns:28px minmax(0,1fr);
  gap:4px;
  align-items:start;
}
.house-layout-forge .house-forge-filters{
  display:flex;
  flex-direction:column;
  align-self:start;
  justify-content:flex-start;
  gap:3px;
  height:auto;
  min-height:0;
}
.house-layout-forge .house-forge-filter{
  box-sizing:border-box;
  flex:0 0 28px;
  width:28px;
  min-width:28px;
  max-width:28px;
  height:28px;
  min-height:28px;
  max-height:28px;
  padding:0;
  font-size:14px;
  line-height:1;
  border-radius:7px;
}


/* Forge browser density contract.
   The category rail and gear grid share one bounded pane. Size categories as
   readable controls and compact the cards instead of shrinking the rail into
   unreadable dots. This also reserves real footer space for rarity + level. */
.house-layout-forge .house-forge-browser{
  grid-template-columns:34px minmax(0,1fr);
  gap:5px;
  align-items:stretch;
}
.house-layout-forge .house-forge-filters{
  display:grid;
  grid-template-columns:1fr;
  grid-auto-rows:34px;
  align-content:start;
  gap:4px;
  height:100%;
  min-height:0;
  overflow:hidden;
}
.house-layout-forge .house-forge-filter{
  box-sizing:border-box;
  width:34px;
  min-width:34px;
  max-width:34px;
  height:34px;
  min-height:34px;
  max-height:34px;
  font-size:17px;
  border-radius:8px;
}
.house-layout-forge .house-gear-grid-forge{
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:54px;
  gap:5px;
  align-content:start;
  min-width:0;
  overflow-y:auto;
}
.house-layout-forge .house-gear-grid-forge .house-tile.icon-only{
  box-sizing:border-box;
  min-width:0;
  width:100%;
  min-height:54px;
  height:54px;
  padding:4px 5px 13px;
  overflow:hidden;
}
.house-layout-forge .house-gear-grid-forge .house-tile.icon-only .house-tile-icon{
  font-size:23px;
}
.house-layout-forge .house-gear-grid-forge .house-tile-rarity,
.house-layout-forge .house-gear-grid-forge .house-tile-level{
  bottom:3px;
  max-width:46%;
  min-height:8px;
  padding:0;
  overflow:visible;
  font-size:5.5px;
  line-height:1.4;
  white-space:nowrap;
}
.house-layout-forge .house-gear-grid-forge .house-tile-rarity{left:5px}
.house-layout-forge .house-gear-grid-forge .house-tile-level{right:5px}


/* Responsive forge contract — container-driven rather than device-driven.
   The forge can be embedded/scaled independently of the browser viewport. */
.house-layout-forge>.house-pane-source{container-type:inline-size;container-name:forge-source}
.house-layout-forge .house-forge-browser{min-width:0}
.house-layout-forge .house-gear-grid-forge{
  grid-template-columns:repeat(auto-fit,minmax(min(82px,100%),1fr));
}
@container forge-source (max-width:260px){
  .house-layout-forge .house-forge-browser{grid-template-columns:32px minmax(0,1fr);gap:4px}
  .house-layout-forge .house-forge-filters{grid-auto-rows:32px;gap:3px}
  .house-layout-forge .house-forge-filter{
    width:32px;min-width:32px;max-width:32px;
    height:32px;min-height:32px;max-height:32px;
    font-size:16px;
  }
  .house-layout-forge .house-gear-grid-forge{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-auto-rows:52px;
    gap:4px;
  }
  .house-layout-forge .house-gear-grid-forge .house-tile.icon-only{
    min-height:52px;height:52px;padding:3px 4px 13px;
  }
  .house-layout-forge .house-gear-grid-forge .house-tile.icon-only .house-tile-icon{font-size:21px}
}
@container forge-source (min-width:380px){
  .house-layout-forge .house-forge-browser{grid-template-columns:38px minmax(0,1fr);gap:7px}
  .house-layout-forge .house-forge-filters{grid-auto-rows:38px;gap:5px}
  .house-layout-forge .house-forge-filter{
    width:38px;min-width:38px;max-width:38px;
    height:38px;min-height:38px;max-height:38px;
    font-size:19px;
  }
  .house-layout-forge .house-gear-grid-forge{
    grid-template-columns:repeat(auto-fit,minmax(72px,1fr));
    grid-auto-rows:60px;
    gap:6px;
  }
  .house-layout-forge .house-gear-grid-forge .house-tile.icon-only{
    min-height:60px;height:60px;padding:5px 6px 14px;
  }
  .house-layout-forge .house-gear-grid-forge .house-tile.icon-only .house-tile-icon{font-size:27px}
  .house-layout-forge .house-gear-grid-forge .house-tile-rarity,
  .house-layout-forge .house-gear-grid-forge .house-tile-level{font-size:6px}
}
@container forge-source (min-width:560px){
  .house-layout-forge .house-gear-grid-forge{
    grid-template-columns:repeat(auto-fit,minmax(88px,1fr));
    grid-auto-rows:68px;
    gap:8px;
  }
  .house-layout-forge .house-gear-grid-forge .house-tile.icon-only{
    min-height:68px;height:68px;padding-bottom:16px;
  }
  .house-layout-forge .house-gear-grid-forge .house-tile.icon-only .house-tile-icon{font-size:30px}
  .house-layout-forge .house-gear-grid-forge .house-tile-rarity,
  .house-layout-forge .house-gear-grid-forge .house-tile-level{font-size:6.5px}
}
/* Height safety: if a short landscape/container leaves insufficient vertical room,
   preserve readable controls and scroll the source pane rather than clipping them. */
.house-layout-forge .house-forge-filters,
.house-layout-forge .house-gear-grid-forge{
  overscroll-behavior:contain;
}


