:root {
  /* Warm, sunny civic palette — friendly but trustworthy, not corporate-gov. */
  --bg: #fbf6ec;
  --panel: #ffffff;
  --ink: #1b3a2b;
  --muted: #4f6157;
  --line: #e9e1cf;
  --accent: #2f8f5b;
  --accent-dark: #1c5a3a;
  --accent-soft: #e4f3e8;
  --sun: #f6a623;
  --sun-soft: #fdedcd;
  --coral: #ef6a4c;
  --shadow: 0 26px 70px rgba(23, 49, 38, 0.14);
  --shadow-card: 0 10px 30px rgba(23, 49, 38, 0.07);
  --ease-out: cubic-bezier(.2, .78, .22, 1);
  --motion-fast: 150ms;
  --motion-med: 260ms;

  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, ui-serif, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Category accent colors — drive the card stripe + tag. */
  --cat-aquatics: #2f8fbf;
  --cat-youth: #e8821e;
  --cat-camps: #2f8f5b;
  --cat-events: #a64b9c;
  --cat-bay-beach: #ef6a4c;
  --cat-wildlife: #14887b;
  --cat-fitness: #d6457a;
  --cat-facilities: #6b7b8a;
  --cat-food: #d6453f;
  --cat-outdoors: #4f7a3a;

  --appbar-h: 86px;

  font-family: var(--font-body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -5%, rgba(246, 166, 35, .14) 0, transparent 26rem),
    radial-gradient(circle at top left, rgba(47, 143, 91, .10) 0, transparent 30rem),
    var(--bg);
  line-height: 1.5;
}
a { color: inherit; }
/* Mode views and layout containers carry display rules that would beat the UA [hidden] rule,
   leaving inactive modes visible. Keep [hidden] authoritative. */
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--appbar-h);
  background: rgba(251, 246, 236, .88);
  color: var(--ink);
  border-bottom: 1px solid rgba(233, 225, 207, .86);
  box-shadow: 0 14px 42px rgba(23, 49, 38, .08);
  backdrop-filter: blur(18px);
}
.appbar-inner {
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  min-height: var(--appbar-h);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .95rem;
  padding: .75rem 1.1rem;
}
.appbar-branding {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  flex: 0 1 auto;
}
.brand {
  display: grid;
  gap: .02rem;
  text-decoration: none;
  min-width: 7.7rem;
  max-width: 10.6rem;
}
.brand-main {
  font-family: var(--font-display);
  font-weight: 720;
  font-size: clamp(.9rem, 1.05vw, 1.08rem);
  line-height: .92;
  letter-spacing: 0;
  color: var(--ink);
  display: grid;
  gap: .02rem;
}
.brand-sub {
  font-family: var(--font-body);
  font-size: clamp(.49rem, .6vw, .61rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: .045em;
  text-transform: uppercase;
  color: var(--accent-dark);
  opacity: .78;
  white-space: nowrap;
}
.app-tag {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: var(--sun-soft);
  color: #173023;
  border: 1px solid #f1e2bd;
  white-space: nowrap;
}
.app-tag::before { content: "ⓘ "; color: var(--coral); font-weight: 900; }
.appbar-official {
  margin-left: 0;
  font-size: .86rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8rem;
}
.appbar-official:hover { text-decoration: underline; }

/* ---------- Language selector (M6D) — compact native select, mobile-safe ---------- */
.lang-switch {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
}
.lang-globe { font-size: 1rem; line-height: 1; flex: 0 0 auto; }
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-dark);
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .42rem 1.7rem .42rem .75rem;
  min-height: 38px;
  max-width: 9.5rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23173f2c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: .6rem;
}
.lang-select:hover { border-color: var(--accent); }
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-layout {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.4rem 1.1rem 2rem;
}

/* ---------- Header nav (desktop) ---------- */
.topnav {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .18rem;
  padding: .36rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 16px 44px rgba(23, 49, 38, .09);
  min-width: 0;
  overflow: visible;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-height: 40px;
  padding: .5rem .68rem;
  border-radius: .72rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 760;
  font-size: .88rem;
  min-width: 0;
  flex: 0 1 auto;
  transition:
    background .14s ease,
    color .14s ease,
    transform .14s ease;
}
.nav-item:hover { background: #f6f8f3; color: var(--ink); }
.nav-item.active {
  background: #173f2c;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.nav-item.active:hover { transform: translateY(-1px); }
.nav-icon { font-size: 1.16rem; flex: 0 0 auto; text-align: center; }
.nav-label {
  min-width: 0;
  max-width: 8.2rem;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.08;
  text-align: center;
}

@media (max-width: 1440px) {
  :root { --appbar-h: 108px; }
  .appbar-inner { gap: .62rem; }
  .brand { max-width: 9.7rem; }
  .appbar-official { display: none; }
  .nav-item { gap: .34rem; padding: .48rem .54rem; font-size: .82rem; }
  .nav-label { max-width: 6.8rem; }
}

@media (max-width: 1280px) and (min-width: 961px) {
  :root { --appbar-h: 128px; }
  .appbar-inner {
    flex-wrap: wrap;
    align-content: center;
    row-gap: .48rem;
  }
  .appbar-branding { flex: 0 1 auto; }
  .topnav {
    order: 2;
    flex: 1 0 100%;
    max-width: 100%;
  }
  .lang-switch {
    margin-left: auto;
  }
  .nav-item {
    flex: 1 1 7.2rem;
    min-height: 44px;
  }
  .nav-label {
    max-width: 9rem;
  }
}

@media (max-width: 1120px) {
  .appbar-inner { gap: .6rem; }
  .appbar-official { display: none; }
  .topnav { justify-content: center; }
  .nav-item { gap: .42rem; padding: .58rem .68rem; font-size: .88rem; }
}

@media (max-width: 960px) {
  .app-tag { display: none; }
  .topnav .nav-label { display: none; }
  .topnav .nav-item { min-width: 2.55rem; padding-inline: .52rem; }
}

/* ---------- Main + mode views ---------- */
.app-main { min-width: 0; }
.mode-view { animation: fade var(--motion-med) var(--ease-out) both; }
.control-sticky {
  position: sticky;
  top: var(--appbar-h);
  z-index: 22;
  margin: 0 -1.1rem 1rem;
  padding: .68rem 1.1rem .7rem;
  background:
    linear-gradient(180deg, rgba(251, 246, 236, .98), rgba(251, 246, 236, .92));
  border-bottom: 1px solid rgba(233, 225, 207, .82);
  box-shadow: 0 16px 36px rgba(23, 49, 38, .08);
  backdrop-filter: blur(14px);
}
.view-head { margin: 0 0 .7rem; }
.view-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -.015em;
  margin: 0 0 .22rem;
}
.view-head p { color: var(--muted); font-size: .96rem; max-width: 60ch; margin: 0; }

.eyebrow {
  margin: 0 0 .55rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .76rem;
  font-weight: 800;
  color: var(--accent-dark);
}

/* ---------- Unofficial notice ---------- */
.unofficial-notice {
  display: inline-flex;
  align-items: flex-start;
  gap: .5rem;
  max-width: 640px;
  margin: 0 0 1.2rem;
  padding: .6rem .95rem;
  border-radius: .85rem;
  background: var(--sun-soft);
  color: #173023;
  border: 1px solid #f1e2bd;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.4;
}
.unofficial-notice::before {
  content: "ⓘ";
  color: var(--coral);
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.3;
}

/* ---------- Home (short, app-like) ---------- */
.home { display: flex; flex-direction: column; gap: 1.7rem; }
.home-hero { display: flex; flex-direction: column; gap: 1rem; }
.home-kicker {
  display: flex; align-items: center; flex-wrap: wrap; gap: .55rem;
  margin: 0; text-transform: uppercase; letter-spacing: .12em;
  font-size: .74rem; font-weight: 800; color: var(--accent-dark);
}
.home-unofficial {
  text-transform: none; letter-spacing: .01em; font-size: .72rem; font-weight: 800;
  color: #8a5a12; background: var(--sun-soft); border: 1px solid #f1e2bd;
  border-radius: 999px; padding: .12rem .55rem;
}
.home-unofficial::before { content: "ⓘ "; color: var(--coral); font-weight: 900; }
.home-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.02;
  letter-spacing: -.02em; margin: 0; max-width: 16ch;
  overflow-wrap: break-word; /* long translated words wrap instead of overflowing at 390px */
}
.home-title em { font-style: italic; color: var(--sun); }

/* search hero */
.home-search { position: relative; display: flex; align-items: center; width: 100%; max-width: 620px; }
.home-search-icon { position: absolute; left: 1.1rem; font-size: 1.15rem; pointer-events: none; opacity: .85; }
.home-search input[type="search"] {
  width: 100%; min-height: 58px; padding: 0 1.1rem 0 2.9rem;
  border: 1.5px solid var(--line); border-radius: 1.1rem; background: #fff;
  font-size: 1.05rem; box-shadow: var(--shadow-card);
}

/* live results panel */
.home-results {
  width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: .9rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 1.1rem;
  padding: 1rem; box-shadow: var(--shadow-card);
}
.home-resgroup { display: flex; flex-direction: column; gap: .25rem; }
.home-reshead {
  margin: 0 .2rem .1rem; font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.home-res {
  --cat: var(--accent);
  display: flex; flex-direction: column; gap: .05rem; text-align: left; min-width: 0;
  border: 0; background: none; border-left: 3px solid var(--cat);
  padding: .4rem .3rem .4rem .7rem; border-radius: .25rem; cursor: pointer; font-family: inherit;
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
}
.home-res:hover, .home-res:focus-visible { background: #f6f8f3; transform: translateX(2px); }
.home-res-name { font-weight: 800; font-size: .98rem; color: var(--ink); }
.home-res-sub { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-res[data-category="aquatics"] { --cat: var(--cat-aquatics); }
.home-res[data-category="youth"] { --cat: var(--cat-youth); }
.home-res[data-category="camps"] { --cat: var(--cat-camps); }
.home-res[data-category="events"] { --cat: var(--cat-events); }
.home-res[data-category="bay-beach"] { --cat: var(--cat-bay-beach); }
.home-res[data-category="wildlife"] { --cat: var(--cat-wildlife); }
.home-res[data-category="fitness"] { --cat: var(--cat-fitness); }
.home-res[data-category="outdoors"] { --cat: var(--cat-outdoors); }
.home-res-all {
  align-self: flex-start; border: 0; background: none; color: var(--accent-dark);
  font-weight: 800; font-size: .9rem; cursor: pointer; text-decoration: underline; padding: .2rem;
}
.home-noresult { margin: 0; color: var(--muted); font-size: .95rem; }

/* quick picks */
.home-quickpicks { display: flex; flex-wrap: wrap; gap: .5rem; }
.quickpick {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 42px;
  padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-family: inherit; font-weight: 700;
  font-size: .9rem; cursor: pointer; box-shadow: var(--shadow-card);
  transition: border-color var(--motion-fast) ease, transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.quickpick:hover, .quickpick:focus-visible { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 14px 32px rgba(23, 49, 38, .12); }

/* path cards (3 browse tiles) */
.home-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.path-card {
  --cat: var(--accent);
  display: flex; align-items: center; gap: .8rem;
  padding: 1rem 1.1rem; border-radius: 1.1rem; background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--cat);
  box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink);
  animation: rise var(--motion-med) var(--ease-out) both;
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.path-card[data-cat="youth"] { --cat: var(--cat-youth); }
.path-card[data-cat="aquatics"] { --cat: var(--cat-aquatics); }
.path-card[data-cat="events"] { --cat: var(--cat-events); }
.path-card:hover, .path-card:focus-visible { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(23, 49, 38, .13); border-color: color-mix(in srgb, var(--cat) 38%, var(--line)); }
.path-icon { font-size: 1.7rem; line-height: 1; flex: 0 0 auto; }
.path-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.path-title { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: -.01em; overflow-wrap: break-word; min-width: 0; }
.path-count { font-size: .82rem; font-weight: 700; color: var(--muted); }
.path-count strong { color: var(--accent-dark); }

/* upcoming snapshot */
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.home-section-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin: 0; letter-spacing: -.01em; }
.home-section-link { font-size: .85rem; font-weight: 800; color: var(--accent-dark); text-decoration: none; white-space: nowrap; }
.home-section-link:hover { text-decoration: underline; }
.home-upcoming-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.up-row {
  --cat: var(--sun);
  display: flex; align-items: center; gap: .9rem;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--cat);
  border-radius: .8rem; padding: .55rem .9rem; box-shadow: var(--shadow-card);
}
.up-row[data-cat="aquatics"] { --cat: var(--cat-aquatics); }
.up-row[data-cat="youth"] { --cat: var(--cat-youth); }
.up-row[data-cat="camps"] { --cat: var(--cat-camps); }
.up-row[data-cat="events"] { --cat: var(--cat-events); }
.up-row[data-cat="bay-beach"] { --cat: var(--cat-bay-beach); }
.up-row[data-cat="wildlife"] { --cat: var(--cat-wildlife); }
.up-when { flex: 0 0 2.5rem; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.up-mon { font-size: .67rem; font-weight: 800; text-transform: uppercase; color: var(--cat); letter-spacing: .03em; }
.up-day { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--ink); }
.up-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.up-title, .up-title-static { text-align: left; font-weight: 800; font-size: .98rem; color: var(--ink); }
.up-title { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.up-title:hover { color: var(--accent-dark); text-decoration: underline; }
.up-meta { font-size: .82rem; color: var(--muted); }

/* quiet stats + sources line */
.home-fine {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1rem; margin: 0; padding-top: .9rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .88rem;
}
.home-fine-stats strong { color: var(--accent-dark); font-weight: 800; }
.home-fine a { color: var(--accent-dark); font-weight: 800; text-decoration: none; white-space: nowrap; }
.home-fine a:hover { text-decoration: underline; }

/* ---------- Toolbar (search + filters), inside sticky view subheader ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .62rem;
  align-items: center;
  padding: 0;
  margin: 0;
  background: transparent;
}
.search { flex: 1 1 260px; }
input[type="search"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 1rem;
  min-height: 50px;
  padding: 0 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
input[type="search"]:focus { outline: 3px solid rgba(47, 143, 91, .28); border-color: var(--accent); }
.filters { display: flex; gap: .38rem; flex-wrap: wrap; flex: 2 1 380px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  min-height: 36px;
  padding: .34rem .66rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.toggle.active { background: var(--sun); border-color: var(--sun); color: #3a2c05; }

/* ---------- Results info ---------- */
.results-info { margin: .55rem 0 0; color: var(--muted); font-size: .9rem; }
.results-info strong { color: var(--ink); }
.clear-filters {
  margin-left: .5rem;
  border: 0;
  background: none;
  color: var(--accent-dark);
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: .2rem .1rem;
}

/* ---------- Cards (Programs) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: .9rem; align-items: stretch; }
.card {
  --cat: var(--accent);
  position: relative;
  min-height: 0;
  height: 218px;
  background:
    radial-gradient(circle at 11% 18%, color-mix(in srgb, var(--cat) 18%, transparent) 0 3.6rem, transparent 3.7rem),
    linear-gradient(135deg, color-mix(in srgb, var(--cat) 8%, #fff) 0%, #fff 62%);
  border: 1px solid color-mix(in srgb, var(--cat) 24%, var(--line));
  border-radius: .95rem;
  padding: .86rem .9rem .76rem;
  box-shadow: 0 12px 28px rgba(23, 49, 38, .07);
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: .72rem;
  overflow: clip;
  transition: transform var(--motion-med) var(--ease-out), box-shadow var(--motion-med) var(--ease-out), border-color var(--motion-med) var(--ease-out), background var(--motion-med) ease;
  animation: rise .5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.card::before {
  content: "";
  position: absolute;
  inset: .64rem auto .64rem 0;
  width: 4px;
  height: auto;
  border-radius: 0 999px 999px 0;
  background: var(--cat);
}
.card:hover, .card:focus-within {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 42px rgba(23, 49, 38, .13);
  border-color: color-mix(in srgb, var(--cat) 50%, var(--line));
}
.card[data-category="aquatics"] { --cat: var(--cat-aquatics); }
.card[data-category="youth"] { --cat: var(--cat-youth); }
.card[data-category="camps"] { --cat: var(--cat-camps); }
.card[data-category="events"] { --cat: var(--cat-events); }
.card[data-category="bay-beach"] { --cat: var(--cat-bay-beach); }
.card[data-category="wildlife"] { --cat: var(--cat-wildlife); }
.card[data-category="fitness"] { --cat: var(--cat-fitness); }
.card[data-category="facilities"] { --cat: var(--cat-facilities); }

.card-mark {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  align-self: start;
  font-size: 1.24rem;
  border-radius: .85rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat) 18%, var(--line));
  transition: transform var(--motion-med) var(--ease-out), box-shadow var(--motion-med) ease;
}
.card:hover .card-mark, .card:focus-within .card-mark { transform: translateY(-2px) rotate(-3deg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat) 24%, var(--line)), 0 8px 18px rgba(23, 49, 38, .1); }
.card-content { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: .42rem; margin: .02rem 0 .28rem; }
.badge {
  align-self: flex-start;
  background: rgba(255, 255, 255, .72);
  color: #46584d;
  border-radius: 999px;
  padding: .12rem .42rem;
  font-size: .6rem;
  font-weight: 760;
  letter-spacing: .01em;
  max-width: 8.6rem;
  overflow: visible;
  white-space: nowrap;
}
.badge.is-free { background: var(--accent-soft); color: var(--accent-dark); }
.card-cat {
  min-width: 0;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--cat);
  overflow: visible;
  white-space: nowrap;
}
.card h3 { margin: 0 0 .24rem; }
.card-title {
  font-family: var(--font-display); font-weight: 680; font-size: 1.04rem;
  letter-spacing: -.01em; line-height: 1.12; text-align: left; color: var(--ink);
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  display: block;
  overflow: visible;
}
.card-title:hover { color: var(--accent-dark); text-decoration: underline; }
.card-summary {
  color: var(--muted);
  margin: 0 0 .52rem;
  font-size: .8rem;
  line-height: 1.3;
  display: block;
  overflow: visible;
}
.card-meta-compact {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  overflow: visible;
  max-height: none;
  margin: 0;
  color: #3c4d43;
  font-size: .69rem;
  line-height: 1.2;
}
.card-meta-compact span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, .66);
  border: 1px solid color-mix(in srgb, var(--cat) 16%, var(--line));
  border-radius: 999px;
  padding: .14rem .45rem;
}
.card-foot {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: .6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: inherit;
  font-weight: 850;
  color: var(--cat);
  background: #fff;
  border: 1.5px solid color-mix(in srgb, var(--cat) 34%, var(--line));
  text-decoration: none;
  min-height: 30px;
  padding: .28rem .62rem;
  border-radius: 999px;
  font-size: .72rem;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, color .14s ease;
}
.card-cta:hover { transform: translateY(-1px); background: var(--cat); color: #fff; }
.card-source { font-weight: 700; color: var(--muted); font-size: .7rem; text-decoration: none; white-space: nowrap; }
.card-source:hover { color: var(--accent-dark); text-decoration: underline; }
.card-empty { grid-column: 1 / -1; }
.card-empty::before { display: none; }
.card-empty h3 { margin-top: .2rem; }

/* ---------- Places (map-first) ---------- */
/* Two columns: a large map-style surface (primary) + a compact grouped rail (replaces 33 cards). */
.places-tool { display: grid; grid-template-columns: 1.25fr .9fr; gap: 1.2rem; align-items: start; }

/* --- map surface: placeholder ONLY — no tiles, no pins, no external map until coords are reviewed --- */
.places-map { position: sticky; top: calc(var(--appbar-h) + 5.4rem); display: flex; flex-direction: column; gap: .7rem; }
.places-map-canvas {
  position: relative; min-height: 460px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1.6rem 3.4rem;
  border-radius: 1.3rem; border: 1px solid var(--line); box-shadow: var(--shadow-card); overflow: hidden;
  background:
    linear-gradient(rgba(47, 143, 91, .05), rgba(47, 143, 91, .05)),
    repeating-linear-gradient(0deg, transparent 0 33px, rgba(27, 58, 43, .05) 33px 34px),
    repeating-linear-gradient(90deg, transparent 0 33px, rgba(27, 58, 43, .05) 33px 34px),
    #eef5ee;
}
.places-map-center { display: flex; flex-direction: column; align-items: center; gap: .35rem; max-width: 44ch; }
.places-map-pin { font-size: 2.4rem; line-height: 1; }
.places-map-title { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin: .1rem 0 0; color: var(--ink); }
.places-map-note { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.places-map-note strong { color: var(--accent-dark); }
/* Plain-language note explaining why only some places have pins (sits under the privacy note). */
.places-map-pins-note { font-size: .82rem; opacity: .92; }
.places-map-readiness {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0;
  padding: .65rem 1rem; background: rgba(255, 255, 255, .85); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); font-size: .82rem; font-weight: 700; color: var(--muted);
}
.places-map-readiness strong { color: var(--ink); }

/* type-count legend — overview + a one-tap filter shortcut */
.places-map-legend { display: flex; flex-wrap: wrap; gap: .45rem; }
.legend-chip {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 34px;
  padding: .28rem .62rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-family: inherit; font-weight: 700; font-size: .8rem;
  cursor: pointer; transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.legend-chip:hover { border-color: var(--accent); }
.legend-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.legend-count { font-weight: 800; color: var(--muted); }
.legend-chip.active .legend-count { color: rgba(255, 255, 255, .85); }
/* Comfortable tap targets on any touch device (covers wide touchscreens, not just narrow viewports) */
@media (pointer: coarse) {
  .chip,
  .legend-chip { min-height: 40px; }
  .place-row-dir { min-height: 38px; }
}

/* --- hidden-map state: shown after the user clicks "Hide map" --- */
.places-map-optin { gap: .9rem; }
.map-toggle-btn {
  margin-top: .35rem; align-self: center;
  display: inline-flex; align-items: center; gap: .34rem; min-height: 38px;
  padding: .42rem .95rem; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-family: inherit; font-weight: 800; font-size: .84rem;
  cursor: pointer; transition: filter .14s ease, border-color .14s ease, color .14s ease;
}
.map-toggle-btn:hover { filter: brightness(1.06); }
.map-toggle-btn.ghost { background: #fff; color: var(--accent-dark); border-color: var(--line); min-height: 34px; padding: .32rem .72rem; font-size: .78rem; }
.map-toggle-btn.ghost:hover { border-color: var(--accent); filter: none; }

/* --- live Leaflet map (shown by default) --- */
.places-map-live { display: flex; flex-direction: column; gap: .55rem; }
.places-map-live-canvas {
  height: 460px; width: 100%;
  border-radius: 1.3rem; border: 1px solid var(--line); box-shadow: var(--shadow-card);
  overflow: hidden; background: #eef5ee;
  position: relative; z-index: 0; isolation: isolate; /* trap Leaflet's internal z-index below the app header & drawer */
}
.places-map-emptynote { margin: 0; color: var(--muted); font-size: .85rem; font-weight: 600; }
.places-map-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.places-map-readiness-inline { margin: 0; font-size: .84rem; font-weight: 700; color: var(--muted); }
.places-map-readiness-inline strong { color: var(--ink); }
.map-pending {
  padding: .78rem .85rem;
  border: 1px solid rgba(180, 96, 28, .24);
  border-radius: 1rem;
  background: rgba(255, 248, 234, .92);
  box-shadow: 0 10px 22px rgba(44, 31, 10, .06);
}
.map-pending-head {
  display: grid;
  gap: .12rem;
  margin-bottom: .55rem;
}
.map-pending-head strong { color: var(--ink); font-size: .85rem; }
.map-pending-head span { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.map-pending-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .38rem;
}
.map-pending-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
}
.map-pending-open {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: .08rem 0;
  text-align: left;
  color: var(--ink);
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}
.map-pending-open span,
.map-pending-open small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-pending-open small {
  margin-top: .04rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}
.map-pending-open:hover span { text-decoration: underline; }
.map-pending-dir,
.map-pending-status {
  white-space: nowrap;
  border-radius: 999px;
  padding: .24rem .55rem;
  font-size: .72rem;
  font-weight: 800;
}
.map-pending-dir {
  color: var(--accent-dark);
  text-decoration: none;
  border: 1px solid rgba(32, 95, 65, .2);
  background: #fff;
}
.map-pending-dir:hover { border-color: var(--accent); }
.map-pending-status {
  color: var(--muted);
  background: rgba(255, 255, 255, .7);
}
.map-pending-more {
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}

/* Leaflet attribution stays legible and links are tappable */
.leaflet-container .leaflet-control-attribution { font-size: .68rem; }
.leaflet-container .leaflet-control-attribution a { color: var(--accent-dark); }

/* --- custom map markers: a teardrop pin carrying the legend emoji, tinted per category --- */
.gb-marker { background: none; border: 0; }
.gb-marker-pin {
  --pin: var(--accent);
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); transform-origin: center;
  background: var(--pin); border: 2px solid #fff; box-shadow: 0 3px 8px rgba(23, 49, 38, .35);
}
.gb-marker-ico { transform: rotate(45deg); font-size: .95rem; line-height: 1; }
.gb-marker:focus-visible .gb-marker-pin { outline: 3px solid var(--sun); outline-offset: 2px; }
.gb-cat-aquatics { --pin: var(--cat-aquatics); }
.gb-cat-youth { --pin: var(--cat-youth); }
.gb-cat-events { --pin: var(--cat-events); }
.gb-cat-bay-beach { --pin: var(--cat-bay-beach); }
.gb-cat-wildlife { --pin: var(--cat-wildlife); }
.gb-cat-food { --pin: var(--cat-food); }
.gb-cat-outdoors { --pin: var(--cat-outdoors); }

/* --- marker popup --- */
.leaflet-popup-content-wrapper {
  border-radius: .9rem;
  box-shadow: 0 12px 26px rgba(23, 49, 38, .22);
}
.leaflet-popup-content {
  width: min(230px, calc(100vw - 3rem)) !important;
  margin: .72rem .82rem .78rem;
  line-height: 1.32;
}
.leaflet-popup-close-button {
  width: 1.6rem !important;
  height: 1.6rem !important;
  display: grid !important;
  place-items: center;
  color: var(--muted) !important;
  font-size: 1.05rem !important;
  line-height: 1 !important;
}
.map-popup { display: grid; gap: .24rem; min-width: 0; }
.leaflet-popup .map-popup-name,
.leaflet-popup .map-popup-type,
.leaflet-popup .map-popup-addr { margin: 0 !important; }
.map-popup-name { font-weight: 800; font-size: .95rem; line-height: 1.15; color: var(--ink); }
.map-popup-type { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.map-popup-addr { font-size: .78rem; line-height: 1.3; color: var(--muted); }
.map-popup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .42rem; margin-top: .38rem; }
.map-popup-details {
  min-height: 30px; padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-family: inherit; font-weight: 800; font-size: .76rem; cursor: pointer;
}
.map-popup-details:hover { filter: brightness(1.06); }
.map-popup-dir { font-weight: 800; font-size: .76rem; color: var(--accent-dark); white-space: nowrap; }

/* --- compact grouped rail (short rows, no per-row source/disclaimer text) --- */
.places-rail { display: grid; gap: 1.15rem; align-content: start; min-width: 0; }
.place-group { display: grid; gap: .4rem; }
.place-group-head {
  display: flex; align-items: center; gap: .45rem; margin: 0;
  font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.pg-count { background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: .05rem .5rem; font-size: .72rem; font-weight: 800; }
.place-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.place-row {
  --cat: var(--accent);
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--cat);
  border-radius: .7rem; padding: 0 .6rem 0 0; box-shadow: var(--shadow-card);
  animation: rise var(--motion-med) var(--ease-out) both;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-fast) ease, background var(--motion-fast) ease;
}
.place-row:hover, .place-row:focus-within { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(23, 49, 38, .11); background: color-mix(in srgb, var(--cat) 4%, #fff); }
.place-row[data-category="aquatics"] { --cat: var(--cat-aquatics); }
.place-row[data-category="youth"] { --cat: var(--cat-youth); }
.place-row[data-category="bay-beach"] { --cat: var(--cat-bay-beach); }
.place-row[data-category="wildlife"] { --cat: var(--cat-wildlife); }
.place-row[data-category="outdoors"] { --cat: var(--cat-outdoors); }
.place-row-open {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .04rem;
  text-align: left; background: none; border: 0; cursor: pointer; font-family: inherit;
  padding: .55rem .4rem .55rem .8rem;
}
.place-row-name { font-weight: 800; font-size: .95rem; color: var(--ink); }
.place-row-open:hover .place-row-name { color: var(--accent-dark); text-decoration: underline; }
.place-row-sub { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-row-flag { color: #9a6212; font-weight: 700; }
.place-row-dir {
  /* Quiet, tinted outline — obvious + tappable, but lighter than the place name. */
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px;
  font-weight: 700; font-size: .78rem; color: var(--accent-dark); background: transparent;
  border: 1.5px solid color-mix(in srgb, var(--cat) 38%, var(--line));
  padding: .3rem .8rem; border-radius: 999px; text-decoration: none; white-space: nowrap;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.place-row-dir:hover { background: var(--cat); border-color: var(--cat); color: #fff; }
.place-row-status { flex: 0 0 auto; font-size: .74rem; font-weight: 800; color: #9a6212; white-space: nowrap; padding-right: .2rem; }
.place-empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 1rem; padding: 1.6rem; text-align: center; }
.place-empty h3 { margin: 0 0 .3rem; font-family: var(--font-display); }
.place-empty p { margin: 0; color: var(--muted); }

/* ---------- Dates (agenda) ---------- */
.dates-agenda { display: grid; gap: 1.5rem; }
.agenda-month-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0 0 .7rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  letter-spacing: -.01em;
}
.agenda-month-title span {
  font-family: var(--font-body);
  font-size: .76rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: .1rem .55rem;
  font-weight: 800;
}
.agenda-empty { color: var(--muted); padding: 1.6rem; text-align: center; border: 1px dashed var(--line); border-radius: 1rem; }
.agenda-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.agenda-row {
  --cat: var(--sun);
  display: flex;
  align-items: stretch;
  gap: .9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cat);
  border-radius: .9rem;
  padding: .7rem 1rem;
  box-shadow: var(--shadow-card);
  animation: rise var(--motion-med) var(--ease-out) both;
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.agenda-row:hover, .agenda-row:focus-within { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(23, 49, 38, .12); border-color: color-mix(in srgb, var(--cat) 36%, var(--line)); }
.agenda-row[data-cat="aquatics"] { --cat: var(--cat-aquatics); }
.agenda-row[data-cat="youth"] { --cat: var(--cat-youth); }
.agenda-row[data-cat="camps"] { --cat: var(--cat-camps); }
.agenda-row[data-cat="events"] { --cat: var(--cat-events); }
.agenda-row[data-cat="bay-beach"] { --cat: var(--cat-bay-beach); }
.agenda-row[data-cat="wildlife"] { --cat: var(--cat-wildlife); }

/* date chip — single-day shows month+day; range shows a span pill + a kind tag */
.agenda-when { flex: 0 0 3.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .1rem; }
.agenda-row.is-range .agenda-when { flex-basis: 5.6rem; }
.agenda-mon { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--cat); }
.agenda-num { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--ink); }
.agenda-range { font-size: .82rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.agenda-tag { font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--cat); border-radius: 999px; padding: .08rem .42rem; }

.agenda-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .25rem; justify-content: center; }
.agenda-title, .agenda-title-static { text-align: left; font-weight: 800; font-size: 1rem; letter-spacing: -.01em; color: var(--ink); }
.agenda-title { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-body); }
.agenda-title:hover { color: var(--accent-dark); text-decoration: underline; }
.agenda-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; }
.agenda-time { color: var(--muted); font-size: .85rem; font-weight: 700; }
.agenda-link { background: none; border: 0; padding: 0; cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--accent-dark); text-decoration: none; }
.agenda-link:hover { text-decoration: underline; }
.agenda-kind { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .04rem .45rem; }
.agenda-src { flex: 0 0 auto; align-self: center; font-weight: 800; font-size: .8rem; color: var(--accent-dark); text-decoration: none; white-space: nowrap; }
.agenda-src:hover { text-decoration: underline; }

/* ---------- Dates: view toggle (segmented) ---------- */
.dates-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; }
.dates-toolbar .filters { flex: 0 0 auto; }   /* don't vertical-grow inside the column toolbar */
.seg { display: inline-flex; gap: .2rem; padding: .25rem; background: #eef0ec; border: 1px solid var(--line); border-radius: 999px; align-self: flex-start; }
.seg-btn { min-height: 38px; padding: .4rem 1.1rem; border: 0; background: none; border-radius: 999px; font-weight: 800; font-size: .9rem; color: var(--muted); cursor: pointer; transition: background .14s ease, color .14s ease; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: var(--ink); color: #fff; }

/* ---------- Dates: month grid ---------- */
.dates-month { display: grid; gap: 1.6rem; }
.cal-month-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin: 0 0 .5rem; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekdays { gap: .3rem; margin-bottom: .3rem; }
.cal-wd { text-align: center; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-grid { gap: .3rem; }
.cal-day {
  --cat: var(--accent);
  min-height: 5rem; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: .6rem; padding: .35rem .4rem; display: flex; flex-direction: column; gap: .2rem; overflow: hidden;
}
.cal-day.empty { background: transparent; border: 0; min-height: 0; }
.cal-day.is-today {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff, var(--accent-soft));
  box-shadow: inset 0 0 0 1px rgba(47, 143, 91, .18);
}
button.cal-day { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
button.cal-day.has:hover { border-color: var(--accent); box-shadow: 0 8px 18px rgba(23, 49, 38, .1); transform: translateY(-1px); }
.cal-day.is-today .cal-num {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 999px;
}
.cal-num { font-weight: 800; font-size: .85rem; color: var(--ink); }
.cal-count { display: none; align-self: flex-start; font-size: .66rem; font-weight: 800; color: #fff; background: var(--accent); border-radius: 999px; padding: .02rem .42rem; }
.cal-events { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.cal-chip { font-size: .62rem; font-weight: 700; color: #fff; background: var(--cat); border-radius: .3rem; padding: .05rem .32rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip[data-cat="aquatics"] { background: var(--cat-aquatics); }
.cal-chip[data-cat="youth"] { background: var(--cat-youth); }
.cal-chip[data-cat="camps"] { background: var(--cat-camps); }
.cal-chip[data-cat="events"] { background: var(--cat-events); }
.cal-chip[data-cat="bay-beach"] { background: var(--cat-bay-beach); }
.cal-chip[data-cat="wildlife"] { background: var(--cat-wildlife); }
.cal-more { font-size: .62rem; font-weight: 800; color: var(--accent-dark); }

/* ---------- Dates: week view ---------- */
.dates-week { display: grid; gap: 1rem; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: .8rem; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .5rem; box-shadow: var(--shadow-card); }
.week-btn { min-height: 40px; padding: .4rem 1.1rem; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; font-weight: 800; cursor: pointer; }
.week-btn:hover { border-color: var(--accent); }
.week-label { font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; }
.week-days { display: grid; gap: .7rem; }
.week-day { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: .7rem .9rem; box-shadow: var(--shadow-card); }
.week-day.empty { box-shadow: none; opacity: .7; }
.week-day.is-today {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff, var(--accent-soft));
  box-shadow: 0 12px 34px rgba(47, 143, 91, .13);
}
.week-day-head { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0 0 .4rem; display: flex; gap: .5rem; align-items: baseline; }
.week-day.is-today .week-day-head::after {
  content: attr(data-today);
  font-family: var(--font-body);
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent-dark);
  background: #fff;
  border: 1px solid rgba(47, 143, 91, .25);
  border-radius: 999px;
  padding: .05rem .48rem;
}
.week-day-head span { font-family: var(--font-body); font-size: .82rem; color: var(--muted); font-weight: 700; }
.week-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.week-none { margin: 0; color: var(--muted); font-size: .85rem; }

/* ---------- Day drawer list ---------- */
.drawer-daylist { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.day-ev { --cat: var(--accent); border-left: 4px solid var(--cat); padding-left: .7rem; display: flex; flex-direction: column; gap: .2rem; }
.day-ev[data-cat="aquatics"] { --cat: var(--cat-aquatics); }
.day-ev[data-cat="youth"] { --cat: var(--cat-youth); }
.day-ev[data-cat="camps"] { --cat: var(--cat-camps); }
.day-ev[data-cat="events"] { --cat: var(--cat-events); }
.day-ev[data-cat="bay-beach"] { --cat: var(--cat-bay-beach); }
.day-ev[data-cat="wildlife"] { --cat: var(--cat-wildlife); }
.day-meta { color: var(--muted); font-size: .85rem; }
.day-links { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }
.day-src { font-weight: 800; font-size: .8rem; color: var(--accent-dark); text-decoration: none; }
.day-src:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .cal-day { min-height: 3.1rem; }
  .cal-events { display: none; }
  .cal-count { display: inline-block; }
  .cal-month-title { font-size: 1.15rem; }
}

/* ---------- Source tables (collapsed accordions) ---------- */
.source-list-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin: 1.25rem 0 .65rem;
  padding: 0 .1rem;
}
.source-list-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2vw, 1.65rem);
  line-height: 1.05;
  margin: 0 0 .22rem;
}
.source-list-head p { margin: 0; color: var(--muted); max-width: 44rem; }
.table-accordions { display: grid; gap: .5rem; margin-bottom: 1.4rem; }
.table-acc {
  --src-accent: var(--accent);
  background: rgba(255, 255, 255, .76);
  border: 1px solid var(--line);
  border-left: 4px solid var(--src-accent);
  border-radius: .78rem;
  box-shadow: 0 8px 22px rgba(23, 49, 38, .045);
  overflow: hidden;
  animation: rise var(--motion-med) var(--ease-out) both;
  transition: background var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.table-acc:hover, .table-acc:focus-within {
  background: #fff;
  box-shadow: 0 13px 28px rgba(23, 49, 38, .07);
  border-color: color-mix(in srgb, var(--src-accent) 22%, var(--line));
}
.table-acc[data-cat="aquatics"] { --src-accent: var(--cat-aquatics); }
.table-acc[data-cat="youth"] { --src-accent: var(--cat-youth); }
.table-acc[data-cat="camps"] { --src-accent: var(--cat-camps); }
.table-acc[data-cat="events"] { --src-accent: var(--cat-events); }
.table-acc[data-cat="food"] { --src-accent: #d94c45; }
.table-acc summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .72rem;
  padding: .82rem 1rem;
}
.table-acc summary::-webkit-details-marker { display: none; }
.table-acc summary::after {
  content: "⌄";
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform .2s ease;
}
.table-acc[open] summary::after { transform: rotate(180deg); }
.acc-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: .65rem;
  background: color-mix(in srgb, var(--src-accent) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--src-accent) 25%, var(--line));
}
.acc-text { min-width: 0; display: grid; gap: .08rem; }
.acc-title {
  font-family: var(--font-display);
  font-size: 1.04rem;
  line-height: 1.08;
  letter-spacing: 0;
}
.acc-sub { color: var(--muted); font-size: .78rem; font-weight: 700; }
.acc-meta {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: .18rem .55rem;
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
}
.acc-body { padding: 0 1rem 1rem; }
.table-acc[open] .acc-body { animation: fade .2s var(--ease-out) both; }
.acc-intro { color: var(--muted); margin: .1rem 0 .7rem; font-size: .9rem; line-height: 1.45; }
.acc-intro a { color: var(--accent-dark); font-weight: 800; text-decoration: none; }
.acc-intro a:hover { text-decoration: underline; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: .68rem;
  background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; border-top: 1px solid var(--line); padding: .62rem .68rem; vertical-align: top; }
thead th { border-top: 0; background: rgba(239, 245, 237, .7); }
th { color: var(--accent-dark); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }


/* ---------- Detail drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 40, 30, .5); z-index: 50; animation: backdropIn .2s ease both; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(460px, 100%);
  background: var(--bg);
  z-index: 51;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  padding: 1.3rem 1.4rem 2.4rem;
  overflow-y: auto;
  animation: slideIn var(--motion-med) var(--ease-out);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .3rem; }
.drawer-eyebrow {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .74rem;
  font-weight: 800;
  color: var(--accent-dark);
}
.drawer-close {
  border: 1px solid var(--line);
  background: #fff;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  font-size: 1.05rem;
  cursor: pointer;
  flex: 0 0 auto;
}
.drawer-close:hover { border-color: var(--accent); }
.drawer h2 { font-family: var(--font-display); font-size: 1.8rem; margin: .1rem 0 .8rem; line-height: 1.06; }
.drawer-badge {
  display: inline-block;
  background: #eef0ec;
  color: #46584d;
  border-radius: 999px;
  padding: .3rem .75rem;
  font-size: .78rem;
  font-weight: 800;
  margin: 0 0 .8rem;
}
.drawer-badge.is-free { background: var(--accent-soft); color: var(--accent-dark); }
.drawer-summary { color: var(--ink); margin: 0 0 1rem; }
.drawer-facts { display: grid; gap: .55rem; margin: 0 0 1.1rem; }
.drawer-facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .6rem; }
.drawer-facts dt { color: var(--muted); font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .1rem; }
.drawer-facts dd { margin: 0; font-size: .92rem; }
.drawer-facts dd a { color: var(--accent-dark); font-weight: 700; }
.drawer-rel { border-top: 1px solid var(--line); padding-top: .9rem; margin-bottom: .9rem; }
.drawer-rel h3 { font-size: .95rem; margin: 0 0 .55rem; display: flex; align-items: center; gap: .4rem; }
.drawer-rel h3 span { font-size: .72rem; background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: .05rem .45rem; font-weight: 800; }
.drawer-rel-list, .drawer-evlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.drawer-rel-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; font-size: .88rem; }
.rel-link {
  border: 0; background: none; padding: 0;
  color: var(--accent-dark); font-weight: 800; cursor: pointer;
  text-decoration: underline; font-family: inherit; font-size: .92rem;
}
.rel-link:hover { color: var(--accent); }
.rel-type { color: var(--muted); font-size: .76rem; }
.rel-dir { color: var(--accent-dark); font-weight: 700; font-size: .78rem; text-decoration: none; }
.rel-dir:hover { text-decoration: underline; }
.drawer-evlist li { font-size: .86rem; color: #3c4d43; line-height: 1.5; }
.ev-date { font-weight: 800; color: var(--accent-dark); }
.ev-time { color: var(--muted); }
.drawer-source {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  padding: .6rem 1.05rem;
  border-radius: 999px;
  margin: .3rem 0 .2rem;
}
.drawer-source:hover { filter: brightness(1.05); }
.drawer-source.ghost { background: transparent; color: var(--accent-dark); border: 1.5px solid var(--line); }
.drawer-review {
  color: #9a6212;
  font-weight: 700;
  font-size: .84rem;
  background: var(--sun-soft);
  border: 1px solid #f1e2bd;
  border-radius: .7rem;
  padding: .55rem .75rem;
  margin: .2rem 0 1rem;
}
.drawer-prov { color: var(--muted); font-size: .78rem; margin: .8rem 0 0; line-height: 1.5; }
body.drawer-open { overflow: hidden; }

/* ---------- Contact (in Sources) ---------- */
.contact-card {
  background:
    radial-gradient(circle at 4% 10%, rgba(47, 143, 91, .24) 0 6.4rem, transparent 6.5rem),
    linear-gradient(135deg, #dfeee5 0%, #f4f1df 58%, #fff6df 100%);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent-dark) 28%, var(--line));
  border-radius: 1.15rem;
  padding: 1.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(260px, .82fr);
  gap: 1rem;
  margin: 0 0 1.3rem;
  box-shadow: 0 18px 44px rgba(23, 49, 38, .12);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: .42rem;
  background: linear-gradient(180deg, var(--accent-dark), var(--accent), var(--sun));
}
.contact-card > * { position: relative; z-index: 1; }
.contact-card .eyebrow { color: var(--accent-dark); margin-bottom: .35rem; }
.contact-card h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 2.2vw, 1.75rem); margin: 0 0 .45rem; color: var(--ink); }
.contact-note { color: #33483c; max-width: 58ch; margin-bottom: .85rem; }
.source-contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .62rem; margin-top: .6rem; }
.source-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  padding: .78rem .84rem;
  border-radius: .78rem;
  background: rgba(255, 255, 255, .88);
  border: 1px solid color-mix(in srgb, var(--accent-dark) 18%, var(--line));
  box-shadow: 0 8px 20px rgba(23, 49, 38, .055);
}
.source-contact h3 { margin: 0 0 .18rem; color: var(--ink); font-size: .92rem; font-weight: 800; line-height: 1.1; }
.source-contact p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.source-contact small { display: block; margin-top: .22rem; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.source-contact a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  font-size: .8rem;
}
.source-contact a:hover { text-decoration: underline; }
.guide-contact {
  margin-top: .78rem;
  padding: .82rem .9rem;
  border: 1px solid color-mix(in srgb, var(--accent-dark) 28%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: .82rem;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 20px rgba(23, 49, 38, .055);
}
.guide-contact-title {
  margin: 0 0 .2rem;
  color: var(--ink);
  font-weight: 850;
}
.guide-contact p:not(.guide-contact-title) {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.42;
}
.guide-contact a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.guide-contact a:hover { text-decoration: underline; }
.quick-links {
  display: grid;
  gap: .52rem;
  align-content: start;
  padding: .62rem;
  border-radius: .95rem;
  background: rgba(22, 48, 36, .08);
  border: 1px solid rgba(22, 48, 36, .1);
}
.quick-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .72rem .82rem;
  border-radius: .72rem;
  background: rgba(255, 255, 255, .9);
  border: 1px solid color-mix(in srgb, var(--accent-dark) 16%, var(--line));
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(23, 49, 38, .045);
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.quick-links a:hover {
  transform: translateY(-1px);
  background: #f0f8ec;
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}
.source-disclaimer { color: var(--muted); font-size: .88rem; max-width: 70ch; margin: 0; }

/* ---------- Footer ---------- */
footer { text-align: center; color: var(--muted); padding: 1.6rem 1rem 2.5rem; }
.footer-line { max-width: 640px; margin: 0 auto; font-size: .85rem; line-height: 1.55; }
.footer-line strong { color: var(--ink); }
.footer-bwai { color: var(--accent-dark); font-weight: 800; text-decoration: none; }
.footer-bwai:hover { text-decoration: underline; }
.footer-disc { max-width: 640px; margin: .5rem auto 0; font-size: .8rem; line-height: 1.5; }
.footer-i18n-note { max-width: 640px; margin: .35rem auto 0; font-size: .76rem; line-height: 1.5; font-style: italic; opacity: .9; }
/* Quiet link to the secondary Sources view (Sources left the primary nav in M6E). */
.footer-links { max-width: 640px; margin: .5rem auto 0; font-size: .82rem; }
.footer-links a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-contact { max-width: 640px; margin: .42rem auto 0; font-size: .82rem; line-height: 1.45; }
.footer-contact a { color: var(--accent-dark); font-weight: 800; text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav { display: none; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: .88; transform: translateX(100%); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: .88; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --appbar-h: 66px; }
  .app-layout { padding: 1.1rem 1rem 1rem; }
  .topnav { display: none; }
  .lang-switch { margin-left: auto; } /* top nav gone → keep selector pinned to the right */
  .app-main { padding-bottom: 1rem; }
  footer { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } /* clear the fixed bottom nav */
  .contact-card { grid-template-columns: 1fr; padding: 1.5rem; }
  .source-contacts { grid-template-columns: 1fr; }
  .source-contact { grid-template-columns: 1fr; align-items: start; }
  .source-contact a { justify-self: start; }
  .source-list-head { align-items: start; margin-top: 1rem; }
  .table-acc summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .6rem;
  }
  .table-acc summary::after { display: none; }
  .acc-meta { font-size: .7rem; padding-inline: .46rem; }
  /* Places map-first: map stacks above the rail; drop sticky so it scrolls normally on mobile.
     Shorter placeholder so the compact list appears sooner; bigger touch targets. */
  .places-tool { grid-template-columns: 1fr; gap: 1rem; }
  .places-map { position: static; top: auto; }
  .places-map-canvas { min-height: 200px; padding: 1.3rem 1.1rem 3rem; }
  /* Keep the live map from dominating the phone screen so the rail/list stays reachable below it. */
  .places-map-live-canvas { height: 300px; }
  .places-map-title { font-size: 1.25rem; }
  .legend-chip { min-height: 44px; }
  .place-row-dir { min-height: 40px; }
  .map-pending-row { grid-template-columns: 1fr; gap: .28rem; }
  .map-pending-dir,
  .map-pending-status { justify-self: start; min-height: 36px; display: inline-flex; align-items: center; }
  .control-sticky {
    margin: 0 -1rem .9rem;
    padding: .9rem 1rem .68rem;
  }
  .view-head { margin-bottom: .62rem; }
  .view-head h1 { font-size: clamp(1.45rem, 8vw, 2rem); }
  .view-head p { font-size: .9rem; line-height: 1.35; }
  .toolbar { gap: .55rem; }
  .control-sticky .filters {
    flex: 1 0 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .12rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .dates-toolbar .filters {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .control-sticky .filters::-webkit-scrollbar { display: none; }
  .control-sticky .chip { flex: 0 0 auto; scroll-snap-align: start; }
  input[type="search"] { min-height: 46px; }

  .bottomnav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: var(--panel);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(23, 49, 38, .1);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom, 0px));
  }
  .nav-item {
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: .45rem .2rem;
    border-radius: .7rem;
    font-size: .7rem;
    text-align: center;
  }
  .nav-item:hover { background: transparent; color: var(--muted); }
  .nav-item.active { background: transparent; color: var(--accent-dark); }
  .nav-item.active .nav-icon { transform: translateY(-1px); }
  .nav-icon { font-size: 1.35rem; flex: none; }
  .nav-label { font-weight: 800; overflow-wrap: break-word; hyphens: auto; min-width: 0; max-width: 100%; }
}

@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .card {
    height: auto;
    min-height: 166px;
    padding: .78rem .82rem .72rem;
    grid-template-columns: 2.18rem minmax(0, 1fr);
    column-gap: .64rem;
    background:
      radial-gradient(circle at 8% 16%, color-mix(in srgb, var(--cat) 16%, transparent) 0 3rem, transparent 3.08rem),
      linear-gradient(135deg, color-mix(in srgb, var(--cat) 8%, #fff) 0%, #fff 62%);
  }
  .card-mark {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.08rem;
    border-radius: .74rem;
  }
  .card-top { margin-bottom: .2rem; }
  .card-title { font-size: 1rem; line-height: 1.1; }
  .card-summary { margin-bottom: .42rem; font-size: .8rem; line-height: 1.28; }
  .card-foot { margin-top: .72rem; }
  /* 3 compact browse tiles stay in a row — icon stacks over label so they fit a narrow screen */
  .path-card { flex-direction: column; align-items: flex-start; gap: .35rem; padding: .85rem .8rem; }
  .path-icon { font-size: 1.5rem; }
  .path-title { font-size: 1.05rem; }
  .home-paths { gap: .55rem; }
  .appbar-inner { padding-inline: .9rem; gap: .5rem; }
  .appbar-branding { min-width: 0; }
  .brand { min-width: 7.1rem; max-width: min(46vw, 8.9rem); }
  .brand-main { font-size: .86rem; }
  .brand-sub { font-size: .48rem; letter-spacing: .035em; }
  .app-tag { font-size: .68rem; padding-inline: .5rem; }
  .appbar-official { display: none; }
  /* Narrow header: keep the selector tight so 390px has no horizontal overflow */
  .lang-switch { gap: .25rem; }
  .lang-select { max-width: 7.4rem; font-size: .78rem; padding: .4rem 1.5rem .4rem .6rem; }
  .drawer {
    top: auto;
    bottom: 0;
    height: 90%;
    width: 100%;
    border-radius: 1.3rem 1.3rem 0 0;
    animation: slideUp .24s ease;
  }
  .agenda-row { flex-wrap: wrap; }
  .agenda-src { width: 100%; padding-top: .2rem; }
}

/* ---------- Typography softening ----------
   Keep page headings and active states confident, but let everyday labels breathe. */
.nav-item,
.chip,
.legend-chip,
.home-quick,
.path-count,
.home-section-link,
.home-fine a,
.clear-filters,
.card-cta,
.place-row-dir,
.seg-btn,
.week-btn,
.day-src,
.drawer-source,
.rel-link,
.rel-dir {
  font-weight: 700;
}

.app-tag,
.appbar-official,
.home-unofficial,
.home-res-name,
.home-action,
.card-source,
.place-row-name,
.agenda-title,
.agenda-title-static,
.agenda-link,
.up-title,
.up-title-static,
.table-acc summary,
.quick-links a,
.footer-line strong {
  font-weight: 650;
}

.card-cat,
.badge,
.place-group-head,
.pg-count,
.agenda-kind,
.agenda-tag,
.agenda-src,
.acc-meta,
.drawer-badge,
.drawer-facts dt,
.drawer-rel h3 span,
.ev-date,
.legend-count,
.cal-num,
.cal-more,
.week-label,
.nav-label {
  font-weight: 700;
}

.results-info,
.card-meta-compact,
.place-row-sub,
.agenda-time,
.day-meta,
.drawer-facts dd,
.drawer-prov,
.source-disclaimer,
.footer-line {
  font-weight: 400;
}

/* ---------- Summer Meals (M4E-6C) ---------- */
/* New "food" category accent — used by the Programs card, home search, and meal-site rows. */
.card[data-category="food"],
.home-res[data-category="food"],
.place-row[data-category="food"],
.meal-row[data-category="food"] { --cat: var(--cat-food); }

/* Per-event meal badge in the program/place drawers. */
.ev-meal {
  display: inline-block;
  background: #fde7e4;
  color: #9a2d27;
  border-radius: 999px;
  padding: .02rem .42rem;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

/* "Need to know" collapsible inside the meals drawer. */
.meal-notes { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #fff; padding: .2rem .2rem; }
.meal-notes summary { cursor: pointer; font-weight: 800; font-size: .86rem; padding: .55rem .7rem; color: var(--accent-dark); }
.meal-notes[open] summary { border-bottom: 1px solid var(--line); }
.meal-notes ul { margin: .6rem 0; padding-left: 1.2rem; display: grid; gap: .4rem; }
.meal-notes li { font-size: .82rem; color: var(--muted); line-height: 1.45; }

/* Finder shell: search + filter chips + grouped list. */
.meal-finder { border-top: 1px solid var(--line); padding-top: .9rem; margin-bottom: .9rem; }
.meal-search {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: .8rem;
  padding: .6rem .8rem;
  font: inherit;
  background: #fff;
  margin-bottom: .6rem;
}
.meal-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.meal-filters { display: flex; flex-wrap: wrap; gap: .34rem; margin-bottom: .65rem; }
.meal-filters .chip { font-size: .78rem; padding: .3rem .56rem; }
.meal-list { display: grid; gap: .8rem; }
.meal-group-head {
  display: flex; align-items: center; gap: .4rem;
  font-size: .92rem; margin: 0 0 .5rem; color: var(--ink);
}
.meal-group-head .pg-count {
  font-size: .72rem; background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: .05rem .45rem; font-weight: 800;
}
.meal-rows {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .42rem;
}
.meal-row {
  --cat: var(--cat-food);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .38rem;
  background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--cat);
  border-radius: .58rem; padding: .42rem .48rem .42rem .58rem;
  min-height: 74px;
  animation: rise var(--motion-med) var(--ease-out) both;
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.meal-row:hover, .meal-row:focus-within { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23, 49, 38, .1); background: color-mix(in srgb, var(--cat) 4%, #fff); }
.meal-row.is-event { --cat: var(--cat-events); }
.meal-row-open {
  flex: 1 1 auto; min-width: 0; text-align: left;
  border: 0; background: none; padding: 0; cursor: pointer;
  display: grid; gap: .08rem;
}
.meal-row-head { display: flex; align-items: baseline; gap: .34rem; flex-wrap: wrap; }
.meal-row-name { font-weight: 760; font-size: .86rem; color: var(--ink); line-height: 1.08; }
.meal-row-open:hover .meal-row-name { color: var(--accent-dark); text-decoration: underline; }
.meal-row-type {
  font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: #f1efe7; border-radius: 999px; padding: .02rem .34rem;
}
.meal-row-addr {
  font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meal-row-addr.is-pending { font-style: italic; }
.meal-row-times { font-size: .72rem; color: var(--ink); font-weight: 620; }
.meal-row-meta {
  font-size: .7rem; color: var(--muted); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meal-row-flag { font-size: .67rem; font-weight: 760; color: #9a6212; }
.meal-dir {
  flex: 0 0 auto; align-self: center; white-space: nowrap;
  font-size: .72rem; font-weight: 700; text-decoration: none;
  color: var(--accent-dark); border: 1.5px solid var(--line);
  border-radius: 999px; padding: .24rem .52rem;
}
.meal-dir:hover { background: var(--cat); border-color: var(--cat); color: #fff; }
.meal-empty { font-size: .88rem; color: var(--muted); padding: .6rem 0; }

@media (min-width: 901px) {
  /* On desktop the finder needs a little more room than a normal detail drawer. */
  .drawer.is-meals { width: min(620px, 100%); }
}
@media (max-width: 900px) {
  .meal-dir { min-height: 40px; display: inline-flex; align-items: center; }
}

/* ---------- Dedicated #meals view: need-to-know rules + official source (M6E) ---------- */
.meal-needtoknow { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.meal-need-title { font-size: 1.05rem; margin: 0 0 .6rem; color: var(--ink); }
.meal-rules { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .45rem; }
.meal-rules li { position: relative; padding-left: 1.5rem; font-size: .9rem; color: var(--ink); line-height: 1.45; }
.meal-rules li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent-dark); font-weight: 800; }
.meal-official {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 700; font-size: .9rem;
  border-radius: 999px; padding: .55rem 1rem; min-height: 44px;
}
.meal-official:hover { filter: brightness(1.05); }
.meal-view-disc { color: var(--muted); font-size: .78rem; margin: .9rem 0 0; line-height: 1.5; max-width: 70ch; }
.meal-map { position: static; top: auto; margin: .75rem 0 1rem; }
.meal-map .places-map-canvas { min-height: 260px; }
.meal-map .places-map-live-canvas { height: clamp(380px, 56vh, 560px); }

@media (max-width: 900px) {
  .meal-map .places-map-canvas { min-height: 210px; }
  .meal-map .places-map-live-canvas { height: 300px; }
  .meal-rows { grid-template-columns: 1fr; }
}
