/* BailCA — California bail bonds directory
   Mobile-first. People reach this site on a phone, at night, under stress:
   one obvious action per card, large tap targets, no horizontal scroll. */

/* ---------------------------------------------------------------- tokens */
:root {
  /* ink */
  --ink:        #14181d;
  --ink-2:      #46515c;
  --ink-3:      #5c6772;
  /* surfaces */
  --bg:         #ffffff;
  --bg-2:       #f6f8fa;
  --bg-3:       #eef2f6;
  --line:       #dde4ea;
  --line-2:     #c6d0da;
  /* brand: deep navy reads as institutional/trustworthy rather than salesy */
  --brand:      #14456e;
  --brand-2:    #0e3253;
  --brand-ink:  #ffffff;
  /* action: bail is an urgent purchase; the call button must win the page */
  --act:        #0f7a4a;
  --act-2:      #0c6a40;
  --act-ink:    #ffffff;
  /* signal */
  --warn:       #a8321c;
  --star:       #c98a15;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --wrap: 1140px;
  --tap: 48px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --shadow: 0 1px 2px rgba(20, 24, 29, .06), 0 4px 12px rgba(20, 24, 29, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e9eef3; --ink-2: #a9b6c2; --ink-3: #8593a0;
    --bg: #0e1216; --bg-2: #161c22; --bg-3: #1e262e;
    --line: #2a333c; --line-2: #3a4650;
    --brand: #6fb2e8; --brand-2: #9acdf5; --brand-ink: #0e1216;
    --act: #35b273; --act-2: #52c88b;
    --warn: #f08a70; --star: #e0b155;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sp-4); }
@media (min-width: 700px) { .wrap { padding: 0 var(--sp-5); } }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand); color: var(--brand-ink); padding: 12px 18px;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- header */
.site-head {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.head-inner {
  display: flex; align-items: center; gap: var(--sp-4);
  min-height: 56px;
}
.brand {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  flex: none;
}
/* nav scrolls sideways instead of wrapping to a second line and eating
   a sixth of a phone screen with a sticky header */
.site-head nav {
  display: flex; gap: var(--sp-4);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  margin-left: auto;
  -webkit-overflow-scrolling: touch;
}
.site-head nav::-webkit-scrollbar { display: none; }
.site-head nav a {
  text-decoration: none; white-space: nowrap;
  font-size: .92rem; font-weight: 500; color: var(--ink-2);
  padding: 0 0 2px; border-bottom: 2px solid transparent;
  min-height: 44px; display: inline-flex; align-items: center;
}
.site-head nav a:hover { color: var(--brand); border-bottom-color: var(--brand); }

@media (max-width: 640px) {
  .head-inner { flex-wrap: wrap; gap: var(--sp-2); min-height: 0; padding-top: 10px; }
  .brand { font-size: 1.05rem; }
  .site-head nav {
    order: 3; width: 100%; margin: 0 calc(var(--sp-4) * -1); padding: 0 var(--sp-4) 8px;
    gap: var(--sp-4);
  }
}

/* ---------------------------------------------------------------- type */
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 5.2vw, 2.3rem); margin: var(--sp-5) 0 var(--sp-3); }
h2 { font-size: clamp(1.25rem, 3.4vw, 1.5rem); margin: var(--sp-6) 0 var(--sp-3); }
h3 { font-size: 1.05rem; margin: 0 0 var(--sp-2); }

.lede { font-size: 1.05rem; color: var(--ink-2); max-width: 68ch; margin: 0 0 var(--sp-4); }
.muted { color: var(--ink-3); font-size: .88rem; }

/* ---------------------------------------------------------------- hero */
.hero {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--line);
  padding: var(--sp-6) 0 var(--sp-5);
}
.hero h1 { margin-top: 0; max-width: 20ch; }
.stat {
  font-size: .9rem; color: var(--ink-3); margin: var(--sp-4) 0 0;
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
}
.stat strong { color: var(--ink); }

/* ---------------------------------------------------------------- layout */
.cols { display: grid; gap: var(--sp-5); padding-bottom: var(--sp-7); }
.main-col { min-width: 0; }
@media (min-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr) 310px; gap: var(--sp-7); align-items: start; }
  .side-col { position: sticky; top: 76px; }
}

.crumbs {
  font-size: .82rem; color: var(--ink-3); padding: var(--sp-4) 0 0;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap); padding: 12px 20px;
  border-radius: var(--r); border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink);
  font-size: 1rem; font-weight: 600; text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--brand-2); color: var(--brand-ink); }

/* the call button is the page's job — full width on phones, green so it does
   not compete with every other navy link on the page */
.btn-call {
  display: flex; width: 100%;
  background: var(--act); color: var(--act-ink);
  font-size: 1.05rem; letter-spacing: -.01em;
  margin: var(--sp-3) 0 var(--sp-2);
  box-shadow: var(--shadow);
}
.btn-call:hover { background: var(--act-2); color: var(--act-ink); }

/* the dark-mode green is light, so white text on it fails contrast; flip the
   label to near-black instead of dimming the button */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-call,
  :root:not([data-theme="light"]) .btn-call:hover { color: #08120c; }
}
.btn-label {
  font-weight: 500; opacity: .82; font-size: .9rem;
  text-transform: uppercase; letter-spacing: .06em;
}
@media (min-width: 620px) {
  .btn-call { width: auto; display: inline-flex; min-width: 260px; }
}

.btn-ghost {
  background: transparent; color: var(--brand);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--brand-2); }

.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-4) 0; }
.actions .btn { flex: 1 1 auto; }
@media (min-width: 620px) { .actions .btn { flex: 0 0 auto; } }

/* secondary links as a text row, not a wall of pills */
.link-row {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  margin: 0; font-size: .92rem;
}
.link-row a {
  text-decoration: none; font-weight: 500;
  /* full 44px touch target: these sit right under the call button and a
     mis-tap at 2am costs the user a phone call */
  min-height: 44px; display: inline-flex; align-items: center;
}
.link-row a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- listings */
.listing {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4); margin: 0 0 var(--sp-3);
  background: var(--bg);
}
@media (min-width: 620px) { .listing { padding: var(--sp-5); } }

.listing h3 { font-size: 1.15rem; margin-bottom: var(--sp-1); }
.listing h3 a {
  text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; min-height: 40px;
}
.listing h3 a:hover { color: var(--brand); }

.listing-featured {
  border-color: var(--brand); border-width: 2px;
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.card-rating {
  display: flex; align-items: baseline; gap: var(--sp-2);
  margin: 0 0 var(--sp-2); font-size: .92rem;
}

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--sp-3); }
.badge {
  font-size: .7rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; color: var(--ink-2);
  white-space: nowrap;
}
.listing-featured .badge { background: var(--bg); }
.badge-featured { border-color: var(--brand); color: var(--brand); }
.badge-verified { border-color: var(--act); color: var(--act); }
.badge-listed { color: var(--ink-3); }

.summary { margin: 0 0 var(--sp-2); color: var(--ink-2); }
.office { margin: 0; font-size: .9rem; color: var(--ink-3); }
.empty {
  background: var(--bg-2); border: 1px dashed var(--line-2);
  border-radius: var(--r); padding: var(--sp-4);
  color: var(--ink-2); font-size: .94rem;
}

/* ---------------------------------------------------------------- county grid */
.region { margin: 0 0 var(--sp-5); }
.region h3 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
  padding-bottom: var(--sp-2); margin-bottom: var(--sp-2);
}
.county-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0 var(--sp-5);
}
.county-grid li {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-2); border-bottom: 1px solid var(--line);
}
.county-grid a {
  text-decoration: none; font-size: .95rem;
  padding: 11px 0; flex: 1; min-height: 44px; display: flex; align-items: center;
}
.county-grid a:hover { color: var(--brand-2); }
.ct {
  font-size: .72rem; color: var(--ink-3); background: var(--bg-3);
  border-radius: 999px; padding: 2px 9px; min-width: 26px; text-align: center;
}

/* ---------------------------------------------------------------- tables */
.table-scroll {
  overflow-x: auto; margin: var(--sp-4) 0 var(--sp-6);
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r);
}
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td {
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); background: var(--bg-2);
  position: sticky; top: 0;
}
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover td { background: var(--bg-2); }
table.data td:first-child { font-variant-numeric: tabular-nums; }
table.data td:nth-child(2) { white-space: normal; min-width: 230px; }

/* ---------------------------------------------------------------- jails */
.jail-list { list-style: none; margin: var(--sp-4) 0; padding: 0; }
.jail-item {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--sp-4); margin-bottom: var(--sp-3);
}
.jail-item h3 { margin-bottom: var(--sp-1); }
.jail-meta {
  margin: 0; font-size: .89rem; color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 2px var(--sp-2); align-items: center;
}
.jail-meta a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.jail-meta a:hover { text-decoration: underline; }
.unverified {
  margin: var(--sp-3) 0 0; font-size: .84rem; color: var(--ink-2);
  background: var(--bg-2); border-left: 3px solid var(--warn);
  padding: 10px 12px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ---------------------------------------------------------------- guides */
.guide-list { list-style: none; margin: var(--sp-4) 0 var(--sp-7); padding: 0; }
.guide-list li { border-bottom: 1px solid var(--line); }
.guide-list a {
  display: block; padding: var(--sp-4) var(--sp-1);
  text-decoration: none; color: inherit;
}
.guide-list a:hover { background: var(--bg-2); }
.guide-list strong {
  display: block; color: var(--brand); font-size: 1.05rem; margin-bottom: 2px;
}
.guide-list span { display: block; color: var(--ink-2); font-size: .92rem; }

article h2 { border-top: 1px solid var(--line); padding-top: var(--sp-5); }
article ol, article ul { padding-left: var(--sp-5); }
article li { margin-bottom: var(--sp-2); }
article p { max-width: 70ch; }

/* ---------------------------------------------------------------- glossary */
.jump {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-5); padding: var(--sp-4);
  background: var(--bg-2); border-radius: var(--r); font-size: .88rem;
}
.jump a { text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.jump a:hover { text-decoration: underline; }
.terms { padding-bottom: var(--sp-7); }
.term {
  border-top: 1px solid var(--line); padding: var(--sp-4) 0;
  scroll-margin-top: 80px;
}
.term h3 { color: var(--brand); }
.term p { margin: 0; color: var(--ink-2); max-width: 70ch; }

/* ---------------------------------------------------------------- sponsor */
.sponsor {
  border: 1px solid var(--line); border-top: 3px solid var(--brand);
  border-radius: var(--r); padding: var(--sp-4);
  background: var(--bg-2); margin-bottom: var(--sp-4);
}
.sponsor-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); margin: 0 0 var(--sp-3); font-weight: 700;
}
.sponsor-logo {
  display: block; width: 100%; max-width: 220px; height: auto;
  margin: 0 0 var(--sp-3); border-radius: var(--r-sm);
}
.sponsor-name { font-weight: 700; font-size: 1.1rem; margin: 0 0 var(--sp-1); }
.sponsor-blurb { font-size: .9rem; color: var(--ink-2); margin: 0 0 var(--sp-3); }
.sponsor .btn { width: 100%; }
.disclose { font-size: .75rem; color: var(--ink-3); margin: var(--sp-3) 0 0; }

.card {
  border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-4);
}
.card h3 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); margin-bottom: var(--sp-2);
}
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
ul.plain a {
  text-decoration: none; font-size: .94rem;
  display: flex; align-items: center; min-height: 44px;
}
ul.plain a:hover { color: var(--brand-2); }

/* ---------------------------------------------------------------- notices */
.notice {
  border: 1px solid var(--line); border-left: 4px solid var(--brand);
  background: var(--bg-2); border-radius: 0 var(--r) var(--r) 0;
  padding: var(--sp-4); margin: var(--sp-4) 0;
}
.notice p { margin: 0; font-size: .92rem; color: var(--ink-2); max-width: 70ch; }
.notice strong { color: var(--ink); }
.notice-legal { border-left-color: var(--warn); }

/* ---------------------------------------------------------------- reputation */
.stars { color: var(--star); letter-spacing: 1px; font-size: 1.02rem; }
.rating-num { font-weight: 700; }
.no-rating, .rep-none { color: var(--ink-3); font-size: .92rem; }
.reputation {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--sp-4); margin: 0 0 var(--sp-5); background: var(--bg-2);
}
.rep-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3); }
.rep-text { font-size: .95rem; color: var(--ink-2); }
.reputation p { margin: var(--sp-3) 0 0; }
.reputation .muted { font-size: .78rem; }
.office-rating { display: block; margin: var(--sp-1) 0; font-size: .9rem; }

.office-list { list-style: none; margin: var(--sp-4) 0 var(--sp-6); padding: 0; }
.office-list li {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--sp-4); margin-bottom: var(--sp-3);
  display: grid; gap: 3px;
}
.office-list strong { font-size: 1rem; }
.office-list span { font-size: .89rem; color: var(--ink-3); }
.office-list a {
  font-size: .93rem; min-height: 44px; display: inline-flex; align-items: center;
  text-decoration: none;
}
.office-list a:hover { text-decoration: underline; }
.src { font-size: .8rem; margin-top: var(--sp-5); }

/* ---------------------------------------------------------------- filter */
.filter { margin: var(--sp-5) 0 var(--sp-2); }
.filter label {
  display: block; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-3); margin-bottom: var(--sp-2);
}
.filter input {
  width: 100%; max-width: 440px; padding: 13px 16px; font-size: 16px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg); color: var(--ink); min-height: var(--tap);
}
.filter input:focus { outline: 3px solid var(--brand); outline-offset: 1px; }
.count { font-size: .84rem; color: var(--ink-3); margin: var(--sp-2) 0 0; }

/* ---------------------------------------------------------------- footer */
.site-foot {
  border-top: 1px solid var(--line); background: var(--bg-2);
  padding: var(--sp-6) 0; font-size: .86rem; color: var(--ink-3);
  margin-top: var(--sp-6);
}
.site-foot p { margin: 0 0 var(--sp-3); }
.disclaimer { max-width: 76ch; }

/* ---------------------------------------------------------------- maps */
/* One instrument, two mountings: a framed card inside content pages, and an
   app frame that owns the viewport on /map/ pages. The tiles are visually
   loud, so everything of ours stays flat and quiet around them. */

.map-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--bg);
  box-shadow: var(--shadow);
  margin: var(--sp-4) 0 var(--sp-5);
}

.map-bar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.map-name {
  margin: 0; font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2);
  white-space: nowrap;
}
.map-bar input[type="search"] {
  flex: 1 1 150px; min-width: 0;
  padding: 9px 14px; font-size: 16px;      /* 16px stops iOS focus-zoom */
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg); color: var(--ink); min-height: 42px;
}
.map-bar input[type="search"]:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.map-count {
  font-size: .8rem; color: var(--ink-3); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.map-expand {
  font-size: .84rem; font-weight: 600; text-decoration: none;
  white-space: nowrap; padding: 8px 10px; border-radius: var(--r-sm);
}
.map-expand:hover { background: var(--bg-3); }

.map-frame { position: relative; height: 46vh; min-height: 320px; z-index: 0; }
@media (min-width: 700px) { .map-frame { height: 54vh; } }
.map-frame #map { position: absolute; inset: 0; background: var(--bg-2); }

/* legend floats inside the map so it can never dangle below the fold */
.map-key {
  position: absolute; left: 10px; bottom: 10px; z-index: 800;
  display: flex; flex-wrap: wrap; gap: 4px var(--sp-3);
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 6px 12px; font-size: .78rem; color: var(--ink-2);
  box-shadow: var(--shadow);
  pointer-events: none; max-width: calc(100% - 20px);
}

/* app frame: the map owns everything between toolbar and micro-footer */
body.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.app main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
body.app .site-head { position: static; }
.map-app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.map-app .map-bar { border-top: 1px solid var(--line); }
.map-app .map-frame { flex: 1; height: auto; min-height: 0; }
.foot-mini {
  flex: none; padding: 7px var(--sp-4);
  font-size: .74rem; color: var(--ink-3);
  background: var(--bg-2); border-top: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.foot-mini a { color: var(--ink-3); }
.lg-item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.lg-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line-2);
}
.lg-star { color: var(--star); font-size: 1.05rem; line-height: 1; }

.pin { background: none; border: none; }
.pin-dot {
  background: var(--brand); border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.pin-star {
  color: var(--star); font-size: 26px; line-height: 30px; text-align: center;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 1px 4px rgba(0,0,0,.5);
}

/* featured partner: red, bigger, with a soft pulse so the eye lands on it
   even against 400 navy dots */
.pin-featured {
  color: #d3222a; font-size: 36px; line-height: 40px;
  text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 2px 6px rgba(0,0,0,.55);
  position: relative;
}
.pin-featured::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 2px solid rgba(211, 34, 42, .55);
  animation: pin-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes pin-pulse {
  0%   { transform: scale(.55); opacity: .9; }
  70%  { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pin-featured::after { animation: none; opacity: 0; }
}

.lg-star--featured { color: #d3222a; font-size: 1.15rem; line-height: 1; }
.map-error { padding: var(--sp-6); text-align: center; color: var(--ink-2); }

.leaflet-popup-content { font: 14px/1.5 inherit; margin: 12px 14px; }
.pop-muted { color: #667; font-size: .85em; }
.pop-stars { color: var(--star); }
.pop-badge {
  font-size: .68em; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--star);
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px;
  vertical-align: middle;
}
.pop-links { display: grid; gap: 4px; margin-top: 8px; }
.pop-links a { min-height: 30px; display: inline-flex; align-items: center; }

.map-locate { font-size: 18px; }

@media (max-width: 640px) {
  .map-bar { flex-wrap: wrap; }
  .map-bar--page .map-name { flex: 1 1 100%; padding-top: 2px; }
  .map-frame { height: 44vh; min-height: 300px; }
  .map-app .map-frame { height: auto; }
}

/* ---------------------------------------------------------------- hero */
/* One committed visual world: a clean courthouse-at-dusk photograph (only the
   star badge is baked in, bottom-right). All words are real HTML over a scrim
   sampled from the photo's own dusk sky, identical in both themes. */
.hero-shot {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(24, 33, 44, .62) 0%, rgba(24, 33, 44, .38) 55%,
                    rgba(24, 33, 44, .18) 100%),
    url("/assets/img/hero-full.jpg") center top / cover no-repeat,
    #161c23;
  border-bottom: 1px solid #223;
  padding: clamp(56px, 11vh, 130px) var(--sp-4) clamp(72px, 16vh, 170px);
  /* header is 57px on desktop; hero owns the rest of the first screen */
  min-height: calc(100svh - 58px);
}
.hero-copy { text-align: center; }
.hero-copy h1 {
  margin: 0 0 var(--sp-3); color: #fff;
  font-size: clamp(1.9rem, 5.4vw, 3.4rem);
  line-height: 1.12; letter-spacing: -.02em; font-weight: 700;
  text-shadow: 0 2px 20px rgba(8, 13, 20, .65);
  text-wrap: balance;
}
.hero-sub {
  margin: 0 auto var(--sp-6); color: #e2e8ee;
  font-size: clamp(1rem, 2.4vw, 1.2rem); max-width: 56ch;
  text-shadow: 0 1px 12px rgba(8, 13, 20, .6);
}
.hero-anchor { width: 100%; display: flex; justify-content: center; }
.hero-badge { display: none; }          /* baked into the photo, bottom-right */

@media (max-width: 699px) {
  /* the mobile crop excludes the baked badge, so it renders in HTML here */
  .hero-shot {
    background:
      linear-gradient(180deg, rgba(24, 33, 44, .66) 0%, rgba(24, 33, 44, .34) 100%),
      url("/assets/img/hero-courthouse.jpg") center / cover no-repeat,
      #161c23;
    min-height: 0; padding: 48px var(--sp-4) 56px;
  }
  .hero-badge {
    display: flex; justify-content: center; align-items: center;
    gap: var(--sp-2); margin: var(--sp-5) auto 0;
    color: #e2e8ee; font-size: .92rem;
    text-shadow: 0 1px 8px rgba(8, 13, 20, .6);
  }
  .hero-stars { color: #f2b73f; font-size: 1.25rem; letter-spacing: 2px; }
}


.hero-search { position: relative; width: 100%; max-width: 620px; }
#hero-q {
  width: 100%;
  padding: 16px 20px; font-size: 16px;
  border: 0; border-radius: var(--r);
  background: #fff; color: #14181d;
  min-height: 54px;
  box-shadow: 0 6px 28px rgba(8, 13, 20, .45);
}
#hero-q::placeholder { color: #6b7681; }
#hero-q:focus { outline: 3px solid #7db4e0; outline-offset: 2px; }

.hero-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 90;
  background: #fff; border-radius: var(--r);
  box-shadow: 0 10px 34px rgba(8, 13, 20, .5);
  overflow: hidden; max-height: 320px; overflow-y: auto;
  text-align: left;
}
.hero-suggest a {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  padding: 12px 18px; min-height: 46px;
  color: #14181d; text-decoration: none; font-size: .97rem;
  border-bottom: 1px solid #eef1f4;
}
.hero-suggest a:last-child { border-bottom: 0; }
.hero-suggest a:hover, .hero-suggest a.hs-active { background: #eef4fa; color: #0e3253; }
.hs-kind {
  flex: none; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: #6b7681; background: #f0f3f6;
  border-radius: 999px; padding: 3px 9px;
}



.guide-group { margin: 0 0 var(--sp-5); }
.guide-group h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
  padding-bottom: var(--sp-2); margin: var(--sp-6) 0 0;
}
.guide-group .guide-list { margin-bottom: 0; }

/* ---------------------------------------------------------------- home split */
/* California is tall and narrow: the map takes the right half at proportions
   that suit the state, the featured partner and resources take the left. */
.home-split {
  display: grid; gap: var(--sp-5);
  padding-top: var(--sp-6); padding-bottom: var(--sp-4);
}
.home-side h2 { margin-top: 0; }
.home-side .card { margin-top: var(--sp-4); }
.home-split .map-card { margin: 0; }
.home-split .map-frame { height: 46vh; min-height: 320px; }
@media (min-width: 900px) {
  .home-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-7); }
  .home-split .map-frame { height: 620px; }
}

/* ---------------------------------------------------------------- home longform */
.home-longform { padding-top: var(--sp-6); }
.home-longform h2 { margin-top: var(--sp-6); }
.home-longform p { max-width: 72ch; color: var(--ink-2); }
.home-longform p a { font-weight: 500; }

.showcase-grid { display: grid; gap: 0 var(--sp-6); }
@media (min-width: 900px) {
  .showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.showcase-grid .guide-group h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
  padding-bottom: var(--sp-2); margin: var(--sp-5) 0 0;
}
.showcase-grid .guide-list { margin-bottom: 0; }
.showcase-grid .guide-list a { padding: var(--sp-3) var(--sp-1); }
.showcase-grid .guide-list span { font-size: .86rem; }

.home-tools { display: grid; gap: var(--sp-5); }
@media (min-width: 900px) {
  .home-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-7); }
}
.tool-col h2 { margin-top: var(--sp-6); }
ul.two-col { columns: 2; column-gap: var(--sp-5); }
ul.two-col li { break-inside: avoid; }
@media (max-width: 620px) { ul.two-col { columns: 1; } }

/* ---------------------------------------------------------------- faq */
.faq { max-width: 76ch; margin-bottom: var(--sp-6); }
.faq details {
  border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: var(--sp-2); background: var(--bg);
}
.faq details[open] { background: var(--bg-2); }
.faq summary {
  cursor: pointer; font-weight: 600; padding: 14px var(--sp-4);
  min-height: var(--tap); display: flex; align-items: center;
  list-style-position: outside;
}
.faq summary:hover { color: var(--brand); }
.faq details p {
  margin: 0; padding: 0 var(--sp-4) var(--sp-4);
  color: var(--ink-2); max-width: 70ch;
}

/* ---------------------------------------------------------------- city links */
.home-cities { padding-bottom: var(--sp-7); }
.city-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
.city-links a {
  text-decoration: none; font-size: .9rem;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; min-height: 40px;
  display: inline-flex; align-items: center;
  color: var(--ink-2);
}
.city-links a:hover { border-color: var(--brand); color: var(--brand); background: var(--bg-2); }

/* ---------------------------------------------------------------- site pass 2026-09-08 */
/* Header call: one number that answers, on every page, at every width. It is
   the featured partner's, and says so. */
.head-call {
  flex: none; margin-left: var(--sp-4);
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 44px; padding: 5px 14px;
  background: var(--act); color: var(--act-ink);
  border-radius: var(--r); text-decoration: none; line-height: 1.15;
  white-space: nowrap;
}
.head-call:hover { background: var(--act-2); color: var(--act-ink); }
.head-call-label {
  font-size: .6rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.head-call-num { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .head-call,
  :root:not([data-theme="light"]) .head-call:hover { color: #08120c; }
}
@media (max-width: 640px) {
  .head-call { margin-left: auto; padding: 4px 12px; }
  .head-call-num { font-size: .92rem; }
}

/* Bite, snack, meal: one-sentence answer, four facts, then the page. */
.bite { font-size: 1.1rem; max-width: 68ch; margin: 0 0 var(--sp-4); }
.bite b { color: var(--brand); }
.glance {
  border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 0 var(--r) var(--r) 0; background: var(--bg-2);
  padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-5); max-width: 68ch;
}
.glance h2 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); margin: 0 0 var(--sp-2);
}
.glance ul { margin: 0; padding-left: 1.1em; }
.glance li { margin: 0 0 4px; font-size: .95rem; }
.glance li:last-child { margin-bottom: 0; }

/* Footer: the pages that matter, in plain words. */
.foot-links {
  display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5);
  margin: 0 0 var(--sp-5); padding: 0 0 var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.foot-links a {
  color: var(--ink-2); text-decoration: none; font-weight: 500;
  min-height: 40px; display: inline-flex; align-items: center;
}
.foot-links a:hover { color: var(--brand); text-decoration: underline; }
.foot-meta span { margin-right: var(--sp-4); }
.foot-mini span, .foot-mini a { margin-right: var(--sp-3); }

/* Company facts row, no separators needed between two labeled pairs. */
.facts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.facts strong { margin-right: 4px; }

/* County filter hides cards the way the schedule filter hides rows. */
.listing[hidden] { display: none; }
