/* HVAC Site Score
   Palette: galvanized steel, service-van white, duct navy, Freon blue, safety yellow.
   Type: Barlow Condensed (signage / nameplates) + Barlow (body). */

:root {
  --steel: #e6eaee;
  --panel: #ffffff;
  --ink: #13263a;
  --ink-soft: #4a5b6d;
  --line: #c6cfd7;
  --blue: #1273b8;
  --blue-dark: #0c5a92;
  --yellow: #f5b800;
  --red: #c8372a;
  --amber: #c77700;
  --green: #1e8a4c;
  --dial-face: #f7f8f9;
  --dial-rim: #d7dde2;
  --shadow: 0 1px 0 rgba(19, 38, 58, 0.06), 0 10px 30px -12px rgba(19, 38, 58, 0.35);
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --steel: #0f1b28; --panel: #162636; --ink: #e8eef3; --ink-soft: #a7b5c3; --line: #2b3f53;
    --blue: #4aa3e2; --blue-dark: #7bbdec; --dial-face: #1c2f42; --dial-rim: #2d4459;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  --steel: #0f1b28; --panel: #162636; --ink: #e8eef3; --ink-soft: #a7b5c3; --line: #2b3f53;
  --blue: #4aa3e2; --blue-dark: #7bbdec; --dial-face: #1c2f42; --dial-rim: #2d4459;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--steel); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.55;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 2px; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--panel); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--display); line-height: 1.05; letter-spacing: -0.005em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); font-weight: 800; max-width: 16ch; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.45rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }

/* Top bar: a yellow stripe like the edge of a service van */
.topbar { background: var(--ink); color: #fff; border-bottom: 4px solid var(--yellow); }
:root[data-theme="dark"] .topbar { background: #0a141e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { background: #0a141e; } }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.4rem; }
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; color: #fff; }
.topnav { display: flex; gap: 1.25rem; }
.topnav a { color: #d8e2ea; text-decoration: none; font-weight: 500; }
.topnav a:hover { color: #fff; text-decoration: underline; }

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.lede { font-size: 1.2rem; color: var(--ink-soft); }
.scan-form { margin-top: 1.75rem; max-width: 560px; }
.scan-form label { display: block; font-weight: 600; margin-bottom: .4rem; }
.scan-row { display: flex; gap: .5rem; }
.scan-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.15rem; padding: .85rem 1rem;
  border: 2px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink);
}
.scan-row input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
button, .btn {
  font: inherit; font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: .01em;
  border: 0; border-radius: 6px; padding: .8rem 1.4rem; cursor: pointer;
  background: var(--blue); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
}
button:hover, .btn:hover { background: var(--blue-dark); color: #fff; }
button:disabled { opacity: .6; cursor: wait; }
.btn-quiet { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-quiet:hover { background: var(--panel); color: var(--ink); border-color: var(--ink-soft); }
.btn-fb { background: #1877f2; }
.btn-fb:hover { background: #0f63d0; }
.linkish { background: none; color: var(--blue); padding: 0; font-family: var(--body); font-weight: 600; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { background: none; color: var(--blue-dark); }
.form-note { font-size: .95rem; color: var(--ink-soft); margin-top: .75rem; }
.form-error { color: var(--red); font-weight: 600; margin-top: .5rem; }
.turnstile { margin-top: .75rem; min-height: 0; }

/* The thermostat: the one bold element */
.hero-dial { display: flex; justify-content: center; }
.dial-housing {
  width: min(360px, 78vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--panel), var(--dial-rim) 78%);
  box-shadow: var(--shadow), inset 0 -6px 14px rgba(19, 38, 58, .12);
  padding: 7%; display: grid; place-items: center;
}
.dial-housing svg { width: 100%; height: 100%; display: block; }
.dial-num { font-family: var(--display); font-weight: 800; fill: var(--ink); }
.dial-sub { font-family: var(--body); font-weight: 500; fill: var(--ink-soft); }
.dial-tick { stroke: var(--ink-soft); opacity: .45; }
.dial-track { stroke: var(--line); }
.dial-arc { transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .dial-arc { transition: none; } }

/* Progress */
.progress { padding: 1rem 0 3rem; }
.progress-title { font-size: 1.8rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; max-width: 560px; }
.steps li { display: flex; align-items: center; gap: .75rem; color: var(--ink-soft); }
.steps li::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none;
}
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active::before { border-color: var(--blue); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px var(--panel); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps li.active::before { animation: none; } }

/* Results */
.results { padding: 1rem 0 4rem; }
.results-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.results-aside { position: sticky; top: 1rem; display: grid; gap: 1.25rem; }
.results-aside .dial-housing { width: 100%; max-width: 340px; margin-inline: auto; }
.result-name { text-align: center; }
.result-name h2 { margin-bottom: .15em; font-size: 2rem; }
.result-name p { color: var(--ink-soft); margin: 0 auto; word-break: break-all; }
.verdict { text-align: center; font-weight: 600; margin: 0 auto; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: clamp(1.1rem, 2.5vw, 1.6rem); }
.panel + .panel { margin-top: 1.25rem; }
.panel h3 { margin-bottom: .6rem; }

.cats { display: grid; gap: .85rem; }
.cat-top { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; }
.cat-top span:last-child { font-family: var(--display); font-size: 1.2rem; white-space: nowrap; }
.bar { height: 10px; border-radius: 5px; background: var(--steel); overflow: hidden; margin-top: .3rem; }
.bar > i { display: block; height: 100%; border-radius: 5px; }

.issue { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.issue:first-of-type { border-top: 0; padding-top: .3rem; }
.issue-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.issue-head h4 { margin: 0; font-size: 1.1rem; }
.issue-pts { font-family: var(--display); font-weight: 700; color: var(--red); white-space: nowrap; }
.issue p { margin: .4rem 0 0; }
.issue .fix { background: color-mix(in srgb, var(--yellow) 16%, var(--panel)); border-left: 4px solid var(--yellow); padding: .6rem .8rem; border-radius: 0 4px 4px 0; margin-top: .6rem; }
.issue .locked { color: var(--ink-soft); font-size: .95rem; margin-top: .5rem; }
.passes { columns: 2 220px; padding-left: 1.2rem; margin: 0; }
.passes li { margin-bottom: .3rem; }

/* Share */
.share-actions { display: grid; gap: .6rem; }
.share-actions .btn, .share-actions button { width: 100%; }
.caption-box { background: var(--steel); border-radius: 6px; padding: .75rem .9rem; font-size: .98rem; margin: .25rem 0 .5rem; }
.share-note { font-size: .92rem; color: var(--ink-soft); margin: .5rem 0 0; }
.card-preview { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* Survey */
.survey fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; }
.survey legend { font-weight: 700; margin-bottom: .45rem; padding: 0; }
.choice { display: flex; align-items: flex-start; gap: .55rem; padding: .3rem 0; cursor: pointer; }
.choice input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--blue); flex: none; }
.survey input[type=email] { font: inherit; width: 100%; max-width: 420px; padding: .7rem .85rem; border: 2px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); margin-top: .4rem; }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0 1.4rem; }
.tier { border: 1px solid var(--line); border-radius: 6px; padding: .8rem .9rem; }
.tier b { font-family: var(--display); font-size: 1.35rem; display: block; }
.tier .price { font-family: var(--display); font-size: 1.15rem; color: var(--ink-soft); }
.tier p { font-size: .93rem; margin: .35rem 0 0; }
.soon { display: inline-block; background: var(--yellow); color: #13263a; font-weight: 700; font-size: .85rem; padding: .1rem .5rem; border-radius: 3px; margin-left: .4rem; vertical-align: middle; }
.thanks { font-weight: 600; color: var(--green); }

/* What we check: an equipment nameplate */
.checks { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-lede { color: var(--ink-soft); font-size: 1.1rem; }
.plate {
  position: relative; background: var(--panel); border: 2px solid var(--ink); border-radius: 6px;
  padding: .6rem clamp(1rem, 3vw, 2rem); margin-top: 1.5rem;
}
.plate::before, .plate::after {
  content: ""; position: absolute; top: 10px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--dial-rim); box-shadow: inset 0 0 0 2px var(--ink-soft);
}
.plate::before { left: 10px; }
.plate::after { right: 10px; }
.plate-row { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 3.5rem; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.plate-row:last-child { border-bottom: 0; }
.plate-name { font-family: var(--display); font-weight: 700; font-size: 1.35rem; }
.plate-detail { color: var(--ink-soft); }
.plate-pts { font-family: var(--display); font-weight: 800; font-size: 1.7rem; text-align: right; }

.faq { padding: 0 0 4rem; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .9rem 1.1rem; margin-bottom: .6rem; max-width: 760px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: .6rem 0 0; }

.footer { border-top: 1px solid var(--line); padding: 1.5rem 0 2rem; color: var(--ink-soft); font-size: .95rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer p { margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--steel); padding: .7rem 1.1rem; border-radius: 6px; font-weight: 600; z-index: 20; }

/* Prose pages */
.prose { padding: 3rem 0 4rem; }
.prose h1 { max-width: none; font-size: clamp(2.2rem, 4vw, 3rem); }
.prose h2 { font-size: 1.7rem; margin-top: 1.6em; }
.prose li { margin-bottom: .4rem; max-width: 68ch; }

@media (max-width: 900px) {
  .hero-grid, .results-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-dial { order: -1; }
  .hero-dial .dial-housing { width: min(250px, 62vw); }
  .results-aside { position: static; }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .plate-row { grid-template-columns: minmax(0, 1fr) 3rem; }
  .plate-detail { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  .scan-row { flex-direction: column; }
  .topnav a:first-child { display: none; }
}

/* Before/after */
.change { text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.3rem; margin: 0 auto; }
.change.up { color: var(--green); }
.change.down { color: var(--red); }
.change.same { color: var(--ink-soft); }
.board-panel h3 { margin-bottom: .35rem; }

/* Leaderboard page */
.lb { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.lb-wrap { max-width: 860px; }
.lb h1 { max-width: 22ch; }
.lb-edition { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--blue); margin-bottom: .3rem; }
.lb-list { list-style: none; padding: 0; margin: 2rem 0 .75rem; background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; }
.lb-row { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto auto; gap: 1rem; align-items: center; padding: .9rem clamp(.9rem, 2.5vw, 1.4rem); border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { font-family: var(--display); font-weight: 800; font-size: 2.1rem; text-align: center; line-height: 1; }
.lb-row:nth-child(-n+3) .lb-rank { color: var(--blue); }
.lb-name { display: grid; min-width: 0; }
.lb-name strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.lb-name a { font-size: .95rem; overflow-wrap: anywhere; }
.lb-score { font-family: var(--display); font-weight: 800; font-size: 1.9rem; white-space: nowrap; }
.lb-score small { font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.lb-good { color: var(--green); } .lb-fair { color: var(--amber); } .lb-poor { color: var(--red); }
.lb-award { font-size: 1rem; padding: .45rem .8rem; }
.lb-meta { color: var(--ink-soft); font-size: .95rem; }
.lb-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0 2rem; }
.lb-method, #removal { margin-top: 1.25rem; }
#removal-form { display: grid; gap: .4rem; max-width: 460px; }
#removal-form label { font-weight: 600; margin-top: .4rem; }
#removal-form input, #removal-form textarea { font: inherit; padding: .65rem .8rem; border: 2px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
#removal-form button { justify-self: start; margin-top: .5rem; }
@media (max-width: 640px) {
  .lb-row { grid-template-columns: 2.4rem minmax(0, 1fr) auto; }
  .lb-award { grid-column: 2 / -1; justify-self: start; }
}

/* Admin */
.admin-main { padding: 2rem 0 4rem; }
.admin h1 { font-size: 2.2rem; max-width: none; margin-top: 1.5rem; }
.admin h2 { font-size: 1.5rem; }
.admin section { scroll-margin-top: 1rem; }
.admin-login { max-width: 460px; margin: 3rem auto; }
.admin-login form { display: grid; gap: .5rem; }
.admin-login input, .admin input[type=text], .admin textarea {
  font: inherit; padding: .65rem .8rem; border: 2px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); width: 100%;
}
.admin textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; }
.admin-signout { color: #d8e2ea; font-size: 1rem; }
.admin-signout:hover { color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; }
.stat b { display: block; font-family: var(--display); font-size: 2.2rem; line-height: 1; }
.stat span { color: var(--ink-soft); font-size: .95rem; }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.admin-cols .panel + .panel { margin-top: 0; }
.admin-cols .cats { display: grid; gap: .7rem; }
.admin-row { display: grid; gap: .35rem; max-width: 360px; margin-bottom: .6rem; }
.admin-row label { font-weight: 600; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.admin-actions button, .admin-actions .btn { font-size: 1.05rem; padding: .55rem 1rem; }
.admin-count { font-family: var(--body); font-size: 1rem; font-weight: 500; color: var(--ink-soft); }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .97rem; min-width: 820px; }
.admin-table th { text-align: left; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid var(--line); padding: .5rem; }
.admin-table td { border-bottom: 1px solid var(--line); padding: .45rem .5rem; vertical-align: middle; }
.admin-table .name-input { padding: .35rem .5rem; border-width: 1px; min-width: 180px; }
.admin-table tr.st-removed td { opacity: .55; }
.admin-table tr.st-pending td { background: color-mix(in srgb, var(--yellow) 12%, transparent); }
.row-actions { white-space: nowrap; }
.row-actions button { font-size: .95rem; padding: .35rem .7rem; margin-right: .3rem; }
.warn { color: var(--red); font-weight: 600; }
.removal { border-top: 1px solid var(--line); padding: .8rem 0; }
.removal:first-child { border-top: 0; }
.removal.done { opacity: .6; }
.email-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.email-list li { display: flex; gap: 1rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: .5rem 0; flex-wrap: wrap; }
.email-list button { font-size: .95rem; padding: .3rem .7rem; }
.setup-panel.has-warnings { border: 2px solid var(--red); }
.setup-panel ul { margin: 0; padding-left: 1.2rem; }
.setup-panel li { margin-bottom: .4rem; }
.report { margin-top: 1rem; }
.report summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.report textarea { font: inherit; width: 100%; padding: .6rem .75rem; border: 2px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); margin: .4rem 0; }
