:root {
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-strong: #ffffff;
  --text: #1c2530;
  --muted: #66778a;
  --accent: #87a8ff;
  --accent-soft: #dfe8ff;
  --border: rgba(145, 164, 190, 0.25);
  --shadow: 0 18px 50px rgba(66, 86, 122, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;

  --color-community: #cfe8ff;
  --color-school: #e6d9ff;
  --color-town: #e8d8c3;
  --color-secondfriday: #ffe2cc;
  --color-fallfest: #ffd6e7;
  --color-covh: #d9f5d6;

  --color-text-dark: #333;
}

/* =========================
   Base
   ========================= */
* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #ffffff 0%, #eff4ff 35%, #edf4f6 100%);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

h3 {
  margin-bottom: 10px;
}

.hidden {
  display: none !important;
}

.subtle {
  color: var(--muted);
  line-height: 1.45;
}

/* =========================
   Layout shells
   ========================= */
.page-shell {
  min-height: 100vh;
  padding: 18px;
}

.phone-shell {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-shell {
  padding-bottom: 24px;
}

.wide-shell {
  max-width: 100%;
}

/* =========================
   Shared cards / pills / buttons
   ========================= */
.back-link,
.top-badge,
.pill,
.meta-chip,
.day-chip,
.tab-button,
.filter-chip,
.resource-link,
.theme-toggle,
.flyer-action {
  border-radius: 999px;
}

.back-link,
.top-badge,
.pill,
.meta-chip,
.day-chip,
.tab-button,
.hero-card,
.info-card,
.event-launch-card,
.map-card,
.item-card,
.location-card,
.vendor-card,
.schedule-card,
.modal-card,
.theme-toggle,
.filter-chip,
.resource-link,
.flyer-action {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.back-link,
.top-badge,
.pill,
.meta-chip,
.day-chip,
.resource-link {
  padding: 10px 14px;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--text);
}

.hero-card,
.info-card,
.event-launch-card,
.map-card,
.item-card,
.location-card,
.vendor-card,
.schedule-card {
  border-radius: var(--radius-xl);
  padding: 18px;
}

.hero-card.compact {
  padding-top: 20px;
}

.event-launch-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.event-launch-card h2 {
  margin-top: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.soft-list {
  padding-left: 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.tab-button {
  appearance: none;
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
}

.tab-button.active,
.day-chip.active {
  background: linear-gradient(180deg, #eef3ff 0%, #dce7ff 100%);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.inline-link-button,
.modal-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f7faff 0%, #e8efff 100%);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* =========================
   Generic layout helpers
   ========================= */
.top-bar,
.card-header-line,
.hero-topline,
.calendar-toolbar,
.calendar-nav,
.segmented-control,
.calendar-day-header,
.agenda-day-header {
  display: flex;
  align-items: center;
}

.top-bar {
  justify-content: space-between;
  margin-top: 4px;
}

.hero-meta,
.chip-row,
.tab-row,
.grid-cards,
.stack-list,
.schedule-top,
.badge-row,
.legend-row,
.sponsor-grid,
.filter-chip-row,
.resource-links {
  display: flex;
  gap: 10px;
}

.hero-meta,
.chip-row,
.tab-row,
.badge-row,
.legend-row,
.sponsor-grid,
.filter-chip-row,
.resource-links {
  flex-wrap: wrap;
}

.grid-cards,
.stack-list {
  flex-direction: column;
}

.stack-list {
  margin-top: 12px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.tab-row {
  justify-content: flex-start;
}

.card-header-line {
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.badge-row {
  margin-top: 8px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fbff 0%, #e8efff 100%);
  border: 1px solid rgba(145, 164, 190, 0.25);
  font-size: 0.74rem;
  font-weight: 700;
  color: #4f67a8;
}

/* =========================
   Buttons / chips
   ========================= */
.filter-chip,
.day-chip,
.view-button,
.nav-button,
.theme-toggle,
.flyer-action {
  cursor: pointer;
  color: var(--text);
}

.filter-chip,
.day-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.filter-chip.active,
.day-chip.active {
  background: linear-gradient(180deg, #e5efff 0%, #d4e4ff 100%);
  color: #314f88;
}

.view-button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
}

.view-button.active {
  background: linear-gradient(180deg, #eef3ff 0%, #dce7ff 100%);
  box-shadow: inset 0 0 0 1px rgba(145, 164, 190, 0.25);
}

.nav-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 1rem;
}

.segmented-control {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
}

/* =========================
   Content-specific shared styles
   ========================= */
.schedule-card .time-range {
  font-weight: 700;
  font-size: 0.95rem;
}

.schedule-card .detail-row,
.vendor-card .detail-row,
.location-card .detail-row,
.item-card .detail-row {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.schedule-card button,
.vendor-card button,
.location-card button,
.item-card button {
  margin-top: 12px;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #f7faff 0%, #e8efff 100%);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.error-state {
  border: 1px solid rgba(205, 92, 92, 0.35);
  background: rgba(255, 244, 244, 0.95);
  color: #8a2d2d;
  padding: 14px 16px;
  border-radius: 18px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.disclaimer {
  margin-top: 24px;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.55;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
}

.page-disclaimer {
  margin: 18px 0 6px;
}

.modal-disclaimer {
  margin-top: 18px;
  text-align: left;
}

/* =========================
   Home page
   ========================= */
.home-hero {
  gap: 14px;
}

.hero-topline,
.calendar-toolbar {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-topline-home {
  align-items: flex-start;
}

.hero-topline-home h1 {
  margin-bottom: 0;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.header-left {
  min-width: 0;
}

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

.home-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.bucket-rail {
  min-width: 0;
}

.bucket-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bucket-stack .event-launch-card {
  min-width: 0;
}

.bucket-stack .event-launch-card h2 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-weight: 700;
}

.theme-toggle-label {
  font-size: 0.88rem;
}

.theme-toggle-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e3ebfb 0%, #d2def5 100%);
  border: 1px solid rgba(145, 164, 190, 0.35);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(58, 75, 107, 0.2);
  transition: transform 0.2s ease;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
  transform: translateX(20px);
}

/* =========================
   Map / modal
   ========================= */
.map-surface {
  position: relative;
  min-height: 280px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f9fbff 0%, #ecf3ff 100%);
  overflow: hidden;
  border: 1px solid var(--border);
}

.covh-map-gallery {
  background: transparent;
  border: 0;
  min-height: 0;
}

.covh-map-tab-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.map-actions {
  display: flex;
  justify-content: flex-end;
}

.covh-map-panel {
  position: relative;
  overflow: hidden;
}

.covh-map-panel img {
  display: block;
  width: 100%;
  height: auto;
}

.covh-map-hotspots {
  position: absolute;
  inset: 0;
}

.map-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(63, 84, 130, 0.24);
  background: rgba(255, 255, 255, 0.94);
  color: #1f2a44;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 10px 24px rgba(55, 78, 116, 0.18);
  cursor: pointer;
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
}

.flyer-hotspot {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
}

.map-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.8rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}

.modal.hidden {
  display: none;
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  flex: 0 0 auto;
  padding: 22px 56px 12px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.modal-header .eyebrow {
  margin: 0 0 6px;
}

.modal-header h2 {
  margin: 0;
  line-height: 1.15;
}

.modal-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 24px 24px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.external-map-wrap {
  width: 100%;
  height: 100%;
}

.map-embed-frame {
  width: 100%;
  min-height: 520px;
  border: 0;
  display: block;
  border-radius: 12px;
}

.map-actions {
  margin-top: 10px;
}

/* =========================
   Calendar
   ========================= */
.calendar-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-title {
  min-width: 180px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

.calendar-nav {
  gap: 10px;
}

.calendar-controls-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.calendar-controls-left {
  justify-self: start;
}

.calendar-controls-center {
  min-width: 0;
  justify-self: center;
}

.calendar-controls-right {
  justify-self: end;
}

.calendar-controls-center .filter-chip-row {
  justify-content: center;
}

.calendar-controls-right .calendar-nav {
  justify-content: flex-end;
}

.proper-calendar-shell {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(145, 164, 190, 0.22);
  border-radius: 28px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.weekday-pill {
  text-align: center;
  padding: 10px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-grid {
  display: grid;
  gap: 10px;
}

.month-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: rgba(210, 223, 244, 0.6);
  gap: 1px;
  border: 1px solid rgba(145, 164, 190, 0.2);
  border-radius: 20px;
  overflow: hidden;
}

.calendar-day-card,
.agenda-day-card {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 24px;
}

.calendar-day-card {
  min-height: 155px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-day-card.muted {
  opacity: 0.65;
}

.calendar-day-card.today,
.agenda-day-card.today {
  outline: 2px solid rgba(135, 168, 255, 0.65);
}

.calendar-day-header {
  justify-content: space-between;
  gap: 8px;
}

.calendar-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7faff 0%, #e8efff 100%);
  font-weight: 800;
}

.calendar-day-label {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.calendar-day-events,
.agenda-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-event-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #edf3ff 100%);
  border: 1px solid rgba(145, 164, 190, 0.25);
}

.event-time {
  font-size: 0.78rem;
  font-weight: 800;
  color: #4f67a8;
}

.event-text {
  font-size: 0.9rem;
  font-weight: 700;
}

.event-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.calendar-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px 2px;
}

.stacked-grid {
  grid-template-columns: 1fr;
}

.agenda-day-card {
  padding: 16px;
}

.agenda-day-card.solo {
  min-height: 280px;
}

.agenda-day-header {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.agenda-day-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.agenda-day-subtitle,
.agenda-day-count {
  color: var(--muted);
  font-size: 0.88rem;
}

.expanded-day-row {
  grid-column: 1 / -1;
}

.calendar-day-card.proper-grid {
  background: rgba(255, 255, 255, 0.96);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 150px;
  padding: 10px;
}

.calendar-day-card.proper-grid.muted {
  background: rgba(245, 248, 252, 0.96);
}

.calendar-day-card.proper-grid.today {
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(112, 146, 226, 0.55);
}

.calendar-day-card.proper-grid.selected {
  box-shadow: inset 0 0 0 2px rgba(79, 103, 168, 0.65);
  background: linear-gradient(180deg, #ffffff 0%, #f2f6ff 100%);
}

.calendar-day-card.proper-grid .calendar-day-header {
  justify-content: flex-start;
  margin-bottom: 4px;
}

.calendar-day-card.proper-grid .calendar-day-number {
  width: 30px;
  height: 30px;
  font-size: 0.95rem;
}

.calendar-day-card.proper-grid .calendar-day-events {
  gap: 6px;
}

.calendar-day-card.proper-grid .calendar-empty {
  min-height: 14px;
}

/* Compact month markers */
.month-grid .calendar-day-card.proper-grid {
  min-height: 168px;
  padding: 10px 10px 8px;
  cursor: pointer;
}

.month-grid .calendar-day-card.proper-grid .calendar-event-chip {
  pointer-events: none;
}

.month-grid .calendar-day-card.proper-grid .calendar-day-header {
  margin-bottom: 8px;
}

.month-grid .calendar-day-card.proper-grid .calendar-day-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  align-content: flex-start;
  min-height: 20px;
}

.month-grid .calendar-day-card.proper-grid .calendar-event-chip {
  width: 10px;
  height: 10px;
  min-width: 10px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  box-shadow: none;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

.month-grid .calendar-day-card.proper-grid .calendar-event-chip .event-time,
.month-grid .calendar-day-card.proper-grid .calendar-event-chip .event-text,
.month-grid .calendar-day-card.proper-grid .calendar-event-chip .event-meta {
  display: none;
}

.month-grid .calendar-day-card.proper-grid .calendar-empty {
  min-height: 10px;
  padding: 0;
}

.month-grid .calendar-event-chip {
  padding: 8px 9px;
}

.month-grid .event-time {
  font-size: 0.72rem;
}

.month-grid .event-text {
  font-size: 0.82rem;
}

.month-grid .event-meta {
  font-size: 0.7rem;
}

.month-grid .calendar-day-card {
  overflow: hidden;
}

.more-events-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  padding: 2px 4px;
}

/* =========================
   Calendar bucket colors
   ========================= */
.calendar-event-chip.bucket-community,
.filter-chip[data-filter="Community"].active {
  background: var(--color-community);
}

.filter-chip[data-filter="Community"] {
  border-color: var(--color-community);
}

.calendar-event-chip.bucket-school,
.filter-chip[data-filter="School"].active {
  background: var(--color-school);
}

.filter-chip[data-filter="School"] {
  border-color: var(--color-school);
}

.calendar-event-chip.bucket-town-services,
.filter-chip[data-filter="Town Services"].active {
  background: var(--color-town);
}

.filter-chip[data-filter="Town Services"] {
  border-color: var(--color-town);
}

.calendar-event-chip.bucket-fall-fest,
.filter-chip[data-filter="Fall Fest"].active {
  background: var(--color-fallfest);
}

.filter-chip[data-filter="Fall Fest"] {
  border-color: var(--color-fallfest);
}

.calendar-event-chip.bucket-2nd-fridays,
.filter-chip[data-filter="2nd Fridays"].active {
  background: var(--color-secondfriday);
}

.filter-chip[data-filter="2nd Fridays"] {
  border-color: var(--color-secondfriday);
}

.calendar-event-chip.bucket-covh,
.filter-chip[data-filter="COVH"].active {
  background: var(--color-covh);
}

.filter-chip[data-filter="COVH"] {
  border-color: var(--color-covh);
}

.filter-chip[data-filter="Community"],
.filter-chip[data-filter="School"],
.filter-chip[data-filter="Town Services"],
.filter-chip[data-filter="Fall Fest"],
.filter-chip[data-filter="2nd Fridays"],
.filter-chip[data-filter="COVH"] {
  border-width: 2px;
}

/* =========================
   Additional shared content
   ========================= */
.resource-links {
  gap: 8px;
  margin-top: 8px;
}

.resource-link {
  background: rgba(255, 255, 255, 0.78);
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.location-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 2px;
}

.flyer-meta,
.muted-inline {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.modal-list-item {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px solid rgba(145, 164, 190, 0.18);
}

.modal-divider {
  border: 0;
  border-top: 1px solid rgba(145, 164, 190, 0.22);
  margin: 14px 0;
}
.public-group-section {
  margin-bottom: 20px;
}

.public-group-section__header {
  margin-bottom: 12px;
}

.public-group-section__body {
  display: grid;
  gap: 14px;
}

.public-group-card {
  background: var(--card, #fff);
  border: 1px solid var(--border, #d9dee8);
  border-radius: 18px;
  padding: 16px;
}

.public-group-card__header {
  margin-bottom: 10px;
}

.public-group-card__body {
  display: grid;
  gap: 10px;
}

.public-empty {
  border: 1px dashed var(--border, #d9dee8);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted, #667085);
  font-style: italic;
}
/* =========================
   Flyer / printable pamphlet
   ========================= */
.flyer-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flyer-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 30px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.flyer-hero {
  text-align: center;
}

.legend-pill,
.sponsor-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(145, 164, 190, 0.32);
  background: #f8fbff;
  font-size: 0.82rem;
}

.flyer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flyer-section h3 {
  margin: 0;
}

.flyer-entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flyer-entry-list.compact {
  gap: 8px;
}

.flyer-entry {
  border: 1px solid rgba(145, 164, 190, 0.24);
  border-radius: 16px;
  padding: 10px 11px;
  background: #fff;
}

.flyer-entry-top,
.flyer-note-top,
.flyer-region-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.flyer-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  background: #edf3ff;
  font-weight: 800;
  font-size: 0.92rem;
}

.flyer-name-block {
  min-width: 0;
  flex: 1;
}

.flyer-name-block h4 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  line-height: 1.18;
}

.flyer-entry p,
.flyer-note-card p,
.flyer-footer-lines {
  margin: 0;
  color: #2e3e54;
  line-height: 1.35;
  font-size: 0.85rem;
}

.flyer-callout-grid,
.flyer-thanks-grid {
  display: grid;
  gap: 12px;
}

.flyer-note-card {
  border: 1px solid rgba(145, 164, 190, 0.24);
  border-radius: 16px;
  padding: 12px;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flyer-note-card h3 {
  margin: 0;
  font-size: 1rem;
}

.flyer-tree-sign {
  width: 78px;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(145, 164, 190, 0.24);
  background: white;
}

.flyer-qr {
  width: 120px;
  max-width: 100%;
  height: auto;
  align-self: center;
  border-radius: 10px;
  border: 1px solid rgba(145, 164, 190, 0.24);
  background: white;
  padding: 6px;
}

.flyer-mini-map {
  width: 100px;
  max-width: 34%;
  border-radius: 10px;
  border: 1px solid rgba(145, 164, 190, 0.24);
  background: white;
}

.flyer-list {
  padding-left: 18px;
  margin: 0;
  color: #2e3e54;
  font-size: 0.85rem;
  line-height: 1.4;
}

.flyer-footer-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 6px;
}

.qr-card {
  align-items: center;
  text-align: center;
}

.flyer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


.flyer-preview-shell {
  display: grid;
  gap: 18px;
}

.flyer-page {
  background: #fff;
  color: #111;
  border: 1px solid rgba(145, 164, 190, 0.28);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.flyer-page-inner {
  padding: 18px;
}

.flyer-page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(145, 164, 190, 0.28);
  padding-bottom: 12px;
}

.flyer-title-wrap h2 {
  margin-bottom: 6px;
  font-size: 1.8rem;
}

.flyer-legend {
  gap: 8px;
}

.flyer-page-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
}

.flyer-page-columns.page-two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

.flyer-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flyer-section-heading {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #32445d;
}

.flyer-print-page {
  background: white;
}

.flyer-print-shell {
  width: fit-content;
  margin: 0 auto;
  padding: 12px;
}

/* =========================
   COVH pamphlet flyer
   ========================= */
.covh-preview-shell {
  gap: 20px;
}

.covh-pamphlet-page {
  background: #fff;
  border-radius: 6px;
  color: #171717;
}

.covh-page-inner {
  padding: 22px 24px 24px;
}

.covh-banner {
  position: relative;
  text-align: center;
  padding: 0 0 16px;
  border-bottom: 2px solid #d8d8d8;
  margin-bottom: 18px;
  overflow: hidden;
}

.covh-banner-overlay {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.covh-banner-strip {
  width: 100%;
  display: block;
}

.covh-banner-strip-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.covh-banner-strip-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.covh-banner-strip-image-wide {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.covh-banner-copy {
  min-width: 0;
}

.covh-banner-copy-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 22px 24px 18px;
  text-align: center;
  background: transparent;
}

.covh-banner-title,
.covh-script-heading {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  color: #2f4f3b;
}

.covh-banner-date {
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4f4f4f;
  margin-bottom: 10px;
  text-shadow: 0 1px 1px rgba(255,255,255,0.55);
}

.covh-banner-title {
  font-size: 2.35rem;
  line-height: 1.05;
  margin-bottom: 8px;
  color: #2f4f3b;
  text-shadow: 0 1px 1px rgba(255,255,255,0.65);
}

.covh-banner-note {
  font-size: 1rem;
  color: #3f3f3f;
  text-shadow: 0 1px 1px rgba(255,255,255,0.55);
}

.covh-page-one-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

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

.covh-list-item,
.covh-regional-block,
.covh-key-card,
.covh-map-main-card,
.covh-map-card,
.covh-thanks-block,
.covh-qr-block,
.covh-sponsor-block,
.covh-art-block {
  border: 1px solid #cfcfcf;
  background: #fff;
}

.covh-list-item {
  padding: 8px 10px;
}

.covh-item-head,
.covh-regional-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.covh-item-title-line {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  flex-wrap: wrap;
}

.covh-item-number {
  min-width: 18px;
  font-weight: 700;
}

.covh-item-title-line h4,
.covh-regional-name {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.15;
  font-weight: 700;
}

.covh-item-hours,
.covh-regional-hours {
  font-size: 0.79rem;
  white-space: nowrap;
  color: #525252;
  text-align: right;
}

.covh-item-meta,
.covh-regional-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 4px 26px;
  color: #4f4f4f;
  font-size: 0.77rem;
  align-items: center;
}

.covh-item-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1;
  font-weight: 800;
}

.covh-item-address {
  color: #4f4f4f;
}

.covh-list-item p,
.covh-regional-item p,
.covh-thanks-block p,
.covh-footer-lines,
.covh-sponsor-list,
.covh-benefactor-list {
  margin: 0 0 0 26px;
  font-size: 0.78rem;
  line-height: 1.28;
  color: #303030;
}

.covh-regional-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.covh-regional-block {
  padding: 8px 10px;
}

.covh-regional-title,
.covh-key-title,
.covh-qr-title {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #36523c;
  margin-bottom: 8px;
}

.covh-regional-item + .covh-regional-item {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dotted #cfcfcf;
}

.covh-key-card {
  padding: 10px;
  position: sticky;
  top: 10px;
}

.covh-key-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px dotted #d0d0d0;
}

.covh-key-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.covh-key-label,
.covh-inline-badge {
  font-weight: 800;
  color: #2d4d37;
}

.covh-bag-icon {
  display: block;
  object-fit: contain;
}

.covh-inline-bag-icon {
  width: 11px;
  height: 11px;
  min-width: 11px;
  flex: 0 0 11px;
}

.covh-title-bag-icon {
  display: inline-block;
  vertical-align: middle;
}

.covh-bag-text-symbol {
  font-weight: 700;
}

.covh-bag-callout,
.covh-tree-callout {
  padding: 10px 12px;
  border: 1px solid #cfcfcf;
  background: #f6faf6;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #31503a;
}

.covh-bag-callout-under-regional,
.covh-tree-callout-under-regional {
  margin-top: 8px;
}

.covh-bag-callout {
  display: block;
}

.covh-bag-callout span,
.covh-tree-callout span {
  display: inline;
}

.covh-callout-bag-icon-inline,
.covh-tree-icon-inline {
  display: inline-block;
  vertical-align: -2px;
  margin: 0 4px;
}

.covh-callout-bag-icon-inline {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.covh-tree-icon-inline {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.covh-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.95fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.covh-map-main-card,
.covh-map-card,
.covh-regional-map-only {
  padding: 10px;
  position: relative;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.covh-main-map {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.covh-map-stack {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  height: 100%;
}

.covh-regional-map-image {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  object-fit: cover;
  border: 1px solid #d8d8d8;
  background: #fff;
}

.covh-map-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cfcfcf;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.covh-compass-card {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 56px;
  border: 1px solid #cfcfcf;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  line-height: 1.05;
}

.covh-footer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) 220px minmax(0, 1.08fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "thanks qr art"
    "sponsors qr art";
  gap: 14px;
  align-items: stretch;
}

.covh-thanks-block,
.covh-qr-block,
.covh-sponsor-block,
.covh-art-block {
  padding: 12px;
}

.covh-thanks-block {
  grid-area: thanks;
  min-height: 0;
  padding-top: 10px;
  padding-bottom: 8px;
}

.covh-sponsor-block {
  grid-area: sponsors;
  min-height: 0;
  padding-top: 14px;
  padding-bottom: 14px;
}

.covh-qr-block {
  grid-area: qr;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.covh-art-block {
  grid-area: art;
  position: relative;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  align-self: stretch;
}

.covh-script-heading {
  font-size: 1.42rem;
  margin-bottom: 8px;
}

.covh-thanks-block .covh-script-heading {
  font-size: 1.3rem;
}

.covh-sponsor-block .covh-script-heading {
  font-size: 1.42rem;
}

.covh-qr-title {
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
}

.covh-qr-image {
  width: 100%;
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.covh-art-image {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 70%;
  max-width: none;
  height: auto;
  display: block;
  margin: 0;
  object-fit: contain;
  object-position: right bottom;
}

.covh-footer-lines {
  position: absolute;
  left: 12px;
  top: 16px;
  z-index: 2;
  margin: 0;
  max-width: 31%;
  line-height: 1.35;
  color: #303030;
}

.covh-footer-lines > div {
  padding: 0 0 4px;
}

.covh-map-layout-tab {
  grid-template-columns: 1.5fr 1fr;
}

/* =========================
   Desktop enhancements
   ========================= */
@media (min-width: 700px) {
  .phone-shell {
    width: 100%;
  }
}

@media (min-width: 1080px) {
  .home-content-grid {
    grid-template-columns: minmax(0, 1.45fr) 300px;
    gap: 20px;
  }

  .bucket-rail {
    position: sticky;
    top: 18px;
    align-self: start;
  }

  .bucket-stack {
    max-height: calc(100vh - 160px);
    overflow: auto;
    padding-right: 4px;
  }
}

/* =========================
   Tablet / narrow desktop
   ========================= */
@media (max-width: 1100px) {
  .calendar-controls-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .calendar-controls-left,
  .calendar-controls-center,
  .calendar-controls-right {
    justify-self: stretch;
  }

  .calendar-controls-center .filter-chip-row {
    justify-content: flex-start;
  }

  .calendar-controls-right .calendar-nav {
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  .covh-page-one-grid,
  .covh-map-layout,
  .covh-footer-layout {
    grid-template-columns: 1fr;
  }

  .covh-footer-layout {
    grid-template-areas:
      "thanks"
      "qr"
      "sponsors"
      "art";
  }

  .covh-key-card {
    position: static;
  }

	.covh-banner-overlay {
	  min-height: 150px;
	}
}

@media (max-width: 699px) {
  .flyer-page-columns,
  .flyer-page-columns.page-two {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Dark mode
   ========================= */
body.soft-light {
  background:
    radial-gradient(circle at top left, rgba(232, 242, 255, 0.95), transparent 35%),
    radial-gradient(circle at top right, rgba(255, 239, 245, 0.9), transparent 32%),
    linear-gradient(180deg, #f6f9ff 0%, #edf3fb 100%);
}

body.theme-dark {
  --bg: #0f1724;
  --panel: rgba(17, 25, 40, 0.84);
  --panel-strong: #131d2d;
  --text: #eef4ff;
  --muted: #afbed6;
  --accent: #95b5ff;
  --accent-soft: rgba(88, 120, 190, 0.28);
  --border: rgba(124, 150, 194, 0.22);
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.38);
  --color-community: #29445f;
  --color-school: #473969;
  --color-town: #584638;
  --color-secondfriday: #6b4d3b;
  --color-fallfest: #633f54;
  --color-covh: #345542;
  background:
    radial-gradient(circle at top left, rgba(43, 69, 115, 0.3), transparent 35%),
    radial-gradient(circle at top right, rgba(109, 55, 82, 0.24), transparent 28%),
    linear-gradient(180deg, #0d1522 0%, #111b2a 100%);
}

body.theme-dark.soft-light {
  background:
    radial-gradient(circle at top left, rgba(43, 69, 115, 0.3), transparent 35%),
    radial-gradient(circle at top right, rgba(109, 55, 82, 0.24), transparent 28%),
    linear-gradient(180deg, #0d1522 0%, #111b2a 100%);
}

body.theme-dark .theme-toggle,
body.theme-dark .filter-chip,
body.theme-dark .day-chip,
body.theme-dark .resource-link,
body.theme-dark .weekday-pill,
body.theme-dark .calendar-event-chip,
body.theme-dark .calendar-day-card.proper-grid,
body.theme-dark .calendar-day-card.proper-grid.muted,
body.theme-dark .segmented-control,
body.theme-dark .nav-button,
body.theme-dark .pill,
body.theme-dark .back-link,
body.theme-dark .top-badge,
body.theme-dark .meta-chip,
body.theme-dark .tab-button,
body.theme-dark .hero-card,
body.theme-dark .info-card,
body.theme-dark .event-launch-card,
body.theme-dark .map-card,
body.theme-dark .item-card,
body.theme-dark .location-card,
body.theme-dark .vendor-card,
body.theme-dark .schedule-card,
body.theme-dark .modal-card,
body.theme-dark .proper-calendar-shell,
body.theme-dark .agenda-day-card,
body.theme-dark .calendar-day-card {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

body.theme-dark .calendar-title,
body.theme-dark .eyebrow,
body.theme-dark .subtle,
body.theme-dark .calendar-empty,
body.theme-dark .agenda-day-subtitle,
body.theme-dark .agenda-day-count,
body.theme-dark .detail-row,
body.theme-dark .event-time,
body.theme-dark .more-events-label,
body.theme-dark .weekday-pill {
  color: var(--muted);
}

body.theme-dark .view-button.active,
body.theme-dark .tab-button.active,
body.theme-dark .day-chip.active,
body.theme-dark .filter-chip.active {
  background: linear-gradient(180deg, rgba(81, 109, 163, 0.65) 0%, rgba(61, 88, 141, 0.8) 100%);
  color: var(--text);
}

body.theme-dark .calendar-day-number,
body.theme-dark .schedule-card button,
body.theme-dark .vendor-card button,
body.theme-dark .location-card button,
body.theme-dark .item-card button,
body.theme-dark .mini-badge,
body.theme-dark .legend-pill,
body.theme-dark .sponsor-pill,
body.theme-dark .flyer-number {
  background: linear-gradient(180deg, rgba(55, 77, 119, 0.8) 0%, rgba(42, 61, 96, 0.95) 100%);
  color: var(--text);
}

body.theme-dark .theme-toggle-track {
  background: linear-gradient(180deg, rgba(55, 77, 119, 0.85) 0%, rgba(42, 61, 96, 0.98) 100%);
}

body.theme-dark .calendar-day-card.proper-grid.selected {
  background: linear-gradient(180deg, rgba(32, 46, 74, 0.96) 0%, rgba(24, 36, 60, 0.98) 100%);
  box-shadow: inset 0 0 0 2px rgba(123, 154, 223, 0.72);
}

/* Dark mode filter chip colors */
body.theme-dark .filter-chip[data-filter="Community"] {
  border-color: var(--color-community);
}

body.theme-dark .filter-chip[data-filter="School"] {
  border-color: var(--color-school);
}

body.theme-dark .filter-chip[data-filter="Town Services"] {
  border-color: var(--color-town);
}

body.theme-dark .filter-chip[data-filter="Fall Fest"] {
  border-color: var(--color-fallfest);
}

body.theme-dark .filter-chip[data-filter="2nd Fridays"] {
  border-color: var(--color-secondfriday);
}

body.theme-dark .filter-chip[data-filter="COVH"] {
  border-color: var(--color-covh);
}

body.theme-dark .filter-chip[data-filter="Community"].active {
  background: var(--color-community);
  color: #fff;
}

body.theme-dark .filter-chip[data-filter="School"].active {
  background: var(--color-school);
  color: #fff;
}

body.theme-dark .filter-chip[data-filter="Town Services"].active {
  background: var(--color-town);
  color: #fff;
}

body.theme-dark .filter-chip[data-filter="Fall Fest"].active {
  background: var(--color-fallfest);
  color: #fff;
}

body.theme-dark .filter-chip[data-filter="2nd Fridays"].active {
  background: var(--color-secondfriday);
  color: #fff;
}

body.theme-dark .filter-chip[data-filter="COVH"].active {
  background: var(--color-covh);
  color: #fff;
}

body.theme-dark .filter-chip {
  border-width: 2px;
}

/* Dark mode: preserve bucket colors on calendar event chips / dots */
body.theme-dark .calendar-event-chip.bucket-community {
  background: var(--color-community);
  border-color: var(--color-community);
}

body.theme-dark .calendar-event-chip.bucket-school {
  background: var(--color-school);
  border-color: var(--color-school);
}

body.theme-dark .calendar-event-chip.bucket-town-services {
  background: var(--color-town);
  border-color: var(--color-town);
}

body.theme-dark .calendar-event-chip.bucket-fall-fest {
  background: var(--color-fallfest);
  border-color: var(--color-fallfest);
}

body.theme-dark .calendar-event-chip.bucket-2nd-fridays {
  background: var(--color-secondfriday);
  border-color: var(--color-secondfriday);
}

body.theme-dark .calendar-event-chip.bucket-covh {
  background: var(--color-covh);
  border-color: var(--color-covh);
}

/* =========================
   Mobile
   ========================= */
@media (max-width: 700px) {
  html {
    font-size: 20px;
  }

  .page-shell {
    padding: 8px;
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
  }

  .phone-shell {
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .hero-card,
  .info-card,
  .event-launch-card,
  .map-card,
  .item-card,
  .location-card,
  .vendor-card,
  .schedule-card {
    padding: 14px;
    border-radius: 22px;
  }

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.2rem;
}

.subtle,
.detail-row,
.flyer-meta,
.muted-inline {
  font-size: 1rem;
}

.event-text {
  font-size: 1.05rem;
}

.event-time {
  font-size: 0.9rem;
}

.calendar-title {
  font-size: 1.2rem;
}

  .nav-button {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
  }
  
  body.large-text {
  font-size: 19px;
}

body.large-text .event-text {
  font-size: 1.1rem;
}

body.large-text .calendar-day-card {
  min-height: 125px;
}

  /* Force calendar to fit screen width on mobile */
  .proper-calendar-shell {
    overflow-x: visible;
    width: 100%;
    max-width: 100%;
    padding-bottom: 8px;
  }

  .calendar-shell,
  .calendar-grid,
  .calendar-weekdays,
  .month-grid {
    width: 100%;
    max-width: 100%;
  }

  .calendar-weekdays.month-only,
  .month-grid {
    min-width: 0;
  }

  .calendar-weekdays {
    gap: 4px;
  }

  .weekday-pill {
    min-width: 0;
    padding: 8px 2px;
    font-size: 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .month-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .calendar-day-card.proper-grid {
    min-width: 0;
    min-height: 115px;
    padding: 8px 4px 6px;
  }

  .calendar-day-card.proper-grid .calendar-day-header {
    margin-bottom: 6px;
  }

  .calendar-day-card.proper-grid .calendar-day-number,
  .calendar-day-number {
    width: 28px;
    height: 28px;
    font-size: 1rem;
    font-weight: 800;
  }

  .calendar-day-label {
    font-size: 0.75rem;
  }

  .month-grid .calendar-day-card.proper-grid .calendar-day-events {
    gap: 5px;
    min-height: 18px;
  }

  .month-grid .calendar-day-card.proper-grid .calendar-event-chip {
    width: 10px;
    height: 10px;
    min-width: 10px;
  }

  .more-events-label {
    font-size: 0.64rem;
    padding: 0;
  }

  .agenda-day-card,
  .agenda-day-card.solo,
  .expanded-day-row {
    padding: 14px;
    min-height: 0;
  }

  .agenda-day-title {
    font-size: 1.1rem;
  }

  .agenda-day-subtitle,
  .agenda-day-count {
    font-size: 0.95rem;
  }

  .calendar-event-chip {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .event-time {
    font-size: 0.82rem;
  }

  .event-text {
    font-size: 0.98rem;
  }

  .schedule-card button,
  .vendor-card button,
  .location-card button,
  .item-card button,
  .inline-link-button,
  .modal-action-button,
  .flyer-action {
    min-height: 46px;
    font-size: 0.95rem;
  }

  .modal-action-row {
    grid-template-columns: 1fr;
  }

  .modal-card {
    width: min(100%, 100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal-header {
    padding: 18px 52px 10px 18px;
  }

  .modal-content {
    padding: 14px 18px 18px;
  }

  /* Keep maps/flyers allowed to size naturally */
  .map-surface,
  .covh-map-panel,
  .flyer-page,
  .flyer-preview-shell,
  .covh-pamphlet-page {
    overflow-x: visible;
  }

  .map-hotspot {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }
}

/* =========================
   Print
   ========================= */
@media print {
  body.flyer-print-page,
  .flyer-print-page {
    background: white !important;
  }

  .flyer-print-shell {
    padding: 0;
    margin: 0;
  }

  .flyer-page {
    width: 8.5in;
    min-height: 11in;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    break-after: page;
    page-break-after: always;
  }

  .flyer-page:last-child,
  .covh-pamphlet-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .flyer-page-inner {
    padding: 0.35in;
  }

  .flyer-page-header {
    margin-bottom: 0.12in;
    padding-bottom: 0.08in;
  }

  .flyer-title-wrap h2 {
    font-size: 20pt;
  }

  .flyer-section-heading {
    font-size: 10pt;
  }

  .flyer-entry {
    padding: 7pt 8pt;
    border-radius: 10pt;
  }

  .flyer-number {
    min-width: 24pt;
    height: 24pt;
    font-size: 8.5pt;
    border-radius: 8pt;
  }

  .flyer-name-block h4 {
    font-size: 8.9pt;
    margin-bottom: 2pt;
  }

  .flyer-meta,
  .flyer-entry p,
  .flyer-note-card p,
  .flyer-list,
  .legend-pill,
  .sponsor-pill,
  .flyer-footer-lines {
    font-size: 7.5pt;
    line-height: 1.2;
  }

  .legend-row {
    gap: 5pt;
  }

  .flyer-page-columns {
    gap: 10pt;
  }

  .flyer-column {
    gap: 8pt;
  }

  .flyer-entry-list {
    gap: 6pt;
  }

  .flyer-section,
  .flyer-callout-grid,
  .flyer-thanks-grid {
    gap: 7pt;
  }

  .flyer-note-card {
    padding: 8pt;
    border-radius: 10pt;
    gap: 6pt;
  }

  .flyer-tree-sign {
    width: 56pt;
  }

  .flyer-qr {
    width: 78pt;
  }

  .flyer-mini-map {
    width: 62pt;
  }

  .flyer-toolbar {
    display: none !important;
  }

   .covh-pamphlet-page {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    break-after: page;
    page-break-after: always;
  }

  .covh-page-inner {
    padding: 0.35in 0.33in 0.32in;
  }

    .covh-banner {
    padding: 0 0 0.12in;
    margin-bottom: 0.15in;
    overflow: hidden;
  }

  .covh-banner-overlay {
    min-height: 1.55in;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .covh-banner-strip-overlay {
    position: absolute;
    inset: 0;
  }

  .covh-banner-strip-image,
  .covh-banner-strip-image-wide {
    width: 100%;
    height: 100%;
    object-fit: fill;
  }

    .covh-banner-copy-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 14pt 18pt 10pt;
    text-align: center;
    background: transparent;
  }

  .covh-banner-page-two {
    min-height: 1.25in;
  }

  .covh-footer-layout {
    grid-template-columns: 2.35in 1.75in 2.25in;
    grid-template-rows: auto auto;
    grid-template-areas:
      "thanks qr art"
      "sponsors qr art";
    gap: 0.12in;
    align-items: stretch;
  }

  .covh-thanks-block .covh-script-heading {
    font-size: 14pt;
  }

  .covh-sponsor-block .covh-script-heading {
    font-size: 16pt;
  }

  .covh-qr-image {
    max-width: 1.3in;
  }

  .covh-art-block {
    min-height: 2.15in;
    height: 100%;
    align-self: stretch;
  }

  .covh-art-image {
    right: 0;
    bottom: 0;
    width: 70%;
  }

  .covh-footer-lines {
    left: 8pt;
    bottom: 24pt;
    max-width: 31%;
  }
  
  @page {
    size: letter portrait;
    margin: 0;
  }
}
.public-footer {
  margin: 8px auto 20px;
  width: 100%;
  max-width: 1060px;
  text-align: center;
}

.public-footer-link {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.9;
}

.public-footer-link:hover,
.public-footer-link:focus {
  text-decoration: underline;
  opacity: 1;
}


/* Public locations + vendors refresh */
.public-group-block {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.public-group-block:first-child {
  margin-top: 0;
}

.public-group-block__header,
.public-entity-card__top,
.public-button-row,
.detail-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.public-group-block__header h4,
.public-entity-card__top h5,
.detail-section h4 {
  margin: 0;
}

.public-entity-row,
.detail-list-item {
  margin-top: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
}

.public-entity-row:first-of-type {
  margin-top: 0.9rem;
}

.public-kv-grid,
.detail-grid {
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.public-kv-grid.compact {
  margin-top: 0.6rem;
}

.public-kv-grid div,
.detail-grid div {
  display: grid;
  gap: 0.2rem;
}

.public-kv-grid dt,
.detail-grid dt {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.public-kv-grid dd,
.detail-grid dd {
  margin: 0;
}

.public-badge-row {
  margin-top: 0.75rem;
}

.mini-badge-muted {
  opacity: 0.75;
}

.mini-badge-highlight {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(219, 234, 254, 0.9);
  color: #1d4ed8;
}

.detail-section {
  margin-top: 1rem;
}

.detail-list {
  display: grid;
  gap: 0.65rem;
}

.detail-list-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.detail-list-item:hover,
.detail-list-item:focus {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.12);
}

.detail-list-meta,
.subtle {
  color: var(--muted);
}

.inline-link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent, #2563eb);
  cursor: pointer;
  text-decoration: underline;
}

.modal-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-content .secondary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(255,255,255,0.9);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.modal-content .secondary-button:hover,
.modal-content .secondary-button:focus,
.secondary-button:hover,
.secondary-button:focus {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12);
}

.public-vendor-item {
  background: rgba(255,255,255,0.96);
}

body.theme-dark .public-group-block {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.34);
}

body.theme-dark .public-entity-row,
body.theme-dark .detail-list-item,
body.theme-dark .secondary-button,
body.theme-dark .modal-content .secondary-button {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
}

body.theme-dark .mini-badge-highlight {
  background: rgba(30, 64, 175, 0.25);
  color: #bfdbfe;
}

/* --- Vendor empty-state styling fix --- */
.detail-list-item:not(button) {
  cursor: default;
}

.detail-list-item:not(button):hover,
.detail-list-item:not(button):focus {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

/* Dark mode */
body.theme-dark .detail-list-item:not(button):hover,
body.theme-dark .detail-list-item:not(button):focus {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: none;
}


@media (max-width: 720px) {
  .public-group-block__header,
  .public-entity-card__top,
  .public-button-row,
  .detail-actions,
  .detail-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .public-kv-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
