:root {
  /* PioCare brand palette (piocarellc.com) */
  --ink: #233d4d;
  --muted: #4a6070;
  --line: #dde5ea;
  --bg: #f7f7f3;
  --card: #ffffff;
  --forest: #233d4d;      /* primary: PioCare navy */
  --forest-dark: #1a2e3a;
  --navy-mid: #2e5268;
  --sun: #f2a307;         /* accent: PioCare gold */
  --sun-dark: #d99006;
  --mist: #e8eef1;
  --mom: #be185d;
  --dad: #1d4ed8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,42,36,.06), 0 4px 14px rgba(31,42,36,.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1, h2, .brand strong, .card h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 700; }
a { color: var(--forest); }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { border: 1px solid transparent; border-radius: 999px; padding: 9px 18px; font-weight: 600; font-size: .95rem; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--sun); color: var(--forest-dark); }
.btn-primary:hover { background: var(--sun-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--forest); }
.btn-light { background: var(--sun); color: var(--forest-dark); }
.btn-light:hover { background: var(--sun-dark); }
.link-btn { background: none; border: 0; padding: 0; color: var(--forest); text-decoration: underline; font-size: inherit; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 38px; height: 38px; color: var(--forest); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 1.15rem; }
.brand small { color: var(--muted); font-size: .78rem; }
.header-actions { display: flex; gap: 8px; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--mist) 0%, var(--bg) 100%); padding: 44px 0 26px; }
.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); max-width: 22ch; letter-spacing: -.01em; }
.lede { color: var(--muted); max-width: 62ch; font-size: 1.08rem; margin: 12px 0 20px; }
.search-row input {
  width: 100%; max-width: 640px; padding: 14px 18px; font-size: 1.05rem;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow);
}
.search-row input:focus { outline: 3px solid rgba(242,163,7,.35); border-color: var(--forest); }
.parent-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; color: var(--muted); font-weight: 600; }

/* Chips */
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 13px; font-size: .88rem; font-weight: 600; }
.chip:hover { border-color: var(--forest); }
.chip[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.chip-mom[aria-pressed="true"] { background: var(--mom); border-color: var(--mom); }
.chip-dad[aria-pressed="true"] { background: var(--dad); border-color: var(--dad); }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }

/* Layout */
.layout { display: grid; grid-template-columns: 290px 1fr; gap: 28px; padding-top: 22px; padding-bottom: 48px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; align-self: start; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
.filters-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.filters h2 { font-size: 1.05rem; }
.filters fieldset { border: 0; border-top: 1px solid var(--line); margin: 12px 0 0; padding: 12px 0 0; }
.filters legend { font-weight: 700; font-size: .92rem; padding: 0; margin-bottom: 4px; float: left; width: 100%; }
.filters legend + * { clear: both; }
.hint { color: var(--muted); font-size: .82rem; margin: 0 0 8px; }
.check-list label { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: .9rem; cursor: pointer; }
.check-list input { margin-top: 4px; accent-color: var(--forest); }
.check-list .count { color: var(--muted); margin-left: auto; font-size: .8rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; margin-top: 6px; }

.results-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-count { margin: 0; color: var(--muted); font-weight: 600; flex: 1; }
.filter-toggle { display: none; }
.view-toggle { display: none; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.view-toggle button { border: 0; background: none; padding: 7px 16px; font-weight: 600; }
.view-toggle button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.active-filters .chip::after { content: " ×"; }

.results-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 12px; }
.map-col { position: sticky; top: 76px; align-self: start; }
#map { height: calc(100vh - 140px); min-height: 380px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }
.map-note { color: var(--muted); font-size: .82rem; margin: 6px 2px 0; }

/* Cards */
.cards { display: grid; gap: 14px; align-content: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.card.flash { outline: 3px solid var(--sun); }
.card.featured { border-color: var(--sun); }
.card-top { display: flex; gap: 14px; align-items: flex-start; }
.logo { width: 54px; height: 54px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.card h3 { font-size: 1.12rem; }
.cat-pill { display: inline-block; margin-top: 4px; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.badge-partner { background: #fdf0d2; color: #7a5200; }
.badge-found { background: #eef0f2; color: #475569; }
.badge-mom { background: #fce7f3; color: var(--mom); }
.badge-dad { background: #dbeafe; color: var(--dad); }
.summary { margin: 10px 0 10px; font-size: .95rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.meta strong { color: var(--ink); font-weight: 600; }
.ages { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.age-tag { font-size: .76rem; padding: 2px 8px; border-radius: 6px; background: var(--mist); color: var(--forest-dark); }
.age-tag.match { background: var(--forest); color: #fff; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.links a, .links button { font-size: .85rem; font-weight: 600; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: #fff; color: var(--forest-dark); }
.links a:hover, .links button:hover { border-color: var(--forest); }
.links .report { margin-left: auto; border: 0; color: var(--muted); font-weight: 500; padding-right: 0; }
.addr { font-size: .84rem; color: var(--muted); margin-top: 8px; }
.addr div { margin-top: 2px; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); }

/* Map popups */
.leaflet-popup-content { font: .88rem/1.4 ui-sans-serif, system-ui, sans-serif; }
.leaflet-popup-content strong { font-size: .95rem; }
.popup-link { display: inline-block; margin-top: 6px; }

/* CTA + footer */
.cta-band { background: var(--forest); color: #fff; padding: 34px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-band p { margin: 6px 0 0; opacity: .9; }
.site-footer { padding: 24px 0 40px; color: var(--muted); font-size: .88rem; }

/* Modals */
.modal { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(20,30,25,.5); }
.modal-form { padding: 22px 24px; display: grid; gap: 12px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.close { border: 0; background: none; font-size: 1.8rem; line-height: 1; color: var(--muted); }
.modal label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.modal input:not([type=checkbox]), .modal select, .modal textarea { font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; width: 100%; }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: 2px solid rgba(242,163,7,.4); border-color: var(--forest); }
.modal label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.inline-checks { border: 0; padding: 0; margin: 0; }
.inline-checks legend { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.inline-checks div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.inline-checks label { display: flex; gap: 6px; font-weight: 400; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-status { font-size: .9rem; }
.form-status.ok { color: var(--forest); font-weight: 600; }
.form-status.err { color: #b91c1c; }

/* Responsive */
@media (max-width: 1100px) {
  .results-split { grid-template-columns: 1fr; }
  .view-toggle { display: inline-flex; }
  .results-area[data-view="list"] .map-col { display: none; }
  .results-area[data-view="map"] .cards { display: none; }
  .map-col { position: static; }
  #map { height: 70vh; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .filters { display: none; position: static; max-height: none; }
  .filters.open { display: block; }
  .filter-toggle { display: inline-block; }
  .header-actions .btn-ghost { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .links .report { margin-left: 0; }
}
@media (max-width: 480px) {
  .brand small { display: none; }
  .header-actions .btn { padding: 8px 13px; font-size: .85rem; }
}
