/* ===============================
   House: Medium Polish Pass
   Improves readability, spacing,
   clarity, and layout stability.
   =============================== */

/* --- Sticky summary bar --- */
.house-sticky {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 0;
  backdrop-filter: blur(4px);
}

.house-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.house-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--fg-muted);
}

.house-summary-metrics .k {
  color: var(--fg);
  font-weight: 700;
}

/* --- Form Polish --- */

/* Prevent chips from overlapping input */
.house-form-chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Checklist alignment improvement */
.house-checklist {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}

.house-checklist label {
  margin: 0;
  font-weight: 600;
}

/* --- Section headers --- */
h2 {
  font-size: 20px;
  font-weight: 800;
  margin-top: 8px;
  margin-bottom: 4px;
  color: var(--fg);
}

/* --- Results block layout --- */
#house-results {
  padding-top: 4px;
}

/* Cards stacking inside results */
#house-results .card + .card {
  margin-top: 14px;
}

/* --- Key/value emphasis in results --- */
#house-results .k {
  color: var(--fg-muted);
  font-size: 16px;
  font-weight: 700;
}

#house-results .v {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}

/* --- Histogram polish --- */
#hist {
  width: 100%;
  height: 260px;
  margin-top: 10px;
  border-radius: 10px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  padding: 10px;
}

/* --- House Log Polish --- */
.house-log {
  max-height: 250px;
  overflow: auto;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px;
  background: var(--bg-elev-1);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}

.house-log--tail {
  background: #132b1e;
  border-color: #2f7a49;
}

/* Each line visually separated */
.log-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 2px;
}

.log-line + .log-line {
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
  padding-top: 6px;
}

/* Index badge */
.log-idx {
  display: inline-block;
  background: rgba(159,232,201,0.12);
  border: 1px solid rgba(159,232,201,0.35);
  border-radius: 999px;
  padding: 1px 7px;
  margin-right: 4px;
  font-weight: 700;
  color: #9fe8c9;
}

/* Highlight bits */
.log-roll { color: #ffd089; font-weight: 600; }
.log-delta { color: #dffbe9; }
.log-tapped { color: #c4d7e1; font-style: italic; }
.log-note { color: #a9b9ff; }

/* --- Responsive Tweaks --- */
@media (max-width: 560px) {
  .house-summary-metrics {
    gap: 6px;
  }

  #hist {
    height: 220px;
  }
}
