:root {
  --spruce: #1E4A3B;
  --spruce-dark: #163A2E;
  --asphalt: #2A2E33;
  --yellow: #F2B630;
  --sage: #9FC2B0;
  --sage-light: #E3EEE8;
  --white: #FFFFFF;
  --gray: #F3F5F4;
  --line: #D5DDD9;
  --muted: #545B61;
  --danger: #A3261B;
  --radius: 12px;
  --head: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Barlow", Arial, sans-serif;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--gray);
  color: var(--asphalt);
  font: 17px/1.5 var(--body);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .4em; color: var(--spruce); }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--spruce); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--asphalt); color: var(--white); padding: 12px 16px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

.mock-banner { background: var(--asphalt); color: var(--white); font-size: .85rem; text-align: center; padding: 6px 16px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 8px 16px; position: sticky; top: 0; z-index: 10;
}
.brand { display: inline-flex; min-height: 44px; align-items: center; }
.brand img { height: 52px; width: auto; display: block; }
.staff-link {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px;
  border: 2px solid var(--spruce); border-radius: 999px; font-weight: 600; text-decoration: none;
}
.staff-link[aria-current="page"] { background: var(--spruce); color: var(--white); }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 32px; outline: none; }
main.wide { max-width: 1040px; }

/* Bottom tab bar on mobile, top-aligned row on desktop */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--white); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 600;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tabbar a[aria-current="page"] { color: var(--spruce); box-shadow: inset 0 3px 0 var(--yellow); }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .topbar { padding: 8px 32px; }
  .tabbar {
    position: sticky; top: 61px; bottom: auto; display: flex; justify-content: center; gap: 8px;
    border-top: 0; border-bottom: 1px solid var(--line);
  }
  .tabbar a { flex-direction: row; min-height: 48px; padding: 0 18px; font-size: .95rem; gap: 8px; }
  .tabbar a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--yellow); }
  .tabbar svg { width: 20px; height: 20px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px; border: 2px solid transparent;
  font: 600 1rem var(--body); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--spruce); color: var(--white); }
.btn-primary:hover { background: var(--spruce-dark); }
.btn-secondary { background: var(--white); color: var(--spruce); border-color: var(--spruce); }
.btn-secondary:hover { background: var(--sage-light); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; color: var(--spruce); text-decoration: underline; cursor: pointer; }

/* Cards and layout */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.eyebrow { font: 700 .8rem var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; margin-bottom: 4px; }
.placeholder { background: #FFF4D6; border-radius: 4px; padding: 0 3px; font-weight: 600; }

/* Home */
.hero {
  background: var(--spruce); color: var(--white); border-radius: var(--radius);
  padding: 28px 22px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero h1 { color: var(--white); font-size: 2.1rem; }
.hero p { max-width: 34em; }
.hero .placeholder { color: var(--asphalt); }
.hero::after {
  content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 120px;
  background: var(--asphalt); transform: skewX(-12deg);
  box-shadow: inset 4px 0 0 var(--white);
}
.hero::before {
  content: ""; position: absolute; right: 18px; top: 0; bottom: 0; width: 4px;
  background: repeating-linear-gradient(var(--yellow) 0 14px, transparent 14px 26px);
  transform: skewX(-12deg); z-index: 1;
}
.hero > * { position: relative; z-index: 2; max-width: calc(100% - 70px); }
.hero .btn-primary { background: var(--yellow); color: var(--asphalt); }
.hero .btn-primary:hover { background: #E3A71E; }
.hero .btn-secondary { background: transparent; color: var(--white); border-color: var(--white); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.1); }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.covers { list-style: none; padding: 0; margin: 0; }
.covers li { padding: 8px 0 8px 28px; position: relative; border-bottom: 1px solid var(--gray); }
.covers li:last-child { border-bottom: 0; }
.covers li::before { content: ""; position: absolute; left: 4px; top: 16px; width: 12px; height: 4px; background: var(--yellow); border-radius: 2px; }
.steps { padding-left: 1.3em; margin: 0; }
.steps li { margin-bottom: 6px; }

/* Map */
.map-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-svg { display: block; width: 100%; height: auto; background: #E9F0EC; }
.map-svg .water { fill: #BFD8E6; }
.map-svg .parcel { fill: none; stroke: #CBD8D1; stroke-width: 1; }
.map-svg .boundary { fill: none; stroke: var(--spruce); stroke-width: 2; stroke-dasharray: 8 5; }
.map-svg .road-hit { fill: none; stroke: transparent; stroke-width: 26; cursor: pointer; }
.map-svg .road-edge { fill: none; stroke: var(--white); stroke-width: 11; stroke-linecap: round; pointer-events: none; }
.map-svg .road-line { fill: none; stroke-width: 7; stroke-linecap: round; pointer-events: none; }
.map-svg .road-line.good { stroke: var(--spruce); }
.map-svg .road-line.fair { stroke: #8A6A12; }
.map-svg .road-line.poor { stroke: var(--danger); }
.map-svg .road-center { fill: none; stroke: var(--yellow); stroke-width: 1.4; stroke-dasharray: 5 5; pointer-events: none; }
.map-svg g.road:focus { outline: none; }
.map-svg g.road:focus .road-edge, .map-svg g.road.selected .road-edge { stroke: var(--yellow); stroke-width: 15; }
.map-svg .label { font: 600 11px var(--body); fill: var(--asphalt); paint-order: stroke; stroke: #E9F0EC; stroke-width: 3px; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .9rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 22px; height: 6px; border-radius: 3px; display: inline-block; }
.swatch.good { background: var(--spruce); }
.swatch.fair { background: #8A6A12; }
.swatch.poor { background: var(--danger); }
.map-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .map-layout { grid-template-columns: 3fr 2fr; align-items: start; } }
.road-list { list-style: none; padding: 0; margin: 0; }
.road-list button {
  width: 100%; min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: none; border: 0; border-bottom: 1px solid var(--gray); padding: 8px 4px; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.road-list button:hover { background: var(--gray); }
.road-list button[aria-pressed="true"] { background: var(--sage-light); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid transparent;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--sage-light); color: var(--spruce); }
.badge.fair { background: #FBF0D2; color: #6B500A; }
.badge.poor { background: #F8E1DE; color: var(--danger); }
.badge.submitted { background: var(--gray); color: var(--asphalt); border-color: var(--line); }
.badge.review { background: #FBF0D2; color: #6B500A; }
.badge.scheduled { background: var(--sage-light); color: var(--spruce); }
.badge.complete { background: var(--spruce); color: var(--white); }

dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
dl.facts dt { font-weight: 600; color: var(--muted); }
dl.facts dd { margin: 0; }

/* Forms */
form .field { margin-bottom: 18px; }
label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; font-size: .9rem; color: var(--muted); margin: -2px 0 6px; font-weight: 400; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid #8B959C; border-radius: 8px;
  font: inherit; color: var(--asphalt); background: var(--white);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--spruce); outline: 3px solid var(--yellow); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.error { color: var(--danger); font-size: .9rem; font-weight: 600; margin-top: 4px; }
.error-summary { border: 2px solid var(--danger); background: #FDF1EF; border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; }
.error-summary h2 { color: var(--danger); font-size: 1.1rem; }
.error-summary ul { margin: 0; padding-left: 1.2em; }
.choice-grid { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
@media (min-width: 560px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice-grid legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice label {
  margin: 0; min-height: 48px; display: flex; align-items: center; padding: 10px 14px 10px 44px;
  border: 2px solid var(--line); border-radius: 8px; background: var(--white); font-weight: 500; cursor: pointer; position: relative;
}
.choice label::before { content: ""; position: absolute; left: 14px; width: 18px; height: 18px; border: 2px solid #8B959C; border-radius: 50%; background: var(--white); }
.choice input:checked + label { border-color: var(--spruce); background: var(--sage-light); }
.choice input:checked + label::before { border-color: var(--spruce); box-shadow: inset 0 0 0 4px var(--white); background: var(--spruce); }
.choice input:focus-visible + label { outline: 3px solid var(--yellow); outline-offset: 2px; }
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed #8B959C; border-radius: 10px; padding: 20px; background: var(--white); min-height: 120px;
}
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload label { margin: 8px 0 0; }
.upload:focus-within { outline: 3px solid var(--yellow); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* Confirmation */
.confirm-head { text-align: center; padding: 28px 20px; }
.check { width: 64px; height: 64px; border-radius: 50%; background: var(--spruce); display: grid; place-items: center; margin: 0 auto 12px; }
.check svg { width: 34px; height: 34px; stroke: var(--yellow); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.req-number {
  display: inline-block; font: 700 1.8rem var(--head); letter-spacing: .04em; background: var(--asphalt); color: var(--white);
  padding: 6px 16px; border-radius: 8px; border-bottom: 4px solid var(--yellow); margin: 6px 0 4px;
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 44px; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 4px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--spruce); }
.timeline .dot {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--line); display: grid; place-items: center;
}
.timeline li.done .dot { background: var(--spruce); border-color: var(--spruce); }
.timeline li.current .dot { background: var(--yellow); border-color: var(--asphalt); }
.timeline .dot svg { width: 16px; height: 16px; stroke: var(--white); stroke-width: 3; fill: none; }
.timeline h3 { margin: 2px 0 2px; color: var(--asphalt); }
.timeline li.todo h3 { color: var(--muted); }
.timeline p { margin: 0; }

/* Staff */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--white);
  font: 600 .95rem var(--body); color: var(--asphalt); cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--asphalt); border-color: var(--asphalt); color: var(--white); }
.chip .count { font-weight: 400; margin-left: 4px; }
.req-list { list-style: none; padding: 0; margin: 0; }
.req-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; min-height: 64px;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: inherit;
}
.req-list a:hover { border-color: var(--spruce); }
.req-list .id { font: 700 1.05rem var(--head); color: var(--spruce); }
.req-list .meta { grid-column: 1 / -1; font-size: .92rem; color: var(--muted); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px); z-index: 30;
  background: var(--asphalt); color: var(--white); padding: 12px 20px; border-radius: 10px; border-left: 5px solid var(--yellow);
}
@media (min-width: 900px) { .toast { bottom: 24px; } }
.staff-note { background: var(--sage-light); border-radius: 8px; padding: 10px 14px; font-size: .92rem; margin-bottom: 16px; }

.site-foot { text-align: center; font-size: .85rem; color: var(--muted); padding: 8px 16px 24px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 559px) {
  .hero::before, .hero::after { display: none; }
  .hero > * { max-width: none; }
  .hero { border-bottom: 6px solid var(--yellow); }
}
.inline-link { display: inline-flex; align-items: center; min-height: 44px; }
