/* =====================================================
   Permit & Parcel — Main Page Redesign v2
   Light "product tool" direction — close to live site DNA
   ===================================================== */

:root {
  --maxw: 1060px;
  --gap: 14px;

  /* lifted from the live site tokens */
  --canvas: #F9FAFB;
  --card-bg: #FFFFFF;
  --card-border: #E5E7EB;
  --line: #EEF0F3;

  --ink: #111827;
  --ink-2: #374151;
  --muted: #6B7280;
  --faint: #9CA3AF;

  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #EFF6FF;
  --accent-50: #DBEAFE;
  --accent-ink: #1E40AF;

  --good: #16A34A; --good-bg: #DCFCE7;
  --warn: #B45309; --warn-bg: #FEF3C7;
  --bad: #DC2626;  --bad-bg: #FEE2E2;

  --radius-pill: 9999px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-md: 0 1px 2px rgba(16,24,40,0.04), 0 6px 16px -8px rgba(16,24,40,0.10);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Contain any horizontal overflow (e.g. the parcel map) so content never shifts
     right / a stray horizontal scroll never appears on small screens. */
  max-width: 100vw;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(17,24,39,0.07);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.logo svg { width: 26px; height: 26px; stroke: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; transition: color .18s; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.pro-link { color: var(--accent); font-weight: 600; }

/* Hamburger — hidden on desktop, dropdown nav on mobile */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink-2); border-radius: 2px; transition: all .2s; }
@media (max-width: 760px){
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    flex-direction: column; gap: 0; padding: 8px 0;
    z-index: 1001;
    box-shadow: 0 6px 16px rgba(16,24,40,0.10);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 24px; font-size: 15px; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child a { border-bottom: none; }
}

/* ---------- Hero / search (faithful to live: simple title + tagline + pill) ---------- */
.hero { padding: 38px 0 28px; text-align: center; }
.hero h1 { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 8px; }
.hero .tagline { font-size: 15px; color: var(--muted); margin-bottom: 24px; }
.hero .tagline b { color: var(--ink-2); font-weight: 600; }

.search-wrap { max-width: 600px; margin: 0 auto; position: relative; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card-bg); border: 2px solid var(--card-border);
  border-radius: var(--radius-pill); padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-bar .s-icon { width: 20px; height: 20px; stroke: var(--faint); flex-shrink: 0; }
/* font-size must stay >= 16px: iOS Safari auto-zooms the page when a smaller input is
   focused and never zooms back out, which looked like the page "zooming in" after search. */
.search-bar input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; color: var(--ink); padding: 10px 0; }
.search-bar input::placeholder { color: var(--faint); }
.btn-search { background: var(--accent); color: #fff; font-weight: 600; font-size: 14.5px; padding: 11px 24px; border-radius: var(--radius-pill); transition: background .18s; }
.btn-search:hover { background: var(--accent-hover); }
.btn-clear { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--faint); background: transparent; flex-shrink: 0; transition: background .15s, color .15s; }
.btn-clear:hover { background: var(--line); color: var(--ink); }
.btn-clear svg { width: 17px; height: 17px; }
.search-hint { font-size: 13.5px; color: var(--faint); margin-top: 14px; }

/* Small-screen tuning — shrink the oversized search button + hero so the input
   has room and the layout feels balanced (matches the main site's mobile sizing). */
@media (max-width: 480px){
  .hero { padding: 26px 0 22px; }
  .hero h1 { font-size: 26px; }
  .hero .tagline { font-size: 14px; margin-bottom: 20px; }
  .search-bar { padding: 5px 5px 5px 14px; gap: 6px; }
  .search-bar input { font-size: 16px; }
  .btn-search { padding: 10px 16px; font-size: 14px; }
  .result-head { gap: 12px; }
  .head-actions { width: 100%; display: flex; gap: 10px; }
  .head-actions .btn { flex: 1; justify-content: center; }
}

.ac-drop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); box-shadow: 0 16px 40px rgba(16,24,40,0.14); overflow: hidden; z-index: 50; display: none; text-align: left; }
.ac-drop.open { display: block; }
.ac-item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; font-size: 15px; cursor: pointer; color: var(--ink-2); }
.ac-item:hover, .ac-item.hl { background: var(--accent-soft); }
.ac-item svg { width: 16px; height: 16px; stroke: var(--faint); flex-shrink: 0; }
.ac-item b { color: var(--ink); font-weight: 600; }

/* ---------- Result header ---------- */
.results { padding-top: 8px; padding-bottom: 16px; }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
/* Serif-hero address — records/real-estate treatment so the property reads as the hero */
.addr-block { min-width: 0; }
.addr-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); margin-bottom: 7px; }
.addr-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.result-head .addr {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 30px; font-weight: 700; color: var(--ink);
  letter-spacing: 0; line-height: 1.1;
  /* Playfair defaults to old-style figures (9s dip below the baseline) — force
     lining figures so digits sit at cap-height, aligned with the letters. */
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1, "onum" 0;
}
.addr-verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--good); background: var(--good-bg); border-radius: var(--radius-pill); padding: 3px 10px 3px 8px; transform: translateY(-3px); white-space: nowrap; }
.addr-verified svg { width: 13px; height: 13px; }
.addr-loc { display: flex; align-items: center; gap: 6px; margin-top: 11px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.addr-loc svg { width: 15px; height: 15px; stroke: var(--accent); flex-shrink: 0; }
@media (max-width: 480px){
  .result-head .addr { font-size: 24px; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--card-bg); border: 1px solid var(--card-border); padding: 6px 12px; border-radius: var(--radius-pill); }
.chip svg { width: 14px; height: 14px; stroke: var(--accent); }
.head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 11px 18px; border-radius: var(--radius-sm); transition: all .18s; border: 1px solid transparent; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--card-bg); color: var(--ink-2); border-color: var(--card-border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Section blocks (the live-site DNA) ---------- */
.section { padding: 14px 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
.section-head .rule { flex: 1; height: 1px; background: var(--card-border); }
.section-head .meta { font-size: 12.5px; color: var(--faint); font-weight: 500; }

/* ---------- Card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow-md); }
.span-2 { grid-column: 1 / -1; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-icon { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.card-icon.radon svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); flex: 1; }
.card-title .sub { font-weight: 500; color: var(--faint); font-size: 12px; margin-left: 8px; letter-spacing: 0; }
.card-body { padding: 16px; flex: 1; }
.card-note { font-size: 12px; color: var(--faint); margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); line-height: 1.45; }
.card-note b { color: var(--ink); font-weight: 700; }

/* NJDEP DataMiner how-to instructions */
.enviro-steps { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.enviro-steps-title { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.enviro-steps ol { margin: 0; padding-left: 18px; }
.enviro-steps li { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-bottom: 5px; }
.enviro-steps li b { color: var(--ink-2); font-weight: 600; }
.enviro-fill { margin-top: 10px; padding: 9px 12px; background: var(--accent-soft); border: 1px solid var(--accent-50); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.enviro-fill b { color: var(--accent-ink); font-weight: 700; }

/* ---------- Stat grids ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.stat-num { font-weight: 800; font-size: 21px; line-height: 1.1; color: var(--ink); letter-spacing: -0.02em; }
.stat-num.sm { font-size: 17px; }
.stat-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-num.green { color: var(--good); } .stat-num.amber { color: var(--warn); } .stat-num.red { color: var(--bad); }

/* key-value rows */
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; color: var(--ink); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-sm); }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad  { background: var(--bad-bg);  color: var(--bad); }
.badge-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.badge-desc { font-size: 13.5px; color: var(--muted); flex: 1; min-width: 160px; }

/* ── Sample-lot placeholder (idle state, before a real search) ── */
.sample { position: relative; background: var(--card-bg); border: 1px dashed var(--accent-50); border-radius: var(--radius-lg); overflow: hidden; display: grid; grid-template-columns: 340px 1fr; box-shadow: var(--shadow-sm); }
.sample-map { position: relative; min-height: 210px; background: #0f1d33; }
.sample-map .tex { position: absolute; inset: 0; }
.sample-map .tex svg { width: 100%; height: 100%; display: block; }
.sample-badge { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); background: #fff; border: 1px solid var(--accent-50); border-radius: var(--radius-pill); padding: 5px 12px; box-shadow: var(--shadow-sm); }
.sample-badge svg { width: 12px; height: 12px; stroke: var(--accent); fill: none; }
.sample-body { padding: 18px 20px; display: flex; flex-direction: column; }
.sample-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); margin-bottom: 6px; }
.sample-addr { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.sample-loc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.sample-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 22px; margin-top: 12px; }
.sample-facts .kv { padding: 6px 0; font-size: 13px; }
.sample-cta { margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--faint); }
.sample-cta b { color: var(--accent); font-weight: 600; cursor: pointer; }
@media (max-width: 700px) {
  .sample { grid-template-columns: 1fr; }
  .sample-map { min-height: 170px; }
  .sample-facts { grid-template-columns: 1fr; }
}

/* radon risk scale (borrowed idea — gradient bar + marker) */
.radon-scale { height: 10px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--good) 0%, #F59E0B 52%, var(--bad) 100%); position: relative; margin: 20px 0 8px; }
.radon-scale .marker { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--bad); box-shadow: 0 3px 9px rgba(16,24,40,0.22); transform: translateX(-50%); }
.radon-legend { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); }
.radon-legend .hl { color: var(--bad); }

/* map */
.map-box { height: 260px; border-radius: var(--radius-md); overflow: hidden; background: #e2e8f0; }
.map-dim { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.map-dim svg { width: 15px; height: 15px; stroke: var(--accent); }
.map-dim.empty { display: none; }

/* Property Location: satellite map + street view side by side; stacked on mobile */
.loc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.loc-split.no-sv { grid-template-columns: 1fr; }
.loc-pane { min-width: 0; }
.sv-link { display: block; height: 260px; border-radius: var(--radius-md); overflow: hidden; background: #e2e8f0; }
.sv-img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 768px) {
  .loc-split { grid-template-columns: 1fr; }
}

/* flood map (FEMA NFHL overlay) */
.flood-map { height: 210px; border-radius: var(--radius-md); overflow: hidden; background: #e2e8f0; margin-top: 14px; }
.flood-map .leaflet-container { border-radius: var(--radius-md); }

/* permits */
.permit-item { border-bottom: 1px solid var(--line); }
.permit-item:last-child { border-bottom: none; }
.permit { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.permit.is-clickable { cursor: pointer; }
.permit.is-clickable:hover .permit-type { color: var(--accent); }
.permit-chev { width: 16px; height: 16px; stroke: var(--faint); fill: none; flex-shrink: 0; transition: transform .18s; }
.permit-item.expanded .permit-chev { transform: rotate(180deg); }
.permit-detail { display: none; padding: 2px 4px 14px 50px; }
.permit-item.expanded .permit-detail { display: block; }
.pd-section { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 560px){ .pd-section { grid-template-columns: 1fr; } }
.pd-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: 11px 0 3px; }
.pd-item { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.pd-k { color: var(--muted); white-space: nowrap; }
.pd-v { color: var(--ink-2); font-weight: 600; text-align: right; }
.pd-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.pd-raw { white-space: pre-wrap; margin: 4px 0 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f8fafc; color: var(--ink-2); font: 12px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.pd-open { color: var(--bad); font-weight: 700; }
.pd-flag { color: var(--warn); font-weight: 700; }
.permit-ic { width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.permit-ic svg { width: 19px; height: 19px; stroke: currentColor; fill: none; }
.permit-main { flex: 1; min-width: 0; }
.permit-type { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.permit-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.permit-status { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--good); background: var(--good-bg); padding: 5px 11px; border-radius: var(--radius-pill); flex-shrink: 0; }

/* flags */
.flag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 560px){ .flag-grid { grid-template-columns: 1fr; } }
.flag { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; font: inherit; text-align: left; }
.flag:last-child { border-bottom: none; }
.flag.is-clickable { cursor: pointer; border-radius: var(--radius-sm); transition: background .16s ease, transform .16s ease; }
.flag.is-clickable:hover { background: var(--accent-soft); }
.flag.is-clickable:active { transform: translateY(1px); }
.flag.is-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.flag-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--warn); }
.flag-dot.bad { background: var(--bad); }
.flag-dot.info { background: var(--good); }
.flag-body { flex: 1; min-width: 0; }
.flag-title { display: block; font-weight: 600; font-size: 14px; color: var(--ink); }
.flag-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.flag-pill { flex-shrink: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 4px 10px; border-radius: var(--radius-pill); margin-top: 2px; }
.flag-pill.red { color: var(--bad); background: var(--bad-bg); }
.flag-pill.amber { color: var(--warn); background: var(--warn-bg); }
.flag-pill.blue { color: var(--accent-ink); background: var(--accent-50); }
.flag-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .48); }
.flag-modal-card { width: min(420px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--card-bg); border-radius: 16px; box-shadow: var(--shadow-lg); }
.flag-modal-head { display: flex; align-items: center; gap: 12px; padding: 17px 20px; background: var(--warn-bg); }
.flag-modal-icon { font-size: 24px; line-height: 1; }
.flag-modal-title { margin: 0; color: var(--warn); font-size: 18px; line-height: 1.25; }
.flag-modal-body { padding: 22px 20px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.flag-modal-cta { display: flex; gap: 9px; margin-top: 16px; padding: 12px 14px; background: var(--accent-soft); border: 1px solid var(--accent-50); border-radius: var(--radius-sm); color: var(--accent-ink); font-weight: 600; font-size: 13.5px; line-height: 1.5; }
.flag-modal-cta-ic { flex-shrink: 0; }
/* Modal detail sections: material/location chips + "Look for" list + resource link */
.flag-modal-sec { margin-top: 16px; }
.flag-modal-sec-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
.flag-modal-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.flag-modal-chip { font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--line); border: 1px solid var(--card-border); border-radius: var(--radius-pill); padding: 5px 11px; }
.flag-modal-list { margin: 0; padding-left: 0; list-style: none; }
.flag-modal-list li { position: relative; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 6px; }
.flag-modal-list li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.flag-modal-link { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.flag-modal-link:hover { text-decoration: underline; }
/* Flag row affordance — a caret so people know the row opens detail */
.flag-caret { width: 15px; height: 15px; stroke: var(--faint); flex-shrink: 0; margin-top: 4px; margin-left: 2px; align-self: center; transition: transform .16s ease, stroke .16s ease; }
.flag.is-clickable:hover .flag-caret { stroke: var(--accent); transform: translateX(2px); }
.flag-modal-src { margin-top: 12px; font-size: 12px; color: var(--faint); font-style: italic; }
.flag-modal-actions { padding: 12px 20px 16px; border-top: 1px solid var(--line); text-align: right; }
.flag-modal-close { border: 0; border-radius: var(--radius-sm); background: var(--accent); color: white; padding: 10px 20px; font-weight: 700; cursor: pointer; }
.flag-modal-close:hover { filter: brightness(.96); }
.flag-modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* school */
.school { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.school:last-child { border-bottom: none; }
.school .name { flex: 1; }
.school .rate { font-weight: 800; font-size: 15px; color: var(--ink); }
.school .rate small { color: var(--faint); font-weight: 500; font-size: 12px; }

/* comps */
.comps-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin: 4px 0 12px; }
.comp { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.comp:last-child { border-bottom: none; }
.comp .addr { font-weight: 500; color: var(--ink); }
.comp .meta { color: var(--muted); font-size: 12.5px; }
.comp .price { font-weight: 800; font-size: 15.5px; white-space: nowrap; color: var(--ink); }

/* mortgage */
.mort-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 640px){ .mort-grid { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 11px 12px; border: 1px solid var(--card-border); border-radius: var(--radius-sm); background: var(--canvas); color: var(--ink); font-size: 16px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mort-result { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: center; background: var(--canvas); border-radius: var(--radius-md); padding: 16px; }
@media (max-width: 560px){ .mort-result { grid-template-columns: 1fr; } }
.mort-total { text-align: center; }
.mort-total .big { font-weight: 800; font-size: 30px; color: var(--accent); letter-spacing: -0.02em; }
.mort-total .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.mort-break { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mort-cell { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.mort-cell .l { font-size: 11.5px; color: var(--muted); }
.mort-cell .v { font-weight: 800; font-size: 16px; color: var(--ink); }

/* simple text card */
.card-body > p.lead, .card-body p.lead { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }

/* pro banner */
.pro-banner { margin: 22px 0 0; }
.pro-inner { background: linear-gradient(120deg, #1E3A8A, #2563EB); color: #fff; border-radius: var(--radius-lg); padding: 20px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pro-inner h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.pro-inner p { color: rgba(255,255,255,0.82); font-size: 13.5px; margin-top: 4px; max-width: 520px; }
.pro-inner .btn-white { background: #fff; color: var(--accent-ink); font-weight: 700; padding: 13px 24px; border-radius: var(--radius-sm); font-size: 15px; flex-shrink: 0; }

/* about — compact, footnote-style "why this exists" */
.about { padding: 28px 0 34px; }
.about-inner { max-width: 560px; margin: 0 auto; text-align: center; }
.about h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; color: var(--ink); }
.about p { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-bottom: 9px; }
.about p em { color: var(--ink-2); font-style: italic; }
.about .sig { font-size: 12px; color: var(--faint); margin-top: 14px; }
.about .sig a { color: var(--accent); font-weight: 600; }
.about .sig a:hover { text-decoration: underline; }

/* footer */
.site-footer { border-top: 1px solid var(--card-border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.footer-brand img { height: 24px; opacity: .9; }
.footer-inner a { font-size: 14px; }

@media (max-width: 720px){
  .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hero h1 { font-size: 26px; }
  .hero { padding: 30px 0 24px; }
  .container { padding: 0 18px; }
}

/* =====================================================
   LIVE additions — states for real data wiring
   ===================================================== */

/* utility */
.hidden { display: none !important; }

/* open vs closed permit status */
.permit-status.open { color: var(--warn); background: var(--warn-bg); }

/* loading states */
.permit-loading { display: flex; align-items: center; gap: 10px; padding: 22px 0; color: var(--muted); font-size: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--accent-50); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: pp-spin .7s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }

/* ── OPRA module (rendered by the shared opra.js into #opra-result) ── */
#opra-result.opra-loading, #opra-result.opra-idle { color: var(--muted); }
.opra-mun-name { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.opra-type-badge { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.opra-notes { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 0 0 14px; }
.opra-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.btn-opra-unified {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--ink-2); border: 1px solid var(--card-border);
  text-decoration: none; cursor: pointer; transition: all .15s;
}
.btn-opra-unified:hover { border-color: var(--accent); color: var(--accent); }
.btn-opra-unified.btn-opra-cta { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-opra-unified.btn-opra-cta:hover { background: var(--accent-hover); color: #fff; }
.btn-opra-unified.btn-opra-call { background: var(--good-bg); color: var(--good); border-color: var(--good-bg); }
.btn-opra-unified.btn-opra-call:hover { border-color: var(--good); color: var(--good); }
.opra-email { font-size: 13.5px; color: var(--muted); margin: 6px 0; }
.opra-custodian { font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; line-height: 1.45; }
.opra-cust-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 5px; margin-right: 7px; }
.opra-email a { color: var(--accent); }
.opra-report-link { display: inline-block; font-size: 12px; color: var(--faint); margin-top: 6px; }
.opra-loading-spinner, .opra-spinner { width: 16px; height: 16px; border: 2px solid var(--accent-50); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: pp-spin .7s linear infinite; }

/* school rows without a rating still look intentional */
.school .name { font-size: 14px; color: var(--ink-2); }

/* ── Idle preview grid (landing state before a search) ── */
.idle-state { padding-top: 8px; padding-bottom: 8px; }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
@media (max-width: 980px){ .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .feat-grid { grid-template-columns: 1fr; } }
.feat { display: flex; align-items: flex-start; gap: 12px; background: var(--card-bg); border: 1px solid var(--card-border); border-top: 3px solid var(--accent); border-radius: var(--radius-md) var(--radius-md) var(--radius-lg) var(--radius-lg); padding: 16px; box-shadow: none; transition: box-shadow .2s, border-color .2s; }
.feat:hover { box-shadow: var(--shadow-md); border-left-color: var(--accent-50); border-right-color: var(--accent-50); border-bottom-color: var(--accent-50); }
.feat.f-good { border-top-color: var(--good); }
.feat.f-warn { border-top-color: var(--warn); }

/* Family group labels — group the feature grid into labelled sections (spans full grid width) */
.fam-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.fam-row:first-child { margin-top: 0; }
.fam-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; white-space: nowrap; }
.fam-lbl.blue { color: var(--accent); }
.fam-lbl.green { color: var(--good); }
.fam-lbl.amber { color: var(--warn); }
.fam-rule { flex: 1; height: 1px; background: var(--card-border); }

/* History & records / Risk flags — two 2-card families placed side by side (each its own
   label + 2-col mini-grid), instead of living inside the 4-col .feat-grid, which put each
   family in its own half-empty row and (at the 2-col breakpoint) detached labels from cards
   entirely via grid auto-placement. Explicit side-by-side layout instead of relying on
   auto-placement gap-filling, so pairing holds at every width. */
.fam-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 20px; }
.fam-group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 12px; }
@media (max-width: 980px) { .fam-pair { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .fam-group-grid { grid-template-columns: 1fr; } }
.feat-ic { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feat-ic.warn { background: var(--warn-bg); color: var(--warn); }
.feat-ic.good { background: var(--good-bg); color: var(--good); }
.feat-ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; }
.feat-t { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.feat-d { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* ── Async enrichment — Zillow skeleton shimmer (fills in when scrape returns) ── */
@keyframes pp-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel { color: transparent !important; border-radius: 6px; background: linear-gradient(100deg, #EEF0F3 28%, #F7F8FA 50%, #EEF0F3 72%); background-size: 200% 100%; animation: pp-shimmer 1.3s ease-in-out infinite; }
.stat-num.skel { display: inline-block; width: 56px; height: 21px; }
.stat-num.sm.skel { height: 17px; }
.pd-src-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.src-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); background: var(--canvas); border: 1px solid var(--line); padding: 3px 9px; border-radius: var(--radius-pill); }

/* Mortgage: no-price prompt (shown in place of the estimate when we have no sale price/zestimate) */
.mort-prompt { display: flex; align-items: center; gap: 11px; background: var(--warn-bg); border: 1px solid #FCD34D; color: var(--warn); border-radius: var(--radius-md); padding: 16px 18px; font-size: 14px; line-height: 1.45; }
.mort-prompt svg { width: 20px; height: 20px; flex-shrink: 0; stroke: var(--warn); }
.mort-prompt b { font-weight: 700; }

/* ── NJ DCA housing inspection ── */
.dca-portal { font-size: 13px; font-weight: 600; color: var(--accent); border: 1px solid var(--card-border); padding: 7px 13px; border-radius: var(--radius-sm); white-space: nowrap; flex-shrink: 0; text-decoration: none; transition: border-color .18s, background .18s; }
.dca-portal:hover { border-color: var(--accent); background: var(--accent-soft); }
.dca-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.dca-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.dca-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: var(--radius-pill); }
.dca-badge.ok { background: var(--good-bg); color: var(--good); }
.dca-badge.no { background: var(--bad-bg); color: var(--bad); }
.inspect-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.inspect-row:last-of-type { border-bottom: none; }
.inspect-main { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.inspect-type { font-weight: 600; font-size: 14px; color: var(--ink); }
.inspect-date { font-size: 12.5px; color: var(--muted); }
.inspect-flag { flex-shrink: 0; font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-pill); }
.inspect-flag.ok { color: var(--good); background: var(--good-bg); }
.inspect-flag.bad { color: var(--bad); background: var(--bad-bg); }
@media (max-width: 560px){ .inspect-row { flex-wrap: wrap; gap: 6px; } }
/* DCA alerts — outstanding bills / judgments (real-data warnings) */
.dca-alert { background: var(--warn-bg); border: 1px solid #FCD34D; border-radius: var(--radius-md); padding: 12px 14px; margin-top: 14px; }
.dca-alert-title { font-size: 13px; font-weight: 700; color: var(--warn); margin-bottom: 6px; }
.dca-alert-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; flex-wrap: wrap; }
.dca-alert-row .due { color: var(--muted); font-size: 12.5px; }
.dca-alert-row .amt { color: var(--bad); font-weight: 700; }

/* print: hide chrome, let cards flow */
@media print {
  .site-header, .hero, .pro-banner, .head-actions, .about, .site-footer, .nav-links, .idle-state { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
