/* =====================================================================
   HS SOLAR: calculator ("Sun Dial Studio"). The tool itself is an
   interface (data-ui), so it keeps quiet filled surfaces and compact
   controls; the motif (slanted panel, sun disc) still carries it.
   ===================================================================== */
:root { --lit: #d6f4ff; }
.calc-body { padding-block: clamp(28px, 4vw, 64px) clamp(96px, 10vw, 140px); }

/* stepper: flat slanted tabs */
.stepper { list-style: none; margin: 0 0 clamp(16px, 2vw, 28px); padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stepper button { width: 100%; border: 0; background: var(--surface); color: var(--ink); min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: var(--s-small); padding: 0 10px; clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); transition: background 0.2s, color 0.2s; }
@media (hover: hover) and (pointer: fine) { .stepper button:hover { background: var(--silver); } }
.stepper .n { width: 30px; height: 30px; display: grid; place-items: center; background: var(--bg); font-family: var(--f-display); font-weight: 800; clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); flex: none; }
.stepper li.done button { background: var(--silver); }
.stepper li.on button { background: var(--ink); color: var(--bg); }
.stepper li.on .n { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) { .stepper .lbl { display: none; } .stepper li.on .lbl { display: inline; } .stepper { grid-template-columns: 1fr 1fr 1fr 2fr; } }

/* shell */
.shell { display: grid; gap: clamp(16px, 2vw, 28px); align-items: start; }
@media (min-width: 980px) { .shell { grid-template-columns: 5fr 6fr; } .stage { position: sticky; top: calc(var(--hdr) + 16px); } }
.shell.is-result { display: none; }

/* stage: the house adds a panel per answer */
.stage { position: relative; overflow: hidden; background: var(--sky); aspect-ratio: 500 / 440; isolation: isolate; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .slot { fill: rgba(255, 255, 255, 0.16); transition: fill 0.3s; transform-box: fill-box; transform-origin: center; }
.stage .slot.on { fill: var(--lit); animation: pop 0.22s var(--ease); }
.stage .slot.on.alt { fill: #b9e8fb; }
@keyframes pop { from { opacity: 0; transform: scale(0.9); } }
.stage .hud { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 3; flex-wrap: wrap; }
.hud-chip { background: var(--bg); padding: 8px 14px; }
.hud-chip small { display: block; font-size: var(--s-small); color: var(--muted); }
.hud-chip b { font-family: var(--f-display); font-size: var(--s-lead); line-height: 1.1; }
.hud-chip.hot { background: var(--ink); } .hud-chip.hot small { color: var(--on-violet-2); } .hud-chip.hot b { color: #fff; }
.stage .warn { position: absolute; top: 12px; left: 12px; right: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: var(--s-small); padding: 8px 12px; z-index: 3; }
.stage .warn[hidden] { display: none; }

/* deck: the questions */
.deck { background: var(--surface); padding: clamp(18px, 3vw, 40px); min-height: 480px; }
.step-pane { animation: riseSm 0.25s var(--ease); }
@keyframes riseSm { from { opacity: 0; transform: translateY(8px); } }
.step-pane[hidden] { display: none; }
.q { margin-bottom: 28px; }
.deck h2, .deck h3 { font-size: var(--s-lead); letter-spacing: -0.02em; margin-bottom: 0.5em; line-height: 1.15; }
.deck .sub, .sub { color: var(--muted); font-size: var(--s-small); }
.deck .chip, .deck .opt, .deck .mode, .deck .numfield, .deck details.adv { background: var(--bg); }
.deck .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .deck .chip:hover { background: var(--silver); } }

.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mode { border: 0; color: var(--ink); padding: 14px 16px; text-align: left; display: grid; gap: 2px; transition: background 0.2s, color 0.2s; min-height: 44px; }
.mode b { font-family: var(--f-display); font-size: var(--s-body); }
.mode span { font-size: var(--s-small); color: var(--muted); line-height: 1.3; }
@media (hover: hover) and (pointer: fine) { .mode:hover { background: var(--silver); } }
.mode[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.mode[aria-checked="true"] span { color: var(--on-violet-2); }

/* the dial */
.dial-zone { display: grid; gap: 16px; align-items: center; }
@media (min-width: 560px) { .dial-zone { grid-template-columns: 300px 1fr; } }
.dial-wrap { width: min(100%, 300px); margin-inline: auto; touch-action: none; user-select: none; }
.dial-wrap svg { width: 100%; height: auto; overflow: visible; cursor: grab; }
.dial-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 50%; }
.dial-track { fill: none; stroke: var(--bg); stroke-width: 22; stroke-linecap: butt; }
.dial-fill { fill: none; stroke: var(--accent); stroke-width: 22; stroke-linecap: butt; }
.dial-val { font-family: var(--f-display); font-weight: 800; fill: var(--ink); text-anchor: middle; }
.dial-sub { font-family: var(--f-text); font-weight: 600; fill: var(--muted); text-anchor: middle; font-size: 15px; }
.dial-est { font-family: var(--f-text); font-weight: 800; fill: var(--ink); text-anchor: middle; font-size: 15px; }
.numfield { display: flex; align-items: center; padding: 0 16px; }
.numfield span { font-family: var(--f-display); font-weight: 800; font-size: var(--s-lead); }
.numfield input { background: transparent; border: 0; font-family: var(--f-display); font-weight: 800; font-size: var(--s-lead); min-width: 0; }
.numfield input:focus { outline: none; }
.numfield:focus-within { outline: 3px solid var(--accent); }
.dial-side .chips { margin-bottom: 16px; }

.kw-step { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 16px; }
.kw-step button { width: 64px; height: 56px; border: 0; background: var(--ink); color: var(--bg); font-size: 2rem; line-height: 1; display: grid; place-items: center; clip-path: polygon(var(--skew) 0, 100% 0, calc(100% - var(--skew)) 100%, 0 100%); transition: background 0.15s, transform 0.15s; }
@media (hover: hover) and (pointer: fine) { .kw-step button:hover { background: var(--accent); color: var(--accent-ink); } } 
.kw-step output { font-family: var(--f-display); font-weight: 800; font-size: var(--s-display); color: var(--ink); min-width: 4.4ch; text-align: center; line-height: 1; letter-spacing: -0.04em; }
.kw-step output small { font-size: var(--s-lead); color: var(--muted); margin-left: 4px; }

.opt-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.opt { border: 0; color: var(--ink); padding: 14px 16px; text-align: left; display: grid; gap: 4px; transition: background 0.2s, color 0.2s; }
.opt b { font-family: var(--f-display); }
.opt span { font-size: var(--s-small); color: var(--muted); line-height: 1.35; }
@media (hover: hover) and (pointer: fine) { .opt:hover { background: var(--silver); } }
.opt .badge { justify-self: start; font-size: var(--s-small); font-weight: 700; font-style: normal; color: var(--violet); }
.opt .badge.no { color: var(--muted); }
.opt[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.opt[aria-checked="true"] span, .opt[aria-checked="true"] .badge { color: var(--on-violet-2); }
.area-row { display: grid; gap: 8px; }
.area-row output { font-family: var(--f-display); font-weight: 800; font-size: var(--s-lead); }
.area-row output small { font-size: var(--s-small); color: var(--muted); font-family: var(--f-text); font-weight: 600; }
.lw { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.lw span { font-weight: 800; }
details.adv { padding: 4px 16px; }
details.adv summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
details.adv .in { padding-bottom: 14px; display: grid; gap: 14px; }
.deck input[type="text"], .deck input[type="tel"] { background: var(--surface); }
.deck .numfield input { background: transparent; }
.rng { display: grid; gap: 2px; }
.rng .rl { display: flex; justify-content: space-between; font-weight: 700; font-size: var(--s-small); }
.nav-btns { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 20px; }

/* sticky result bar: flat, full width */
.peek { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; background: var(--ink); color: #fff; padding: 10px var(--margin); display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); transition: transform 0.35s var(--ease); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.peek.off, .peek.away { transform: translateY(100%); }
.peek .pk { display: grid; line-height: 1.1; }
.peek .pk small { font-size: var(--s-small); color: var(--on-violet-2); }
.peek .pk b { font-family: var(--f-display); font-size: var(--s-lead); }
.peek .btn { margin-left: auto; }
@media (max-width: 640px) { .peek { gap: 14px; } .peek .pk:nth-child(2) { display: none; } .peek .ptype { display: none; } .peek .btn { padding: 0 1.4em; font-size: var(--s-small); } .stage { aspect-ratio: 500 / 335; } .stage .hud { gap: 6px; } .hud-chip { padding: 5px 10px; } .hud-chip b { font-size: var(--s-body); } }
@media (max-width: 979px) { .stage { aspect-ratio: 500 / 335; } }

/* =====================================================================
   RESULTS: your solar story
   ===================================================================== */
.results { display: grid; gap: clamp(16px, 2.4vw, 32px); }
.results[hidden] { display: none; }
.r-hero { padding: clamp(24px, 4vw, 56px); }
.r-hero h2 { margin-bottom: 0.2em; }
.r-hero .lead { max-width: 34ch; }
.r-hero .big { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; margin-top: 28px; }
.r-hero .bx { background: rgba(255, 255, 255, 0.12); padding: 16px 22px; }
.r-hero .bx small { display: block; font-size: var(--s-small); color: var(--on-violet-2); font-weight: 600; }
.r-hero .bx b { font-family: var(--f-display); font-size: var(--s-head); line-height: 1.05; letter-spacing: -0.035em; display: block; }
.r-hero .resize { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; color: var(--on-violet-2); font-weight: 600; }
.r-hero .resize button[data-resize] { width: 48px; height: 48px; border: 0; background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 1.5rem; line-height: 1; }
@media (hover: hover) and (pointer: fine) { .r-hero .resize button[data-resize]:hover { background: var(--accent); color: var(--accent-ink); } }
.r-hero .resize b { color: #fff; font-family: var(--f-display); font-size: var(--s-lead); }
.r-grid { display: grid; gap: clamp(16px, 2.4vw, 32px); }
@media (min-width: 900px) { .r-grid.two { grid-template-columns: 1fr 1fr; } }
.rcard { background: var(--surface); padding: clamp(20px, 3vw, 40px); }
.rcard h3 { font-size: var(--s-lead); margin-bottom: 0.2em; }
.rcard .cap { color: var(--muted); font-size: var(--s-small); margin-bottom: 16px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 18px; }
.pb { padding: 16px 18px 18px; display: grid; gap: 2px; }
.pb h4 { margin: 0; font-size: var(--s-small); font-weight: 700; letter-spacing: 0; }
.pb b { font-family: var(--f-display); font-size: var(--s-lead); line-height: 1.1; letter-spacing: -0.03em; }
.pb small { color: inherit; }
.pb.now { background: var(--bg); } .pb.after { background: var(--accent); color: var(--accent-ink); }
.win-line { font-weight: 700; font-size: var(--s-body); }
.wf { display: grid; gap: 10px; margin-top: 12px; }
.wf-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; font-size: var(--s-small); }
.wf-row .track { background: var(--bg); height: 30px; overflow: hidden; }
.wf-row .fill { height: 100%; transform-origin: left; animation: grow 0.6s var(--ease) both; }
.wf-row b { text-align: right; font-family: var(--f-display); }
@keyframes grow { from { transform: scaleX(0); } }
@media (max-width: 520px) { .wf-row { grid-template-columns: 96px 1fr 80px; } }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--f-text); font-size: 12px; fill: var(--muted); }
.chart .grid-l { stroke: rgba(28, 18, 54, 0.14); stroke-width: 1; }
.chart .draw { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1.6s 0.2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scrubline { display: grid; gap: 4px; margin-top: 8px; }
.scrubline output { font-size: var(--s-body); color: var(--muted); }
.scrubline output b { color: var(--ink); font-family: var(--f-display); font-size: var(--s-lead); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--s-small); font-weight: 600; margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 14px; }
.mini-stats div { background: var(--bg); padding: 12px 16px; }
.mini-stats b { display: block; font-family: var(--f-display); font-size: var(--s-lead); line-height: 1.15; }
.mini-stats span { font-size: var(--s-small); color: var(--muted); font-weight: 600; }
.cash { padding: 18px 22px; background: var(--sky); color: var(--accent-ink); font-size: var(--s-body); }
.cash.neg { background: var(--accent); }
.cash b { font-family: var(--f-display); font-size: var(--s-lead); }
.rcard .lines li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: var(--s-body); }
.rcard .lines li:last-child { font-weight: 800; }
.rcard .lines li small { display: block; color: var(--muted); font-size: var(--s-small); max-width: 46ch; font-weight: 400; }
.notes { display: grid; gap: 8px; }
.act { padding: clamp(22px, 4vw, 56px); display: grid; gap: 18px; }
.act h3 { font-size: var(--s-head); margin: 0; max-width: 18ch; }
.act p { margin: 0; }
.act .row { display: grid; gap: 12px; max-width: 760px; }
@media (min-width: 720px) { .act .row { grid-template-columns: 1fr 1fr; } }
.act input, .act select { background: var(--bg); }
.act .btns { display: flex; flex-wrap: wrap; gap: 12px; }
.tiny-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 84px; translate: -50% 0; background: var(--ink); color: #fff; padding: 12px 22px; font-weight: 700; z-index: 80; animation: rise 0.3s; }
@media print {
  .ph, .stepper, .peek, .act .btns, .act .row, .resize, .tiny-btns, .scrubline input { display: none !important; }
  .calc-body { padding: 0; }
  .r-hero { background: #fff !important; color: #000; border: 2px solid #000; } .r-hero h2, .r-hero .bx b { color: #000; }
  .rcard, .act { break-inside: avoid; } .act { background: #fff; border: 2px solid #000; } .chart .draw { animation: none; stroke-dashoffset: 0; }
}

.stepper li { animation: rise 0.45s var(--ease) both; }
.stepper li:nth-child(2) { animation-delay: 0.08s; } .stepper li:nth-child(3) { animation-delay: 0.16s; } .stepper li:nth-child(4) { animation-delay: 0.24s; }
.stage { animation: rise 0.5s 0.15s var(--ease) both; } .deck { animation: rise 0.5s 0.22s var(--ease) both; }

.r-hero { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .r-hero { grid-template-columns: 7fr 4fr; } }
.r-side img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.rcard.plain { background: none; padding: 0; }
.rcard.plain .mini-stats div { background: var(--surface); }

.results { gap: clamp(36px, 4vw, 56px); }
.r-grid { gap: clamp(36px, 4vw, 56px); }

/* clean pass */
.deck, .stage, .rcard, .r-hero, .act, .peek .btn { border-radius: var(--r-lg); }
.rcard.plain { border-radius: 0; }
.mode, .opt, .hud-chip, .pb, .mini-stats div, .wf-row .track, details.adv { border-radius: 14px; }
.stage .warn { border-radius: 12px; }
.r-hero .bx { border-radius: 18px; }
.r-hero .resize button[data-resize] { border-radius: 50%; }
