/* Home Energy Grant Finder: deep teal and warm orange, light and dark */
:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f3ece3;
  --text: #1c2430;
  --muted: #5b6472;
  --line: #e4dccf;
  --brand: #0f4c5c;
  --brand-ink: #ffffff;
  --brand-soft: #e3eff1;
  --accent: #e8772e;
  --accent-ink: #1c1208;
  --accent-soft: #fdebdc;
  --ok: #2f7d4f;
  --ok-soft: #e2f3e8;
  --warn: #9a5600;
  --warn-soft: #fdf1dc;
  --bad: #b23a3a;
  --radius: 14px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f171b; --surface: #162227; --surface-2: #1d2c32; --text: #eef2f3; --muted: #a7b3b8; --line: #2a3b42;
    --brand: #6cc3d5; --brand-ink: #08262d; --brand-soft: #173840; --accent: #f2a05c; --accent-ink: #1c1208; --accent-soft: #3a2614;
    --ok: #6fd39a; --ok-soft: #173326; --warn: #f0b45a; --warn-soft: #3a2b12; --bad: #f08a8a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f171b; --surface: #162227; --surface-2: #1d2c32; --text: #eef2f3; --muted: #a7b3b8; --line: #2a3b42;
  --brand: #6cc3d5; --brand-ink: #08262d; --brand-soft: #173840; --accent: #f2a05c; --accent-ink: #1c1208; --accent-soft: #3a2614;
  --ok: #6fd39a; --ok-soft: #173326; --warn: #f0b45a; --warn-soft: #3a2b12; --bad: #f08a8a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.55 var(--font); }
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 .9em; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); font-weight: 800; font-size: 1.2rem; margin-right: auto; }
.logo img { width: 40px; height: 40px; display: block; }
.logo b { color: var(--accent); font-weight: 800; }
.theme-toggle { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.nav { flex-basis: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nav a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--brand); font-weight: 700; text-decoration: none; line-height: 1.2; }
.nav a:hover { border-color: var(--brand); }
.nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
@media (max-width: 480px) { .nav { grid-template-columns: repeat(2, 1fr); gap: 6px; } .site-header .wrap { flex-wrap: nowrap; display: grid; grid-template-columns: 1fr auto; } .logo { font-size: 1.02rem; min-width: 0; } .nav { grid-column: 1 / -1; } }

.notice { background: var(--surface-2); font-size: .9rem; color: var(--muted); }
.notice .wrap { padding-top: 8px; padding-bottom: 8px; }

main { padding: 22px 0 40px; }

/* hero and search */
.hero { background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft)); border: 1px solid var(--line); border-radius: 20px; padding: 26px; margin-bottom: 20px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; color: var(--accent); margin: 0 0 6px; }
:root[data-theme="dark"] .kicker { color: var(--accent); }
.hero h1 { color: var(--brand); }
.hero p.lead { font-size: 1.1rem; max-width: 46em; }
.search { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.search input { flex: 1 1 220px; min-height: 52px; font: inherit; font-size: 1.1rem; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--text); text-transform: uppercase; }
.search input::placeholder { text-transform: none; }
.search input:focus { border-color: var(--brand); outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-main { background: var(--accent); color: var(--accent-ink); }
.btn-main:hover { filter: brightness(1.05); }
.btn-plain { background: var(--surface); color: var(--brand); border-color: var(--line); }
.btn-plain:hover { border-color: var(--brand); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.err { color: var(--bad); font-weight: 600; }

/* place chip */
.place { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; }
.chip.good { background: var(--ok-soft); border-color: transparent; color: var(--ok); font-weight: 700; }

/* questions */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.qs { display: grid; gap: 18px; }
.q > .ql { display: block; font-weight: 700; margin-bottom: 8px; }
.q .hint { font-weight: 400; color: var(--muted); font-size: .88rem; display: block; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills label { position: relative; }
.pills input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pills span { display: inline-flex; align-items: center; min-height: 42px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .95rem; }
.pills input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pills input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.pills.epc span { min-width: 44px; justify-content: center; }
.epc-A, .epc-B { --e: #19b459; } .epc-C { --e: #8dce46; } .epc-D { --e: #ffd500; } .epc-E { --e: #fcaa65; } .epc-F { --e: #ef8023; } .epc-G { --e: #e9153b; }
.pills.epc label[class] span { background: var(--e); color: #111; border-color: var(--e); min-width: 48px; border-radius: 10px; font-weight: 800; }
.pills.epc label[class] input:checked + span { outline: 3px solid var(--text); outline-offset: 2px; background: var(--e); color: #111; }
.ticks { display: grid; gap: 8px; }
.ticks label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ticks input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.q select, .q input[type="number"], .epcpick input { min-height: 46px; font: inherit; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--text); max-width: 100%; }
.epcpick { margin: 0 0 16px; }
.epch { font-size: 1.2rem; margin: 0 0 4px; }
.epcpick select { width: 100%; }

/* results */
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 6px 0 16px; }
.big { font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.group { margin: 26px 0 8px; }
.group h2 { display: flex; align-items: center; gap: 10px; }
.group h2 .n { font-size: .9rem; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.res { border-left: 6px solid var(--line); }
.res.yes { border-left-color: var(--ok); }
.res.maybe { border-left-color: var(--accent); }
.res h3 { margin-bottom: 4px; }
.res .top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.amount { font-weight: 800; color: var(--brand); font-size: 1.05rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .03em; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; }
.tag.yes { background: var(--ok-soft); color: var(--ok); }
.tag.maybe { background: var(--warn-soft); color: var(--warn); }
.tag.soon { background: var(--brand-soft); color: var(--brand); }
.res .who { margin: 8px 0; }
.res ul.why { margin: 6px 0 10px; padding-left: 20px; font-size: .95rem; }
.res ul.why li.ok::marker { color: var(--ok); }
.res ul.why li.ask::marker { color: var(--warn); }
.res .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.res details { margin-top: 6px; }
.res summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.provider { color: var(--muted); font-size: .9rem; }
details.notyou > summary { cursor: pointer; font-weight: 700; color: var(--brand); padding: 8px 0; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }

/* plain pages */
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.4em; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; font-size: .9rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }

@media (max-width: 560px) { body { font-size: 16px; } .hero { padding: 18px; } .card { padding: 16px; } }
@media print {
  .site-header, .notice, .site-footer, .hero, #questions, .acts .btn, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; }
}
.epcpick input { width: 100%; max-width: 360px; display: block; margin: 4px 0 8px; }
.epcbig { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 4px; }
.epcl { font: 800 1.7rem/1 Figtree, system-ui, sans-serif; color: #111; width: 2.1em; height: 2.1em; display: grid; place-items: center; border-radius: 8px; flex: none; }
.epcl.sm { font-size: .85rem; width: 1.8em; height: 1.8em; border-radius: 5px; display: inline-grid; margin-right: 8px; }
.epcl.A { background: #008054; color: #fff; } .epcl.B { background: #19b459; color: #fff; } .epcl.C { background: #8dce46; } .epcl.D { background: #ffd500; } .epcl.E { background: #fcaa65; } .epcl.F { background: #ef8023; } .epcl.G { background: #e9153b; color: #fff; }
.epclist { list-style: none; padding: 0; margin: 6px 0; }
.epclist li { margin: 4px 0; }
.epcrow { display: flex; align-items: center; width: 100%; text-align: left; background: none; border: 1px solid var(--line, #3335); border-radius: 10px; padding: 6px 8px; color: inherit; font: inherit; cursor: pointer; }
.foot-topics { margin-top: 8px; font-size: .95em; }
.topics { columns: 2 14em; padding-left: 1.2em; }
.topics li { margin: 4px 0; }
