/* Homebuilder frame — Builds list and the build detail pane (header, tabs,
   overview, selections, plans). The overview reflows by the width of its
   own pane (container query), so it lays out the same whether the build
   list is beside it or not. */

/* ---- list ---- */
.hm-build-list { display: grid; gap: 8px; }
.hm-build-row { display: grid; gap: 5px; padding: 12px 14px; color: inherit; text-decoration: none; background: var(--app-surface); border: 1px solid var(--hm-line); border-radius: var(--hm-radius); transition: background var(--motion-fast), border-color var(--motion-fast); }
.hm-build-row:hover { background: var(--app-surface-2); }
.hm-build-row.is-active { background: var(--app-accent-soft); border-color: color-mix(in srgb, var(--app-accent) 35%, white); }
.hm-build-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hm-build-row-top b { min-width: 0; font-size: 15px; font-weight: 650; color: var(--hm-ink); overflow-wrap: anywhere; }
.hm-build-row > small { font-size: 12.5px; line-height: 1.35; color: var(--hm-muted); }
.hm-build-row-progress { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 12px; font-weight: 650; color: var(--hm-muted); font-variant-numeric: tabular-nums; }
.hm-build-row-progress .hm-progress { flex: 1; height: 5px; }
.hm-build-row-progress .hm-muted-line { margin: 0; font-size: 12px; font-weight: 500; }
.hm-build-row-warranty { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--app-ok); }
.hm-build-row-warranty .hm-ic { width: 15px; height: 15px; flex: none; }
.hm-build-row-warranty .hm-nowrap { white-space: nowrap; }
.hm-build-row-warranty.is-ended { font-weight: 500; color: var(--hm-muted); }
.hm-build-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--hm-muted); }
@media (min-width: 1024px) {
  .hm-build-list { gap: 2px; }
  .hm-build-row { border-color: transparent; border-radius: 10px; background: transparent; }
  .hm-build-row:hover { background: var(--app-surface-2); }
  .hm-build-row.is-active { border-color: transparent; }
}

/* ---- portfolio (desktop, nothing selected) ---- */
.hm-portfolio .hm-tiles { margin-bottom: 8px; }
.hm-portfolio > .hm-empty { margin-top: 24px; }

/* ---- detail header ---- */
.hm-bd { container-type: inline-size; }
.hm-bd-head { padding: 12px 0 0; }
.hm-bd-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hm-bd-head .hm-tabs { margin-bottom: 16px; }

/* ---- overview ---- */
.hm-bd-overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.hm-bd-overview > section { min-width: 0; }
.hm-bd-overview > section > .hm-section-head:first-child .hm-section-title { margin-top: 18px; }
.hm-bd-progress { padding: 14px 16px; }
.hm-bd-progress-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hm-bd-progress-top b { display: block; font-size: 28px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; color: var(--app-navy); font-variant-numeric: tabular-nums; }
.hm-bd-progress-meta { display: grid; justify-items: end; gap: 2px; font-size: 13px; color: var(--hm-muted); text-align: right; }
.hm-bd-progress .hm-progress { height: 8px; }
.hm-bd-items { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--app-warn); }
.hm-bd-items .hm-ic { width: 16px; height: 16px; }

.hm-bd-warranty .hm-bd-progress-top { margin-bottom: 0; }
.hm-bd-warranty-date { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--app-ok); }
.hm-bd-warranty-date .hm-ic { width: 16px; height: 16px; }
.hm-bd-warranty.is-ended .hm-bd-progress-top b { color: var(--hm-muted); }
.hm-bd-warranty.is-ended .hm-bd-warranty-date { color: var(--hm-muted); }

/* Finished homes: the checklist is kept but folded away. */
.hm-bd-fold > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 18px; list-style: none; cursor: pointer; }
.hm-bd-fold > summary::-webkit-details-marker { display: none; }
.hm-bd-fold > summary .hm-section-title { margin: 0; }
.hm-bd-fold-count { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--hm-muted); font-variant-numeric: tabular-nums; }
.hm-bd-fold[open] > summary .hm-phase-caret { transform: rotate(180deg); }
.hm-bd-fold-tools { display: flex; justify-content: flex-end; margin: 0 0 6px; }

/* A wide pane: Costs across the full width, then the checklist beside the
   build's email. */
@container (min-width: 720px) {
  .hm-bd-overview { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "progress progress" "costs costs" "checklist mail"; gap: 4px 24px; align-items: start; }
  .hm-bd-progress { grid-area: progress; }
  .hm-bd-costs { grid-area: costs; }
  .hm-bd-checklist { grid-area: checklist; }
  .hm-bd-mail { grid-area: mail; }
}

/* ---- checklist ---- */
.hm-phases { display: grid; gap: 8px; }
.hm-phase { background: var(--app-surface); border: 1px solid var(--hm-line); border-radius: var(--hm-radius); }
.hm-phase > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; min-height: 52px; padding: 10px 14px; list-style: none; cursor: pointer; }
.hm-phase > summary::-webkit-details-marker { display: none; }
.hm-phase-name { font-size: 14.5px; font-weight: 650; color: var(--hm-ink); }
.hm-phase-count { font-size: 12.5px; font-weight: 650; color: var(--hm-muted); font-variant-numeric: tabular-nums; }
.hm-phase-caret { width: 16px; height: 16px; color: var(--hm-faint); transition: transform var(--motion-fast); }
.hm-phase[open] .hm-phase-caret { transform: rotate(180deg); }
.hm-phase-bar { grid-column: 1 / -1; }
.hm-phase-bar .hm-progress { height: 4px; }
.hm-phase.is-done .hm-phase-bar .hm-progress > span { background: var(--app-ok); }
.hm-phase.is-done .hm-phase-count { color: var(--app-ok); }
.hm-steps { margin: 0; padding: 2px 14px 8px; list-style: none; border-top: 1px solid var(--hm-line); }
.hm-step { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--app-surface-3); }
.hm-step:last-child { border-bottom: 0; }
.hm-step-main { min-width: 0; }
.hm-step-main b { display: block; font-size: 14px; font-weight: 600; color: var(--hm-ink); }
.hm-step-ok .hm-step-main b { color: var(--hm-muted); }
.hm-step-main small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--hm-muted); }
.hm-step-note { display: block; margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--hm-text); }
.hm-glyph { display: grid; place-items: center; width: 22px; height: 22px; flex: none; margin-top: 1px; color: var(--hm-faint); border: 1.5px solid var(--hm-line-strong); border-radius: 50%; }
.hm-glyph .hm-ic { width: 13px; height: 13px; stroke-width: 2.6; }
.hm-glyph-ok { color: #fff; background: var(--app-ok); border-color: var(--app-ok); }
.hm-glyph-warn { color: var(--app-warn); background: var(--app-warn-bg); border-color: var(--app-warn); }
.hm-glyph-info { color: var(--app-info); background: var(--app-info-bg); border-color: var(--app-info); }

/* ---- correspondence on a build ---- */
.hm-mail-list-compact .hm-mail-row { border-radius: 0; }

/* ---- selections ---- */
.hm-sel { display: grid; gap: 14px; }
.hm-sel-sheet { margin: 0; padding: 14px 16px; }
.hm-sel-group .hm-section-title { margin-top: 8px; }
.hm-sel-list { display: grid; gap: 8px; }
.hm-sel-item { padding: 12px 14px; background: var(--app-surface); border: 1px solid var(--hm-line); border-radius: var(--hm-radius); }
.hm-sel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hm-sel-top b { font-size: 13px; font-weight: 650; letter-spacing: .01em; color: var(--hm-muted); }
.hm-sel-choice { margin: 4px 0 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--hm-ink); overflow-wrap: anywhere; }
.hm-sel-choice.is-empty { font-weight: 500; font-style: italic; color: var(--hm-faint); }
.hm-sel-notes { margin: 8px 0 0; padding: 0 0 0 12px; list-style: none; border-left: 2px solid var(--hm-line); }
.hm-sel-notes li { padding: 2px 0; font-size: 13px; line-height: 1.45; color: var(--hm-text); }
.hm-sel-notes small { display: block; font-size: 11.5px; color: var(--hm-faint); }
@container (min-width: 760px) {
  .hm-sel-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- plans & documents ---- */
.hm-plans { display: grid; gap: 4px; }
.hm-plan-hero { display: flex; align-items: center; gap: 14px; padding: 16px; transition: background var(--motion-fast); }
.hm-plan-hero:hover { background: var(--app-surface-2); }
.hm-plan-hero-ic { display: grid; place-items: center; width: 52px; height: 52px; flex: none; color: #fff; background: var(--app-navy); border-radius: 12px; }
.hm-plan-hero-ic .hm-ic { width: 26px; height: 26px; }
.hm-plan-hero .hm-row-main b { font-size: 16px; }
.hm-docs h3.hm-section-title { margin-top: 14px; font-size: 11.5px; }
@container (min-width: 760px) {
  .hm-docs .hm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
