/* DA Radar — drafting-document look: cool paper, cadastre-blue ink,
   notice-yellow reserved exclusively for open-for-submissions. */

:root {
  --ink: #1a1d21;
  --ink-soft: #4a5058;
  --paper: #fafbfc;
  --rule: #d7dce2;
  --cadastre: #2456a6;
  --cadastre-soft: #e8eef8;
  --notice: #ffd32d;
  --closed: #64748b;
  --danger: #a5453c;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --body: "Public Sans", system-ui, sans-serif;
  --display: "Archivo", var(--body);
}

* { box-sizing: border-box; }
/* The hidden attribute must beat any author display rule (watch button,
   clear-pin link): UA display:none loses to `.watchbtn { display:block }`. */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--body); color: var(--ink); font-size: 15px; line-height: 1.45; }

#layout { display: flex; height: 100vh; height: 100dvh; }
#mapwrap { position: relative; flex: 1; min-width: 0; display: flex; }
#map { flex: 1; min-width: 0; }

/* Filters overlay the map (category chips + lodged-within): they filter
   what the map shows, and on phones they were starving the sidebar of the
   space the results list needs. */
#mapfilters {
  position: absolute; top: 10px; left: 10px; right: 56px; z-index: 3;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
#mapfilters > * { pointer-events: auto; }

#sidebar {
  width: 400px; max-width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  z-index: 2;
}

/* Title block — set like a survey plan's title panel */
.titleblock { padding: 18px 20px 14px; border-bottom: 1px solid var(--rule); }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--cadastre); margin: 0 0 2px;
}
.titleblock h1 {
  font-family: var(--display); font-stretch: 125%; font-weight: 700;
  font-size: 34px; line-height: 1; margin: 0; letter-spacing: -0.01em;
}
.tagline { margin: 6px 0 0; color: var(--ink-soft); font-size: 13.5px; }

/* Controls */
.controls { padding: 14px 20px 12px; border-bottom: 1px solid var(--rule); }
.fieldlabel {
  display: block; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 5px;
}
.fieldlabel output { color: var(--ink); font-weight: 500; }

.searchwrap { position: relative; margin-bottom: 12px; }
#search {
  width: 100%; padding: 9px 11px; font: inherit;
  border: 1.5px solid var(--ink); border-radius: 3px; background: #fff;
}
#search:focus { outline: 3px solid var(--cadastre-soft); border-color: var(--cadastre); }
#suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  margin: 2px 0 0; padding: 0; list-style: none;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 3px;
  box-shadow: 0 6px 16px rgba(26, 29, 33, 0.12);
}
#suggestions li { padding: 8px 11px; cursor: pointer; }
#suggestions li:hover, #suggestions li[aria-selected="true"] { background: var(--cadastre-soft); }

.row { margin-bottom: 10px; }
input[type="range"] { width: 100%; accent-color: var(--cadastre); }
.checkrow { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.checkrow input { accent-color: var(--cadastre); margin-top: 2px; }
.hint { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-soft); }

/* Category legend — chips double as the filter (all on by default). Identity
   rides on the labelled glyph, not colour alone; text stays in ink. */
#legend { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.legendchip, .segbtn { box-shadow: 0 1px 3px rgba(26, 29, 33, 0.22); }

/* Collapsed-categories toggle: phones only (see media query). */
#cat-toggle {
  display: none; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
  padding: 5px 12px; border: 1px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink); cursor: pointer; width: max-content;
  box-shadow: 0 1px 3px rgba(26, 29, 33, 0.22);
}
#cat-toggle .caret { font-size: 10px; }
#cat-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
#cat-count { color: var(--cadastre); font-weight: 600; }
.legendchip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
  padding: 3px 8px 3px 6px; border: 1px solid var(--rule); border-radius: 999px;
  background: #fff; color: var(--ink); cursor: pointer;
}
.legendchip:hover, .legendchip:focus-visible { border-color: var(--ink); outline: none; }
.legendchip[aria-pressed="false"] { opacity: 0.45; }
.legendchip[aria-pressed="false"] .caticon svg { fill: var(--rule); }

#clear-pin {
  display: inline-block; margin-top: 4px; font-size: 12.5px;
  color: var(--cadastre); white-space: nowrap;
}

/* "Lodged within" segmented control (features/date-filter) */
#lodged { display: flex; width: max-content; }
.segbtn {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
  padding: 3px 10px; border: 1px solid var(--rule); border-left-width: 0;
  background: #fff; color: var(--ink-soft); cursor: pointer;
}
.segbtn:first-child { border-left-width: 1px; border-radius: 999px 0 0 999px; }
.segbtn:last-child { border-radius: 0 999px 999px 0; }
.segbtn:hover, .segbtn:focus-visible { color: var(--ink); border-color: var(--ink); outline: none; }
.segbtn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Category glyphs (features/category-icons): the coloured icon replaces the
   old ::before colour dot on every chip — identity stays colour + label, the
   shape is reinforcement. The symbol sheet is inlined once per page. */
.caticon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.caticon { display: inline-flex; flex: none; }
.caticon svg { width: 12px; height: 12px; fill: var(--cat, currentColor); }
.legendchip .caticon svg { width: 11px; height: 11px; }

/* Results & detail */
#panel { flex: 1; overflow-y: auto; }
.empty { padding: 28px 20px; color: var(--ink-soft); }
.resultcount {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-soft);
  padding: 10px 20px 4px;
}

.card {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 12px 20px; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; cursor: pointer;
}
.card:hover, .card:focus-visible { background: var(--cadastre-soft); outline: none; }
.card .address { font-weight: 600; margin: 0 0 2px; }
.card .meta { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.card .mono { font-family: var(--mono); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 2px;
  background: var(--cadastre-soft); color: var(--cadastre);
}
.chip.status-determined, .chip.status-withdrawn, .chip.status-cancelled { background: #eef1f4; color: var(--closed); }
.chip.status-rejected { background: #f6e9e7; color: var(--danger); }
.chip.catchip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--rule); color: var(--ink);
}
.cardcat {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 11px; color: var(--ink);
  margin-right: 6px;
}

/* The signature: notice-yellow deadline strip, echoing the corflute DA sign */
.noticestrip {
  display: flex; justify-content: space-between; gap: 8px;
  background: var(--notice); color: var(--ink);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 4px 8px; border-radius: 2px; margin-top: 6px;
}
.noticebar {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: var(--notice); border: 1.5px solid var(--ink);
  padding: 10px 12px; margin: 0 0 14px; font-size: 14px;
}

/* Detail card */
.detailcard { padding: 16px 20px 24px; }
.back {
  font: inherit; font-size: 13px; color: var(--cadastre);
  background: none; border: 0; padding: 0 0 12px; cursor: pointer;
}
.detailcard h2 { font-family: var(--display); font-size: 21px; margin: 2px 0 6px; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 14px 0; }
.facts dt {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink-soft); padding-top: 2px;
}
.facts dd { margin: 0; }
.site { border-top: 1px solid var(--rule); padding: 10px 0; }
.site p { margin: 0 0 2px; }
.sitelabel { text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.detaillinks { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 10px; }
.detaillinks a { color: var(--cadastre); font-weight: 600; font-size: 14px; }
.detaillinks .copylink {
  align-self: flex-start; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--cadastre); font-weight: 600; font-size: 14px; font-family: inherit;
  text-decoration: underline;
}
.verifynote { font-size: 12.5px; color: var(--ink-soft); }

/* Watch button + sidebar nav (Stage 2) */
.topnav { float: right; font-size: 13px; }
.topnav a { color: var(--cadastre); font-weight: 600; text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
.watchbtn {
  display: block; margin-top: 10px; padding: 8px 11px; text-align: center;
  background: var(--cadastre); color: #fff; font-weight: 600; font-size: 13.5px;
  border-radius: 3px; text-decoration: none;
}
.watchbtn:hover { background: #1c458a; }

/* Account pages (Stage 2) */
.pagewrap {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 720px; margin: 0 auto; padding: 0 20px; background: var(--paper);
}
.pagehead {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  flex-wrap: wrap; padding: 18px 0 14px; border-bottom: 2px solid var(--ink);
}
.brand {
  font-family: var(--display); font-stretch: 125%; font-weight: 700;
  font-size: 24px; color: var(--ink); text-decoration: none; line-height: 1;
}
.brand .eyebrow { display: block; font-size: 10px; margin-bottom: 1px; }
.pagenav { display: flex; align-items: baseline; gap: 14px; font-size: 14px; }
.pagenav a { color: var(--cadastre); font-weight: 600; text-decoration: none; }
.pagenav a:hover { text-decoration: underline; }
.pagemain { flex: 1; padding: 20px 0 32px; }
.pagemain h1 { font-family: var(--display); font-size: 26px; margin: 0 0 8px; }
.pagesub { color: var(--ink-soft); margin: 0 0 18px; max-width: 56ch; }
.pagefoot { border-top: 1px solid var(--rule); }

.linkbtn {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--cadastre);
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline;
}
.linkbtn.danger { color: var(--danger); }
.primarybtn {
  display: inline-block; margin-top: 14px; padding: 9px 16px; font: inherit;
  font-weight: 600; font-size: 14px; color: #fff; background: var(--cadastre);
  border: 0; border-radius: 3px; cursor: pointer; text-decoration: none;
}
.primarybtn:hover { background: #1c458a; }
.cancellink { margin-left: 14px; font-size: 13.5px; color: var(--ink-soft); }

.authcard {
  max-width: 430px; background: #fff; border: 1.5px solid var(--ink);
  border-radius: 4px; padding: 20px 22px; margin-top: 8px;
}
.authcard h1 { font-family: var(--display); font-size: 22px; margin: 0 0 8px; }
.authcard p { margin: 0 0 10px; }
.authcard input[type="email"], .authcard input[type="text"] {
  width: 100%; padding: 9px 11px; font: inherit;
  border: 1.5px solid var(--ink); border-radius: 3px; background: #fff;
}
.fielderror { color: var(--danger); font-size: 13px; margin: 4px 0 0; }

.flash {
  padding: 9px 12px; border-radius: 3px; font-size: 14px; margin: 14px 0 0;
  background: var(--cadastre-soft); color: var(--cadastre);
}
.flash-error { background: #f6e9e7; color: var(--danger); }
.flash-success { background: #e8f3ea; color: #2c6e3f; }

.watchlist { list-style: none; margin: 0; padding: 0; }
.watchitem {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
  padding: 14px 16px; margin-bottom: 10px;
}
.watchitem.watch-paused { opacity: 0.65; }
.watchlabel { font-weight: 600; margin: 0 0 2px; }
.watchitem .meta { margin: 0 0 4px; font-size: 13px; color: var(--ink-soft); }
.maplink { font-size: 13.5px; font-weight: 600; color: var(--cadastre); }
.watchactions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* SEO pages (features/seo phase 1) — same drafting-document shell as the
   account pages, a bit wider for the listings. */
.seopage { max-width: 860px; }
.breadcrumbs {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  padding: 10px 0 0;
}
.breadcrumbs a { color: var(--cadastre); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.crumbsep { margin: 0 6px; color: var(--rule); }
.seopage h1 { font-family: var(--display); font-size: 30px; margin: 2px 0 8px; letter-spacing: -0.01em; }
.seopage .pagesub a { color: var(--cadastre); }
.seosection { margin-top: 26px; }
.seosection h2 {
  font-family: var(--display); font-size: 19px; margin: 0 0 10px;
  padding-bottom: 4px; border-bottom: 2px solid var(--ink);
}
.thinnote { background: var(--cadastre-soft); padding: 9px 12px; border-radius: 3px; font-size: 14px; }
.thinnote a, .seealso a, .morelink a { color: var(--cadastre); font-weight: 600; }
.seealso { margin-top: 26px; }
.seealso h2 { font-family: var(--display); font-size: 17px; margin: 0 0 4px; }
.morelink { font-size: 13.5px; color: var(--ink-soft); }

.dalist { list-style: none; margin: 0; padding: 0; }
.darow a {
  display: block; color: inherit; text-decoration: none;
  padding: 11px 12px; border: 1px solid var(--rule); border-radius: 4px;
  background: #fff; margin-bottom: 8px;
}
.darow a:hover, .darow a:focus-visible { border-color: var(--cadastre); outline: none; }
.darow .address { display: block; font-weight: 600; }
.darow .rowmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 2px; }
.darow .rowsummary {
  display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.darow .noticestrip { margin-top: 8px; }

.breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.breakdown li { display: flex; align-items: baseline; gap: 7px; }

.subcloud, .councillist { list-style: none; margin: 0; padding: 0; }
.subcloud { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.subcloud a, .councillist a { color: var(--cadastre); font-weight: 600; text-decoration: none; }
.subcloud a:hover, .councillist a:hover { text-decoration: underline; }
.councillist li {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 7px 2px; border-bottom: 1px solid var(--rule);
}

.statrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.stat {
  background: #fff; border: 1.5px solid var(--ink); border-radius: 4px;
  padding: 10px 14px; min-width: 130px;
}
.statnum { display: block; font-family: var(--display); font-size: 24px; line-height: 1.1; }
.statlabel {
  display: block; font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-top: 2px;
}

.browselink a { color: var(--cadastre); font-weight: 600; }

/* Attribution footer */
.attribution {
  padding: 10px 20px 12px; border-top: 1px solid var(--rule);
  font-size: 11px; color: var(--ink-soft);
}
.attribution p { margin: 0 0 4px; }
.attribution a { color: var(--cadastre); }

/* Map extras */
.maplibregl-ctrl-attrib { font-size: 11px; }
.pin-marker { cursor: grab; }

@media (max-width: 720px) {
  /* Map-first: the map (with its filter overlay) gets the larger pane; the
     sidebar below is mostly the results/detail panel, so tapping a dot
     always reveals its card. */
  #layout { flex-direction: column-reverse; }
  #sidebar { width: 100%; height: 45%; border-right: 0; border-top: 2px solid var(--ink); }
  #mapwrap { height: 55%; flex: none; }

  /* Compact header: one line, no tagline — every saved pixel is list space. */
  .titleblock { padding: 8px 16px 6px; display: flex; align-items: baseline; gap: 10px; }
  .titleblock h1 { font-size: 20px; }
  .tagline { display: none; }
  .eyebrow { display: none; }
  .topnav { order: 2; margin-left: auto; }

  .controls { padding: 8px 16px 6px; }
  .searchwrap { margin-bottom: 8px; }
  .row { margin-bottom: 6px; }
  .hint { display: none; }
  .watchbtn { padding: 8px 10px; }

  /* The sheet scrolls as a whole and the results/detail panel is guaranteed
     real height — the original mobile bug was this panel flexing to zero. */
  #sidebar { overflow-y: auto; }
  #panel { flex: 1 0 auto; min-height: 220px; overflow-y: visible; }
  .attribution { font-size: 11px; }

  /* Categories collapse behind a toggle (a horizontal scroll row wasn't
     discoverable); the expanded panel wraps chips on an opaque card. The
     four date presets fit a phone row as-is. */
  #mapfilters { right: 10px; }
  #cat-toggle { display: inline-flex; }
  #legend { display: none; }
  #mapfilters.cats-open #legend {
    display: flex; flex-wrap: wrap;
    background: rgba(250, 251, 252, 0.97); border: 1px solid var(--ink);
    border-radius: 8px; padding: 10px; max-height: 45vh; overflow-y: auto;
    box-shadow: 0 6px 16px rgba(26, 29, 33, 0.18);
  }
  .legendchip { white-space: nowrap; }
  .segbtn { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
