/* The Acceptance House Observatory (GET /houses, lib/pilot/houses.mjs; Wave 73). Built on site.css's tokens and
   bill.css's card. No inline style or script anywhere on the page (CSP style-src 'self', script-src 'self'): the fault
   bars are SVG whose widths are attributes, and /houses.js only swaps elements and classes.
   Two kinds of evidence, never mixed: LIVE (teal, solid) and SIMULATED (amber, dashed). Each also says so in words. */
.houses { --teal: #2dd4bf; --amber: var(--work); --red: #ff6b6b; --red-strong: #dc2626; }
.houses .houses-card { max-width: 72rem; }
/* site.css's .btn and the flex rows below set display, which would outrank the hidden attribute: hidden stays hidden. */
.houses [hidden] { display: none !important; }

/* the two evidence labels */
.evidence-flag { display: inline-flex; align-items: flex-start; gap: 0.5em; font: 400 0.72rem/1.35 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--rule-strong); border-radius: 2px; padding: 0.3em 0.65em; margin: 0 0 0.9rem; max-width: 100%; overflow-wrap: anywhere; }
.evidence-flag.live { color: var(--teal); border-color: var(--teal); }
.evidence-flag.live::before { content: ""; flex: none; width: 0.55em; height: 0.55em; margin-top: 0.4em; border-radius: 50%; background: var(--teal); }
.evidence-flag.sim { color: var(--amber); border: 1px dashed var(--amber); }
.evidence-flag.sim::before { content: "≈"; flex: none; }
.evidence-legend { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.92rem; color: var(--dust); }
.evidence-legend li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.6rem; }
.evidence-legend .evidence-flag { margin: 0; }

.bill-card section.evidence-live { border-top: 2px solid var(--teal); }
.bill-card section.evidence-sim { border: 1px dashed var(--amber); border-radius: 6px; padding: 1.3rem 1.1rem 0.6rem; margin: 1.4rem 0;
  background: repeating-linear-gradient(135deg, rgba(242, 180, 90, 0.035) 0 12px, transparent 12px 24px); }
@media (min-width: 720px) { .bill-card section.evidence-sim { padding: 1.6rem 1.6rem 0.8rem; } }

/* the summary strip */
.houses-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 10px; margin: 0.4rem 0 1rem; }
.houses-kpis div { border: 1px solid var(--rule); border-radius: 4px; padding: 0.7rem 0.85rem; background: var(--space); }
.houses-kpis dt { font: 400 0.7rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dust); margin: 0 0 0.3rem; }
.houses-kpis dd { margin: 0; font: 300 1.65rem/1.15 var(--sans); font-variant-numeric: tabular-nums; color: var(--line); overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .houses-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .houses-kpis div { padding: 0.6rem 0.7rem; }
  .houses-kpis dd { font-size: 1.35rem; }
}

/* breaker status, said in words and drawn in colour */
.pill { display: inline-block; font: 400 0.7rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--rule-strong);
  border-radius: 999px; padding: 0.2em 0.7em; color: var(--line); white-space: nowrap; vertical-align: middle; }
.pill-veteran { background: var(--live); border-color: var(--live); color: var(--space); }
.pill-active { color: var(--live); border-color: var(--live); }
.pill-caution_throttled { color: var(--amber); border-color: var(--amber); }
.pill-suspended_circuit_breaker { color: var(--red); border-color: var(--red-strong); background: rgba(220, 38, 38, 0.14); }
.pill-unrated { color: var(--dust); border-style: dashed; }

/* fault bars: 0 to 10,000 bps across; the line marks the 2,200 bps (22%) breaker */
.meter { display: block; width: 100%; max-width: 16rem; height: 10px; margin: 0.35rem 0 0.25rem; border-radius: 2px; overflow: hidden; }
.meter-track { fill: var(--rule); }
.meter-fill.meter-good { fill: var(--live); }
.meter-fill.meter-caution { fill: var(--amber); }
.meter-fill.meter-over { fill: var(--red-strong); }
.meter-fill.meter-none { fill: transparent; }
.meter-mark { stroke: var(--caution); stroke-width: 2px; }

/* the live tables: on a phone they scroll sideways in their .table-wrap rather than crush seven columns */
.houses-table { min-width: 46rem; }
.sim-regimes { min-width: 34rem; }
.sim-timeline { min-width: 30rem; }
.houses-group h3 .count { color: var(--dust); letter-spacing: 0.06em; text-transform: none; font-family: var(--sans); font-size: 0.86rem; }
.houses-table td, .houses-table th { font-variant-numeric: tabular-nums; }
.houses-table .sub { display: block; margin-top: 0.25rem; color: var(--dust); font-size: 0.82rem; }
.houses-table .pill + .sub { margin-top: 0.4rem; }
.houses-table .fault-cell { min-width: 9rem; }
.houses-table th[scope="row"] a, .houses-table td a { color: var(--line); }
.houses-table th[scope="row"] code, .sim-timeline th[scope="row"] code { white-space: nowrap; overflow-wrap: normal; }

/* the inspector */
.inspector-card { border: 1px solid var(--rule-strong); border-radius: 6px; padding: 1.1rem 1rem 0.4rem; margin: 0.6rem 0 1rem; background: var(--space); }
@media (min-width: 720px) { .inspector-card { padding: 1.4rem 1.4rem 0.6rem; } }
.inspector-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin: 0 0 0.8rem; }
.bill-card .inspector-head h3 { font: 400 1.25rem/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--line); margin: 0; overflow-wrap: anywhere; }
.inspector-head h3 code { border: 0; padding: 0; font-size: 1em; }
.inspector-card .facts { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--rule); }
.inspector-card .facts div { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--rule); }
.inspector-card .facts dt { font: 400 0.72rem/1.6 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dust); margin: 0; }
.inspector-card .facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .inspector-card .facts div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }
.bill-card .inspector-card h4 { font: 400 0.75rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dust); margin: 1.2rem 0 0.6rem; }

/* copy buttons (shown by /houses.js where the clipboard can be written) */
.copy-btn { min-height: 40px; padding: 0.45em 1em; font: 400 0.75rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dust); }
.copy-btn:hover, .copy-btn:focus-visible { color: var(--line); }

/* the simulation: regimes, the epoch picker and the three house cards */
.sim-regimes .regime-competitive_acceptance_houses th, .sim-regimes .regime-competitive_acceptance_houses td { color: var(--amber); }
.sim-timeline .pill { font-size: 0.66rem; }
.epoch-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.8rem; }
.epoch-btn { min-height: 44px; padding: 0.5em 1.1em; border: 1px solid var(--amber); border-radius: 2px; background: transparent; color: var(--amber);
  font: 400 0.8rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.epoch-btn:hover { background: rgba(242, 180, 90, 0.12); }
.epoch-btn[aria-pressed="true"] { background: var(--amber); color: var(--space); }
.epoch-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.sim-caption { color: var(--line); border-left: 2px solid var(--amber); padding: 0.15rem 0 0.15rem 0.8rem; max-width: 46rem; }
.sim-houses { list-style: none; margin: 0.8rem 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; }
.sim-house { border: 1px dashed var(--rule-strong); border-radius: 4px; padding: 0.85rem 0.9rem 0.4rem; background: var(--space); }
.sim-house.sim-suspended_circuit_breaker { border-color: var(--red-strong); }
.sim-house-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem; }
.bill-card .sim-house h4 { margin: 0; font: 400 0.95rem/1.3 var(--sans); letter-spacing: 0; text-transform: none; overflow-wrap: anywhere; }
.sim-house h4 code { border: 0; padding: 0; font-size: 0.92em; }
.sim-house .meter { max-width: none; }
.sim-figures { margin: 0.2rem 0 0.3rem; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.sim-money { margin: 0 0 0.3rem; color: var(--amber); font: 400 0.86rem/1.4 var(--mono); }
.sim-note { margin: 0 0 0.5rem; color: var(--dust); font-size: 0.86rem; }

/* operate a house */
.house-steps { margin: 0.6rem 0 1rem; padding-left: 1.3rem; max-width: 52rem; }
.house-steps li { margin: 0 0 0.9rem; }
.house-steps li > p:first-child { margin-bottom: 0.4rem; }
.house-steps .bill-cmd { margin-bottom: 0.4rem; }

@media (forced-colors: active) {
  .evidence-flag.live::before { forced-color-adjust: none; background: var(--teal); }
  .meter-fill { forced-color-adjust: none; }
}
