/* The full-page savings app. Colors, fonts and the shared parts (search
   results, plan cards, questions, estimate box) come from style.css; this
   file only lays out the page. */

/* style.css fixes the map page to the window; this page scrolls. */
html:has(body.save), body.save { height: auto; min-height: 100%; overflow: auto; background: var(--paper); }
body.save { --gutter: 24px; --qlab-w: 130px; --qrow-gap: 12px; }
.save main { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter) 80px; }
.save [hidden] { display: none !important; }

/* nav */
#nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 22px var(--gutter); }
#brand-link { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
#brand-link span { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
#nav .links { display: flex; gap: 22px; font-size: 14px; }
#nav .links a { color: var(--ink); opacity: 0.65; }
#nav .links a:hover { opacity: 1; color: var(--teal); text-decoration: none; }

/* landing: one question, one box */
#landing { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px 0 60px; }
#landing .strip { width: 260px; margin-bottom: 28px; overflow: visible; }
#landing .strip text { font-size: 9px; fill: var(--ink); opacity: 0.45; font-family: "Work Sans", sans-serif; }
#landing h1 { font-family: "Space Grotesk", sans-serif; font-size: clamp(32px, 5.6vw, 54px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: 0; max-width: 780px; }
#landing h1 .hl { color: var(--teal); }
#landing h1 .nowrap { white-space: nowrap; }
#landing .lede { font-size: 17px; line-height: 1.5; opacity: 0.65; max-width: 540px; margin: 18px 0 0; }
#start-search { position: relative; width: min(460px, 100%); margin-top: 34px; text-align: left; }
#again-search { position: relative; width: min(300px, 100%); }
#again-search .field { margin-top: 0; }

/* result header */
.where { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 12px; }
.where .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.5; }
.where h2 { font-family: "Space Grotesk", sans-serif; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; margin: 4px 0 0; }

/* 1. the number */
#hero { margin-top: 28px; padding: 28px 30px; border-radius: 18px; background: rgba(28, 110, 92, 0.08); }
#hero .k { font-size: 15px; opacity: 0.7; }
#hero .v { font-family: "Space Grotesk", sans-serif; font-weight: 700; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font-size: clamp(44px, 8vw, 68px); }
#hero .v .win { color: var(--teal); }
#hero .v .lose { color: var(--maroon); }
#hero .v .none { font-size: clamp(30px, 5vw, 44px); color: var(--ink); }
#hero .v i { font-size: 20px; font-weight: 500; font-style: normal; opacity: 0.7; }
#hero .v .m { font-family: "Work Sans", sans-serif; font-size: 18px; font-weight: 500; opacity: 0.7; }
#hero .s { margin-top: 12px; font-size: 13.5px; line-height: 1.5; opacity: 0.7; }

/* 2. status */
.status { margin-top: 20px; font-size: 16px; line-height: 1.55; }
.status .badge { display: inline-block; margin-right: 8px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 2px; }
.status .badge.good { background: var(--teal); color: var(--paper); }
.status .badge.none { background: rgba(28, 37, 48, 0.08); color: var(--ink); }

/* sections */
.save .block { margin-top: 44px; }
.save h3 { font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.save h4 { font-size: 14px; font-weight: 600; margin: 24px 0 0; }
.save .sub { font-size: 14.5px; line-height: 1.55; opacity: 0.7; margin: 8px 0 0; max-width: 680px; }
.save .hint { font-size: 12px; opacity: 0.55; margin-top: 6px; }

/* 2a. rates: three prices as bars, the flat price as a line across them */
.chart { --col-w: 150px; --col-gap: 28px; margin-top: 20px; }
.chart .bars { position: relative; width: max-content; display: flex; align-items: flex-end; gap: var(--col-gap); margin-top: 40px; border-bottom: 1px solid var(--line); }
.chart .labels { display: flex; gap: var(--col-gap); margin-top: 8px; }
.chart .col { width: var(--col-w); display: flex; flex-direction: column; align-items: center; text-align: center; }
/* Over the flat line, with the page color behind, so the line never runs through a figure. */
.chart .n { position: relative; z-index: 2; padding: 0 6px; background: var(--paper); font-family: "Space Grotesk", sans-serif; font-size: 28px; font-weight: 700; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.chart .bar { width: 64px; border-radius: 8px 8px 2px 2px; }
.chart .flat .bar { background: rgba(28, 37, 48, 0.28); }
.chart .low .bar { background: var(--teal); }
.chart .low .n { color: var(--teal); }
.chart .peak .bar { background: var(--maroon); }
.chart .peak .n { color: var(--maroon); }
.chart .flatline { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(28, 37, 48, 0.35); z-index: 1; pointer-events: none; }
.chart .k { font-size: 13px; font-weight: 600; }
.chart .w { font-size: 12px; opacity: 0.6; margin-top: 2px; }
@media (max-width: 560px) { .chart { --col-w: 96px; --col-gap: 12px; } .chart .n { font-size: 21px; } .chart .bar { width: 44px; } }
.save .plan .seasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 28px; }
.save .plan .seasons .season + .season { margin-top: 0; }

/* call to action: ask the utility */
#switch { margin-top: 26px; }
#switch .cta.switch { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; padding: 15px 26px; margin-top: 0; font-size: 15.5px; text-decoration: none; }
#switch .cta.switch:hover { color: var(--paper); }
#switch .s { margin-top: 8px; font-size: 12.5px; opacity: 0.6; }

/* 3. factors: questions beside the breakdown */
.save .calc-grid { margin-top: 8px; }
.save .qrow select.field { margin-top: 0; flex: 1 1 200px; max-width: 360px; }
.save .refine .qrow { margin-top: 12px; }
/* Optional, but easy to find: a card that opens in place. */
.save .refine { margin-top: 22px; border: 1px solid rgba(28, 110, 92, 0.3); border-radius: 12px; padding: 0; background: rgba(28, 110, 92, 0.04); }
.save .refine summary { list-style: none; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; color: var(--ink); }
.save .refine summary::-webkit-details-marker { display: none; }
.save .refine summary::after { content: "+"; grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 22px; font-weight: 500; color: var(--teal); }
.save .refine[open] summary::after { content: "−"; }
.save .refine summary .t { font-family: "Space Grotesk", sans-serif; font-size: 16.5px; font-weight: 600; color: var(--teal); }
.save .refine summary .d { font-size: 12.5px; font-weight: 400; opacity: 0.65; line-height: 1.4; }
.save .refine summary:hover { background: rgba(28, 110, 92, 0.06); border-radius: 12px; }
.save .refine[open] > :not(summary) { margin-left: 16px; margin-right: 16px; }
.save .refine[open] { padding-bottom: 16px; }
.save .qrow .field.bill { margin-top: 0; flex: 1 1 100px; max-width: 160px; }
.save .qrow select.field.unit { flex: 0 0 84px; }
.save .questions .hint { padding-left: calc(var(--qlab-w) + var(--qrow-gap)); }
.save .qrow:has(#f-miles) { flex-wrap: nowrap; }
.save .qrow .inline .field { width: 80px; }
@media (min-width: 780px) {
  .save .calc-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .save .calc-grid .estbox { position: sticky; top: 16px; }
}

/* 4. utility and plans */
#plans select.field { max-width: 420px; }
#plans .fact { margin-top: 16px; }
#plans .plans { gap: 12px; }

/* 5. sign-up */
#lead { display: flex; gap: 10px; margin-top: 14px; max-width: 520px; }
#lead .field { margin-top: 0; flex: 1; }
#lead .cta { margin-top: 0; width: auto; padding: 0 22px; white-space: nowrap; }

/* How We Calculate page */
#nav .links a.on { opacity: 1; color: var(--teal); }
.save main.page { padding-top: 24px; }
.save main.page h1 { font-family: "Space Grotesk", sans-serif; font-size: clamp(30px, 5vw, 42px); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.controls .qlab { margin-top: 0; }
.controls select.field { margin-top: 0; width: auto; min-width: 90px; }
.controls .seg { margin-top: 0; flex-wrap: wrap; max-width: 100%; }
.controls .seg button { flex: none; padding: 7px 14px; }
.controls .seg button:disabled { opacity: 0.35; cursor: default; }
.hourchart { margin: 22px 0 0; }
.hourchart svg { width: 100%; max-width: 720px; display: block; }
.hourchart svg text { font-size: 6px; fill: var(--ink); opacity: 0.5; font-family: "Work Sans", sans-serif; }
.hourchart figcaption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; }
.save .source { font-size: 12px; opacity: 0.55; margin-top: 10px; line-height: 1.5; }

@media (max-width: 560px) {
  #nav .links { gap: 14px; font-size: 13px; }
  #brand-link span { display: none; }
  #hero { padding: 22px 20px; }
  body.save { --qlab-w: 110px; }
  .save .questions .hint { padding-left: 0; }
  #lead { flex-direction: column; }
  #lead .cta { padding: 13px 0; }
}
