/* Palette borrowed from the Ordnance Survey map and the planning "red line" site boundary. */
:root {
  --paper: #f4f7f1;
  --surface: #ffffff;
  --wash: #e3ecdb;
  --ink: #1c2a22;
  --ink-soft: #4b5a51;
  --hedge: #2e6b40;
  --hedge-deep: #1f4a2c;
  --redline: #c8102e;
  --contour: #b98a5a;
  --amber: #8a5a00;
  --amber-wash: #fbefd5;
  --rule: #cfdac6;
  --focus: #1d5fd0;
  --radius-s: 4px;
  --radius-m: 10px;
  --measure: 68ch;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131a15; --surface: #1b241e; --wash: #22301f; --ink: #e6ede3; --ink-soft: #a9b8ad;
    --hedge: #7cc48e; --hedge-deep: #a6dcb3; --redline: #ff5a6b; --contour: #8a6a49;
    --amber: #f0c060; --amber-wash: #3a2f15; --rule: #33443a; --focus: #7aa7ff; color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); }
img { max-width: 100%; }
a { color: var(--hedge-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.1; letter-spacing: .005em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9em; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.page { padding-top: 2rem; padding-bottom: 4rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.big { font-size: 1.15rem; }
.lede { font-size: 1.2rem; max-width: var(--measure); color: var(--ink-soft); }
.empty { color: var(--ink-soft); font-style: italic; }
.crumb { margin-bottom: .5rem; font-size: .95rem; }

/* header */
.site-header { background: var(--hedge-deep); color: #fff; }
@media (prefers-color-scheme: dark) { .site-header { background: #0d1410; } }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font: 700 1.45rem/1 var(--head); }
.brand-mark { width: 34px; height: 34px; color: #b9e0c2; --redline: #ff6b78; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.3rem; }
.site-header nav a { color: #e4f1e7; text-decoration: none; font: 600 1.15rem/1 var(--head); padding: .4rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: #fff; border-bottom-color: #ff6b78; }
.nav-admin { opacity: .85; }

.flash { margin: 1rem 0 0; padding: .7rem 1rem; background: var(--wash); border-left: 4px solid var(--hedge); border-radius: var(--radius-s); }
.error { padding: .7rem 1rem; background: var(--amber-wash); border-left: 4px solid var(--redline); }

/* hero: the red-line boundary is the one loud thing on the site */
.hero { background: var(--wash); border-bottom: 1px solid var(--rule); }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; padding-top: 3rem; padding-bottom: 3rem; }
.hero h1 { max-width: 16ch; }
.hero-map { margin: 0; }
.hero-map svg { width: 100%; height: auto; display: block; }
.hero-map figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .4rem; }
.contours path { stroke: var(--contour); opacity: .55; }
.hedges path { stroke: var(--hedge); opacity: .45; }
.trees circle { fill: var(--hedge); opacity: .55; }
.redline { fill: color-mix(in srgb, var(--redline) 8%, transparent); stroke: var(--redline); stroke-width: 3.5; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s .3s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .redline { animation: none; stroke-dashoffset: 0; } }

.tally { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.5rem 2.5rem; margin: 1.5rem 0; }
.tally div { display: flex; flex-direction: column-reverse; }
.tally dt { font-size: .95rem; color: var(--ink-soft); max-width: 14ch; }
.tally dd { margin: 0; font: 700 2.8rem/1 var(--head); color: var(--hedge-deep); }
.small-tally dd { font-size: 2rem; }

.button { display: inline-block; font: 600 1.1rem/1 var(--head); letter-spacing: .02em; padding: .7rem 1.1rem; border-radius: var(--radius-s); border: 2px solid var(--hedge-deep); background: var(--hedge-deep); color: #fff; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--hedge); border-color: var(--hedge); }
.button.ghost { background: transparent; color: var(--hedge-deep); }
.button.ghost:hover { background: var(--surface); }
.button[disabled] { opacity: .6; cursor: progress; }
@media (prefers-color-scheme: dark) { .button { color: #0d1410; } .button.ghost { color: var(--hedge-deep); } }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--hedge-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.danger { color: var(--redline); }
form.inline { display: inline; margin-left: 1rem; }

/* layout */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 3rem; padding-top: 2.5rem; padding-bottom: 3rem; }
.page .columns { padding-top: 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.2rem 1.3rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.35rem; }
.admin-panel { border-style: dashed; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .45rem 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .8rem; }
ul.plain li:first-child { border-top: 0; }

/* timeline of events */
.events { list-style: none; margin: 0 0 1rem; padding: 0; border-left: 2px solid var(--rule); }
.event { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .8rem 0 .8rem 1rem; position: relative; }
.event::before { content: ""; position: absolute; left: -7px; top: 1.2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-soft); }
.event time { font-size: .9rem; color: var(--ink-soft); padding-top: .15rem; }
.event-kind { font: 600 1.15rem/1.2 var(--head); margin: 0 0 .15rem; }
.event-app { font-weight: 700; }
.event-detail { margin: .2rem 0 0; color: var(--ink-soft); }
.kind-approved::before { background: var(--redline); border-color: var(--redline); }
.kind-refused::before { background: var(--hedge); border-color: var(--hedge); }
.kind-new::before { border-color: var(--amber); background: var(--amber-wash); }
.kind-approved .event-kind { color: var(--redline); }
.kind-refused .event-kind { color: var(--hedge); }
.ref { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; color: var(--ink-soft); }

/* badges: approval is the bad news for this campaign, so it carries the red line */
.badge { display: inline-block; font: 600 1rem/1 var(--head); padding: .3rem .55rem; border-radius: var(--radius-s); border: 1.5px solid currentColor; white-space: nowrap; }
.outcome-pending { color: var(--amber); background: var(--amber-wash); }
.outcome-approved { color: var(--redline); }
.outcome-refused { color: var(--hedge); background: var(--wash); }
.outcome-withdrawn, .outcome-other, .outcome-split, .badge.muted { color: var(--ink-soft); }
.badge.muted { font-size: .85rem; border-width: 1px; }
.gs-threatened.badge { color: var(--redline); }
.gs-consultation.badge { color: var(--amber); background: var(--amber-wash); }
.gs-watching.badge { color: var(--ink-soft); }
.gs-protected.badge { color: var(--hedge); background: var(--wash); }
.gs-lost.badge { color: var(--ink); background: var(--rule); }
.deadline { font-size: .9rem; color: var(--amber); font-weight: 700; }

/* application list */
.app-list { border-top: 1px solid var(--rule); }
.app-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.app-row h3 { font-size: 1.3rem; margin-bottom: .3rem; }
.app-row h3 a { text-decoration: none; color: var(--ink); }
.app-row h3 a:hover { text-decoration: underline; }
.app-summary { max-width: var(--measure); margin-bottom: .4rem; }
.app-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; color: var(--ink-soft); margin: 0; }
.app-row-status { text-align: right; }
.app-row-status .deadline { margin: .5rem 0 0; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem 1rem; margin: 1.5rem 0 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-m); }
.filters label { display: flex; flex-direction: column; font-size: .9rem; color: var(--ink-soft); gap: .25rem; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--radius-s); padding: .55rem .65rem; width: 100%;
}
.filters input[type=search] { min-width: 16rem; }
textarea { resize: vertical; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; }
.stack label .muted { font-weight: 400; }
.stack .check, .check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; margin: 0; }
legend { font: 600 1.3rem/1 var(--head); padding: 0 .4rem; }
.card-form { background: var(--surface); padding: 1.5rem; border: 1px solid var(--rule); border-radius: var(--radius-m); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; flex-wrap: wrap; }
.detail-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); max-width: 26ch; }
.summary-box { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--redline); border-radius: var(--radius-s); padding: 1.2rem 1.4rem; margin-bottom: 2rem; }
.summary-box p:first-of-type { font-size: 1.15rem; }
.notes { background: var(--wash); padding: 1rem 1.3rem; border-radius: var(--radius-m); margin-bottom: 2rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--ink-soft); font-size: .95rem; }
.facts dd { margin: 0; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.8rem; }

.space-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 2.5rem; }
.space { padding: 1.2rem 0; border-top: 3px solid var(--rule); }
.space.gs-threatened { border-top-color: var(--redline); border-top-style: dashed; }
.space h2 a { text-decoration: none; color: var(--ink); }
.space-status { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.tabs { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; border-bottom: 1px solid var(--rule); margin: 1rem 0 1.5rem; }
.tabs a { text-decoration: none; padding: .5rem 0; font: 600 1.15rem/1 var(--head); color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--redline); }

.doc-table, .runs { width: 100%; border-collapse: collapse; }
.doc-table th, .doc-table td, .runs th, .runs td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc-table th, .runs th { font: 600 1.05rem/1 var(--head); color: var(--ink-soft); }
.doc-table td p { margin: .25rem 0 0; }
.runs { margin-top: 1rem; font-size: .9rem; }
.ok { color: var(--hedge); font-weight: 700; }
.fail { color: var(--redline); font-weight: 700; }

.pager { display: flex; gap: 1.5rem; align-items: center; margin-top: 1.5rem; }

.site-footer { border-top: 1px solid var(--rule); background: var(--surface); }
.footer-inner { padding-top: 1.5rem; padding-bottom: 2rem; font-size: .9rem; color: var(--ink-soft); }
.footer-inner p { max-width: var(--measure); }
.footer-inner p:last-child { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
form.inline { margin-left: 0; }

@media (max-width: 860px) {
  .hero-inner, .columns { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 2rem; padding-bottom: 2rem; gap: 1.5rem; }
  .hero-map { max-width: 420px; }
  .columns { gap: 1.5rem; }
}
@media (max-width: 560px) {
  .app-row { grid-template-columns: 1fr; }
  .app-row-status { text-align: left; }
  .event { grid-template-columns: 1fr; gap: .2rem; }
  .filters input[type=search] { min-width: 0; }
  .two { grid-template-columns: 1fr; }
  .doc-table thead { display: none; }
  .doc-table tr { display: block; border-bottom: 1px solid var(--rule); padding: .5rem 0; }
  .doc-table td { display: block; border: 0; padding: .15rem 0; }
}

/* ---- reports from residents and proposals ---- */
.site-header nav a.nav-report { color: #fff; border: 1.5px solid #ff6b78; border-radius: var(--radius-s); padding: .35rem .6rem; }
.site-header nav a.nav-report:hover, .site-header nav a.nav-report[aria-current] { background: #ff6b78; color: #1f1012; border-bottom-color: #ff6b78; }
.report-cta { border: 2px dashed var(--redline); background: var(--surface); }
.report-cta h2 { color: var(--redline); }
.report-form legend .muted { font-family: var(--body); font-size: .85rem; font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { min-height: 65px; }
.pre { white-space: pre-wrap; }

.stage-reported.badge { color: var(--amber); background: var(--amber-wash); }
.stage-consultation.badge { color: var(--redline); }
.stage-submitted.badge { color: var(--redline); background: color-mix(in srgb, var(--redline) 10%, transparent); }
.stage-decided.badge, .stage-withdrawn.badge { color: var(--ink-soft); }

.proposal-list { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 1px solid var(--rule); }
.proposal { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 1.2rem; padding: 1.2rem 0; border-bottom: 1px solid var(--rule); }
.proposal h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.proposal h2 a { color: var(--ink); text-decoration: none; }
.proposal h2 a:hover { text-decoration: underline; }
.proposal-thumb { width: 140px; height: 105px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--rule); background: var(--wash); display: block; }
.empty-thumb { background: repeating-linear-gradient(135deg, var(--wash) 0 10px, var(--paper) 10px 20px); }
.summary-box.closed { border-left-color: var(--rule); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; margin: 1rem 0 2rem; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--rule); display: block; background: var(--wash); }
.file-tile { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 1px dashed var(--rule); border-radius: var(--radius-s); background: var(--surface); padding: 1rem; text-align: center; }
.photo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.photo-pick label { flex-direction: column; align-items: flex-start; gap: .3rem; }
.photo-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--rule); }
.report-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--rule); display: block; }
.danger-button { color: var(--redline); border-color: var(--redline); }
.kind-proposal_new::before { background: var(--redline); border-color: var(--redline); border-radius: 2px; }
.kind-proposal_new .event-kind { color: var(--redline); }
.facts dd ul { margin: 0; padding-left: 1.1rem; }

@media (max-width: 560px) {
  .proposal { grid-template-columns: 1fr; }
  .proposal-thumb { width: 100%; height: 160px; }
}

/* ---- proposals map ---- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 1.5rem; align-items: start; margin-top: 1.5rem; }
.map-col { position: sticky; top: 1rem; }
.proposal-map { height: min(70vh, 640px); min-height: 360px; border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--wash); z-index: 0; }
.pick-map { height: 300px; border: 1px solid var(--rule); border-radius: var(--radius-s); margin: .5rem 0 1rem; z-index: 0; }
.map-list { counter-reset: none; margin: 0; max-height: min(70vh, 640px); overflow-y: auto; border-top: 1px solid var(--rule); }
.map-list .proposal { grid-template-columns: 2.2rem minmax(0, 1fr); gap: .8rem; padding: 1rem .6rem; cursor: pointer; border-left: 4px solid transparent; }
.map-list .proposal h2 { font-size: 1.25rem; }
.map-list .proposal:hover { background: color-mix(in srgb, var(--wash) 60%, transparent); }
.map-list .proposal.selected { background: var(--wash); border-left-color: var(--redline); }
.show-on-map { font: inherit; font-size: .9rem; background: none; border: 1.5px solid var(--hedge); color: var(--hedge-deep); border-radius: var(--radius-s); padding: .2rem .55rem; cursor: pointer; }
.show-on-map:hover, .show-on-map:focus-visible { background: var(--hedge); color: #fff; }
.pin-num, .pin { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font: 700 .95rem/1 var(--head); color: #fff; background: var(--ink-soft); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pin-num { width: 1.9rem; height: 1.9rem; }
.pin { width: 100%; height: 100%; box-sizing: border-box; transition: transform .15s; }
.pin.on { background: var(--ink) !important; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--redline), 0 2px 8px rgba(0,0,0,.55); font-size: 1.1rem; }
.pin-wrap { background: none; border: 0; }
.pin-num.stage-reported, .pin.stage-reported { background: #b07400; }
.pin-num.stage-consultation, .pin.stage-consultation, .pin-num.stage-submitted, .pin.stage-submitted { background: var(--redline); }
.pin-num.stage-decided, .pin.stage-decided, .pin-num.stage-withdrawn, .pin.stage-withdrawn { background: #5b6a61; }
.leaflet-container { font-family: var(--body); }
@media (max-width: 800px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-col { position: static; }
  .proposal-map { height: 50vh; min-height: 280px; }
  .map-list { max-height: none; }
}

.admin-bar .tabs { margin: 1rem 0 0; }
.admin-bar + .wrap.page { padding-top: 1rem; }
