:root {
  --bg: #fbf7f2; --card: #fff; --ink: #1f1a17; --muted: #6e625a; --line: #eadfd4;
  --ban: #d6361f; --ban-soft: #fde4de; --partial: #e59a12; --partial-soft: #fdf0d5;
  --none: #2f9e5f; --none-soft: #dff3e7; --unknown: #b9aea5; --fw: #8a2be2;
  --ember1: #ff6a1a; --ember2: #ffc23d; --accent: #c2410c;
  --r: 16px; --shadow: 0 1px 2px rgb(60 30 10 / .06), 0 8px 24px rgb(60 30 10 / .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15100d; --card: #1f1915; --ink: #f4ece5; --muted: #ab9d92; --line: #362b24;
    --ban-soft: #43180f; --partial-soft: #3e2c0c; --none-soft: #12321f; --unknown: #5b524c; --accent: #ff8a4c;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  --bg: #15100d; --card: #1f1915; --ink: #f4ece5; --muted: #ab9d92; --line: #362b24;
  --ban-soft: #43180f; --partial-soft: #3e2c0c; --none-soft: #12321f; --unknown: #5b524c; --accent: #ff8a4c;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); margin: .2em 0; }
h2 { font-size: 1.25rem; margin: 0 0 .7rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.small { font-size: .88rem; color: var(--muted); }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.brand b { color: var(--accent); }
.brand:hover { text-decoration: none; }
.logo { width: 26px; height: 26px; }
.top nav { display: flex; gap: 1.2rem; font-size: .95rem; }
.top nav a { color: var(--muted); }
.crumbs { font-size: .85rem; color: var(--muted); margin-top: 1rem; }
.crumbs span { margin: 0 .2rem; }

.fl1 { fill: var(--ember1); }
.fl2 { fill: var(--ember2); }
.flame svg, .verdict.ban .fl1, .verdict.ban .fl2 { transform-origin: 50% 90%; animation: flick 2.6s ease-in-out infinite; }
.fl2 { animation-delay: -.7s; }
@keyframes flick { 0%, 100% { transform: scale(1, 1) skewX(0); } 30% { transform: scale(.97, 1.04) skewX(-2deg); } 60% { transform: scale(1.02, .97) skewX(2deg); } }

.hero { padding: 2rem 16px 1rem; }
.hero .sub { color: var(--muted); margin: 0 0 1.2rem; font-size: 1.05rem; }
.hero.home { text-align: center; padding-top: 3rem; }
.hero.home .flame { width: 64px; margin: 0 auto .5rem; filter: drop-shadow(0 6px 18px rgb(255 106 26 / .45)); }
.hero.home .flame svg { animation: flick 2.6s ease-in-out infinite; }
.hero .big { color: var(--muted); }
.hero .big b { color: var(--ban); font-size: 1.4rem; }

.search { position: relative; max-width: 520px; margin: 0 auto 1.2rem; }
.search input, .filter { width: 100%; font: inherit; font-size: 1.1rem; padding: .9rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); box-shadow: var(--shadow); outline: none; }
.search input:focus, .filter:focus { border-color: var(--accent); }
.filter { font-size: 1rem; padding: .6rem 1rem; margin-bottom: .8rem; box-shadow: none; }
#results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-align: left; z-index: 4; }
#results a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 9px; color: var(--ink); }
#results a:hover, #results a[aria-selected="true"] { background: var(--bg); text-decoration: none; }
#results em { margin-left: auto; font-style: normal; color: var(--muted); font-size: .85rem; }

.verdict { display: flex; gap: 1.2rem; align-items: center; padding: 1.4rem; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); border: 2px solid var(--line); animation: rise .5s ease-out both; }
.verdict.ban { border-color: var(--ban); background: linear-gradient(135deg, var(--ban-soft), var(--card) 70%); }
.verdict.none { border-color: var(--none); background: linear-gradient(135deg, var(--none-soft), var(--card) 70%); }
.verdict.partial { border-color: var(--partial); background: linear-gradient(135deg, var(--partial-soft), var(--card) 70%); }
.vicon { flex: 0 0 auto; width: 92px; height: 92px; }
.vicon svg { width: 100%; height: 100%; overflow: visible; }
.vicon .glow { fill: var(--ban); opacity: .12; transform-origin: center; animation: pulse 2s ease-in-out infinite; }
.vicon .slash { stroke: var(--ban); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 70; stroke-dashoffset: 70; animation: draw .6s .35s ease-out forwards; }
.vicon .ring { fill: none; stroke: currentColor; stroke-width: 4; opacity: .25; }
.vicon .tick { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .6s .2s ease-out forwards; }
.verdict.none .vicon { color: var(--none); }
.verdict.partial .vicon, .verdict.unknown .vicon { color: var(--partial); }
.ans { font-size: clamp(2.4rem, 8vw, 3.4rem); font-weight: 800; line-height: 1; margin: 0 0 .3rem; letter-spacing: -.03em; }
.verdict.ban .ans { color: var(--ban); }
.verdict.none .ans { color: var(--none); }
.verdict.partial .ans { color: var(--partial); }
.what { font-size: 1.15rem; font-weight: 600; margin: 0 0 .3rem; }
.meta { margin: .1rem 0; color: var(--muted); font-size: .92rem; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .2; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { transform: translateY(10px); } }

.alert { display: flex; gap: .8rem; align-items: flex-start; margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 12px; background: color-mix(in srgb, var(--fw) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--fw) 40%, transparent); }
.alert svg { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: var(--fw); stroke-width: 2; stroke-linejoin: round; }
.note { margin: .8rem 0 0; padding: .7rem 1rem; border-radius: 10px; background: var(--partial-soft); font-size: .95rem; }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.3rem; margin: 1rem auto; border: 1px solid var(--line); }
.wrap.card { max-width: 1008px; }
@media (max-width: 1040px) { .wrap.card { margin-left: 16px; margin-right: 16px; } }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; }
.grid2 .card { margin: 0; }
@media (max-width: 760px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.map { width: 100%; height: auto; max-height: 70vh; display: block; }
.map .c { stroke: var(--card); stroke-width: 1.2; transition: opacity .2s, filter .2s; }
.map a:hover .c { filter: brightness(1.12); }
.c.ban { fill: var(--ban); }
.c.partial { fill: var(--partial); }
.c.none { fill: color-mix(in srgb, var(--none) 55%, var(--card)); }
.c.unknown { fill: var(--unknown); }
.c.fw { stroke: var(--fw); stroke-width: 3; }
.c.hi { stroke: var(--ink); stroke-width: 5; paint-order: stroke; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; padding: 0; margin: .8rem 0 0; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legend .ban { background: var(--ban); } .legend .partial { background: var(--partial); }
.legend .none { background: color-mix(in srgb, var(--none) 55%, var(--card)); } .legend .fwk { border: 2px solid var(--fw); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .5rem; flex: 0 0 10px; background: var(--unknown); }
.dot.ban { background: var(--ban); box-shadow: 0 0 0 3px var(--ban-soft); }
.dot.partial { background: var(--partial); } .dot.none { background: var(--none); }
.near { list-style: none; padding: 0; margin: 0; }
.near a { display: flex; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.near em { margin-left: auto; font-style: normal; color: var(--muted); font-size: .9rem; }
.hist, .changes { list-style: none; padding: 0; margin: 0; }
.hist li, .changes li { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.hist time, .changes time { margin-left: auto; color: var(--muted); font-size: .88rem; }

.faq details { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: .5rem 0 0; color: var(--muted); }
.prose p { max-width: 70ch; }

.stats { display: flex; flex-wrap: wrap; gap: .8rem; }
.stat { flex: 1 1 140px; padding: 1rem 1.1rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .5s ease-out both; }
.stat b { display: block; font-size: 2.2rem; line-height: 1; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.ban b { color: var(--ban); } .stat.partial b { color: var(--partial); } .stat.none b { color: var(--none); } .stat.fw b { color: var(--fw); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.chips a { display: block; padding: .3rem .7rem; border-radius: 999px; background: var(--ban-soft); color: var(--ink); font-size: .92rem; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); }
th { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .85rem; user-select: none; white-space: nowrap; }
td:first-child { font-weight: 500; }
tr[hidden] { display: none; }

.states { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; list-style: none; padding: 0; margin: 0 0 .8rem; }
.states a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); height: 100%; transition: transform .2s; }
.states a:hover { transform: translateY(-3px); text-decoration: none; }
.states svg { width: 100%; height: 90px; margin-bottom: .4rem; }
.states svg .c { stroke: var(--card); stroke-width: 2; }
.states span { color: var(--muted); font-size: .88rem; }

.foot { margin-top: 3rem; padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

@media (max-width: 560px) {
  .verdict { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .vicon { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .vicon .slash, .vicon .tick { stroke-dashoffset: 0; }
}

/* ---------- motion ---------- */
/* Counties light up in a wave (fill only, so nothing is ever hidden). */
.map.wave .c { animation: ignite .7s var(--d, 0ms) ease-out both; }
@keyframes ignite { from { filter: grayscale(1) brightness(1.25); } }
.mapbox { position: relative; }
.maptip { position: absolute; z-index: 3; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: var(--bg); padding: .35rem .6rem; border-radius: 8px; font-size: .82rem; white-space: nowrap; box-shadow: var(--shadow); }
.maptip b { display: block; }
.map a:focus-visible .c { stroke: var(--ink); stroke-width: 4; outline: none; }

/* Rising embers in the home hero and on a "Yes, burn ban" card. */
.hero.home, .verdict { position: relative; isolation: isolate; }
.embers { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; border-radius: inherit; }
.embers i { position: absolute; bottom: -10px; width: 5px; height: 5px; border-radius: 50%; background: var(--ember2); box-shadow: 0 0 8px 2px var(--ember1); opacity: 0; animation: ember 5s linear infinite; }
.embers i:nth-child(1) { left: 8%; animation-delay: 0s; } .embers i:nth-child(2) { left: 17%; animation-delay: 2.1s; animation-duration: 6s; }
.embers i:nth-child(3) { left: 26%; animation-delay: 1.1s; } .embers i:nth-child(4) { left: 35%; animation-delay: 3.4s; animation-duration: 4.4s; }
.embers i:nth-child(5) { left: 44%; animation-delay: .6s; animation-duration: 6.5s; } .embers i:nth-child(6) { left: 53%; animation-delay: 2.7s; }
.embers i:nth-child(7) { left: 62%; animation-delay: 1.6s; animation-duration: 5.5s; } .embers i:nth-child(8) { left: 71%; animation-delay: 4s; }
.embers i:nth-child(9) { left: 80%; animation-delay: .3s; animation-duration: 4.8s; } .embers i:nth-child(10) { left: 89%; animation-delay: 2.4s; }
.embers i:nth-child(11) { left: 94%; animation-delay: 3.8s; animation-duration: 6.2s; } .embers i:nth-child(12) { left: 4%; animation-delay: 4.6s; }
.embers i:nth-child(13) { left: 22%; animation-delay: 5.2s; } .embers i:nth-child(14) { left: 48%; animation-delay: 4.3s; animation-duration: 5.8s; }
.embers i:nth-child(15) { left: 67%; animation-delay: 5.6s; } .embers i:nth-child(16) { left: 85%; animation-delay: 1.3s; animation-duration: 6.8s; }
@keyframes ember {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: .9; }
  50% { transform: translate(14px, -45vh) scale(.8); }
  100% { transform: translate(-10px, -90vh) scale(.3); opacity: 0; }
}
.verdict .embers i { width: 4px; height: 4px; }
.verdict .embers i { animation-name: ember-card; }
@keyframes ember-card { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .8; } 100% { transform: translate(-12px, -220px) scale(.3); opacity: 0; } }
.hero.home .flame { position: relative; }
.hero.home .flame::after { content: ""; position: absolute; inset: 20% -40% -10%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgb(255 106 26 / .35), transparent); animation: pulse 2.6s ease-in-out infinite; }

/* Live dot next to "checked … ago". */
.live { display: inline-block; width: 8px; height: 8px; margin-right: .4rem; border-radius: 50%; background: var(--none); vertical-align: 1px; box-shadow: 0 0 0 0 color-mix(in srgb, var(--none) 60%, transparent); animation: live 2s ease-out infinite; }
@keyframes live { to { box-shadow: 0 0 0 8px transparent; } }
.dot.ban { animation: live-ban 2.2s ease-out infinite; }
@keyframes live-ban { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ban) 55%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }

/* Scroll reveal: only for content below the fold (app.js adds .rv); a timer guarantees visibility. */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.rv.in { opacity: 1; transform: none; }
.near li, .chips li, .changes li { animation: rise .45s ease-out both; }
.near li:nth-child(2) { animation-delay: .05s } .near li:nth-child(3) { animation-delay: .1s } .near li:nth-child(4) { animation-delay: .15s }
.near li:nth-child(5) { animation-delay: .2s } .near li:nth-child(6) { animation-delay: .25s } .near li:nth-child(7) { animation-delay: .3s } .near li:nth-child(8) { animation-delay: .35s }
.near a { transition: padding .2s, background .2s; border-radius: 8px; }
.near a:hover { padding-left: .5rem; background: var(--bg); text-decoration: none; }
.chips a { transition: transform .15s, background .15s; }
.chips a:hover { transform: translateY(-2px); background: var(--ban); color: #fff; text-decoration: none; }
.stat { transition: transform .2s; }
.stat:hover { transform: translateY(-3px); }
.faq details[open] p { animation: rise .3s ease-out; }
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }

/* ---------- mobile ---------- */
.top .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
a, button, summary, input { -webkit-tap-highlight-color: transparent; }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 1.3rem 16px .6rem; }
  .hero.home { padding-top: 2rem; }
  .hero .sub { font-size: 1rem; }
  .top .wrap { height: 52px; }
  .top nav { gap: .9rem; }
  .crumbs { margin-top: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card { padding: 1rem; border-radius: 14px; }
  .wrap.card { margin-left: 12px; margin-right: 12px; }
  .grid2 { padding: 0 12px; }
  /* Verdict stays side by side: icon + big answer fit one screen without scrolling. */
  .verdict { flex-direction: row; align-items: center; gap: .9rem; padding: 1.1rem; }
  .vicon { width: 58px; height: 58px; }
  .what { font-size: 1.02rem; }
  .meta { font-size: .86rem; }
  .near a { padding: .8rem 0; }
  .stats { gap: .6rem; }
  .stat { flex: 1 1 calc(50% - .6rem); padding: .8rem .9rem; }
  .stat b { font-size: 1.8rem; }
  .states { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .states a { padding: .8rem; }
  .states svg { height: 70px; }
  /* County table becomes a list of cards. */
  table.sortable thead { display: none; }
  table.sortable, table.sortable tbody { display: block; }
  table.sortable tr { display: grid; grid-template-columns: 1fr auto; gap: .15rem .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  table.sortable td { padding: 0; border: 0; }
  table.sortable td:first-child { font-size: 1.02rem; }
  table.sortable td[data-l="Status"] { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }
  table.sortable td[data-l="Since"] { grid-row: 1; grid-column: 2; color: var(--muted); font-size: .85rem; }
  table.sortable td[data-l="Fire weather"]:empty { display: none; }
  table.sortable td[data-l="Fire weather"] { grid-column: 1 / -1; color: var(--fw); font-size: .85rem; }
  .search input { font-size: 1.05rem; }
  #results a { padding: .75rem .7rem; }
  .foot { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .embers, .hero.home .flame::after { display: none; }
  .rv { opacity: 1; transform: none; }
}

/* ---------- alert sign-up ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.alertcard { display: flex; gap: 1.1rem; align-items: flex-start; background: linear-gradient(135deg, color-mix(in srgb, var(--ember1) 10%, var(--card)), var(--card) 60%); }
.alertcard h2 { font-size: 1.15rem; margin-bottom: .3rem; }
.bell { flex: 0 0 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ember1) 18%, transparent); }
.bell svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transform-origin: 50% 10%; animation: ring 4s ease-in-out infinite; }
@keyframes ring { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(14deg); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(8deg); } 96% { transform: rotate(-4deg); } }
.aftext { flex: 1; min-width: 0; }
.alertform { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.alertform input[type="email"], .alertform select { flex: 1 1 220px; min-width: 0; font: inherit; padding: .75rem 1rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); outline: none; }
.alertform select { flex-basis: 100%; }
.alertform input:focus, .alertform select:focus { border-color: var(--accent); }
.alertform button { flex: 0 0 auto; font: inherit; font-weight: 600; padding: .75rem 1.3rem; border: 0; border-radius: 12px; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--ember1), var(--ban)); box-shadow: 0 6px 18px rgb(214 54 31 / .3); transition: transform .15s, box-shadow .15s; }
.alertform button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgb(214 54 31 / .4); }
.alertform button:disabled { opacity: .6; cursor: default; transform: none; }
.afmsg { margin: .6rem 0 0; font-weight: 600; }
.afmsg.ok { color: var(--none); } .afmsg.err { color: var(--ban); }
.alertcard.done .alertform { display: none; }
@media (max-width: 640px) {
  .alertcard { flex-direction: column; gap: .6rem; }
  .bell { flex-basis: 40px; width: 40px; height: 40px; }
  .alertform button { flex: 1 1 100%; padding: .9rem; }
  .alertform input[type="email"], .alertform select { font-size: 16px; }
}
