:root {
  --area-blue: #2998ff;
  --area-sky: #78bff8;
  --area-coral: #ff7f70;
  --area-green: #5fd0ad;
}

.breadcrumbs,
.field-note,
.field-help,
.range-meta,
.site-footer { color: #536174; }
.calculator-grid { align-items: stretch; }
.input-card,
.area-result { height: 100%; }
.card-title-row { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title-row .card-title { margin: 0; }
.add-room-top,
.add-room {
  border: 1px solid rgba(16, 112, 225, .2);
  border-radius: 999px;
  color: #0768d2;
  background: #edf6ff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.add-room-top { padding: 9px 13px; }
.add-room {
  width: 100%;
  min-height: 46px;
  margin: 12px 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.add-room span { font-size: 20px; line-height: 1; }
.rooms-list { display: grid; gap: 12px; }
.room-card {
  padding: 16px;
  border: 1px solid rgba(9, 27, 54, .09);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(9, 27, 54, .035);
}
.room-card-head { margin-bottom: 14px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.room-name-label { color: #68758a; font-size: 10px; font-weight: 750; }
.room-name {
  width: min(250px, 100%);
  margin-top: 3px;
  padding: 0;
  border: 0;
  color: #0b203f;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
}
.room-name:focus { outline: 0; box-shadow: inset 0 -2px #2998ff; }
.remove-room {
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  color: #c83f34;
  background: #fff1ef;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.room-card:first-child .remove-room:disabled { display: none; }
.room-dimensions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.room-dimension > label { display: block; margin-bottom: 7px; color: #0b203f; font-size: 11px; font-weight: 800; }
.room-dimension .input-shell { min-height: 50px; }
.room-dimension .input-shell input { padding-left: 14px; font-size: 16px; }
.room-dimension .range { margin-top: 9px; }
.room-dimension .range-meta { margin-top: 5px; font-size: 10px; }
.room-dimension .range-meta strong { font-size: 10px; }
.room-validation { min-height: 15px; margin-top: 8px; display: block; color: #c83f34; font-size: 10px; line-height: 1.35; }
.room-joint {
  margin-top: 12px;
  padding: 13px;
  border: 1px dashed rgba(41, 152, 255, .34);
  border-radius: 15px;
  background: #f4f9ff;
}
.room-joint[hidden] { display: none; }
.room-joint .field-head { margin-bottom: 8px; }
.room-joint .field-head label { color: #0b203f; font-size: 11px; font-weight: 800; }
.room-joint .input-shell { min-height: 48px; }
.room-joint .input-shell input { padding-left: 14px; font-size: 15px; }
.room-joint .range { margin-top: 9px; }
.room-joint .range-meta { margin-top: 5px; font-size: 10px; }
.room-joint > small { margin-top: 8px; display: block; color: #65748b; font-size: 9px; line-height: 1.4; }
.room-inline-result { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #edf0f4; color: #68758a; font-size: 11px; }
.room-inline-result strong { color: #0b203f; font-size: 13px; }
.area-fields { margin-top: 0; }

.openings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opening-card { padding: 14px; border: 1px solid #dbe1e9; border-radius: 16px; background: #fff; }
.opening-head { margin-bottom: 12px; display: flex; justify-content: space-between; gap: 8px; }
.opening-head strong { color: #0b203f; font-size: 13px; }
.opening-head span { color: #7b8799; font-size: 9px; }
.opening-card > label { display: block; margin-bottom: 6px; color: #667388; font-size: 9px; font-weight: 750; }
.mini-inputs { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 6px; }
.mini-inputs .input-shell { min-height: 45px; border-radius: 11px; }
.mini-inputs .input-shell input { min-width: 0; padding: 0 29px 0 10px; font-size: 13px; }
.mini-inputs .suffix { right: 9px; font-size: 9px; }

.result-a11y-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.area-result {
  background:
    radial-gradient(circle at 100% 0, rgba(41, 152, 255, .24), transparent 38%),
    linear-gradient(160deg, #071b38 0%, #0b2b55 100%);
}
.area-result .primary { background: #0877e6; }
.area-result .result-actions button { border-color: var(--area-coral); color: #071b38; background: var(--area-coral); }
.floorplan-section { margin-top: 23px; padding: 22px 0 20px; border-top: 1px solid rgba(255, 255, 255, .15); border-bottom: 1px solid rgba(255, 255, 255, .15); }
.floorplan {
  min-height: 220px;
  padding: 10px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(92px, auto);
  gap: 7px;
  background: rgba(255, 255, 255, .06);
  transition: opacity .4s ease, transform .55s cubic-bezier(.22, 1, .36, 1);
}
.floorplan.is-waiting { opacity: .001; transform: translateY(24px); }
.floorplan.is-building { opacity: 1; transform: translateY(0); }
.floorplan-room {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, rgba(41, 152, 255, .7), rgba(94, 191, 248, .35));
}
.floorplan-room:nth-child(3n+2) { background: linear-gradient(135deg, rgba(95, 208, 173, .55), rgba(41, 152, 255, .28)); }
.floorplan-room:nth-child(3n) { background: linear-gradient(135deg, rgba(255, 127, 112, .5), rgba(41, 152, 255, .25)); }
.floorplan-room span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 750; }
.floorplan-room strong { margin-top: 12px; font-size: 18px; }
.area-metrics { margin-top: 14px; }
.area-metrics dt { display: flex; align-items: center; gap: 9px; }
.floor-dot,
.wall-dot,
.total-dot { width: 9px; height: 9px; border-radius: 50%; }
.floor-dot { background: var(--area-blue); }
.wall-dot { background: var(--area-sky); }
.total-dot { background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.09); }
.total-metric dt,
.total-metric dd { color: #fff; }

.program-back-to-calculator {
  position: fixed;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 14px;
  margin: 0;
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.program-back-to-calculator.is-visible { opacity: 1; transform: translateY(0); visibility: visible; pointer-events: auto; }
.area-breakdown { overflow: visible; }
.room-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.room-result-card { padding: 16px; border: 1px solid rgba(9,27,54,.09); border-radius: 18px; background: #fff; }
.room-result-card span,
.room-result-card strong,
.room-result-card small { display: block; }
.room-result-card span { color: #667388; font-size: 10px; }
.room-result-card strong { margin-top: 5px; color: #0a203f; font-size: 20px; }
.room-result-card small { margin-top: 8px; color: #7b8799; font-size: 9px; }
.formula-summary { margin-top: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.formula-summary > div { padding: 16px; border-radius: 17px; background: #edf5ff; }
.formula-summary span,
.formula-summary strong,
.formula-summary small { display: block; }
.formula-summary span { color: #5f6f86; font-size: 10px; }
.formula-summary strong { margin-top: 4px; color: #0a203f; font-size: 18px; overflow-wrap: anywhere; }
.formula-summary small { margin-top: 6px; color: #758298; font-size: 9px; line-height: 1.35; }

@media (max-width: 900px) {
  .room-results { grid-template-columns: 1fr 1fr; }
  .formula-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .card-title-row { align-items: flex-start; }
  .add-room-top { padding: 8px 10px; font-size: 10px; }
  .room-card { padding: 14px; border-radius: 17px; }
  .room-dimensions { grid-template-columns: 1fr; }
  .openings-grid { grid-template-columns: 1fr; }
  .floorplan { min-height: 190px; }
  .room-results,
  .formula-summary { grid-template-columns: 1fr; }
  .room-dimension .range-meta,
  .room-dimension .range-meta strong,
  .room-joint .range-meta { font-size: 10px; }
  .program-schedule-actions #programSaveButton,
  .program-schedule-actions #programSavedButton,
  .program-schedule-actions #programPrintButton,
  .program-schedule-actions #programPdfButton { display: inline-flex; }
  .program-back-to-calculator { right: 12px; bottom: 12px; }
}

@media print {
  .site-header,
  .breadcrumbs,
  .hero,
  .input-card,
  .program-back-to-calculator,
  .result-actions,
  .program-schedule-actions,
  .seo-content,
  .site-footer { display: none !important; }
  .page,
  .calculator-grid { width: 100%; margin: 0; display: block; }
  .area-result,
  .area-breakdown { margin: 0 0 18px; break-inside: avoid; color: #000; background: #fff; box-shadow: none; }
  .area-result * { color: #000 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .floorplan,
  .program-back-to-calculator { transition: none; }
}
