/* Floor-plan with clickable room overlay (rooms page) */

.floor-plan {
  position: relative;
  display: block;
  width: 100%;
  margin: 0.5rem 0 1.5rem;
  user-select: none;
}
.floor-plan img {
  display: block;
  width: 100%;
  height: auto;
}
.floor-plan svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* let underlying image render; <a> elements re-enable */
}
.floor-plan svg a {
  pointer-events: auto;
  cursor: pointer;
}
.floor-plan svg a rect {
  fill: rgba(0, 100, 200, 0);
  transition: fill 0.12s ease;
}
.floor-plan svg a:hover rect {
  fill: rgba(0, 120, 220, 0.18);
}
.floor-plan svg a:focus-visible rect {
  fill: rgba(0, 120, 220, 0.18);
  outline: 2px solid rgba(0, 120, 220, 0.6);
}

/* Top-level collapsible sections (e.g. /systems/ "Whole house" page).
   Excludes the budget calculator's category panels (.bc-cat) which
   keep their tighter look. */

.md-typeset details:not(.bc-cat) {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 4px;
  margin: 0.5rem 0;
  padding: 0;
  background: var(--md-default-bg-color);
  box-shadow: none;
}
.md-typeset details:not(.bc-cat) > summary {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.55rem 2.25rem 0.55rem 1rem;
  background: transparent;
  cursor: pointer;
  border: 0;
  color: inherit;
  position: relative;
  list-style: none;
  display: block;
}
/* Suppress every browser / theme default marker so we own the indicator */
.md-typeset details:not(.bc-cat) > summary::-webkit-details-marker { display: none; }
.md-typeset details:not(.bc-cat) > summary::marker { content: ""; }
.md-typeset details:not(.bc-cat) > summary::before {
  content: none !important;
  display: none !important;
  background: none !important;
}
/* Single chevron on the right, vertically centered, rotates on open */
.md-typeset details:not(.bc-cat) > summary::after {
  content: "\25B8" !important;       /* ▸ */
  position: absolute !important;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  height: auto;
  border: 0;
  background: none !important;
  color: var(--md-default-fg-color--light);
  font-size: 0.85em;
  line-height: 1;
  transition: transform 0.15s ease;
}
.md-typeset details:not(.bc-cat)[open] > summary::after {
  transform: translateY(-50%) rotate(90deg);
}
.md-typeset details:not(.bc-cat) > summary:hover {
  background: var(--md-default-fg-color--lightest);
}
.md-typeset details:not(.bc-cat) > summary:focus {
  outline: none;
}
.md-typeset details:not(.bc-cat)[open] > summary {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
.md-typeset details:not(.bc-cat) > *:not(summary) {
  padding-left: 1rem;
  padding-right: 1rem;
}
.md-typeset details:not(.bc-cat)[open] > summary + * {
  padding-top: 0.75rem;
}
.md-typeset details:not(.bc-cat) > *:last-child {
  padding-bottom: 0.75rem;
}

/* Renovation budget calculator */

.bc-rendered { font-size: 0.85rem; }
.bc-rendered .bc-note { color: var(--md-default-fg-color--light); margin: 0.5rem 0 1rem; }

.bc-summary {
  position: sticky;
  top: 3.6rem;
  z-index: 4;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.bc-totals { display: flex; gap: 1.5rem; align-items: baseline; flex-wrap: wrap; }
.bc-total-line { display: flex; gap: 0.4rem; align-items: baseline; }
.bc-total-line .bc-label {
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bc-total-line strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bc-total-mid-line strong { color: var(--md-accent-fg-color); }

.bc-actions { display: flex; gap: 0.4rem; }
.bc-actions button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  background: var(--md-default-bg-color);
  color: inherit;
  border-radius: 0.15rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}
.bc-actions button:hover { background: var(--md-default-fg-color--lightest); }

.bc-cat { margin: 0.75rem 0; }
.bc-cat-summary {
  cursor: pointer;
  padding: 0.4rem 0;
  font-weight: 600;
  border-bottom: 2px solid var(--md-default-fg-color--lightest);
  list-style: revert;
}
.bc-cat-total {
  font-weight: normal;
  color: var(--md-default-fg-color--light);
  font-size: 0.8em;
  margin-left: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.bc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4rem 0 0.75rem;
  font-size: 0.85rem;
}
.bc-table th,
.bc-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  vertical-align: middle;
  text-align: left;
}
.bc-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--md-default-fg-color--light);
}
.bc-table input[type="number"] {
  width: 7em;
  padding: 0.2rem 0.4rem;
  font: inherit;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 2px;
  text-align: right;
  background: var(--md-default-bg-color);
  color: inherit;
  font-variant-numeric: tabular-nums;
}
.bc-table input[type="number"]:focus {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: -1px;
}

.bc-source {
  font-size: 0.75em;
  color: var(--md-accent-fg-color);
  margin-left: 0.4rem;
  text-decoration: none;
  white-space: nowrap;
}
.bc-source:hover { text-decoration: underline; }

.bc-indent { padding-left: 1.5rem !important; }

.bc-radio-header td {
  background: var(--md-default-fg-color--lightest);
  border-top: 2px solid var(--md-default-fg-color--lighter);
}
.bc-radio-option { opacity: 0.55; }
.bc-radio-option.bc-selected { opacity: 1; }
.bc-radio-option.bc-selected td { background: rgba(255, 200, 0, 0.06); }

[data-md-color-scheme="slate"] .bc-radio-option.bc-selected td {
  background: rgba(120, 200, 255, 0.07);
}

.bc-badge {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  white-space: nowrap;
}
.bc-badge-must   { background: #fee2e2; color: #991b1b; }
.bc-badge-should { background: #fef3c7; color: #92400e; }
.bc-badge-nice   { background: #d1fae5; color: #065f46; }

[data-md-color-scheme="slate"] .bc-badge-must   { background: #4c1d1d; color: #fca5a5; }
[data-md-color-scheme="slate"] .bc-badge-should { background: #4a3d1d; color: #fcd34d; }
[data-md-color-scheme="slate"] .bc-badge-nice   { background: #1d4a3a; color: #6ee7b7; }

.bc-required {
  color: var(--md-accent-fg-color);
  font-size: 1em;
  display: inline-block;
}

@media print {
  .bc-actions { display: none; }
  .bc-summary { position: static; box-shadow: none; }
  .bc-cat { page-break-inside: avoid; }
  .bc-radio-option { opacity: 1; }
  .bc-radio-option:not(.bc-selected) { display: none; }
}

/* Inline option-group widget (used on systems page for type-of-X picks) */

.reno-opts {
  margin: 0.75rem 0 1.25rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 4px;
  background: var(--md-default-bg-color);
  overflow: hidden;
}
.reno-opts-title {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-default-fg-color--light);
  padding: 0.5rem 0.75rem;
  background: var(--md-default-fg-color--lightest);
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
.reno-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
.reno-opt:last-child { border-bottom: none; }
.reno-opt:hover { background: var(--md-default-fg-color--lightest); }
.reno-opt--selected {
  background: rgba(255, 200, 0, 0.06);
}
[data-md-color-scheme="slate"] .reno-opt--selected {
  background: rgba(120, 200, 255, 0.07);
}
.reno-opt-label {
  flex: 1;
  font-size: 0.92em;
}
.reno-opt-cost {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
  color: var(--md-default-fg-color--light);
  white-space: nowrap;
}
.reno-opt-cost input[type="number"] {
  width: 5.5em;
  padding: 0.15rem 0.35rem;
  font: inherit;
  font-size: inherit;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 2px;
  text-align: right;
  background: var(--md-default-bg-color);
  color: inherit;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
/* Hide native number-input spinner arrows everywhere (Chrome / Safari / Edge / Firefox). */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}
.reno-opt-cost input[type="number"]:focus {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: -1px;
}
.reno-opt-dash {
  color: var(--md-default-fg-color--light);
}
.reno-opt--selected .reno-opt-cost {
  color: var(--md-default-fg-color);
}
.reno-opt input[type="radio"] {
  margin: 0;
  flex-shrink: 0;
}

/* Per-section notes (saved to localStorage / KV) */
.reno-notes {
  margin: 1rem 0 0.5rem;
}
.reno-notes-title {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.35rem;
}
.reno-notes-textarea {
  width: 100%;
  min-height: 3.5rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  background: var(--md-default-bg-color);
  color: inherit;
  padding: 0.5rem;
  font: inherit;
  font-size: 0.9em;
  line-height: 1.4;
  resize: vertical;
  border-radius: 3px;
  box-sizing: border-box;
}
.reno-notes-textarea:focus {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: -1px;
}
