:root {
  /* LADBS official palette */
  --ladbs-navy:   #102d4d;
  --ladbs-dusk:   #23579a;
  --ladbs-blue:   #01b3d7;
  --ladbs-tan:    #c14718;
  --ladbs-orange: #f86c01;
  --ladbs-brown:  #6e391b;
  --ladbs-hat:    #f6c514;
  --ladbs-fog:    #e6e6e6;

  --bg: #102d4d;          /* Navy */
  --surface: #16375c;     /* lifted navy */
  --surface2: #23579a;    /* Dusk Blue — borders / hover */
  --accent: #01b3d7;      /* Classic Blue — links / focus */
  --accent2: #f6c514;     /* Hard Hat — primary CTA */
  --cta: #f6c514;         /* primary button fill */
  --cta-text: #102d4d;    /* primary button text (on yellow) */
  --on-accent: #102d4d;   /* text on Classic Blue — WCAG AA */
  --accent2-text: #f6c514; /* Hard Hat as text on navy — WCAG AA */
  --danger: #ef4444;
  --success: #22c55e;
  --info: #01b3d7;
  --text: #f4f7fb;
  --muted: #a9bcd6;
  /* elevation tiers — keep filters, panel base, and result cards visually distinct */
  --panel-bg: #102d4d;    /* panel base (deepest) */
  --rail: #0b2038;        /* filter / control rail (recessed) */
  --card: #1b4470;        /* result cards (lifted, lighter than base) */
  --card-hover: #22507f;
  --radius: 6px;          /* panels / menus */
  --radius-btn: 4px;      /* buttons / chips — LADBS square look */
  --panel-w: 472px; /* results panel + omnibox share this width */
}

html.light {
  --bg: #e6e6e6;          /* Fog */
  --surface: #ffffff;
  --surface2: #cbd6e4;
  --accent: #23579a;      /* Dusk Blue */
  --accent2: #f6c514;
  --cta: #f6c514;
  --cta-text: #102d4d;
  --on-accent: #ffffff;    /* white on Dusk Blue — WCAG AA */
  --accent2-text: #6e391b; /* LADBS brown on white/fog — WCAG AA */
  --danger: #dc2626;
  --success: #16a34a;
  --info: #23579a;
  --text: #102d4d;
  --muted: #4a5a70;
  --muted: #475569;
  --panel-bg: #eef2f8;    /* panel base */
  --rail: #dde5f0;        /* filter / control rail (recessed) */
  --card: #ffffff;        /* result cards (lifted, white) */
  --card-hover: #f5f8fc;
}

* { box-sizing: border-box; }
.parcel-scope, .parcel-search-status {
  padding: 10px 14px;
  background: var(--rail);
  color: var(--text);
  border-bottom: 1px solid var(--surface2);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.parcel-scope-list summary, .parcel-match summary { cursor: pointer; }
.parcel-scope-list summary:focus-visible, .parcel-match summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.parcel-scope-list ul { padding-left: 20px; max-height: 220px; overflow: auto; }
.parcel-scope-list p, .parcel-match p { margin: 8px 0; }
.parcel-match { margin: 5px 0; font-size: 12px; white-space: normal; }
.parcel-match p { font-weight: normal; line-height: 1.5; overflow-wrap: anywhere; }
.parcel-match-label { font-weight: 600; }
.parcel-evidence, .parcel-unusable { color: var(--muted); }
.tl-row > .parcel-match { grid-column: 2 / -1; }
.parcel-search-status button { margin-left: 8px; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 22px;
  background: linear-gradient(90deg, #102d4d, #23579a 60%, #102d4d);
  border-bottom: 2px solid var(--ladbs-hat);
}
html.light .topbar {
  background: linear-gradient(90deg, #ffffff, #e6e6e6 60%, #ffffff);
  border-bottom: 2px solid var(--ladbs-hat);
}
html.light .topbar h1, html.light .topbar p { color: var(--text); }
.topbar h1 { color: #ffffff; }
.brand-mark { color: var(--ladbs-hat) !important; filter: drop-shadow(0 0 8px rgba(246, 197, 20, .7)); }
html.light .brand-mark { color: var(--ladbs-dusk) !important; filter: drop-shadow(0 0 5px rgba(35, 87, 154, .4)); }
.topbar .api-link { border-color: rgba(255, 255, 255, .28); color: #cddcf0; }
.topbar .api-link:hover { color: #fff; border-color: var(--ladbs-hat); }
html.light .topbar .api-link { border-color: rgba(16, 45, 77, .3); color: var(--ladbs-dusk); }
html.light .topbar .api-link:hover { color: var(--ladbs-navy); border-color: var(--ladbs-dusk); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.theme-btn { cursor: pointer; font-size: 15px; line-height: 1; background: transparent; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.brand:hover h1 { color: var(--ladbs-hat); }
html.light .brand:hover h1 { color: var(--ladbs-dusk); }
.brand-mark {
  font-size: 20px; color: var(--ladbs-hat);
  filter: drop-shadow(0 0 8px rgba(246, 197, 20, .7));
}
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand h1 {
  font: 400 15px "Archivo Black", "Inter", sans-serif;
  margin: 0; letter-spacing: .2px; text-transform: uppercase;
  line-height: 1.1;
}
.brand-tag {
  color: var(--muted); font: 500 10px/1.2 Inter, system-ui, sans-serif;
  letter-spacing: .02em; white-space: nowrap;
}
.brand .h-sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.api-link {
  color: var(--muted); text-decoration: none; font-size: 12.5px;
  border: 1px solid var(--surface2); padding: 4px 12px; border-radius: var(--radius-btn);
  transition: all .15s;
}
.api-link:hover { color: var(--text); border-color: var(--accent); }

/* ---------- omnibox: always floating top-left over the map ---------- */
.searchwrap {
  position: absolute;
  top: 55px; left: 12px;
  z-index: 1100;
  padding: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
/* Public-only City of LA bar (#744) sits above .topbar. Search is viewport-absolute,
   so shift it by that bar (~47px) to keep the same gap under the PRISM header as Internal. */
body:has(#global_navbar_la_4324422) .searchwrap,
body:has(#global_nav_la_4324422) .searchwrap {
  top: calc(55px + 47px);
}
.omnibox {
  position: relative;
  width: min(var(--panel-w), calc(100vw - 24px));
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 6px 8px 6px 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(1, 179, 215, .08);
  transition: box-shadow .2s, border-color .2s;
  box-sizing: border-box;
}
.omnibox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 8px 34px rgba(0, 0, 0, .55), 0 0 0 3px rgba(1, 179, 215, .3);
}
.omnibox input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--text); font: 500 15px "Inter", sans-serif;
  padding: 8px 4px;
  text-overflow: ellipsis;
}
.omnibox input::placeholder { color: #64748b; }
.mode-btn {
  width: 38px; height: 38px; border-radius: var(--radius-btn);
  border: 0; cursor: pointer; font-size: 19px; line-height: 1;
  background: var(--surface2); color: var(--accent);
  transition: all .15s;
}
.mode-btn:hover { background: var(--accent); color: var(--on-accent); }
.detected {
  flex-shrink: 0;
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
  color: var(--cta-text); background: var(--cta);
  padding: 4px 10px; border-radius: var(--radius-btn); white-space: nowrap;
  display: none;
  pointer-events: none;
}
.clear-btn {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 6px;
  visibility: hidden; /* keeps its slot so the Search button never shifts */
}
.clear-btn:hover { color: var(--danger); }
.go-btn {
  border: 0; cursor: pointer;
  background: var(--cta);
  color: var(--cta-text); font: 700 14px "Inter", sans-serif;
  padding: 10px 22px; border-radius: var(--radius-btn);
  transition: filter .15s, transform .1s;
}
.go-btn:hover { filter: brightness(1.08); }
.go-btn:active { transform: scale(.97); }

/* ---------- How-to: a small "?" button + popover, kept out of the way ---------- */
.howto-btn {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--surface2); cursor: pointer;
  background: transparent; color: var(--muted);
  font: 700 13px "Inter", sans-serif;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.howto-btn:hover, .howto-btn[aria-expanded="true"] {
  color: var(--ladbs-navy); background: var(--ladbs-hat); border-color: var(--ladbs-hat);
}
.howto-pop {
  position: absolute; top: 54px; right: 0;
  width: min(360px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-left: 4px solid var(--ladbs-hat);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  box-sizing: border-box;
  overflow: hidden;
  z-index: 1200;
}
.howto-pop[hidden] { display: none; }
.howto-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px 10px 14px;
  font: 700 13.5px "Inter", sans-serif;
  color: var(--text);
  border-bottom: 1px solid var(--surface2);
}
.howto-close {
  margin-left: auto; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 4px;
}
.howto-close:hover { color: var(--danger); }
.howto-ic {
  color: var(--ladbs-navy); background: var(--ladbs-hat);
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.howto-body {
  padding: 4px 16px 14px;
  font: 400 13px/1.55 "Inter", sans-serif;
  color: var(--text);
  max-height: min(52vh, 440px); overflow-y: auto;
}
.howto-body p { margin: 10px 0; }
.howto-body .howto-lead { font-weight: 600; margin-bottom: 4px; }
.howto-body ul { margin: 6px 0 10px; padding-left: 18px; }
.howto-body li { margin: 4px 0; }
.howto-body b { color: var(--accent); font-weight: 600; }
html.light .howto-body b { color: var(--ladbs-dusk); }

/* mode menu — full search-bar width with structured forms */
.mode-menu {
  position: absolute; top: 54px; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  overflow: hidden; display: none;
}
.mode-menu.open { display: block; }
.mm-modes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--surface2);
}
.mm-modes button {
  border: 1px solid var(--surface2); cursor: pointer;
  background: transparent; color: var(--text);
  font: 500 12px "Inter", sans-serif; padding: 8px 6px;
  border-radius: var(--radius-btn); transition: all .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.mm-modes button:hover { border-color: var(--accent); }
.mm-modes button.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.mm-form { padding: 10px 12px 12px; }
.mm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mm-span2 { grid-column: span 2; }
.mm-span3 { grid-column: span 3; }
.mm-grid input, .mm-grid select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--surface2); border-radius: 8px;
  font: 400 13px "Inter", sans-serif; padding: 8px 10px;
  box-sizing: border-box; width: 100%;
}
.mm-grid input:focus, .mm-grid select:focus { outline: none; border-color: var(--accent); }
.mm-grid input::placeholder { color: var(--muted); opacity: .7; }
.mm-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px;
}
.mm-note { color: var(--muted); font-size: 11px; line-height: 1.4; }
.mm-actions button[type=submit] {
  border: 0; cursor: pointer; flex-shrink: 0;
  background: var(--cta);
  color: var(--cta-text); font: 700 13px "Inter", sans-serif;
  padding: 8px 22px; border-radius: var(--radius-btn);
}
.mm-actions button[type=submit]:hover { filter: brightness(1.08); }

/* suggestions */
.suggestions {
  position: absolute; top: 54px; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  overflow: hidden; display: none;
}
.suggestions.open { display: block; }
.suggestion {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; cursor: pointer; font-size: 14px;
}
.suggestion:hover, .suggestion.sel { background: var(--surface2); }
.suggestion .s-label b { color: var(--info); }
.suggestion .s-sub { color: var(--muted); font-size: 11.5px; }
.s-chip {
  font-size: 10px; font-weight: 700; letter-spacing: .6px;
  padding: 3px 8px; border-radius: var(--radius-btn); margin-right: 10px;
}
.s-chip.address  { background: rgba(35, 87, 154,.18);  color: #7fb1ff; }
.s-chip.docnbr   { background: rgba(239,68,68,.16);   color: #fca5a5; }
.s-chip.legal    { background: rgba(34,197,94,.15);   color: #86efac; }
.s-chip.assessor { background: rgba(245,158,11,.15);  color: #fcd34d; }

/* ---------- home mode: results panel hidden ---------- */
body.home footer { display: none; }

/* ---------- workspace: full-bleed map + floating overlay panel ---------- */
.workspace {
  flex: 1;
  display: flex;
  padding: 0;
  min-height: 0;
  position: relative;
}
.panel {
  position: relative;
  width: min(calc(70vw - 20px), 1320px); /* results dominate; map is a focused inset */
  flex-shrink: 0;
  margin: 70px 10px 10px 12px; /* clears the floating omnibox with a small gap */
  z-index: 1050;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel-bg);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .5);
  padding: 12px 10px 10px 10px;
  box-sizing: border-box;
  transition: width .25s ease;
}
.panel[hidden] { display: none; }
/* table view is even wider (data table wants horizontal room) */
body.table-view .panel { width: calc(80vw - 20px); }
.panel.user-sized,
body.table-view .panel.user-sized {
  width: var(--panel-user-w);
  transition: none;
}
.panel-resizer {
  position: absolute;
  top: 0;
  right: -6px;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  z-index: 1060;
  touch-action: none;
}
.panel-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 4px;
  height: 48px;
  margin-top: -24px;
  border-radius: 2px;
  background: var(--surface2);
}
.panel-resizer:hover::after,
.panel-resizer:focus-visible::after,
body.panel-resizing .panel-resizer::after {
  background: var(--ladbs-hat);
}
body.panel-resizing { cursor: col-resize; user-select: none; }
body.panel-resizing .panel { transition: none; will-change: width; }
body.panel-resizing .map-wrap { pointer-events: none; }
body.panel-resizing .results-list { overflow: hidden; }

/* cards view: flow cards into responsive columns so the wide panel is used well */
body:not(.table-view) .results-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
  align-content: start;
}
body:not(.table-view) .results-list > .empty { grid-column: 1 / -1; }
/* an expanded card claims the full row so its detail panel has room */
body:not(.table-view) .results-list > .card:has(.card-detail.open) { grid-column: 1 / -1; }

.panel-tools {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
}
.panel-tools .results-head { flex: 1; min-width: 140px; }
/* Two distinct button groups: view-mode selection, then result actions —
   kept visually separate so they read as different kinds of controls. */
.view-toggle, .result-actions {
  display: flex; gap: 4px; padding: 3px;
  background: var(--surface); border: 1px solid var(--surface2); border-radius: var(--radius-btn);
  margin-bottom: 10px;
}
.view-toggle button, .result-actions button {
  border: 0; cursor: pointer; background: transparent; color: var(--muted);
  font-size: 14px; line-height: 1; padding: 6px 12px; border-radius: var(--radius-btn);
}
.view-toggle button.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.result-actions:not(:has(button:not([hidden]))) { display: none; }
.results-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
  padding: 2px 4px 10px;
}
.result-mode-chip { color: var(--accent2-text); font-weight: 700; }
.results-head .count { color: var(--text); font-weight: 700; font-size: 14.5px; }
.fallback-note { color: var(--accent2-text); font-size: 12px; }
.results-list {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
}
.results-list::-webkit-scrollbar { width: 8px; }
.results-list::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 8px; }

.map-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 0;
}
#map {
  flex: 1;
  min-width: 0;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: none;
}
/* Carto Dark Matter / Positron look without a Carto API key */
#map.basemap-dark .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.92) saturate(0.3);
}
#map.basemap-light .leaflet-tile-pane {
  filter: grayscale(1) brightness(1.12) contrast(0.86);
}
/* rounded map edge + inset when the panel is showing */
.panel:not([hidden]) ~ .map-wrap {
  border-radius: var(--radius);
  margin: 70px 10px 10px 0;
  border: 1px solid var(--surface2);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .35);
  overflow: hidden;
}
/* #717 map search loading indicator */
.map-loading {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(11, 32, 56, 0.48);
  color: #f4f7fb;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  pointer-events: none;
}
html.light .map-loading {
  background: rgba(230, 230, 230, 0.55);
  color: var(--ladbs-navy);
}
.map-loading[hidden] { display: none !important; }
.map-loading .ag-spin {
  width: 22px; height: 22px;
  border-width: 3px;
  border-color: rgba(255,255,255,.35);
  border-top-color: var(--ladbs-hat);
}
html.light .map-loading .ag-spin {
  border-color: rgba(16,45,77,.25);
  border-top-color: var(--ladbs-dusk);
}
.leaflet-container { background: #0b1120; font-family: "Inter", sans-serif; }
html.light .leaflet-container { background: #dfe8f2; }
/* parcels are clickable at high zoom — advertise it */
.leaflet-container.parcels-clickable { cursor: pointer; }
.leaflet-container.parcels-clickable.leaflet-drag-target,
.leaflet-container.parcels-clickable:active { cursor: grabbing; }
/* Clicking a parcel focuses the SVG path; browsers draw a black bbox outline. */
.leaflet-overlay-pane svg:focus,
.leaflet-overlay-pane path:focus,
.leaflet-interactive:focus {
  outline: none;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--surface); color: var(--text);
}

/* map controls: basemap / layers / legend */
.map-ctrl { position: relative; }
.map-ctrl-btn {
  display: flex !important; align-items: center; justify-content: center;
  font-size: 1.25rem; text-decoration: none !important; cursor: pointer;
  background: var(--surface) !important; color: var(--text) !important;
}
/* Accessibility: size the right-side controls in rem so they enlarge with the
   browser zoom / root font-size and meet a ~44px touch target. The
   `.leaflet-touch` prefix + !important override Leaflet's own 30px rules. */
.leaflet-touch .leaflet-bar a,
.leaflet-touch .leaflet-control-zoom a,
.leaflet-bar a,
.map-ctrl-btn {
  width: 2.6rem !important; height: 2.6rem !important; line-height: 2.6rem !important;
}
.leaflet-touch .leaflet-control-zoom a,
.leaflet-control-zoom a { font-size: 1.5rem !important; font-weight: 700; }
.map-ctrl-panel {
  display: none;
  position: absolute; right: 2.9rem; top: 0;
  min-width: 180px;
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  padding: 6px 0 8px;
}
.map-ctrl.expanded .map-ctrl-panel { display: block; }
.map-ctrl-head {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
  padding: 4px 12px 6px; border-bottom: 1px solid var(--surface2);
  margin-bottom: 4px;
}
.map-ctrl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 0.5rem 0.85rem; font-size: 0.9rem; color: var(--text);
  white-space: nowrap; cursor: pointer;
}
.map-ctrl-row:hover { background: var(--surface2); }
.map-ctrl-row input { accent-color: var(--accent); width: 1rem; height: 1rem; }
.legend-row { cursor: default; }
.legend-row:hover { background: none; }
.legend-swatch {
  width: 20px; height: 14px; border-radius: 3px; flex-shrink: 0;
  display: inline-block; font-size: 12px; line-height: 14px; text-align: center;
}
html.light .s-chip.address  { color: #1d4ed8; }
html.light .s-chip.docnbr   { color: #b91c1c; }
html.light .s-chip.legal    { color: #15803d; }
html.light .s-chip.assessor { color: #b45309; }
html.light .chip { color: #1d4ed8; }
html.light .chip.green { color: #15803d; }

/* ---------- table view ---------- */
.rtable-wrap {
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: var(--radius); overflow: auto; flex-shrink: 0;
}
.rtable { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.rtable thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface2); color: var(--muted);
  text-align: left; font-weight: 600; font-size: 11px;
  letter-spacing: .6px; text-transform: uppercase;
  padding: 9px 12px; white-space: nowrap;
  overflow: hidden;
}
.rtable thead tr:first-child th { overflow: visible; }
.th-resizer {
  position: absolute;
  top: 0;
  right: -8px;
  width: 16px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
  touch-action: none;
}
.th-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text) 38%, transparent);
  box-shadow: 3px 0 0 color-mix(in srgb, var(--text) 22%, transparent);
  opacity: .85;
  transition: background .12s, box-shadow .12s, opacity .12s, top .12s, bottom .12s;
}
.th-resizer:hover::after,
body.col-resizing .th-resizer::after,
body.dcol-resizing .th-resizer:hover::after {
  top: 4px;
  bottom: 4px;
  background: var(--ladbs-hat, #c4a35a);
  box-shadow: 3px 0 0 var(--ladbs-hat, #c4a35a);
  opacity: 1;
}
.th-sort-wrap {
  display: inline-flex; align-items: center; gap: 3px;
  max-width: 100%;
}
.th-sort {
  cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 6px; margin: -2px -2px -2px -6px; border-radius: 6px;
  transition: background .12s, color .12s;
}
.th-sort:hover { color: var(--text); background: rgba(35, 87, 154, .14); }
.th-arrow { font-size: 10px; color: var(--muted); opacity: .55; min-width: 11px; }
.th-arrow.active { color: var(--accent2-text); opacity: 1; }
.th-prio {
  font-size: 8.5px; font-weight: 700; color: var(--accent2-text);
  min-width: 7px; margin-left: 1px;
}

.rtable thead .filter-row th {
  top: 33px; /* sticks below the label row */
  background: var(--surface);
  padding: 0 12px 7px;
  border-bottom: 2px solid var(--surface2);
  overflow: visible;
}
.th-filter-wrap { position: relative; }
.th-filter-btn {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--muted); cursor: pointer;
  border: 0; border-bottom: 1px solid var(--surface2);
  font: 400 12px "Inter", sans-serif; padding: 3px 16px 3px 2px;
  text-transform: none; letter-spacing: normal;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
.th-filter-btn:hover { color: var(--text); border-bottom-color: var(--accent); }
.th-filter-btn.filtered { color: var(--accent2-text); font-weight: 600; }
.th-filter-menu {
  display: none;
  position: fixed; /* escapes the table's overflow clipping */
  z-index: 3000;
  min-width: 200px; max-width: 320px; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  padding: 4px 0;
}
.th-filter-menu.open { display: block; }
.fm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; font: 400 12.5px "Inter", sans-serif;
  color: var(--text); cursor: pointer; white-space: nowrap;
  text-transform: none; letter-spacing: normal;
}
.fm-row:hover { background: var(--surface2); }
.fm-row input { accent-color: var(--accent); }
.fm-all { border-bottom: 1px solid var(--surface2); color: var(--muted); }
.fm-foot {
  position: sticky; bottom: 0;
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border-top: 1px solid var(--surface2);
}
.fm-foot button {
  border: 1px solid var(--surface2); border-radius: var(--radius-btn);
  background: transparent; color: var(--text); cursor: pointer;
  font: 600 11.5px "Inter", sans-serif; padding: 4px 14px;
  text-transform: none; letter-spacing: normal;
}
.fm-foot button:hover { border-color: var(--accent); }
.fm-foot [data-fdone] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.pp-label {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12.5px;
}
.pp-label select {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--surface2); border-radius: 8px;
  font: 500 12.5px "Inter", sans-serif; padding: 5px 8px; cursor: pointer;
}
.pp-page { color: var(--muted); font-size: 12.5px; }
.rtable tbody td {
  padding: 9px 12px; border-top: 1px solid var(--surface2);
  vertical-align: top;
}
.rtable tbody tr.data-row td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rtable tbody tr.data-row { cursor: pointer; }
.rtable tbody tr.data-row:hover { background: rgba(35, 87, 154,.08); }
.rtable tbody tr.data-row.active { background: rgba(245,158,11,.10); }
.t-chev, .t-chev-h { width: 24px; padding-right: 0 !important; }
.chev {
  display: inline-block; color: var(--muted); font-size: 12px;
  transition: transform .15s ease;
}
.chev.open { transform: rotate(90deg); color: var(--accent2-text); }
.rtable tbody tr.data-row:hover .chev { color: var(--text); }
.rtable .t-addr { color: var(--info); }
.rtable .t-date, .rtable .t-class { white-space: nowrap; color: var(--muted); }
.rtable a.a-pdf, .rtable a.a-detail { padding: 4px 10px; font-size: 11.5px; }
.rtable tr.detail-row > td { background: var(--bg); padding: 10px 14px; }
/* table view is wide — pack detail sections into columns to save vertical space */
.rtable tr.detail-row .card-detail {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px 8px;
  align-items: flex-start;
  border-top: 0; margin-top: 0; padding-top: 0;
}
.rtable tr.detail-row .d-section {
  flex: 1 1 var(--d-col-w, 340px);
  min-width: 200px;
  max-width: 100%;
  box-sizing: border-box;
}
.rtable tr.detail-row .d-section.user-sized {
  flex: 0 0 var(--d-col-w);
  width: var(--d-col-w);
  max-width: 100%;
}
.rtable tr.detail-row .kv,
.rtable tr.detail-row .kv-v { font-size: 12px; }
.rtable tr.detail-row .kv { padding: 1px 0; }
.rtable tr.detail-row .kv-l { min-width: 110px; }
.rtable tr.detail-row .d-section h3 { margin-bottom: 3px; padding-bottom: 3px; }

/* ---------- result cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
  cursor: pointer;
  flex-shrink: 0;
}
.card.active { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2); }
.card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--card-hover);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
}
.card .c-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .c-type { font-weight: 600; font-size: 14px; }
.card .c-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.card .c-addr { color: var(--info); font-size: 13px; margin: 6px 0 2px; }
.card .c-meta { color: var(--muted); font-size: 12px; }
.card .c-actions { margin-top: 10px; display: flex; gap: 8px; }
.card .c-actions a {
  font-size: 12px; font-weight: 600; text-decoration: none;
  padding: 6px 12px; border-radius: var(--radius-btn);
}
.a-detail { color: var(--text); background: var(--surface2); }
.a-detail:hover { background: #324158; }
html.light .a-detail:hover { background: #cbd5e1; }
.a-pdf {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  color: #fff; background: linear-gradient(135deg, var(--danger), #b91c1c);
  border-radius: var(--radius-btn); text-decoration: none;
  font-weight: 600; line-height: 1;
}
.a-pdf:hover { filter: brightness(1.15); }
.rtable a.a-pdf { padding: 5px 12px; font-size: 11.5px; white-space: nowrap; }
.a-map { color: var(--text); background: rgba(34,197,94,.15); }
.a-map:hover { background: rgba(34,197,94,.3); }

/* collapsible card details */
.card-detail {
  display: none;
  margin-top: 10px;
  border-top: 1px solid var(--surface2);
  padding-top: 10px;
  flex-direction: column;
  gap: 12px;
  cursor: default;
}
.card-detail.open { display: flex; }

.d-toolbar { display: flex; gap: 8px; align-items: stretch; }
.d-toolbar .a-pdf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 600; text-decoration: none; line-height: 1;
  padding: 8px 14px; border-radius: var(--radius-btn);
  color: #fff; background: linear-gradient(135deg, var(--danger), #b91c1c);
}
.a-print {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 12px "Inter", sans-serif; cursor: pointer; line-height: 1;
  padding: 8px 14px; border-radius: var(--radius-btn);
  border: 1px solid var(--surface2); background: var(--surface); color: var(--text);
}
.a-print:hover { border-color: var(--accent); }
.card .c-actions .a-print { padding: 6px 12px; font-size: 12px; }
.rtable .a-print-sm { padding: 5px 9px; font-size: 12px; margin-left: 4px; }

.d-section {
  position: relative;
  padding-right: 10px;
  overflow: hidden;
  min-width: 0;
}
.d-section h3 {
  margin: 0 0 5px; font-size: 11px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase; color: var(--accent2-text);
  border-bottom: 1px solid var(--surface2); padding-bottom: 4px;
}
.d-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  touch-action: none;
}
.d-col-resizer::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 4px;
  width: 2px;
  border-radius: 1px;
  background: var(--surface2);
}
.d-col-resizer:hover::after,
.d-col-resizer:focus-visible::after,
body.dcol-resizing .d-col-resizer:hover::after {
  background: var(--ladbs-hat);
}
body.dcol-resizing { cursor: col-resize; user-select: none; }
body:not(.table-view) .d-col-resizer { display: none; }
.kv { display: flex; gap: 10px; padding: 1.5px 0; font-size: 12.5px; min-width: 0; }
.kv-l { min-width: 150px; color: var(--muted); flex-shrink: 0; }
.kv-v { color: var(--text); overflow-wrap: break-word; word-break: normal; min-width: 0; font-size: 12.5px; }
.kv-row3 { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.kv-row3 .kv { flex: 1 1 140px; min-width: 0; }
.kv-row3 .kv-l { min-width: auto; }
.d-legal { padding: 4px 0 6px; border-bottom: 1px dashed var(--surface2); }
.d-legal:last-child { border-bottom: 0; }
.fm-n { color: var(--muted); font-size: 11px; }
.d-link { color: var(--info); text-decoration: none; font-family: ui-monospace, monospace; font-size: 11.5px; }
.d-link:hover { text-decoration: underline; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px 0 4px; flex-wrap: wrap; }
.back-btn {
  border: 1px solid var(--surface2); background: var(--surface);
  color: var(--info); font: 600 13px "Inter", sans-serif;
  padding: 8px 18px; border-radius: var(--radius-btn); cursor: pointer;
}
.back-btn:hover { border-color: var(--accent); }
.pager button {
  border: 1px solid var(--surface2); background: var(--surface);
  color: var(--text); font: 500 13px "Inter", sans-serif;
  padding: 9px 20px; border-radius: var(--radius-btn); cursor: pointer;
}
.pager button:hover { border-color: var(--accent); }

.empty {
  text-align: center; color: var(--muted);
  padding: 40px 20px; background: var(--surface); border-radius: var(--radius);
}

footer { display: none; }

/* Mobile nav hamburger (#678) */
.nav-toggle {
  display: none;
  border: 1px solid var(--surface2); background: var(--rail); color: var(--text);
  width: 36px; height: 34px; border-radius: var(--radius-btn); cursor: pointer;
  font-size: 18px; line-height: 1; align-items: center; justify-content: center;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1400; background: rgba(4,12,24,.45);
}
body.nav-open .nav-backdrop { display: block; }

@media (max-width: 860px) {
  body { overflow: auto; height: auto; min-height: 100vh; }
  .workspace { flex-direction: column; min-height: calc(100vh - 43px); }
  .map-wrap, #map { min-height: 45vh; }
  .omnibox { width: calc(100vw - 24px); }
  .detected { display: none !important; }
  .nav-toggle { display: inline-flex; }
  .topbar { position: relative; }
  .top-actions {
    display: none;
    position: absolute; right: 10px; top: calc(100% + 6px); z-index: 1500;
    flex-direction: column; align-items: stretch; gap: 6px;
    min-width: 200px; padding: 10px;
    background: var(--panel-bg); border: 1px solid var(--surface2);
    border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.45);
  }
  body.nav-open .top-actions { display: flex; }
  .top-actions .api-link, .top-actions .theme-btn {
    width: 100%; justify-content: flex-start; text-align: left;
  }

  /* after a search: compact map inset on top, results take over the screen */
  .panel-resizer { display: none; }
  .panel:not([hidden]), body.table-view .panel:not([hidden]),
  .panel.user-sized, body.table-view .panel.user-sized {
    order: 2;
    width: auto; margin: 8px; padding-top: 10px;
    max-height: none; flex: 1 0 auto;
  }
  .panel:not([hidden]) ~ .map-wrap {
    order: 1;
    flex: none;
    height: 34vh; min-height: 34vh;
    margin: 55px 8px 8px; /* clear the floating omnibox */
  }
  /* single-column cards on phones */
  body:not(.table-view) .results-list { grid-template-columns: 1fr; }
}

/* ---------- document detail page ---------- */
.back-link {
  color: var(--info); text-decoration: none; font-size: 13px;
  display: inline-block; margin: 0 0 10px 4px;
}
.back-link:hover { text-decoration: underline; }
.detail-title { margin: 0 0 2px 4px; font: 400 20px "Archivo Black", "Inter", sans-serif; }
.detail-sub { margin: 0 0 12px 4px; color: var(--muted); font-size: 13px; }
.detail-block {
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: var(--radius); padding: 14px 16px; flex-shrink: 0;
}
.detail-block h3 {
  margin: 0 0 8px; font-size: 12px; font-weight: 600;
  letter-spacing: .8px; text-transform: uppercase; color: var(--muted);
}
.detail-block ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.detail-block li { padding: 6px 10px; background: var(--surface2); border-radius: 8px; margin-bottom: 6px; }
.detail-block .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-block .chip {
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: var(--radius-btn);
  background: rgba(35, 87, 154,.16); color: #7fb1ff;
}
.detail-block .chip.green { background: rgba(34,197,94,.14); color: #86efac; }
.detail-block dl { margin: 0; font-size: 13px; }
.detail-block dl div { display: flex; justify-content: space-between; padding: 4px 0; gap: 14px; }
.detail-block dt { color: var(--muted); }
.detail-block dd { margin: 0; font-family: ui-monospace, monospace; font-size: 12px; text-align: right; word-break: break-all; }
.pdf-btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: linear-gradient(135deg, var(--danger), #b91c1c); color: #fff;
  font: 600 14px "Inter", sans-serif; padding: 11px 22px; border-radius: var(--radius-btn);
  margin: 2px 0 12px 4px;
}
.pdf-btn:hover { filter: brightness(1.15); }
.muted-note { color: var(--muted); font-size: 12.5px; }

/* ===== added legacy features: date row, advanced form, batch, variations, help ===== */

/* date-range row inside the + search forms (feature 2) */
.mm-daterow {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.mm-dlabel { color: var(--muted); font-size: 11.5px; flex-shrink: 0; min-width: 34px; }
.mm-dsep { color: var(--muted); font-size: 12px; }
.mm-daterow input[type=date] {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--surface2); border-radius: 8px;
  font: 400 12.5px "Inter", sans-serif; padding: 6px 8px;
  flex: 1 1 0; min-width: 0;
}
.mm-daterow input[type=date]:focus { outline: none; border-color: var(--accent); }
html:not(.light) .mm-daterow input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .6; }

/* external-link chips in the header (feature 6) */
.ext-link { white-space: nowrap; }

/* address-variation intermediate bar (feature 5) — recessed "filter rail" */
/* ---- Slim address control (post-gate) ---- */
.variations-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px 7px 12px; margin-bottom: 8px;
  border: 1px solid var(--surface2); border-left: 3px solid var(--accent);
  background: var(--rail); border-radius: var(--radius); flex-shrink: 0;
}
/* [hidden] loses to display:flex above — without this, empty bars show under results head (#654) */
.variations-bar[hidden],
.batch-bar[hidden],
.parcel-panel[hidden],
.records-note[hidden] { display: none !important; }
.vb-cur { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--text); font-size: 13px; }
.vb-cur b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-pin { flex: 0 0 auto; }
.vb-n { color: var(--muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.vb-change {
  margin-left: auto; flex: 0 0 auto; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  font: 600 12px "Inter", sans-serif; padding: 5px 12px; border-radius: var(--radius-btn);
  transition: background .12s, color .12s;
}
.vb-change:hover { background: var(--accent); color: var(--on-accent); }
.vb-count {
  display: inline-block; margin-left: 5px; background: var(--surface2); color: var(--text);
  border-radius: 999px; padding: 0 6px; font-size: 10.5px; font-weight: 700;
}
.vb-change:hover .vb-count { background: rgba(16,45,77,.25); }

/* ---- Address disambiguation gate ---- */
.ag-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
  color: var(--text); font-size: clamp(18px, 2.4vw, 28px); font-weight: 600;
  padding: 48px 20px; line-height: 1.35;
}
.ag-loading .ag-spin {
  width: 56px; height: 56px; border-width: 5px; flex-shrink: 0;
}
.results-list:has(> .ag-loading) {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ag-spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--surface2); border-top-color: var(--accent);
  animation: agspin .7s linear infinite;
}
@keyframes agspin { to { transform: rotate(360deg); } }
.addr-gate {
  max-width: 720px; margin: 4px auto; display: flex; flex-direction: column; gap: 12px;
}
.ag-head { text-align: center; padding: 6px 4px 2px; }
.ag-title { font: 400 18px "Archivo Black", "Inter", sans-serif; color: var(--text); }
.ag-title b { color: var(--accent); }
.ag-sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.ag-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 2px;
}
.ag-actions .ag-all, .ag-actions .ag-view {
  margin-top: 0; width: auto; min-width: min(100%, 280px); flex: 1 1 220px;
}
.ag-view {
  cursor: pointer;
  background: var(--ladbs-hat); border: 1px solid var(--ladbs-hat); color: var(--ladbs-navy);
  font: 600 12.5px "Inter", sans-serif; padding: 11px 14px; border-radius: var(--radius);
}
.ag-view:hover { filter: brightness(1.06); }
.ag-view:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.ag-list { display: flex; flex-direction: column; gap: 6px; }
.ag-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  background: var(--card); border: 1px solid var(--surface2); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; text-align: left;
  transition: border-color .12s, background .12s, transform .06s;
  user-select: none;
}
.ag-item:hover { border-color: var(--accent); background: var(--rail); }
.ag-item:active { transform: scale(.995); }
.ag-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ag-left { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ag-check {
  flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--ladbs-hat); cursor: pointer;
}
.ag-addr {
  display: inline-flex; align-items: center; gap: 9px; min-width: 0;
  font: 600 14px "Inter", sans-serif; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ag-pin { flex: 0 0 auto; }
.ag-n { flex: 0 0 auto; color: var(--accent); font: 700 13px "Inter", sans-serif; white-space: nowrap; }
.ag-n i { color: var(--muted); font-style: normal; font-weight: 500; font-size: 11.5px; }
.ag-all {
  margin-top: 4px; width: 100%; cursor: pointer;
  background: var(--rail); border: 1px dashed var(--surface2); color: var(--muted);
  font: 600 12.5px "Inter", sans-serif; padding: 11px 14px; border-radius: var(--radius);
  transition: border-color .12s, color .12s;
}
.ag-all:hover { border-color: var(--accent); color: var(--text); }
.ag-all-bottom { margin-top: 2px; }

/* batch selection toolbar (feature 4) */
.batch-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-bottom: 2px solid var(--surface2);
  border-left: 3px solid var(--cta);
  background: var(--rail);
  position: sticky; top: 0; z-index: 4;
}
.bb-count { font-size: 12.5px; color: var(--text); font-weight: 600; }
.bb-actions { display: flex; gap: 8px; }
.bb-print {
  border: 0; cursor: pointer;
  background: var(--ladbs-dusk); color: #fff;
  font: 600 12px "Inter", sans-serif; padding: 7px 14px; border-radius: var(--radius-btn);
}
.bb-print:hover { filter: brightness(1.12); }
.bb-print:disabled { opacity: .6; cursor: default; }
.bb-clear {
  border: 1px solid var(--surface2); background: transparent; color: var(--muted);
  font: 500 12px "Inter", sans-serif; padding: 7px 12px; border-radius: var(--radius-btn); cursor: pointer;
}
.bb-clear:hover { color: var(--text); border-color: var(--danger); }

/* row / card select checkboxes */
.c-sel { display: inline-flex; align-items: center; margin-right: 6px; cursor: pointer; }
.c-sel input, .row-sel { cursor: pointer; accent-color: var(--accent); }
.t-sel-h, .t-sel { text-align: center; width: 30px; }
.t-sel input { accent-color: var(--accent); }

/* ---------- help / FAQ page (feature 6) ---------- */
.help-wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.help-title { font: 400 24px "Archivo Black", "Inter", sans-serif; margin: 8px 0 6px; }
.help-lead { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 22px; max-width: 70ch; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .help-grid { grid-template-columns: 1fr; } }
.help-col {
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: var(--radius); padding: 16px 18px;
}
.help-col h3 { margin: 0 0 8px; font-size: 15px; color: var(--accent); }
.help-col h3 + h3 { margin-top: 16px; }
.help-list { margin: 0; padding-left: 18px; color: var(--text); font-size: 13px; line-height: 1.7; }
.help-list code, .help-lead code {
  background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: 12px;
}
.help-tip { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.help-video { margin-top: 26px; }
.help-video h3, .help-links h3 { font-size: 16px; margin: 0 0 12px; }
.help-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--surface2);
}
.help-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.help-links { margin-top: 26px; }
.help-linkrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.help-card {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text);
  transition: border-color .12s;
}
.help-card:hover { border-color: var(--accent); }
.help-card b { font-size: 14px; }
.help-card span { color: var(--muted); font-size: 12px; }
.help-foot { color: var(--muted); font-size: 13px; margin-top: 26px; line-height: 1.6; }
.help-foot a { color: var(--info); }

.print-list-btn { cursor: pointer; }
.parcel-btn { cursor: pointer; }

/* parcel-data panel: aggregated identifiers for a parcel */
.parcel-panel {
  margin-bottom: 8px; flex-shrink: 0;
  border: 1px solid var(--surface2); border-left: 3px solid var(--accent2);
  background: var(--rail); border-radius: var(--radius);
  overflow: hidden;
}
.pp-loading { padding: 12px 14px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.pp-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-bottom: 1px solid var(--surface2);
}
.pp-head b { font-size: 13px; color: var(--text); }
.pp-sub { font-size: 12px; color: var(--muted); flex: 1 1 auto; min-width: 0; }
.pp-close {
  cursor: pointer; border: 1px solid var(--surface2); background: var(--surface);
  color: var(--muted); border-radius: var(--radius-btn); width: 24px; height: 24px;
  line-height: 1; font-size: 13px;
}
.pp-close:hover { color: var(--text); border-color: var(--accent); }
.pp-body { padding: 4px 12px 12px; max-height: 40vh; overflow: auto; }
.pp-sect { margin-top: 10px; }
.pp-sect h5 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pp-n { color: var(--accent2-text); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-chip {
  cursor: pointer; font-size: 12.5px; padding: 4px 10px;
  border: 1px solid var(--surface2); background: var(--surface);
  color: var(--text); border-radius: var(--radius-btn); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-chip:hover { border-color: var(--accent); color: var(--accent); }

/* records-counter locations + hours (DB-driven) */
.ctr-wrap { margin-top: 20px; }
.ctr-title { font-size: 14px; margin: 0 0 10px; color: var(--text); }
.ctr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ctr-card {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: 12px; padding: 14px 16px;
}
.ctr-card b { font-size: 13.5px; color: var(--text); }
.ctr-card span { color: var(--muted); font-size: 12.5px; }
.ctr-hours span { display: flex; justify-content: space-between; gap: 12px; }
.ctr-hours i { color: var(--text); font-style: normal; font-weight: 600; }
.ctr-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* doc pages (help / FAQ) scroll normally instead of the app's fixed workspace */
body.doc { height: auto; min-height: 100vh; overflow-y: auto; }

/* ============ Contact form ============ */
.contact-form {
  max-width: 760px; margin: 4px 0 8px;
  display: flex; flex-direction: column; gap: 16px;
}
.req { color: #ff5c8a; font-weight: 700; }
.cf-fieldset {
  border: 0; padding: 0; margin: 0; min-width: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.cf-fieldset > legend {
  font: 600 12.5px "Inter", sans-serif; color: var(--text);
  letter-spacing: .2px; padding: 0; margin: 0 0 2px;
  float: none; width: auto;
}
.cf-field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.cf-field > label {
  font: 600 12.5px "Inter", sans-serif; color: var(--text);
  letter-spacing: .2px; padding: 0;
}
/* Only style real text fields — never radio/checkbox inputs inside the recipient cards */
.cf-field > input[type="text"],
.cf-field > input[type="email"],
.cf-field > input[type="tel"],
.cf-field > textarea {
  width: 100%; box-sizing: border-box;
  min-height: 42px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--surface2); border-radius: var(--radius-btn);
  padding: 10px 12px; font: 400 14px "Inter", sans-serif;
  transition: border-color .12s, box-shadow .12s;
}
.cf-field > textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.cf-field > input[type="text"]:focus,
.cf-field > input[type="email"]:focus,
.cf-field > input[type="tel"]:focus,
.cf-field > textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 179, 215, .22);
}
/* Show invalid styling only after the user has interacted (not on first paint) */
.cf-field > input:user-invalid,
.cf-field > textarea:user-invalid {
  border-color: rgba(255, 92, 138, .6);
}
.cf-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
}
.cf-radios { display: flex; flex-wrap: wrap; gap: 10px; }
.cf-radio {
  flex: 1 1 240px; display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.cf-radio:hover { border-color: var(--accent); }
.cf-radio > input[type="radio"] {
  width: 16px; height: 16px; margin: 3px 0 0; padding: 0;
  flex: 0 0 16px; accent-color: var(--accent);
  background: none; border: none; box-shadow: none;
}
.cf-radio:has(input:checked) { border-color: var(--accent); background: var(--rail); }
.cf-radio span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cf-radio b { font: 600 13.5px "Inter", sans-serif; color: var(--text); }
.cf-radio small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.cf-error {
  margin: 0; color: #ffb4c8; background: rgba(255, 92, 138, .12);
  border: 1px solid rgba(255, 92, 138, .4); border-radius: var(--radius-btn);
  padding: 9px 12px; font-size: 12.5px;
}
html.light .cf-error { color: #9f1239; background: rgba(255, 92, 138, .1); }
.cf-ok {
  margin: 0; color: #9ff0c4; background: rgba(11, 122, 59, .16);
  border: 1px solid rgba(11, 122, 59, .5); border-radius: var(--radius-btn);
  padding: 9px 12px; font-size: 12.5px;
}
html.light .cf-ok { color: #166534; background: rgba(11, 122, 59, .1); }
.cf-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.cf-send {
  cursor: pointer; border: 1px solid var(--ladbs-hat);
  background: var(--ladbs-hat); color: var(--ladbs-navy);
  font: 700 14px "Inter", sans-serif; padding: 11px 22px;
  border-radius: var(--radius-btn); transition: filter .12s;
}
.cf-send:hover { filter: brightness(1.08); }
.cf-send:disabled { opacity: .65; cursor: wait; }
.cf-note { color: var(--muted); font-size: 12.5px; }
.cf-note b { color: var(--text); }
@media (max-width: 620px) {
  .cf-grid { grid-template-columns: 1fr; }
}

/* ============ Absence-of-records disclaimer ============ */
.records-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--rail); border: 1px solid var(--surface2);
  border-radius: var(--radius); padding: 10px 12px; margin: 10px 0 4px;
  font-size: 12px; color: var(--muted); line-height: 1.5; flex-shrink: 0;
}
.records-note .rn-ic { color: var(--accent2-text); font-size: 14px; line-height: 1.3; flex-shrink: 0; }
.records-note b { color: var(--text); font-weight: 600; }
.records-note a { color: var(--accent); text-decoration: none; }
.records-note a:hover { text-decoration: underline; }

/* ============ Timeline view (dense year-gutter, scales to many records) ============ */
body.timeline-view .results-list { display: block; }
.tl { padding: 2px 2px 12px; }
.tl-grp {
  display: grid; grid-template-columns: 62px 1fr; gap: 10px;
  margin-bottom: 4px; align-items: start;
}
.tl-yr {
  position: sticky; top: 0; z-index: 2; align-self: start;
  display: flex; flex-direction: column; gap: 1px; padding: 4px 0 6px;
  background: linear-gradient(180deg, var(--panel-bg) 72%, transparent);
}
.tl-yrn {
  font: 400 15px "Archivo Black", "Inter", sans-serif;
  color: var(--ladbs-hat); letter-spacing: .5px; line-height: 1;
}
.tl-yrc { font-size: 10px; color: var(--muted); white-space: nowrap; }
.tl-rows { border-left: 2px solid var(--surface2); }
.tl-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 8px; padding: 5px 8px 5px 12px; position: relative;
  border-bottom: 1px solid var(--surface2);
}
.tl-row:last-child { border-bottom: 0; }
.tl-row:hover { background: var(--rail); }
.tl-row::before {
  content: ""; position: absolute; left: -6px; top: 50%; margin-top: -4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--surface2);
  border: 2px solid var(--panel-bg); transition: background .12s;
}
.tl-row:hover::before { background: var(--accent); }
.tl-row.active::before { background: var(--accent2); }
.tl-sel { display: inline-flex; }
.tl-main {
  display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%;
  background: none; border: 0; padding: 0; color: inherit; text-align: left;
  cursor: pointer; font: inherit;
}
.tl-date { flex: 0 0 auto; width: 52px; font: 600 12px "Inter", sans-serif; color: var(--accent); }
.tl-desc {
  flex: 0 1 auto; min-width: 0; font-size: 12.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-desc b { font-weight: 700; }
.tl-status {
  flex: 0 0 auto; font-size: 10px; text-transform: uppercase; letter-spacing: .4px;
  border: 1px solid var(--surface2); color: var(--muted); padding: 1px 7px; border-radius: 999px;
}
.tl-status.ok   { color: #34d399; border-color: rgba(52,211,153,.5);  background: rgba(52,211,153,.10); }
.tl-status.bad  { color: #f87171; border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.10); }
.tl-status.warn { color: #fbbf24; border-color: rgba(251,191,36,.5);  background: rgba(251,191,36,.10); }
html.light .tl-status.ok   { color: #047857; }
html.light .tl-status.bad  { color: #b91c1c; }
html.light .tl-status.warn { color: #b45309; }
.tl-addr {
  flex: 1 1 auto; min-width: 40px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-chev { flex: 0 0 auto; color: var(--muted); font-size: 10px; transition: transform .15s; }
.tl-row.active .tl-chev { transform: rotate(180deg); color: var(--accent2-text); }
.tl-side { display: flex; align-items: center; gap: 10px; }
/* Timeline PDF uses the same red button treatment as cards/table (#693) */
.tl-pdf {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 12px; font-size: 11.5px; font-weight: 600; line-height: 1;
  color: #fff; background: linear-gradient(135deg, var(--danger), #b91c1c);
  border-radius: var(--radius-btn); text-decoration: none; white-space: nowrap;
}
.tl-pdf:hover { filter: brightness(1.15); text-decoration: none; }

/* Card/timeline sort + filter toolbar (#710 / #711) */
.view-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--surface2);
  background: var(--rail); font-size: 12px;
}
.view-tools .vt-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.view-tools select {
  font: 500 12px "Inter", system-ui, sans-serif; color: var(--text);
  background: var(--surface); border: 1px solid var(--surface2);
  border-radius: var(--radius-btn); padding: 4px 8px;
}
.view-tools .vt-dir, .view-tools .vt-filter, .view-tools .vt-sort-mode, .view-tools .vt-clear-sort {
  font: 600 12px "Inter", system-ui, sans-serif; cursor: pointer;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--surface2); border-radius: var(--radius-btn);
  padding: 4px 10px;
}
.view-tools .vt-dir:hover, .view-tools .vt-filter:hover, .view-tools .vt-sort-mode:hover, .view-tools .vt-clear-sort:hover { border-color: var(--accent); }
.view-tools .vt-clear-sort:disabled { opacity: .45; cursor: default; }
.view-tools .vt-filter.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.view-tools .vt-hint { color: var(--muted); font-size: 11px; margin-left: auto; }
/* Table headers already sort — hide the duplicate Sort/Dir controls there. */
body.table-view .view-tools .vt-sort,
body.table-view .view-tools .vt-dir { display: none; }
.card-filter-panel {
  padding: 10px 12px; border-bottom: 1px solid var(--surface2);
  background: var(--panel-bg); max-height: 220px; overflow: auto;
}
.card-filter-panel .cfp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.card-filter-panel h5 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-filter-panel label { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; margin: 2px 0; cursor: pointer; }
.card-filter-panel .cfp-actions { display: flex; gap: 8px; margin-top: 10px; }
.card-filter-panel .cfp-actions button {
  font: 600 12px "Inter", system-ui, sans-serif; cursor: pointer;
  border-radius: var(--radius-btn); padding: 5px 12px; border: 1px solid var(--surface2);
  background: var(--surface); color: var(--text);
}
.card-filter-panel .cfp-actions button.primary { background: var(--cta); color: var(--cta-text); border-color: var(--cta); }
.th-sort .prio {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; margin-left: 4px; padding: 0 4px;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  background: var(--ladbs-hat); color: var(--ladbs-navy); vertical-align: middle;
}
.tl-print { background: none; border: 0; cursor: pointer; font-size: 13px; opacity: .55; padding: 0; }
.tl-print:hover { opacity: 1; }
.tl-row .card-detail { grid-column: 1 / -1; cursor: default; }
@media (max-width: 620px) {
  .tl-grp { grid-template-columns: 44px 1fr; gap: 6px; }
  .tl-main { flex-wrap: wrap; gap: 4px 8px; }
  .tl-addr { flex-basis: 100%; }
  .tl-side { flex-direction: column; gap: 4px; }
}

/* ============ Order-copies modal ============ */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(4, 12, 24, .62); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--surface2);
  border-top: 5px solid var(--ladbs-hat);
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px 10px;
}
.modal-head h2 { margin: 0; font: 400 17px "Archivo Black", "Inter", sans-serif; color: var(--text); }
.modal-x {
  border: 1px solid var(--surface2); background: var(--rail); color: var(--muted);
  width: 30px; height: 30px; border-radius: var(--radius-btn); cursor: pointer; font-size: 14px;
}
.modal-x:hover { color: var(--text); border-color: var(--accent); }
.modal-body { padding: 4px 20px 20px; }
.modal-lead { font-size: 13.5px; line-height: 1.55; color: var(--text); margin: 4px 0 14px; }
.modal-lead b { color: var(--accent); }
.modal-steps { margin: 0 0 14px; padding-left: 20px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.modal-steps > li { margin-bottom: 9px; }
.modal-steps b { color: var(--text); }
.modal-steps ul { margin: 5px 0 0; padding-left: 18px; }
.modal-note {
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
  background: var(--rail); border: 1px solid var(--surface2);
  border-left: 3px solid var(--accent2); border-radius: var(--radius); padding: 9px 12px; margin: 0 0 16px;
}
.modal-note b { color: var(--text); }
.modal-links { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-link {
  font: 600 13px "Inter", sans-serif; text-decoration: none;
  padding: 9px 16px; border-radius: var(--radius-btn);
  border: 1px solid var(--surface2); color: var(--text); background: var(--rail);
}
.modal-link:hover { border-color: var(--accent); }
.modal-link.cta { background: var(--ladbs-hat); border-color: var(--ladbs-hat); color: var(--ladbs-navy); }
.modal-link.cta:hover { filter: brightness(1.08); }

@media (max-width: 860px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: var(--radius) var(--radius) 0 0; }
  .view-toggle button, .result-actions button { padding: 6px 9px; font-size: 13px; }
}

/* ---- intranet (staff) build markers ---- */
.staff-badge {
  display: inline-flex; align-items: center;
  margin-left: 10px; padding: 2px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: #102d4d; background: #f6c514;
  border-radius: var(--radius-btn, 4px);
}
/* distinct top border so staff can tell this apart from the public portal */
.topbar { border-bottom: 3px solid #f6c514; }
