/* ---- Phase 3: rooms screens ---- */
.room-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.room-card { margin: 0; }
.room-card h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
.room-card h2 a { color: var(--text); text-decoration: none; }
.room-card h2 a:hover { text-decoration: underline; }
.room-total { margin-bottom: 12px; }

.back { margin: 0 0 8px; }
.back a { display: inline-flex; align-items: center; min-height: 44px; }
.field { margin-bottom: 12px; min-width: 0; }
.field .input, .field .select { width: 100%; }
.field.compact { margin-bottom: 0; }
.field-err { color: var(--danger); font-size: 0.85rem; margin: 4px 0 0; min-height: 0; }
.field-err:empty { display: none; }
.notes { padding: 8px 12px; min-height: 80px; resize: vertical; font: inherit; }
.save-status { margin: 8px 0 0; min-height: 1.4em; }
.save-status:empty { display: none; }
.jump { width: 100%; margin-top: 12px; }

.room-screen .card h2 { margin-bottom: 12px; }
.items { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 12px; }
.item-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.item-grid.dims { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.item-grid.openings > :first-child, .item-grid.walls > :first-child { grid-column: 1 / -1; }
.item-grid.openings .field:nth-child(4) { grid-column: auto; }
.item-grid .remove { align-self: end; grid-column: 1 / -1; }
.item-grid.excl .remove { grid-column: 1 / -1; }
.item-grid.surf { grid-template-columns: minmax(0, 1fr); }
.item-grid.wood { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.item-grid.wood .field-label { min-height: 2.6em; }

.seg { border: 1px solid var(--border); border-radius: 8px; padding: 0; margin: 0 0 12px; display: flex; overflow: hidden; min-width: 0; }
.seg-opt { flex: 1; position: relative; min-width: 0; display: flex; }
.seg-opt span { flex: 1; }
.seg-opt + .seg-opt { border-left: 1px solid var(--border); }
.seg-in { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-opt span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; text-align: center; font-size: 0.95rem; }
.seg-in:checked + span { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.seg-in:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
.item > .seg { margin-bottom: 0; }

.surface { padding: 12px 0; border-top: 1px solid var(--border); }
.surface:first-child { border-top: 0; padding-top: 0; }
.surface h3 { margin: 0 0 4px; font-size: 1rem; }
.checks { display: grid; margin-top: 8px; }
.surface-body[hidden] { display: none; }

.results h3 { margin: 12px 0 0; font-size: 1rem; }
.res-block { border-top: 1px solid var(--border); padding: 4px 0 8px; }
.res-block:first-of-type { border-top: 0; }
.res-sub { margin: 0 0 4px; }
.figs { margin: 0; }
.fig { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.fig dt { color: var(--muted); }
.fig dd { margin: 0; display: flex; align-items: center; gap: 4px; font-weight: 600; text-align: right; }
.fig-val { overflow-wrap: anywhere; }
.figs.total { border-top: 2px solid var(--text); margin-top: 8px; padding-top: 4px; font-size: 1.1rem; }
.info-btn {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--accent); font-size: 1.25rem; cursor: pointer; border-radius: 50%;
}
.info-btn:hover { background: var(--bg); }
.warn { border-left: 4px solid var(--danger); background: var(--bg); padding: 8px 12px; margin-bottom: 12px; border-radius: 0 8px 8px 0; }
.warn p { margin: 0; }
.warn p + p { margin-top: 6px; }

@media (min-width: 600px) {
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-grid.openings { grid-template-columns: 1.7fr 1fr 1fr 0.8fr auto; }
  .item-grid.openings > :first-child { grid-column: auto; }
  .item-grid.openings .remove, .item-grid.walls .remove, .item-grid.excl .remove { grid-column: auto; }
  .item-grid.walls { grid-template-columns: 1.5fr 1fr 1fr auto; }
  .item-grid.walls > :first-child { grid-column: auto; }
  .item-grid.excl { grid-template-columns: 1fr 1fr auto; }
  .item-grid.surf { grid-template-columns: 7em minmax(0, 1fr); }
}
@media (min-width: 900px) {
  .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-cols { align-items: start; }
  .col-results { position: sticky; top: calc(var(--bar-h) + 16px); max-height: calc(100vh - var(--bar-h) - 32px); overflow-y: auto; }
  .jump { display: none; }
  .item-grid.openings { grid-template-columns: 1.7fr 1fr 1fr 0.8fr auto; }
}
@media (max-width: 380px) {
  .item-grid.wood { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- room colours, feature wall, floor, by-colour results ---- */
.suggest-h { margin: 16px 0 4px; font-size: 1rem; }
.suggestions { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.suggestion { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.suggestion.current { border-color: var(--accent); background: var(--accent-soft); }
.combo-swatches { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.combo-swatches li { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.combo-swatches .small { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.combo-reason { margin: 0; }
.use-combo { justify-self: start; }
.surface-colour { margin: 4px 0 8px; }
.surface-colour .swatch { margin-right: 4px; }
.item-grid.feat { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.by-colours { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.by-colour { display: flex; gap: 10px; border-top: 1px solid var(--border); padding-top: 6px; }
.by-colour:first-child { border-top: 0; }
.by-colour > div { flex: 1; min-width: 0; }
.by-colour p { margin: 0; }
.colour-h { margin-top: 12px; }
@media (max-width: 480px) { .combo-swatches { grid-template-columns: minmax(0, 1fr); } }
.info-btn.inline { width: 44px; height: 44px; margin: -12px 0 -12px 0; font-size: 1.15rem; vertical-align: middle; }

/* ---- room colours as read-only swatches (Phase 10) ---- */
.colour-summary { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.colour-row { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.room-swatches.strip { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.needs-dimensions { font-weight: 600; margin: 8px 0; }

/* ---- info buttons: the icon is centred on the text line (D39) ---- */
.info-btn svg { display: block; width: 22px; height: 22px; }
.info-btn.inline { margin: -12px 0 -12px 2px; font-size: inherit; vertical-align: middle; position: relative; top: -1px; }
.check-note .info-btn { align-self: center; }
