/* housing-intelligence.css — HOU-004 Housing Object v1.0 UI (AreaWise design system). */

.housing-intelligence {
  font-family: var(--font);
  color: var(--ink);
  margin: var(--sp-4) 0;
}

/* ── Overview strip ── */
.hi-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.hi-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.hi-stat-label {
  display: block;
  font-size: var(--fs-label);
  color: var(--muted);
  margin-bottom: var(--sp-1);
}
.hi-stat-value {
  display: block;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.hi-stat-note {
  display: block;
  font-style: normal;
  font-size: var(--fs-small);
  color: var(--subtle);
  margin-top: var(--sp-1);
}

/* ── Family card grid ── */
.hi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}
.hi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.hi-card--council-tax {
  grid-column: 1 / -1;
}
.hi-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.hi-card-title {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.hi-card-scope {
  font-size: var(--fs-small);
  color: var(--subtle);
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 2px 10px;
}
.hi-authority {
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 var(--sp-3);
}
.hi-subhead {
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: var(--sp-4) 0 var(--sp-2);
}

/* ── Proportion bars ── */
.hi-bars {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hi-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 44px;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.hi-bar-name {
  font-size: var(--fs-secondary);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hi-bar-track {
  background: var(--surface-2);
  border-radius: var(--r-pill);
  height: 10px;
  overflow: hidden;
}
.hi-bar-fill {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: var(--r-pill);
}
.hi-bar-value {
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hi-bars-empty,
.hi-empty {
  font-size: var(--fs-secondary);
  color: var(--muted);
}

/* ── Council Tax charging-area table ── */
.hi-ct-table {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
}
.hi-ct-row {
  display: grid;
  grid-template-columns: 160px repeat(8, 1fr);
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  align-items: center;
  min-width: 560px;
}
.hi-ct-row + .hi-ct-row {
  border-top: 1px solid var(--line);
}
.hi-ct-head {
  background: var(--surface-2);
  font-weight: 600;
  font-size: var(--fs-label);
  color: var(--muted);
}
.hi-ct-area {
  font-size: var(--fs-secondary);
  font-weight: 500;
  color: var(--ink);
}
.hi-ct-band {
  font-size: var(--fs-secondary);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
}

/* ── Provenance ── */
.hi-provenance {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: var(--fs-small);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
}
.hi-provenance-label {
  font-weight: 600;
  color: var(--ink);
}

/* ── States ── */
.hi-state {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
}
.hi-state-title {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 var(--sp-2);
}
.hi-state-copy {
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto;
}
.hi-retry {
  margin-top: var(--sp-3);
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-secondary);
  background: var(--green-strong);
  color: #fff;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  min-height: 44px;
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .hi-grid {
    grid-template-columns: 1fr;
  }
  .hi-card--council-tax {
    grid-column: auto;
  }
  .hi-bar-row {
    grid-template-columns: 110px 1fr 44px;
  }
  .hi-overview {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 420px) {
  .hi-overview {
    grid-template-columns: 1fr;
  }
}
