:root {
  --bg: #f4f1ea; --surface: #ffffff; --ink: #1c1917; --muted: #6b645c; --line: #e5ded0;
  --brand: #123f3a; --brand-2: #0f766e; --accent: #c2410c; --ok: #15803d; --warn: #a16207; --bad: #b91c1c;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(18,63,58,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-family: Fraunces, Georgia, serif; font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(16px, 4vw, 40px); background: var(--brand); color: #f4f1ea; position: sticky; top: 0; z-index: 10; }
.brand { color: inherit; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #f4f1ea; color: var(--brand); font-weight: 800; }
#nav { display: flex; gap: .25rem; flex-wrap: wrap; }
#nav a, #nav button { color: #e7efe9; text-decoration: none; background: none; border: 0; font: inherit; padding: .4rem .7rem; border-radius: 8px; cursor: pointer; }
#nav a.active, #nav a:hover, #nav button:hover { background: rgba(255,255,255,.12); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; min-height: 60vh; }
.loading { padding: 4rem 0; text-align: center; color: var(--muted); }
.footer { max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); font-size: .85rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stack > * + * { margin-top: 16px; }

.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; padding: 16px 0 24px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.hero p.lead { font-size: 1.1rem; color: #3f3a35; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--brand-2); }
.points { list-style: none; padding: 0; margin: 1rem 0; }
.points li { padding: .35rem 0 .35rem 1.6rem; position: relative; }
.points li::before { content: "✓"; position: absolute; left: 0; color: var(--brand-2); font-weight: 700; }

label { display: block; font-weight: 600; font-size: .9rem; margin: .75rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; padding: .6rem .75rem; border: 1px solid #d6cdbb; border-radius: 9px; font: inherit; background: #fff;
}
input:focus, select:focus { outline: 2px solid rgba(15,118,110,.35); border-color: var(--brand-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1rem; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { padding: .35rem .65rem; font-size: .85rem; }
.btn.block { width: 100%; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; margin-bottom: .5rem; }
.tabs button { flex: 1; padding: .5rem; border: 1px solid var(--line); background: #faf8f3; border-radius: 8px; cursor: pointer; font: inherit; }
.tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.stat { padding: 16px 18px; }
.stat strong { display: block; font-size: 1.9rem; font-family: Fraunces, Georgia, serif; }
.banner { padding: 12px 16px; border-radius: 10px; border: 1px solid; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.banner.info { background: #ecf7f4; border-color: #b7e0d6; }
.banner.warn { background: #fff7e6; border-color: #f2d49b; }
.banner.bad  { background: #fdecec; border-color: #f3b9b9; }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search { grid-column: 1 / -1; } }
.permit { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.permit:last-child { border-bottom: 0; }
.permit h3 { font-size: 1.02rem; margin: 0 0 .2rem; }
.permit .desc { margin: .4rem 0; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.tag { font-size: .75rem; padding: .15rem .5rem; border-radius: 99px; background: #efeae0; color: #4a443d; }
.tag.stage-application { background: #fff1d6; color: #7a4d00; }
.tag.stage-issued { background: #dcf2e6; color: #135c34; }
.tag.new { background: var(--accent); color: #fff; }
.tag.mine { background: #d9eeea; color: #0d5c55; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.check { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; font-weight: 400; margin: 0; }
.check:has(input:checked) { border-color: var(--brand-2); background: #f0f8f6; }
.check input { margin-top: .25rem; }
.check b { display: block; font-size: .92rem; }
.check small { color: var(--muted); }
.zipchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem; border-radius: 99px; background: var(--brand); color: #fff; font-size: .85rem; }
.chip button { background: none; border: 0; color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.zipgroups { display: grid; gap: 8px; margin-top: .6rem; }
.zipgroups details { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; background: #fff; }
.zipgroups summary { cursor: pointer; font-weight: 600; }
.zipgroups .zips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .5rem; }
.zipgroups .zips button { border: 1px solid var(--line); background: #faf8f3; border-radius: 99px; padding: .2rem .55rem; cursor: pointer; font: inherit; font-size: .85rem; }
.zipgroups .zips button.on { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.off { background: #b8b0a3; }
pre.json { background: #1f2a28; color: #d9f2ec; padding: 12px; border-radius: 10px; overflow: auto; font-size: .8rem; max-height: 320px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c1917; color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: 90vw; z-index: 50; }
.toast.bad { background: var(--bad); }
