:root {
  --ink: #17201c;
  --muted: #66736d;
  --paper: #f7f3e8;
  --panel: rgba(255, 255, 255, 0.92);
  --line: #d8d0bd;
  --sun: #f4b23d;
  --leaf: #42a879;
  --teal: #15584b;
  --blue: #2f668d;
  --roof: #313b43;
  --shadow: 0 18px 46px rgba(30, 39, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(244, 178, 61, 0.12), transparent 36%),
    linear-gradient(160deg, #fbf6e9 0%, #edf2ea 48%, #e7f1f4 100%);
  font-family: Inter, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

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

.app-shell {
  width: min(1500px, calc(100% - clamp(16px, 3vw, 28px)));
  height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 10px 0 8px;
}

.estimate-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) minmax(0, 1.26fr);
  gap: 14px;
  align-items: stretch;
}

.site-credit {
  color: rgba(23, 32, 28, 0.62);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.entry-panel,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entry-panel {
  display: grid;
  align-content: start;
  gap: clamp(16px, 2vh, 26px);
  padding: clamp(22px, 3vh, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    repeating-linear-gradient(135deg, transparent 0 24px, rgba(66, 168, 121, 0.08) 24px 26px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  max-width: 9ch;
  font-size: clamp(2.35rem, 4.9vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 2vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.field-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #354139;
  font-size: 0.92rem;
  font-weight: 800;
}

.field input,
.input-prefix {
  width: 100%;
  min-height: clamp(50px, 6vh, 64px);
  border: 1px solid #cbc5b4;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
}

.field input {
  padding: 0 15px;
}

.field input:focus {
  outline: 3px solid rgba(66, 168, 121, 0.22);
  border-color: var(--leaf);
}

.suggestions {
  display: grid;
  border: 1px solid #cbc5b4;
  border-radius: 6px;
  overflow: hidden;
  background: #fffdf8;
}

.suggestions[hidden] {
  display: none;
}

.suggestion-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.suggestion-button:last-child {
  border-bottom: 0;
}

.suggestion-button:hover,
.suggestion-button:focus {
  outline: 0;
  background: rgba(66, 168, 121, 0.12);
}

.google-attribution {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.input-prefix {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.input-prefix span {
  padding-left: 15px;
}

.input-prefix input {
  min-height: clamp(48px, 5.8vh, 62px);
  border: 0;
  background: transparent;
}

.quick-facts {
  display: grid;
  gap: 10px;
}

.quick-facts div,
.metric,
.breakdown div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.quick-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(11px, 1.7vh, 16px);
}

.quick-facts span,
.headline-metric span,
.metric span,
.breakdown span,
.chart-heading span {
  display: block;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0.72;
}

.quick-facts strong {
  text-align: right;
  font-size: 1rem;
}

.results-panel {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  grid-template-rows: auto auto auto auto auto;
  gap: clamp(10px, 1.5vh, 16px);
  padding: clamp(18px, 2.4vh, 26px);
}

.panel-heading {
  grid-column: 1 / -1;
}

.roof-visual {
  min-height: 0;
  height: clamp(170px, 27vh, 270px);
  display: grid;
  align-items: center;
  justify-items: center;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(244, 178, 61, 0.28), transparent 36%),
    linear-gradient(145deg, #dbe8e8, #fff8e5);
}

.roof-plane {
  position: relative;
  width: min(86%, 390px);
  aspect-ratio: 1.34;
  transform: perspective(760px) rotateX(58deg) rotateZ(-29deg);
  border: 12px solid #252d33;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 28%),
    repeating-linear-gradient(90deg, #2f3940 0 42px, #253039 42px 46px);
  box-shadow: 0 28px 58px rgba(35, 42, 38, 0.22);
}

.panel-strip {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 18%;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, #173d5c, #2c89a0);
}

.strip-one {
  top: 16%;
}

.strip-two {
  top: 41%;
}

.strip-three {
  top: 66%;
}

.sun-dot {
  position: absolute;
  top: -38px;
  right: -42px;
  width: 58px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 18px rgba(244, 178, 61, 0.18);
}

.headline-metric {
  min-height: 0;
  height: clamp(170px, 27vh, 270px);
  padding: clamp(20px, 2.3vw, 28px);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(21, 88, 75, 0.96), rgba(47, 102, 141, 0.96)),
    var(--teal);
  color: white;
}

.headline-metric strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(2.45rem, 4.5vw, 5.3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.metric-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.metric {
  min-height: clamp(82px, 11vh, 112px);
  padding: clamp(13px, 1.7vh, 18px);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.12rem, 1.45vw, 1.55rem);
  line-height: 1.05;
}

.breakdown {
  display: grid;
  gap: clamp(7px, 1vh, 10px);
  align-self: start;
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(10px, 1.4vh, 14px) 16px;
}

.breakdown strong {
  text-align: right;
  font-size: 1.05rem;
}

.insight {
  margin: 0;
  padding: clamp(12px, 1.7vh, 18px) 20px;
  align-self: stretch;
  border-left: 4px solid var(--sun);
  border-radius: 0 8px 8px 0;
  background: #fff8e9;
  color: #4e4129;
  font-size: 1rem;
  line-height: 1.4;
}

.chart-wrap {
  grid-column: 1 / -1;
  min-height: 0;
  padding: clamp(12px, 1.7vh, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121b18;
  color: white;
}

.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chart-heading strong {
  font-size: 1.15rem;
}

#savingsChart {
  width: 100%;
  height: clamp(130px, 22vh, 240px);
  display: block;
}

@media (max-height: 820px) and (min-width: 1181px) {
  .entry-panel,
  .results-panel {
    padding: 18px;
  }

  h1 {
    font-size: clamp(2.2rem, 4.2vw, 4.8rem);
  }

  .field-stack,
  .quick-facts {
    gap: 10px;
  }

  .field {
    gap: 5px;
    font-size: 0.82rem;
  }

  .field input,
  .input-prefix {
    min-height: 46px;
  }

  .input-prefix input {
    min-height: 44px;
  }

  .roof-visual,
  .headline-metric {
    height: 190px;
  }

  .headline-metric strong {
    font-size: clamp(2.2rem, 3.8vw, 4.2rem);
  }

  .metric {
    min-height: 80px;
    padding: 12px;
  }

  .metric strong {
    margin-top: 6px;
  }

  .breakdown strong {
    font-size: 0.96rem;
  }

  .insight {
    font-size: 0.88rem;
  }

  #savingsChart {
    height: 130px;
  }
}

@media (max-width: 1180px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    overflow-x: hidden;
  }

  .app-shell {
    align-items: start;
    height: auto;
    min-height: 100vh;
  }

  .estimate-layout {
    grid-template-columns: 1fr;
  }

  .entry-panel {
    grid-template-columns: minmax(0, 0.72fr) minmax(280px, 1fr);
    align-items: start;
  }

  .field-stack,
  .quick-facts {
    align-self: start;
  }

  h1 {
    max-width: 13ch;
  }

  .quick-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .entry-panel {
    grid-template-columns: 1fr;
  }

  .results-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1500px);
    padding: 9px 0;
  }

  .entry-panel,
  .results-panel {
    padding: 20px;
  }

  .results-panel,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .quick-facts {
    grid-template-columns: 1fr;
  }

  .roof-visual,
  .headline-metric {
    height: auto;
    min-height: 230px;
  }

  h1 {
    max-width: 11ch;
    font-size: 2.85rem;
  }
}

@media (max-width: 480px) {
  .app-shell {
    width: 100%;
    padding: 0;
  }

  .estimate-layout {
    gap: 0;
  }

  .entry-panel,
  .results-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .entry-panel,
  .results-panel {
    padding: 18px 14px;
  }

  .field input,
  .input-prefix {
    min-height: 54px;
  }

  .input-prefix input {
    min-height: 52px;
  }

  .quick-facts div,
  .metric,
  .breakdown div {
    padding: 13px;
  }

  .quick-facts div,
  .breakdown div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .quick-facts strong,
  .breakdown strong {
    text-align: left;
  }

  .roof-visual {
    min-height: 180px;
  }

  .headline-metric {
    min-height: 170px;
  }

  .roof-plane {
    width: min(78%, 290px);
    border-width: 9px;
  }

  .sun-dot {
    top: -30px;
    right: -34px;
    width: 46px;
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .headline-metric strong {
    font-size: 2.35rem;
  }

  .chart-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  #savingsChart {
    height: 190px;
  }
}
