:root {
  --bg: #f4f7fb;
  --bg-top: #eef3f9;
  --card: #ffffff;
  --card-soft: #fbfdff;
  --panel-soft: #f8fbff;
  --muted: #5f7192;
  --text: #1d2b45;
  --line: rgba(16, 24, 40, .10);
  --accent: #2e6ad7;
  --accent-soft: rgba(46, 106, 215, .12);
  --accent-soft-strong: rgba(46, 106, 215, .18);
  --good: #1f9d63;
  --good-soft: rgba(31, 157, 99, .12);
  --warn: #c68a00;
  --warn-soft: rgba(198, 138, 0, .12);
  --bad: #d64545;
  --bad-soft: rgba(214, 69, 69, .12);
  --shadow: 0 8px 24px rgba(16, 24, 40, .08);
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 800px at 20% 0%, #f7f9fc 0%, var(--bg-top) 38%, var(--bg) 100%);
  color: var(--text);
}

.app-header {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand__logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand__copy {
  min-width: 0;
}

.brand__title {
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.1;
  font-size: 18px;
}

.brand__subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mode-toggle {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.tab:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.tab.active {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid rgba(46, 106, 215, .25);
}

.searchbar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.searchbar input {
  width: min(420px, 42vw);
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
}

.searchbar input::placeholder {
  color: var(--muted);
}

.searchbar button {
  border: 1px solid rgba(46, 106, 215, .28);
  background: var(--accent-soft);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: background .15s ease, border-color .15s ease;
}

.searchbar button:hover {
  background: var(--accent-soft-strong);
  border-color: rgba(46, 106, 215, .40);
}

.search-filters {
  display: flex;
  align-items: center;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease;
}

.filter-toggle:hover {
  border-color: rgba(46, 106, 215, .30);
  background: var(--panel-soft);
}

.filter-toggle input {
  margin: 0;
  accent-color: var(--accent);
}

.demo-pills {
  display: flex;
  gap: 8px;
}

.pill {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  transition: border-color .15s ease, background .15s ease;
}

.pill--ghost {
  background: transparent;
}

.pill:hover {
  border-color: rgba(46, 106, 215, .30);
  background: var(--panel-soft);
}

.app-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px 1fr 410px;
  gap: 12px;
  padding: 12px;
}

.pane {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pane--map {
  position: relative;
  min-height: 0;
}

.pane__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  letter-spacing: .1px;
  background: #ffffff;
}

.meta {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.pane--results {
  min-height: 0;
}

.list {
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.list--results {
  flex: 1 1 auto;
}

.card {
  border: 1px solid var(--line);
  background: var(--card-soft);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.card:hover {
  border-color: rgba(46, 106, 215, .28);
  background: var(--panel-soft);
  box-shadow: 0 2px 8px rgba(16, 24, 40, .05);
}

.card.active {
  border-color: rgba(46, 106, 215, .45);
  background: var(--accent-soft);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.title {
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .1px;
}

.case-flags {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: inline-flex;
  gap: 4px;
}

.case-flag-icon {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, .15);
}

.sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}

.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #f8fbff;
  white-space: nowrap;
}

.badge.good {
  border-color: rgba(31, 157, 99, .28);
  background: var(--good-soft);
}

.badge.warn {
  border-color: rgba(198, 138, 0, .28);
  background: var(--warn-soft);
}

.badge.bad {
  border-color: rgba(214, 69, 69, .28);
  background: var(--bad-soft);
}

.badge.mono {
  font-family: var(--mono);
  color: var(--muted);
}

.unresolved-asterisk {
  color: var(--muted);
  font-weight: 800;
  margin-left: 1px;
}

.unresolved-note {
  font-style: italic;
}

/* ---- Owner search ------------------------------------------------------ */

.owner-pick {
  align-items: flex-start;
  gap: 10px;
}

.owner-pick__box {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.owner-pick__body {
  flex: 1;
  min-width: 0;
}

/* Canonical owners ("companies") stand apart from single-LLC owners: one
   heavy blue outline on all four sides and a blue wash. The border is 3px,
   so padding is reduced by 2px to keep text aligned with the 1px-bordered
   cards around it. A dashed version of the same outline marks managers,
   companies that file evictions on properties they do not own (inferred). */
.card.owner-pick-card--canon,
.section.owner-summary--canon {
  --canon-ink: #173a7a;
  border: 3px solid var(--accent);
  background: linear-gradient(180deg, #f4f8ff 0%, #e8f0ff 100%);
  box-shadow: 0 1px 3px rgba(31, 79, 176, .12);
}

.card.owner-pick-card--manager,
.section.owner-summary--manager {
  --canon-ink: #173a7a;
  border: 3px dashed var(--accent);
  background: #f8fbff;
}

.card.owner-pick-card--canon,
.card.owner-pick-card--manager {
  padding: 10px;
}

.section.owner-summary--canon,
.section.owner-summary--manager {
  padding: 12px;
}

.card.owner-pick-card--canon:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, #eef4ff 0%, #dfeaff 100%);
  box-shadow: 0 3px 10px rgba(31, 79, 176, .18);
}

.card.owner-pick-card--manager:hover {
  border-color: var(--accent);
  background: #eef4ff;
}

.card.owner-pick-card--canon.active,
.card.owner-pick-card--manager.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #e3edff 0%, #d3e3ff 100%);
  box-shadow: 0 0 0 3px var(--accent-soft-strong), 0 3px 10px rgba(31, 79, 176, .18);
}

.card.owner-pick-card--canon .title,
.card.owner-pick-card--manager .title,
.section.owner-summary--canon h3,
.section.owner-summary--manager h3 {
  color: var(--canon-ink);
}

.card.owner-pick-card--canon .title,
.card.owner-pick-card--manager .title {
  font-size: 15px;
}

.card.owner-pick-card--canon .badge,
.card.owner-pick-card--manager .badge {
  background: #ffffff;
  border-color: rgba(46, 106, 215, .35);
  color: #1f4fb0;
  font-weight: 700;
}

.section.owner-summary--canon h3,
.section.owner-summary--manager h3 {
  font-size: 16px;
}

.section.owner-summary--canon .kv .k,
.section.owner-summary--manager .kv .k {
  color: #4a5f86;
}

/* Key shown above the owner results. */
.owner-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  font-size: 12px;
  color: var(--muted);
}

.owner-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.owner-legend__row b {
  color: var(--text);
}

.owner-legend__swatch {
  flex: 0 0 26px;
  height: 14px;
  border-radius: 4px;
  border: 3px solid var(--accent);
  background: #eef4ff;
}

.owner-legend__swatch--manager {
  border-style: dashed;
  background: #f8fbff;
}

/* LLC names in a company summary that open a property or narrow the list. */
.llc-list {
  margin-top: 6px;
  line-height: 1.6;
}

.llc-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(46, 106, 215, .35);
}

.llc-link:hover {
  text-decoration-color: currentColor;
}

.llc-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  font-size: 13px;
}

/* Properties an owner appears to manage: dashed outline, as on the map. */
.card.parcel-item--managed {
  border-style: dashed;
  border-color: rgba(46, 106, 215, .45);
}

.role-tab-row {
  margin-top: 0;
}

/* Related properties tab */
.related-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.related-group__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
  font-weight: 800;
}

.related-group .filter-btn {
  align-self: flex-start;
}

/* "View owner" bar. The wrapper is the sticky element because it is the
   list's direct child; a sticky child of a wrapper that is only as tall as
   itself would never stick. */
#ownerSelectBar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 2px -10px -10px;
}

.owner-select-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 14px rgba(16, 24, 40, .06);
}

.owner-select-bar__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.owner-select-bar .filter-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.owner-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.owner-toolbar__sort {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 0;
}

.owner-toolbar select {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
}

.owner-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
  font-weight: 800;
}

.details {
  overflow: auto;
  padding: 12px;
  background: #fcfdff;
}

.section {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .03);
}

.section h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.3;
}

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 10px;
  font-size: 13px;
}

.kv .k {
  color: var(--muted);
}

.unknown-note {
  color: var(--muted);
  font-style: italic;
}

/* Cases / filings per year (Parcel History). */
.year-chart {
  margin: 4px 0 14px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.year-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 134px;           /* plot (98) + slanted year labels (36) */
  padding-left: 14px;      /* room for the first slanted label */
}

.year-chart__col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

/* The bar area: the count sits just above each bar's own top, so the plot
   leaves 16px of headroom above the tallest bar. */
.year-chart__plot {
  position: relative;
  flex: none;
  width: 100%;
  height: 98px;
}

.year-chart__count {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  line-height: 12px;
  color: var(--muted);
  /* bottom is set per bar, in px, from the bar's height */
}

.year-chart__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82px;   /* fixed, so the segment percentages have a height to resolve against; keep in step with YEAR_CHART_BAR_PX in app.js */
  display: flex;
  flex-direction: column-reverse;   /* colored (since purchase) at the bottom */
}

.year-chart__seg {
  width: 100%;
  min-height: 0;
}

.year-chart__seg--blue { background: #2e6ad7; }
.year-chart__seg--red  { background: #d64541; }
.year-chart__seg--pre  { background: #b7bdc8; }

/* Year labels are slanted so every year fits without overlapping: each is
   pinned under its bar by its right end and tilted down to the left. */
.year-chart__year {
  position: relative;
  flex: none;
  width: 100%;
  height: 36px;
}

.year-chart__year span {
  position: absolute;
  top: 3px;
  right: 50%;
  font-size: 10px;
  line-height: 10px;
  color: var(--muted);
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: 100% 0;
}

.year-chart__legend {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.year-chart__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 2px;
  vertical-align: -1px;
}

/* Parcel History: its own section, with a toggle between code cases and
   eviction filings. The two lists inside are plain, not cards within a card. */
.history-section .history-title {
  font-size: 15px;
  margin-bottom: 10px;
}

.history-toggle {
  margin-bottom: 10px;
}

.history-section .section {
  border: 0;
  box-shadow: none;
  background: none;
  padding: 0;
  margin: 0;
}

/* Single-parcel details tabs (Overview / Subsidies / Owner Info). */
.tab-subtitle {
  margin: 14px 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tab-subtitle:first-child {
  margin-top: 0;
}

.owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed rgba(16, 24, 40, .14);
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 14px;
  line-height: 1.45;
}

.results-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--card-soft);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.results-legend__title {
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.results-legend__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}

.results-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.results-legend__dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, .15);
  flex-shrink: 0;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: border-color .15s ease, background .15s ease;
}

.filter-btn:hover {
  border-color: rgba(46, 106, 215, .30);
  background: var(--panel-soft);
}

.filter-btn.active {
  border-color: rgba(46, 106, 215, .38);
  background: var(--accent-soft);
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-delimiter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.case-delimiter::before,
.case-delimiter::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.case-row {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 10px;
  padding: 10px;
}

.case-row__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.case-row__meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.45;
}

.map {
  height: 100%;
  width: 100%;
}

.map-status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  z-index: 800;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.hidden {
  display: none;
}

.app-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  color: var(--muted);
}

.app-footer__inner {
  max-width: none;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .15px;
  text-align: center;
}

.app-footer__inner a,
.footer-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
}

.app-footer__inner a:hover,
.footer-link:hover {
  color: var(--text);
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 300px 1fr 380px;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 320px 1fr;
  }

  .pane--details {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    justify-content: flex-start;
  }

  .searchbar input {
    width: min(100%, 420px);
  }
}

@media (max-width: 760px) {

  html,
  body {
    height: auto;
    overflow-x: hidden;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    flex: none;
    /* was flex:1 — stop shrinking to fit one screen */
    min-height: 0;
    height: auto;
    /* was implicitly constrained via body height:100% */
    padding: 8px;
    gap: 8px;
  }

  .pane {
    width: 100%;
    flex: none;
    /* let each pane size to its own content/max-height */
  }

  .pane--results {
    max-height: 40vh;
  }

  .pane--map {
    height: 45vh;
    min-height: 280px;
    flex: none;
  }

  .pane--details {
    display: flex;
    max-height: 50vh;
  }

  .searchbar input {
    width: 100%;
  }

  .app-header {
    padding: 10px 12px;
  }

  .brand__logo {
    height: 36px;
  }

  .controls {
    width: 100%;
  }
}

/* The Clear chip sets display:flex inline, which beat .hidden and left the
   address showing after clearing. */
.selection-chip.hidden { display: none !important; }

/* Small "i" that shows a note on hover. */
.info-tip {
  color: var(--muted);
  cursor: help;
  font-size: 12px;
}

/* Owner summary tabs (Overview / Subsidies / Owner Info). */
.owner-sum-tabs { margin-bottom: 8px; }
.owner-sum-panel.hidden { display: none; }
.sub-table-wrap { overflow-x: auto; }
.sub-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sub-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 3px 6px 3px 0; }
.sub-table td { padding: 3px 6px 3px 0; border-top: 1px solid var(--line); vertical-align: top; }
.sub-table .num { text-align: right; white-space: nowrap; }

/* Map markers for owner views: managed parcels are polka-dot circles. */
.dotted-marker { background: none; border: 0; }

.dotted-marker div,
.omk-dot--dotted {
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .35);
  background-image: radial-gradient(circle, rgba(255, 255, 255, .95) 0 1.6px, transparent 2px);
  background-size: 6px 6px;
  box-sizing: border-box;
}

.owner-map-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .12);
}

.omk-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  background: #667085;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .35);
  box-sizing: border-box;
}

/* Count column in the Subsidies tab: names left, counts lined up beside them. */
.count-lines {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 2px 20px;
}

.count-lines__n { color: var(--muted); font-style: italic; }

.llc-none { color: var(--muted); }
.llc-rest.hidden { display: none; }
.llc-more-btn { margin-top: 8px; }

/* Always-present link to the owner dashboard. */
.dash-cta-wrap { display: grid; gap: 8px; margin: 2px 0 12px; }

.dash-cta {
  display: block;
  text-align: center;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(31, 79, 176, .28);
  transition: background .15s ease, box-shadow .15s ease;
}

.dash-cta:hover { background: #1f4fb0; box-shadow: 0 3px 10px rgba(31, 79, 176, .38); }
.dash-cta:visited { color: #fff; }

/* Big blue button back to the registry (owner dashboard header). */
.dash-cta--header {
  display: inline-block;
  padding: 14px 26px;
  font-size: 17px;
  border-radius: 14px;
}

/* The results pane only appears after a search or a map click. */
.app-shell.results-hidden { grid-template-columns: 1fr 410px; }
.app-shell.results-hidden .pane--results { display: none; }

@media (max-width: 1200px) {
  .app-shell.results-hidden { grid-template-columns: 1fr 380px; }
}

@media (max-width: 1120px) {
  .app-shell.results-hidden { grid-template-columns: 1fr; }
}

.pane__title-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pane__title-right .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dash-cta--small {
  padding: 10px 16px;
  font-size: 15px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: none;
}

/* Header: logo left, search fills the middle, dashboards button right. */
.app-header--centered {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand search dash";
  gap: 18px;
  align-items: center;
}

.app-header--centered .brand { grid-area: brand; }
.header-center { grid-area: search; }
.header-right { grid-area: dash; }

.header-center {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}

.header-center .searchbar { flex: 1 1 auto; min-width: 0; max-width: 520px; }
.header-center .searchbar input { flex: 1 1 auto; width: 100%; min-width: 0; }

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.header-right .dash-cta--header { padding: 10px 18px; font-size: 15px; border-radius: 12px; white-space: nowrap; }

/* Search is the primary action: same green as the toggle. */
.header-center .searchbar button {
  background: #0aa68a;
  border-color: #078f77;
  color: #fff;
}
.header-center .searchbar button:hover { background: #078f77; border-color: #067a66; }

/* Narrower screens: logo + dashboards on top, search on its own row. */
@media (max-width: 1180px) {
  .app-header--centered {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand dash" "search search";
    row-gap: 10px;
  }
  .header-center { justify-content: flex-start; }
  .header-center .searchbar { max-width: none; }
}

@media (max-width: 640px) {
  .app-header--centered {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "search" "dash";
  }
  .header-right .dash-cta--header { width: 100%; text-align: center; }
  .header-center { flex-direction: column; align-items: stretch; }
  .mode-group { align-items: stretch; }
  .mode-toggle { justify-content: space-between; }
  .mode-toggle .tab { flex: 1; padding: 8px 6px; }
  .header-center .searchbar { max-width: none; }
}
.dash-cta.hidden { display: none; }

/* Search-by options: logo green, the selected one white with green text. */
.mode-toggle {
  background: #0aa68a;
  border-color: #078f77;
}

.mode-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mode-label { font-size: 12px; font-weight: 600; color: #000; letter-spacing: .04em; text-transform: uppercase; }

.mode-toggle .tab { color: #fff; border: 1px solid transparent; }
.mode-toggle .tab:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.mode-toggle .tab.active {
  background: #fff;
  color: #0aa68a;
  border-color: #fff;
}

/* Condo building summary */
.bld-callout { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: #fff7e6; border: 1px solid #f3d9a4; font-size: 13px; line-height: 1.4; }
.bld-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #e2e8f0; margin: 6px 0 10px; }
.bld-bar__seg { display: block; height: 100%; }
.bld-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.bld-profile { margin-left: 6px; font-size: 11px; }
.bld-owners { width: 100%; }
.bld-owners td { vertical-align: top; }
.bld-more-btn { margin-top: 8px; }
.building-link { margin-top: 8px; }
.building-card .sub { overflow-wrap: anywhere; }
.bld-homestead-row td { color: #475569; border-top: 1px dashed #cbd5e1; }

.unit-picker { display: grid; gap: 6px; }
.unit-picker > .sub { font-weight: 700; }
.unit-picker__row { display: flex; gap: 8px; align-items: center; }
.unit-picker select { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.unit-picker .filter-btn { white-space: nowrap; }
.unit-picker .filter-btn:disabled { opacity: .5; cursor: not-allowed; }
.bld-toggle { margin: 10px 0; }
