:root {
  color-scheme: light;
  --bg: #eaf6ff;
  --panel: #ffffff;
  --panel-2: #f2f9ff;
  --text: #14233a;
  --muted: #54677f;
  --line: #c9e2f5;
  --accent: #087fc7;
  --accent-2: #0b8bdc;
  --navy: #0b2f5f;
  --sky: #dff3ff;
  --danger: #d92d20;
  --warn: #d68600;
  --ok: #178a4d;
  --blue: #4aaee8;
  --soft-green: #eafaf1;
  --shadow: 0 18px 42px rgba(18, 79, 130, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(218, 243, 255, 0.72)),
    linear-gradient(135deg, #e9f7ff 0%, #f7fcff 44%, #d4edff 100%);
  color: var(--text);
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.hero,
.panel {
  border: 1px solid rgba(42, 137, 205, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.85fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border-left: 5px solid var(--ok);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fcff;
  border: 1px solid var(--line);
}

.brand-copy {
  min-width: 0;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: #146f9e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--navy);
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.top-lead {
  margin: 4px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.top-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ok);
  background: #f3fff8;
  border: 1px solid rgba(23, 138, 77, 0.26);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7fcff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.contact-card a {
  display: block;
  color: var(--navy);
  text-decoration: none;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.contact-card a:first-child {
  font-size: 13px;
}

.badges,
.certs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.badges span,
.certs span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: #3a3f45;
  background: #f4fbff;
  font-size: 13px;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
  margin: 18px 0;
  padding: 24px;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(225, 246, 255, 0.8)),
    linear-gradient(135deg, rgba(11, 139, 220, 0.16), rgba(255, 255, 255, 0.7), rgba(23, 138, 77, 0.08));
}

.hero-copy p {
  max-width: 720px;
  margin: 0;
  color: #36424e;
  font-size: 17px;
  line-height: 1.55;
}

.thermal-scale {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #194dff, #21c7ff, #58df6c, #ffd43b, #ff9f1a);
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  font-size: 12px;
  font-weight: 800;
}

.thermal-scale strong {
  text-transform: uppercase;
}

.thermal-scale span:last-child {
  text-align: right;
}

.quick-read {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-read div,
.meter {
  min-height: 112px;
  padding: 16px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, #ffffff, #eef9ff),
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(208,236,255,0.26));
  border: 1px solid rgba(42, 137, 205, 0.18);
  box-shadow: 0 14px 24px rgba(18, 79, 130, 0.11), inset 0 1px 0 rgba(255,255,255,0.95);
}

.quick-read strong,
.meter strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  color: var(--navy);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.calculator-stack {
  grid-template-columns: 1fr !important;
  align-items: stretch;
}

.calculator-stack .controls,
.calculator-stack .results {
  grid-column: 1 / -1;
  width: 100%;
}

.calculator-stack .controls {
  align-items: start;
}

.calculator-stack .controls > .panel-head,
.calculator-stack .controls > label,
.calculator-stack .controls > .device-info,
.calculator-stack .controls > #wwsControls {
  grid-column: 1 / -1;
}

.calculator-stack .controls > .two-col,
.calculator-stack #ductControls,
.calculator-stack .controls > .panel-subhead {
  grid-column: 1 / -1;
}

.lower {
  margin-top: 18px;
}

.panel {
  border-radius: 10px;
  padding: 20px;
}

.panel-head p,
.meter small,
.recommendations p,
.footer-panel p,
td {
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: grid;
  gap: 8px;
  color: #2c333a;
  font-size: 14px;
  font-weight: 650;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--panel-2);
  color: var(--text);
}

input[type="range"] {
  accent-color: var(--ok);
}

input[type="range"].range-ok {
  accent-color: var(--ok);
}

input[type="range"].range-warn {
  accent-color: var(--warn);
}

input[type="range"].range-danger {
  accent-color: var(--danger);
}

output {
  color: var(--accent-2);
  font-weight: 750;
}

input:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.device-info {
  position: relative;
  margin-top: 2px;
  border: 1px solid rgba(33, 94, 151, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 16px 16px, rgba(49, 122, 191, 0.16), transparent 34px),
    linear-gradient(135deg, #ffffff 0%, #f2f8ff 58%, #e9f4ff 100%);
  box-shadow: 0 18px 36px rgba(17, 45, 78, 0.14);
  color: var(--text);
  padding: 16px;
  display: grid;
  gap: 10px;
  overflow: visible;
}

.device-info::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 28px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-left: 1px solid rgba(33, 94, 151, 0.22);
  border-top: 1px solid rgba(33, 94, 151, 0.22);
  transform: rotate(45deg);
}

.device-info-top {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}

.device-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(49, 122, 191, 0.28);
}

.device-info h3 {
  margin: 0;
  color: var(--accent);
  font-size: 18px;
  line-height: 1.2;
}

.device-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.device-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.device-info-chip {
  border: 1px solid rgba(190, 211, 229, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 11px;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.device-info-chip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.device-info-chip strong {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.danger-note {
  color: var(--warn);
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 18px;
}

.calculator-stack .controls {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.98), rgba(239,248,255,0.94));
}

.calculator-stack .controls > .two-col > label,
.calculator-stack #ductControls label,
.calculator-stack #wwsControls label,
.calculator-stack .controls > label {
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(18, 79, 130, 0.08);
}

#ductControls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px;
}

.is-hidden {
  display: none !important;
}

.two-col,
.meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.calculator-stack .controls > .two-col,
.calculator-stack #wwsControls {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.calculator-stack #ductControls .two-col {
  grid-template-columns: 1fr;
}

.meters {
  grid-template-columns: repeat(2, 1fr);
}

.diagnostic {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f2f9ff;
  color: #2c333a;
  line-height: 1.5;
}

.install-summary {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcff;
  overflow-wrap: anywhere;
}

.install-summary h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 17px;
}

.install-summary p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.install-summary table {
  min-width: 780px;
}

.diagnostic.ok {
  border-color: rgba(109, 226, 138, 0.4);
  background: #f0fff5;
}

.diagnostic.warn {
  border-color: rgba(255, 204, 102, 0.5);
  background: #fff8e6;
}

.diagnostic.danger {
  border-color: rgba(255, 107, 107, 0.5);
  background: #fff1f1;
}

.fit-meter strong {
  color: var(--navy);
}

.meter strong.state-ok,
.quick-read strong.state-ok {
  color: var(--ok);
}

.meter strong.state-warn,
.quick-read strong.state-warn {
  color: var(--warn);
}

.meter strong.state-danger,
.quick-read strong.state-danger {
  color: var(--danger);
}

.cooling-bar {
  width: 100%;
  height: 10px;
  margin: 10px 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d8f5e3, #ffe6a8, #ffc4c4);
  border: 1px solid rgba(18, 79, 130, 0.12);
  overflow: hidden;
}

.cooling-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #178a4d, #d68600, #d92d20);
  transition: width 180ms ease;
}

.wide {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 30px rgba(18, 79, 130, 0.14), 0 2px 0 rgba(255,255,255,0.9) inset;
  border: 1px solid #cfe7f7;
}

.table-wrap table {
  min-width: 1180px;
}

th,
td {
  padding: 14px 13px;
  border-bottom: 1px solid #d9edf9;
  text-align: left;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.92);
}

th {
  color: #fff;
  font-size: 13px;
  background: linear-gradient(180deg, #128cba, #0b6f9d);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(0,0,0,0.12);
}

tbody tr:nth-child(even) td {
  background: #f5fbff;
}

tbody tr:hover td {
  background: #e9f7ff;
}

.panel-subhead {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.panel-subhead h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.panel-subhead p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.footer-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

.footer-contact {
  margin: 10px 0 0;
  color: var(--navy);
  font-weight: 850;
  line-height: 1.35;
}

.price-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.price-box > div {
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(145deg, #ffffff, #e7f6ff);
  border: 1px solid var(--line);
  box-shadow: 0 14px 24px rgba(18, 79, 130, 0.12), inset 0 1px 0 rgba(255,255,255,0.95);
}

.price-box strong {
  display: block;
  color: var(--navy);
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.offer-text {
  width: 100%;
  min-height: 210px;
  margin-top: 14px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fcff;
  color: var(--text);
  font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95);
}

.quick-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quick-contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #0b5f92, var(--accent-2));
  text-decoration: none;
  font-weight: 850;
}

.accessories-wrap table {
  min-width: 820px;
}

.accessory-check {
  width: 20px;
  height: 20px;
  accent-color: var(--ok);
}

@media (max-width: 860px) {
  .topbar,
  .hero,
  .grid,
  .price-box,
  .footer-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .brand {
    min-height: auto;
  }

  .contact-card {
    min-height: auto;
    justify-items: start;
  }

  .quick-read,
  .meters,
  .two-col {
    grid-template-columns: 1fr;
  }

  .badges,
  .certs {
    justify-content: flex-start;
  }

  h1 {
    font-size: 26px;
  }

  .top-tagline {
    justify-content: flex-start;
    min-height: auto;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 10px;
  }
}
