.hearth {
  --paper: #fff5df;
  --ink: #432b25;
  --muted: #654f45;
  --clay: #99482d;
  --green: #315d51;
  --edge: #ba9980;
  display: grid;
  width: min(100%,1150px);
  gap: 11px;
  padding: clamp(8px,2vw,20px);
  margin-inline: auto;
  border: 1px solid var(--edge);
  border-radius: 19px;
  background: #ece1cd;
  color: var(--ink);
  font: 15px/1.37 system-ui, sans-serif;
  text-align: start;
}
.hearth, .hearth *, .hearth *::before, .hearth *::after { box-sizing: border-box; }
.hearth [hidden] { display: none !important; }
.hearth h2, .hearth h3, .hearth h4, .hearth p { margin: 0; }
.hearth h2 { font-size: clamp(17px,3.5vw,24px); line-height: 1.19; }
.hearth h3 { font-size: 15px; line-height: 1.18; }
.hearth h4 { font-size: 14px; line-height: 1.18; }
.hearth small, .hearth .hp-hint { color: var(--muted); font-size: 12px; }
.hearth button, .hearth select {
  min-width: 0;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid #a88265;
  border-radius: 8px;
  color: var(--ink);
  background: #fff9ea;
  font: 730 13px/1.13 system-ui, sans-serif;
  overflow-wrap: break-word;
  touch-action: manipulation;
  cursor: pointer;
}
.hearth button:focus-visible, .hearth select:focus-visible { outline: 3px solid #2f7367; outline-offset: 2px; }
.hearth button:disabled, .hearth select:disabled { background: #ece4d3; border-color: #c9b8a1; color: #6a5c4f; cursor: default; }
.hearth button[aria-pressed=true]:not(:disabled) { background: #e2ecdb; color: #285244; border-color: #568373; box-shadow: inset 0 0 0 1px #6a8b7a; }
.hearth button.hp-primary:not(:disabled) { background: #8e442e; color: #fff8e9; border-color: #773c2c; font-weight: 850; }
.hp-stats, .hp-districts, .hp-modes, .hp-recipes, .hp-hire { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.hp-stat, .hp-district {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #c1a98f;
  border-radius: 8px;
  background: var(--paper);
}
.hp-stats strong { font-size: clamp(15px,3.4vw,23px); line-height: 1.16; font-variant-numeric: tabular-nums; }
.hp-district { border-block-start-width: 3px; }
.hp-district[data-status=active] { border-color: #a47157; background: #f8e7cb; }
.hp-district[data-status=ready] { border-color: #7d9d7f; background: #e3edda; }
.hp-district strong { font-size: 13px; }
.hp-layout, .hp-workshop { display: grid; grid-template-columns: minmax(0,1.24fr) minmax(0,1fr); gap: 11px; align-items: start; }
.hp-column { display: grid; gap: 11px; min-width: 0; }
.hp-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: clamp(7px,1.4vw,13px);
  border: 1px solid var(--edge);
  border-radius: 11px;
  background: var(--paper);
}
.hp-head, .hp-compact { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.hp-bay {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(67px,.68fr);
  min-height: 98px;
  align-items: center;
  gap: 4px;
  padding: 7px 8px;
  background: radial-gradient(ellipse at 75% 70%,#e5b783,#f2dfbf 74%);
  border: 1px solid #bd9c79;
  border-radius: 9px;
}
.hp-bay img { display: block; width: min(100%,153px); max-height: 114px; margin-inline: auto; object-fit: contain; }
.hp-bay-readout { display: grid; gap: 4px; min-width: 0; }
.hp-bay-readout strong { font-size: 16px; }
.hp-mode small, .hp-recipe small { font-weight: 500; }
.hp-mode,.hp-recipe { display: grid; justify-items: center; gap: 3px; align-content: center; text-align: center; }
.hp-recipe img { display: block; width: min(100%,95px); height: 48px; object-fit: contain; }
.hp-forecast, .hp-batch,.hp-order,.hp-role,.hp-upgrade,.hp-shelf-row,.hp-permit {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #c6aa8b;
  border-radius: 8px;
  background: #fff6e4;
}
.hp-forecast { background: #f2e4cf; border-inline-start-width: 3px; border-inline-start-color: #91755a; }
.hp-forecast[data-heat=safe], .hp-order[data-done=true] { border-color: #8fa387; background: #e9efdd; }
.hp-forecast[data-heat=hot] { border-inline-start-color: #a94731; }
.hp-batch[data-phase=ripe] { border-color: #88a08b; }
.hp-batch[data-phase=over] { border-color: #bf6a55; }
.hp-rack-list,.hp-orders,.hp-stock,.hp-upgrades,.hp-crew-grid { display: grid; gap: 5px; }
.hp-rack-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
.hp-rack-list button { display: grid; justify-items: start; gap: 4px; text-align: start; }
.hp-rack-list small { line-height: 1.17; }
.hp-track {
  position: relative;
  overflow: hidden;
  height: 7px;
  border-radius: 7px;
  background: #e4d2b8;
}
.hp-track i { position: absolute; top: 0; bottom: 0; left: var(--min,0%); width: var(--span,0%); background: #a9bc8d; }
.hp-track b { position: absolute; left: var(--progress,0%); top: 0; bottom: 0; width: 3px; margin-inline-start: -1px; background: #574334; }
.hp-track { direction: ltr; }
.hp-two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.hp-stock-items { display: flex; flex-wrap: wrap; gap: 4px; }
.hp-stock-items span {
  min-width: 23px;
  padding: 2px 4px;
  text-align: center;
  border: 1px solid #c6a48a;
  border-radius: 4px;
  color: #664936;
  background: #f7e7d0;
  font: 750 10px/1.12 system-ui, sans-serif;
}
.hp-stock-items span[data-strong=true] { color: #315247; background: #e1ecdb; border-color: #a4b29a; }
.hp-role > button, .hp-order > button { width: 100%; }
.hp-automation { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hp-automation select { flex: 1 1 105px; }
.hp-automation label { display: flex; align-items: center; min-height: 44px; gap: 5px; font-size: 12px; }
.hp-automation input { accent-color: #7b4a35; }
.hp-notice,.hp-win {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #a87859;
  border-radius: 10px;
  background: #f4e1c8;
}
.hp-win { border-color: #82a489; background: #e5edda; }
.hp-notice-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.hp-msg { min-height: 15px; color: #31574c; font-size: 12px; }
@media (max-width: 740px) {
  .hp-layout,.hp-workshop { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 350px) {
  .hp-recipes,.hp-rack-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hp-recipes button,.hp-rack-list button { padding-inline: 4px; }
}
