.layout-entry {
  margin: 0 0 16px;
  background: var(--mint-wash);
  color: var(--deep);
  border-color: var(--deep);
}
#quote-layout-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 16px;
  padding: 0;
}
#quote-layout-card .room-entry { flex: 1 1 184px; }
#quote-layout-label { flex: 1 0 100%; }
.room-entry { min-width: 0; }
.room-action {
  gap: 6px;
  min-height: 44px;
  padding-inline: 12px;
  border-color: var(--deep);
  background: var(--mint-wash);
  color: var(--deep);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.room-action img { flex: 0 0 20px; }
.room-action::after { content: attr(aria-label); }
.room-action[aria-disabled="true"] { opacity: .8; cursor: default; }
#quote-layout-card .room-action {
  width: 100%;
}
.room-status { margin: 4px 0 0; }
.room-status:empty { display: none; }
.room-status input { display: block; width: 100%; margin-top: 4px; font-size: 16px; }
#layout-editor[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  inset: 0;
  width: min(1140px, 100%);
  height: min(890px, 100dvh);
  max-width: 100%;
  max-height: 100dvh;
  padding: 0;
  margin: auto;
  overflow: hidden;
  border-radius: 0;
}
#layout-editor .quote-header {
  margin: 0;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--rule);
}
#layout-title { font-size: clamp(20px, 4vw, 28px); }
#layout-title:focus { outline: none; }
#layout-package { display: block; margin-top: 2px; }
#layout-content { position: relative; overflow: hidden; }
#layout-frame { display: block; width: 100%; height: 100%; border: 0; }
#layout-status {
  position: absolute;
  inset: 8px 8px auto;
  padding: 8px 12px;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.layout-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
}
.layout-footer .room-action { width: 100%; }
.layout-footer #layout-apply { margin-left: auto; }
#layout-apply:disabled { opacity: .65; cursor: default; }
@media (max-width: 380px) {
  .layout-footer :is(.room-action, #layout-apply) { padding-inline: 8px; font-size: 14px; }
  .layout-footer .room-action img { width: 16px; height: 16px; flex-basis: 16px; }
}
@media (min-width: 800px) {
  #layout-editor[open] { width: min(1140px, calc(100% - 32px)); height: min(890px, calc(100dvh - 32px)); border-radius: 20px; }
  #layout-editor .quote-header, .layout-footer { padding: 12px 20px; }
}
@media print {
  #quote-layout-card { display: none; }
}

@media print { #quote-layout-card, #layout-editor { display: none !important; } }

#layout-sets { padding-inline: 16px; border-bottom: 1px solid var(--rule); }
#layout-sets summary { min-height: 44px; padding-block: 12px; cursor: pointer; font-weight: 620; }
.layout-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-bottom: 8px; }
.layout-choices .button { min-height: 44px; padding: 5px; border-color: var(--rule); background: var(--warm); font-size: 13px; display: grid; justify-content: center; text-align: center; }
.layout-choices .button[aria-pressed="true"] { background: #e4ebe1; color: #2c5142; }
.layout-choices small { display: block; font-size: 11px; }
#layout-change-note { min-width: 0; max-width: 20ch; margin-right: auto; }

@media (max-width: 420px) {
  .layout-footer { flex-wrap: wrap; }
  #layout-change-note { flex: 1 1 120px; align-self: center; }
}

#layout-change-note strong { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; }
#layout-apply { min-height: 44px; }

/* Keep the room action in view while the customer explores the setup. */
.layout-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.layout-footer .room-entry { grid-column: 1 / -1; }
.layout-footer .room-action { min-height: 52px; font-size: 17px; font-weight: 650; background: var(--deep); color: var(--paper); border: 2px solid var(--deep); }
.layout-footer .room-action img { filter: brightness(0) invert(1); }
.layout-footer .room-status { text-align: center; }
.room-action:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }
