/* Shared browser theme. Dark values preserve the established DEV40 palette. */
:root {
  --theme-page: #07131f;
  --theme-surface: #0d2130;
  --theme-surface-raised: #102b3d;
  --theme-surface-muted: #091a27;
  --theme-text: #eaf0f4;
  --theme-secondary: #aebdc7;
  --theme-border: #243b4a;
  --theme-input: #091a27;
  --theme-link: #a8c3d2;
  --theme-button: #17384d;
  --theme-button-hover: #204b64;
  --theme-button-text: #edf3f7;
  --theme-tag: #162d3d;
  --theme-accent: #f0b35e;
  --theme-header: rgba(7, 19, 31, .94);
  --theme-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
html[data-theme="light"] {
  --theme-page: #f7f2e8;
  --theme-surface: #fffaf1;
  --theme-surface-raised: #f2e7d4;
  --theme-surface-muted: #eee4d5;
  --theme-text: #263442;
  --theme-secondary: #53616b;
  --theme-border: #cbbda8;
  --theme-input: #fffdf8;
  --theme-link: #31576b;
  --theme-button: #eee2cf;
  --theme-button-hover: #e4d1b5;
  --theme-button-text: #263442;
  --theme-tag: #ede0c9;
  --theme-accent: #985714;
  --theme-header: rgba(247, 242, 232, .97);
  --theme-shadow: 0 8px 24px rgba(60, 42, 20, .08);
  --vb-bg: var(--theme-page);
  --vb-bg-soft: var(--theme-surface-muted);
  --vb-panel: var(--theme-surface);
  --vb-panel-2: var(--theme-surface-muted);
  --vb-panel-3: var(--theme-surface-raised);
  --vb-line: var(--theme-border);
  --vb-line-soft: #ded3c1;
  --vb-text: var(--theme-text);
  --vb-muted: var(--theme-secondary);
  --vb-shadow: var(--theme-shadow);
  --ink: var(--theme-text);
  --ink2: #385064;
  --paper: var(--theme-page);
  --card: var(--theme-surface);
  --line: var(--theme-border);
  --muted: var(--theme-secondary);
  background: var(--theme-page);
}

/* One branding component is used by both layout families. */
.brand-mark-slot { display: inline-flex; align-items: center; flex: none; }
.brand-logo { display: block; max-width: 108px; max-height: 42px; width: auto; height: auto; object-fit: contain; }
.brand-logo-light { display: none; }
html[data-theme="dark"] .brand-logo-auto-invert { filter: invert(1); }
html[data-theme="light"] .brand-logo-light { display: block; }
html[data-theme="light"] .brand-logo-dark { display: none; }
.brand-mark-fallback.has-dark-logo { display: none; }
html[data-theme="light"] .brand-mark-fallback.has-dark-logo { display: grid; }
html[data-theme="light"] .brand-mark-fallback.has-light-logo { display: none; }
html[data-theme="dark"] .logo-error-dark .brand-logo-dark, html[data-theme="light"] .logo-error-light .brand-logo-light { display: none; }
html[data-theme="dark"] .logo-error-dark .brand-mark-fallback, html[data-theme="light"] .logo-error-light .brand-mark-fallback { display: grid; }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1.02; }
.brand-lockup { text-decoration: none; }
.brand-lockup:focus-visible, .public-brand:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 4px; }

/* The label names the destination mode; JS updates only the accessible name. */
.theme-toggle, .public-site .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; min-height: 34px; gap: 5px; padding: 5px 11px;
  border: 1px solid var(--theme-border); border-radius: 999px;
  background: transparent; color: var(--theme-text); font: inherit;
  font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover, .public-site .theme-toggle:hover { background: var(--theme-surface-raised); border-color: var(--theme-accent); color: var(--theme-text); }
.theme-toggle:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 2px; }
.theme-toggle-icon { font-size: 17px; line-height: 1; }
.theme-toggle-to-dark { display: none; }
html[data-theme="light"] .theme-toggle-to-dark { display: inline-flex; align-items: center; gap: 5px; }
html[data-theme="light"] .theme-toggle-to-light { display: none; }

/* Home hierarchy: two columns for results, quiet static benefits. */
.home-event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-community-section { padding: 25px 0; border-top: 1px solid var(--theme-border); border-bottom: 1px solid var(--theme-border); }
.home-community-links { display: flex; flex-wrap: wrap; gap: 10px; }
.public-site .home-community-links a { display: inline-flex; padding: 10px 13px; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface); color: var(--theme-text); text-decoration: none; font-weight: 700; }
.public-site .home-community-links a:hover { border-color: var(--theme-accent); background: var(--theme-surface-raised); }
.public-purpose-grid { gap: 22px; }
.public-purpose-card { padding: 0 0 0 14px; border: 0; border-left: 2px solid var(--theme-border); border-radius: 0; background: transparent; }
.public-purpose-card h3 { margin-top: 0; }
.public-purpose-number { display: none; }

/* The homepage pointer and static roadmap stay quieter than result cards. */
.home-whats-next {
  display: flex; align-items: end; justify-content: space-between; gap: 18px;
  padding: 28px 0 4px; border-top: 1px solid var(--theme-border);
}
.home-whats-next h2 { margin: 0 0 7px; font-size: clamp(20px, 2.5vw, 26px); }
.home-whats-next p { margin: 0; color: var(--theme-secondary); }
.public-site .home-whats-next a { flex: none; color: var(--theme-link); font-weight: 700; text-underline-offset: 3px; }
.public-site .home-whats-next a:hover { color: var(--theme-text); }
.public-site .home-whats-next a:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 3px; }

.roadmap-page { max-width: 900px; }
.roadmap-page > header { max-width: 760px; }
.roadmap-page > header p { margin: 0 0 10px; color: var(--theme-secondary); }
.roadmap-group { padding: 24px 0; border-top: 1px solid var(--theme-border); }
.roadmap-group-heading { display: flex; align-items: start; gap: 13px; margin-bottom: 14px; }
.roadmap-group-heading h2 { margin: 1px 0 0; font-size: 22px; }
.roadmap-marker { flex: none; width: 10px; height: 10px; margin-top: 10px; border-radius: 50%; border: 2px solid var(--theme-secondary); }
.roadmap-marker-now { border-color: #78ae8b; background: #78ae8b; }
.roadmap-marker-next { border-color: var(--theme-accent); background: var(--theme-accent); }
.roadmap-marker-later { border-color: var(--theme-secondary); }
.roadmap-page .roadmap-group ul {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 34px;
  margin: 0 0 0 23px; padding: 0; list-style: disc;
}
.roadmap-page .roadmap-group li { padding-left: 2px; color: var(--theme-secondary); }
.roadmap-page .roadmap-note { margin-top: 12px; color: var(--theme-secondary); }

/* The title link owns one stable card-wide hit area; only real links sit above it. */
.discovery-open-card {
  position: relative; isolation: isolate; cursor: pointer;
  transition: border-color .15s ease;
}
.discovery-open-card .card-primary-link::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
}
.discovery-open-card .card-primary-link:focus-visible::after {
  outline: 3px solid var(--theme-accent); outline-offset: -4px; border-radius: 10px;
}
.discovery-open-card a:not(.card-primary-link) { position: relative; z-index: 3; }
.public-site .discovery-open-card .card-primary-link:hover { color: var(--theme-text); }
.discovery-open-card:hover { border-color: var(--theme-secondary); transform: none; }
.directory-profile-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.community-card-location { margin: 9px 0 3px; color: var(--theme-secondary); font-size: 14px; }
.community-card-systems { align-items: center; margin-top: 6px; }
.community-card-more { color: var(--theme-secondary); font-size: 12px; padding: 5px 2px; }
.community-card-activity { display: grid; gap: 3px; min-width: 0; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--theme-border); overflow-wrap: anywhere; }
.community-card-activity span { color: var(--theme-secondary); font-size: 12px; font-weight: 700; }
.community-card-activity strong { color: var(--theme-text); font-size: 14px; line-height: 1.4; }
.community-card-activity small { color: var(--theme-secondary); font-size: 12px; }
.community-card-tagline { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--theme-secondary); font-size: 13px; line-height: 1.45; }
.community-active-filters { display: none; }
.community-filter-disclosure { min-width: 0; }
.community-filter-disclosure[open] > summary { display: none; }
.community-filter-form { margin-top: 1rem; }
@media (prefers-reduced-motion: reduce) {
  .discovery-open-card { transition: none; }
}

.discovery-mobile-active-filters { display: none; }
.empty-directory h2 { margin: 0 0 8px; font-size: 21px; }
.empty-directory p { color: var(--theme-secondary); }
.empty-directory .empty-directory-secondary { margin-bottom: 0; font-size: 13px; }
.public-site .empty-directory-secondary a { color: var(--theme-link); }
@media (max-width: 1400px) {
  .public-header-inner > .theme-toggle { margin-left: auto; }
  .public-account { margin-left: 0; }
}
@media (max-width: 650px) {
  .directory-discovery .public-search-box { margin-top: 0; }
  .community-active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
  .public-site .community-filter-chip { min-width: 0; max-width: 100%; overflow-wrap: anywhere; background: var(--theme-surface-muted); border-color: var(--theme-border); color: var(--theme-secondary) !important; }
  .community-filter-disclosure > summary,
  .community-filter-disclosure[open] > summary { display: list-item; min-height: 44px; padding: 10px 12px; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-surface-muted); color: var(--theme-text); cursor: pointer; font-weight: 700; }
  .community-filter-disclosure > summary:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 2px; }
  .community-filter-disclosure[open] > summary { border-radius: 8px 8px 0 0; }
  .community-filter-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 0; padding: 12px; border: 1px solid var(--theme-border); border-top: 0; border-radius: 0 0 8px 8px; }
  .community-filter-form label { margin-top: 4px; }
  .directory-discovery .community-filter-form select { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
  .public-site .community-filter-apply { width: 100%; min-height: 44px; margin-top: 8px; font-size: 16px; }
  .home-event-grid { grid-template-columns: minmax(0, 1fr); }
  .public-purpose-grid { gap: 18px; }
  .home-whats-next { display: block; }
  .home-whats-next a { display: inline-block; margin-top: 12px; }
  .roadmap-page .roadmap-group ul { grid-template-columns: minmax(0, 1fr); }
  .discovery-mobile-active-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
  .discovery-mobile-active-filters .discovery-chip { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .public-header-inner > .theme-toggle { order: 1; margin-left: auto; }
  .public-menu-toggle { order: 2; margin-left: 0; }
  .public-nav { order: 3; }
  .public-account { order: 4; }
  .app-topbar { gap: 7px; }
  .global-search { min-width: 0; }
  .topbar-actions { gap: 5px; }
  .app-topbar .theme-toggle { padding: 5px 8px; }
}
@media (max-width: 380px) {
  .public-brand { gap: 6px; }
  .public-brand-mark { width: 30px; height: 30px; }
  .public-brand-copy strong { font-size: 12px; }
  .public-brand .brand-logo { max-width: 42px; max-height: 32px; }
  .app-topbar .global-search { max-width: 44px; padding: 0 9px; }
  .app-topbar .global-search:focus-within { max-width: none; }
}

/* Public shell and reusable discovery surfaces. */
html[data-theme="light"] .public-site {
  --accent: var(--theme-accent);
  --muted: var(--theme-secondary);
  background: radial-gradient(circle at 20% 0%, rgba(210, 157, 75, .12), transparent 34rem), var(--theme-page);
  color: var(--theme-text);
}
html[data-theme="light"] .public-header { background: var(--theme-header); border-bottom-color: var(--theme-border); }
html[data-theme="light"] .public-brand-mark { color: var(--theme-accent); border-color: var(--theme-accent); background: #f7e8c9; }
html[data-theme="light"] .public-brand-copy small,
html[data-theme="light"] .public-nav a,
html[data-theme="light"] .public-footer a { color: var(--theme-secondary); }
html[data-theme="light"] .public-nav a:hover,
html[data-theme="light"] .public-footer a:hover { color: var(--theme-text); }
html[data-theme="light"] .public-site h1,
html[data-theme="light"] .public-site h2,
html[data-theme="light"] .public-site h3,
html[data-theme="light"] .public-site .card h1,
html[data-theme="light"] .public-site .card h2,
html[data-theme="light"] .public-site .card h3,
html[data-theme="light"] .public-site .directory-card a { color: var(--theme-text); }
html[data-theme="light"] .public-site .muted { color: var(--theme-secondary); }
html[data-theme="light"] .public-hero p,
html[data-theme="light"] .public-home-section-head p,
html[data-theme="light"] .public-purpose-card p,
html[data-theme="light"] .home-event-info p,
html[data-theme="light"] .home-event-meta,
html[data-theme="light"] .directory-heading p,
html[data-theme="light"] .public-event-summary,
html[data-theme="light"] .public-event-meta,
html[data-theme="light"] .public-event-organiser,
html[data-theme="light"] .directory-card-summary,
html[data-theme="light"] .directory-card-meta,
html[data-theme="light"] .featured-event-date,
html[data-theme="light"] .featured-event-location,
html[data-theme="light"] .featured-event-organiser,
html[data-theme="light"] .public-map-heading p,
html[data-theme="light"] .public-calendar-heading p,
html[data-theme="light"] .trust-page p,
html[data-theme="light"] .trust-page li { color: var(--theme-secondary); }
html[data-theme="light"] .public-site .button,
html[data-theme="light"] .public-site button.button,
html[data-theme="light"] .public-menu-toggle,
html[data-theme="light"] .public-site .audience-card .button,
html[data-theme="light"] .public-site .directory-card .button { background: var(--theme-button); border-color: var(--theme-border); color: var(--theme-button-text); }
html[data-theme="light"] .public-site .button:hover,
html[data-theme="light"] .public-site button.button:hover,
html[data-theme="light"] .public-menu-toggle:hover { background: var(--theme-button-hover); border-color: var(--theme-accent); color: var(--theme-text); }
html[data-theme="light"] .public-site .button.primary,
html[data-theme="light"] .public-site button.button.primary { background: #37566b; border-color: #37566b; color: #fff; }
html[data-theme="light"] .public-site .button.ghost { background: transparent; border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .public-site .theme-toggle { background: transparent; border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .public-site .theme-toggle:hover { background: var(--theme-surface-raised); border-color: var(--theme-accent); }
html[data-theme="light"] .public-site .card,
html[data-theme="light"] .public-event-card,
html[data-theme="light"] .featured-events-section,
html[data-theme="light"] .featured-event-card,
html[data-theme="light"] .home-event-card,
html[data-theme="light"] .attending-vendor-card,
html[data-theme="light"] .public-purpose-section,
html[data-theme="light"] .trust-section,
html[data-theme="light"] .public-map-filters,
html[data-theme="light"] .directory-filters,
html[data-theme="light"] .public-map-card,
html[data-theme="light"] .public-month-card { background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .public-purpose-section { background: transparent; }
html[data-theme="light"] .public-purpose-card { background: transparent; border-color: var(--theme-border); }
html[data-theme="light"] .home-event-date,
html[data-theme="light"] .event-date-block,
html[data-theme="light"] .public-week-number { background: var(--theme-surface-muted); border-color: var(--theme-border); color: var(--theme-accent); }
html[data-theme="light"] .home-event-info h3 a,
html[data-theme="light"] .public-event-topline h2 a,
html[data-theme="light"] .featured-event-card h3 a { color: var(--theme-text); }
html[data-theme="light"] .home-event-link,
html[data-theme="light"] .public-back-link { color: var(--theme-link) !important; }
html[data-theme="light"] .public-site .badge,
html[data-theme="light"] .featured-event-tags .badge { background: var(--theme-tag); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .public-site input,
html[data-theme="light"] .public-site select,
html[data-theme="light"] .public-site textarea { background: var(--theme-input); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .public-site select option { background: var(--theme-input); color: var(--theme-text); }
html[data-theme="light"] .public-site input::placeholder { color: #65727c; }
html[data-theme="light"] .public-site .public-menu-open .public-nav a { background: var(--theme-surface-muted); color: var(--theme-text); }
html[data-theme="light"] .public-detail-hero,
html[data-theme="light"] .public-detail-section,
html[data-theme="light"] .public-profile-hero.has-banner { border-color: var(--theme-border); }
html[data-theme="light"] .public-profile-hero.has-banner::after { background: linear-gradient(90deg, rgba(247,242,232,.85), rgba(247,242,232,.58)); }
html[data-theme="light"] .public-profile-logo,
html[data-theme="light"] .directory-profile-logo,
html[data-theme="light"] .public-profile-gallery a { background: var(--theme-surface-muted); border-color: var(--theme-border); }
html[data-theme="light"] .public-date-status { color: #8f5818; }
html[data-theme="light"] .public-map-summary,
html[data-theme="light"] .public-calendar-note { color: var(--theme-secondary); }
html[data-theme="light"] .public-site .maplibregl-popup-content { background: var(--theme-surface) !important; border-color: var(--theme-border); color: var(--theme-text) !important; }
html[data-theme="light"] .public-site .maplibregl-popup-tip { border-top-color: var(--theme-surface) !important; }

/* Workspace shell, cards, filters and task-oriented editors. */
html[data-theme="light"] body:not(.public-site) { --accent: var(--theme-accent); background: var(--theme-page); color: var(--theme-text); }
html[data-theme="light"] .app-shell { background: var(--theme-page); }
html[data-theme="light"] .app-sidebar { background: var(--theme-surface); box-shadow: 9px 0 30px rgba(60,42,20,.08); }
html[data-theme="light"] .app-topbar { background: var(--theme-header); }
html[data-theme="light"] .brand-lockup:hover,
html[data-theme="light"] .side-nav-item:hover,
html[data-theme="light"] .sidebar-trust-links a:hover { color: var(--theme-text); }
html[data-theme="light"] .nav-section-label,
html[data-theme="light"] .side-nav-item,
html[data-theme="light"] .sidebar-trust-links a,
html[data-theme="light"] .sidebar-signout button,
html[data-theme="light"] .user-chip,
html[data-theme="light"] .notification-link { color: var(--theme-secondary); }
html[data-theme="light"] .side-nav-item:hover,
html[data-theme="light"] .user-chip:hover,
html[data-theme="light"] .notification-link:hover { background: var(--theme-surface-muted); }
html[data-theme="light"] .side-nav-item.active { background: var(--theme-surface-raised); color: var(--theme-text); }
html[data-theme="light"] .global-search,
html[data-theme="light"] .card,
html[data-theme="light"] .account-card,
html[data-theme="light"] .account-hero,
html[data-theme="light"] .directory-hero,
html[data-theme="light"] .detail-hero,
html[data-theme="light"] .command-hero,
html[data-theme="light"] .command-toolbar,
html[data-theme="light"] .workflow-column,
html[data-theme="light"] .workflow-event,
html[data-theme="light"] .focus-card,
html[data-theme="light"] .kpi,
html[data-theme="light"] .filters,
html[data-theme="light"] .public-directory-filters,
html[data-theme="light"] .month-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .calendar-legend,
html[data-theme="light"] .vector-map-card,
html[data-theme="light"] .map-card,
html[data-theme="light"] .map-toolbar,
html[data-theme="light"] .nav-editor-row,
html[data-theme="light"] .quick-actions-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; box-shadow: var(--theme-shadow); }
html[data-theme="light"] .workflow-event,
html[data-theme="light"] .quick-action-list .button,
html[data-theme="light"] .detail-subnav a,
html[data-theme="light"] .quick-filter { background: var(--theme-surface-muted) !important; color: var(--theme-text); }
html[data-theme="light"] .app-shell .button:not(.primary),
html[data-theme="light"] .app-shell button:not(.theme-toggle):not(.primary) { background: var(--theme-button); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .app-shell .button:not(.primary):hover,
html[data-theme="light"] .app-shell button:not(.theme-toggle):not(.primary):hover { background: var(--theme-button-hover); border-color: var(--theme-accent); }
html[data-theme="light"] .app-shell input,
html[data-theme="light"] .app-shell select,
html[data-theme="light"] .app-shell textarea { background: var(--theme-input) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
html[data-theme="light"] .app-shell select option { background: var(--theme-input); color: var(--theme-text); }
html[data-theme="light"] .app-shell input::placeholder,
html[data-theme="light"] .global-search input::placeholder { color: #65727c; }
html[data-theme="light"] .app-shell label,
html[data-theme="light"] .app-shell .strong,
html[data-theme="light"] .app-shell .kpi strong,
html[data-theme="light"] .app-shell .metric strong,
html[data-theme="light"] .app-shell .details dd,
html[data-theme="light"] .app-shell .finance-kpis strong,
html[data-theme="light"] .app-shell .score-breakdown strong,
html[data-theme="light"] .app-shell .directory-card h2 a,
html[data-theme="light"] .app-shell .workflow-column-title { color: var(--theme-text) !important; }
html[data-theme="light"] .app-shell .badge,
html[data-theme="light"] .app-shell .status,
html[data-theme="light"] .app-shell .score,
html[data-theme="light"] .app-shell .workflow-count { background: var(--theme-tag); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .app-shell .muted,
html[data-theme="light"] .app-shell .helptext,
html[data-theme="light"] .app-shell .card form p,
html[data-theme="light"] .app-shell .account-card form p,
html[data-theme="light"] .app-shell .directory-card-summary,
html[data-theme="light"] .app-shell .directory-card-meta,
html[data-theme="light"] .app-shell .command-hero p,
html[data-theme="light"] .app-shell .workflow-meta,
html[data-theme="light"] .app-shell .details dt,
html[data-theme="light"] .app-shell .kpi span { color: var(--theme-secondary) !important; }
html[data-theme="light"] .app-shell th,
html[data-theme="light"] .app-shell .month-card h2,
html[data-theme="light"] .app-shell .month-grid.header span,
html[data-theme="light"] .app-shell .weekno { background: var(--theme-surface-muted) !important; color: var(--theme-text) !important; }
html[data-theme="light"] .app-shell td,
html[data-theme="light"] .app-shell .day,
html[data-theme="light"] .app-shell .daynum { background: var(--theme-surface); color: var(--theme-text) !important; }
html[data-theme="light"] .app-shell tbody tr:hover { background: var(--theme-surface-muted); }
html[data-theme="light"] .app-shell .message { background: var(--theme-surface-raised); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .app-shell .form-section,
html[data-theme="light"] .app-shell .form-tab-panel,
html[data-theme="light"] .app-shell .admission-row,
html[data-theme="light"] .app-shell .taxonomy-picker { border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .app-shell .form-tab[aria-selected="true"] { background: var(--theme-surface-raised); color: var(--theme-text); }
html[data-theme="light"] .app-shell .maplibregl-popup-content { background: var(--theme-surface) !important; color: var(--theme-text) !important; }
html[data-theme="light"] .app-shell .beta-feedback-dialog { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }

/* Public practical detail, profile, authentication, calendar and map controls. */
html[data-theme="light"] .public-facts-card,
html[data-theme="light"] .public-private-tools,
html[data-theme="light"] .public-source-link,
html[data-theme="light"] .public-auth-card,
html[data-theme="light"] .public-calendar-note,
html[data-theme="light"] .public-calendar-tba,
html[data-theme="light"] .public-series-edition,
html[data-theme="light"] .public-site .calendar-dialog[open] {
  background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="light"] .public-detail-copy,
html[data-theme="light"] .public-notice p,
html[data-theme="light"] .public-notice time,
html[data-theme="light"] .public-facts dd,
html[data-theme="light"] .public-facts dt,
html[data-theme="light"] .public-auth-intro,
html[data-theme="light"] .public-site .calendar-dialog-head p { color: var(--theme-secondary); }
html[data-theme="light"] .public-facts dd strong,
html[data-theme="light"] .public-source-link strong,
html[data-theme="light"] .public-site .calendar-dialog-head h2 { color: var(--theme-text); }
html[data-theme="light"] .public-facts dd a,
html[data-theme="light"] .public-calendar-note a,
html[data-theme="light"] .public-calendar-tba-list a { color: var(--theme-link) !important; }
html[data-theme="light"] .public-facts > div,
html[data-theme="light"] .public-detail-subsection,
html[data-theme="light"] .public-notice { border-color: var(--theme-border); }
html[data-theme="light"] .public-auth-form label { color: var(--theme-text); }
html[data-theme="light"] .public-month-card h2,
html[data-theme="light"] .public-month-header { background: var(--theme-surface-muted); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .public-calendar-day,
html[data-theme="light"] .public-calendar-day:nth-child(7),
html[data-theme="light"] .public-calendar-day:nth-child(8),
html[data-theme="light"] .public-calendar-day.outside { background: var(--theme-surface); border-color: var(--theme-border); }
html[data-theme="light"] .public-calendar-day.has-event { background: #f5ead6; }
html[data-theme="light"] .public-calendar-day-number,
html[data-theme="light"] .public-week-heading { color: var(--theme-text); }
html[data-theme="light"] .public-calendar-event,
html[data-theme="light"] .public-calendar-day-summary,
html[data-theme="light"] .public-calendar-event-key { background: #dce7e5; border-color: #9db2b4; color: #213747 !important; }
html[data-theme="light"] .public-calendar-event:hover,
html[data-theme="light"] .public-calendar-day-summary:hover { background: #c8d9d8; color: #213747 !important; }
html[data-theme="light"] .public-site .calendar-dialog-event,
html[data-theme="light"] .public-site .calendar-tba-event { background: var(--theme-surface-muted); border-color: var(--theme-border); color: var(--theme-text) !important; }
html[data-theme="light"] .public-site .calendar-dialog-event span,
html[data-theme="light"] .public-site .calendar-tba-event span { color: var(--theme-secondary); }
html[data-theme="light"] .public-map-summary strong,
html[data-theme="light"] .public-calendar-day.today .public-calendar-day-number { color: var(--theme-accent); }
html[data-theme="light"] .public-map-error { background: #f8eacb; border-color: #b99556; color: #59421e; }
html[data-theme="light"] .public-site .maplibregl-popup-content a { color: var(--theme-link) !important; }

/* The editor stylesheet is loaded by individual pages after the base shell. */
html[data-theme="light"] .editing-taxonomy-picker,
html[data-theme="light"] .editing-readiness,
html[data-theme="light"] .editing-series,
html[data-theme="light"] .editing-tab-panel,
html[data-theme="light"] .editing-admission-row,
html[data-theme="light"] .editing-section {
  background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="light"] .editing-taxonomy-picker summary,
html[data-theme="light"] .editing-readiness summary,
html[data-theme="light"] .editing-series summary { color: var(--theme-text); }
html[data-theme="light"] .editing-tabs a,
html[data-theme="light"] .editing-tabs button { background: var(--theme-surface-muted); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .editing-tabs [aria-selected="true"],
html[data-theme="light"] .editing-tabs .active { background: var(--theme-surface-raised); color: var(--theme-text); }
html[data-theme="light"] .app-shell .calendar-dialog[open] { background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .app-shell .calendar-dialog-head h2,
html[data-theme="light"] .app-shell .calendar-dialog-event,
html[data-theme="light"] .app-shell .calendar-tba-event { color: var(--theme-text) !important; }
html[data-theme="light"] .app-shell .calendar-dialog-event,
html[data-theme="light"] .app-shell .calendar-tba-event { background: var(--theme-surface-muted); border-color: var(--theme-border); }
html[data-theme="light"] .editing-panel,
html[data-theme="light"] .editing-taxonomy-picker,
html[data-theme="light"] .editing-readiness,
html[data-theme="light"] .editing-series,
html[data-theme="light"] .editing-repeat-row,
html[data-theme="light"] .editing-actions {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text);
}
html[data-theme="light"] .editing-actions { box-shadow: 0 -5px 20px rgba(60,42,20,.1); }
html[data-theme="light"] .editing-tabs a { background: var(--theme-surface-muted); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="light"] .editing-tabs a:hover,
html[data-theme="light"] .editing-tabs a[aria-selected="true"] { background: var(--theme-surface-raised); border-color: var(--theme-accent); color: var(--theme-text); }
html[data-theme="light"] .editing-panel .form-row label,
html[data-theme="light"] .editing-taxonomy-options label,
html[data-theme="light"] .editing-repeat-row legend,
html[data-theme="light"] .editing-check-field label,
html[data-theme="light"] .editing-repeat-controls label { color: var(--theme-text); }
html[data-theme="light"] .editing-section-head p,
html[data-theme="light"] .editing-picker-count,
html[data-theme="light"] .editing-readiness-grid ul { color: var(--theme-secondary); }
html[data-theme="light"] .editing-taxonomy-options label:hover,
html[data-theme="light"] .editing-taxonomy-options label:has(input:checked) { background: var(--theme-surface-raised); color: var(--theme-text); }
html[data-theme="light"] .editing-repeat-controls { border-color: var(--theme-border); }
html[data-theme="light"] .editing-repeat-row.is-removed { background: #f7e8e7 !important; border-color: #b9827e !important; }
html[data-theme="light"] .app-shell .button.danger,
html[data-theme="light"] .app-shell button.danger { background: #f8e6e2; color: #86362d; border-color: #b9827e; }
html[data-theme="light"] .public-footer { border-color: var(--theme-border); color: var(--theme-secondary); }
html[data-theme="light"] .registration-intent { border-color: var(--theme-border); }
html[data-theme="light"] .registration-intent label span { color: var(--theme-secondary); }
/* Intent choices are presentation only; keep all four easy to scan and tap. */
.registration-intent label { min-height: 54px; padding: 9px 10px; border-radius: 8px; align-items: start; }
.registration-intent label:hover, .registration-intent label:focus-within { background: var(--theme-surface-raised); }
.registration-intent input { margin-top: 4px; }
.registration-intent label strong { color: var(--theme-text); }
.registration-intent label span { color: var(--theme-secondary); }
.onboarding-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.onboarding-choice-grid .audience-feature { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; background: var(--theme-surface); border-color: var(--theme-border); }
.onboarding-choice-grid .audience-feature h2, .onboarding-choice-grid .audience-feature p { overflow-wrap: anywhere; }
.onboarding-choice-grid .audience-feature p { color: var(--theme-secondary); flex: 1; }
.onboarding-choice-grid .audience-feature .button { align-self: flex-start; }
.community-join-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; margin: 0 0 16px; color: var(--theme-secondary); }
.public-site .community-join-prompt a { color: var(--theme-link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.community-join-prompt a:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 3px; }
html[data-theme="light"] .public-site .beta-feedback-dialog { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="light"] .community-item,
html[data-theme="light"] .community-venue-search,
html[data-theme="light"] .community-public-places > div {
  background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="light"] .community-public-places small { color: var(--theme-secondary); }
html[data-theme="light"] .discovery-more-filters,
html[data-theme="light"] .discovery-filter-disclosure > summary,
html[data-theme="light"] .public-map-filters fieldset { background: var(--theme-surface-muted); border-color: var(--theme-border); color: var(--theme-text); }

/* A phone calendar is a dated agenda; the existing month grid remains on larger screens. */
.public-calendar-agenda { display: none; }
.public-calendar-regular-key, .public-calendar-regular-count { color: var(--theme-secondary); }
.public-calendar-regular-key { font-weight: 700; margin-left: 8px; }
.public-calendar-day-summary span { display: block; }
.public-calendar-day-summary .public-calendar-regular-count { font-size: .82em; }
.calendar-item-group.regular { opacity: .82; }
.calendar-item-group h3 { margin: 12px 0 6px; font-size: 1rem; }
.calendar-item-group + .calendar-item-group { margin-top: 10px; }

@media (max-width: 650px) {
  .onboarding-choice-grid { grid-template-columns: 1fr; gap: 10px; }
  .onboarding-choice-grid .audience-feature { padding: 17px; }
  .onboarding-choice-grid .audience-feature .button { min-height: 44px; }
  .community-join-prompt a { min-height: 44px; display: inline-flex; align-items: center; }
  .public-header-inner { min-height: 60px; padding: 8px 0; gap: 6px; flex-wrap: nowrap; }
  .public-brand { flex: 1 1 auto; min-width: 0; gap: 7px; }
  .public-brand-copy { min-width: 0; }
  .public-brand-copy strong { font-size: 14px; line-height: 1.15; overflow-wrap: anywhere; }
  .public-brand-copy small { display: none; }
  .public-brand-mark { width: 32px; height: 32px; }
  .public-brand .brand-logo { max-width: 42px; max-height: 34px; }
  .public-header-inner > .theme-toggle,
  .public-menu-toggle { flex: none; min-width: 44px; min-height: 44px; margin-left: 0; }
  .public-header-inner > .theme-toggle { order: 1; padding: 6px; font-size: 0; }
  .public-header-inner > .theme-toggle .theme-toggle-icon { font-size: 20px; }
  .public-menu-toggle { order: 2; justify-content: center; padding: 6px; }
  .public-menu-toggle span { display: none; }
  .public-header-inner .public-nav,
  .public-header-inner .public-account { position: absolute; left: 0; right: 0; width: auto; background: var(--theme-header); padding: 10px 12px; border: 1px solid var(--theme-border); }
  .public-header-inner .public-nav { top: 100%; }
  .public-header-inner .public-account { top: calc(100% + 1px); }
  .public-header-inner.public-menu-open { flex-wrap: wrap; }
  .public-header-inner.public-menu-open .public-nav,
  .public-header-inner.public-menu-open .public-account { position: static; width: 100%; border: 0; padding: 0; background: transparent; }
  .public-header-inner.public-menu-open .public-nav a { background: var(--theme-surface); color: var(--theme-text); }
  .public-header-inner.public-menu-open .public-account { padding-top: 8px; }

  .public-main { padding-top: 18px; }
  .public-hero { padding: 14px 0 20px; }
  .public-hero .eyebrow { margin-bottom: 7px; }
  .public-hero h1 { font-size: clamp(30px, 8vw, 36px); line-height: 1.1; margin-bottom: 10px; }
  .public-hero p { font-size: 16px; line-height: 1.45; }
  .public-hero .public-search-box { margin-top: 18px; }
  .public-search-box input,
  .public-search-box .button { min-height: 44px; font-size: 16px; }
  .public-hero-actions { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 12px; }
  .public-site .public-hero-actions .button { padding: 7px 0; min-height: 44px; background: transparent; border: 0; color: var(--theme-link); }
  .public-upcoming-section { margin-top: 20px; margin-bottom: 26px; }
  .public-home-section { margin-top: 20px; }
  .public-home-section-head { margin-bottom: 12px; }
  .home-event-card { min-height: 0; }
  .home-event-info { padding: 12px; }
  .home-community-section { padding: 18px 0; }
  .home-community-links a { min-height: 44px; align-items: center; }
  .public-purpose-section { padding-top: 18px; }
  .public-purpose-grid { gap: 12px; }
  .public-purpose-card { padding: 0 0 0 12px; }
  .home-whats-next { padding-top: 20px; }

  .discovery-mobile-active-filters { overflow-wrap: anywhere; }
  .discovery-filter-disclosure > summary { min-height: 44px; background: var(--theme-surface-muted); border-color: var(--theme-border); }
  .discovery-filter-panel,
  .discovery-more-filters { background: var(--theme-surface); border-color: var(--theme-border); }
  .discovery-more-filters summary { min-height: 44px; color: var(--theme-text); }
  .discovery-primary-filters select,
  .discovery-primary-filters input,
  .discovery-advanced-fields select,
  .discovery-advanced-fields input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
  .public-view-switcher .button,
  .public-calendar-navigation .button,
  .public-calendar-modes .button { min-height: 44px; }
  .public-event-card { min-width: 0; }
  .public-event-content { min-width: 0; padding: 12px; overflow-wrap: anywhere; }
  .public-event-tags, .directory-profile-tags { flex-wrap: wrap; }
  .public-event-bottom { flex-wrap: wrap; gap: 8px; }

  .public-calendar-note { padding: 8px 10px; margin-bottom: 12px; background: var(--theme-surface-muted); border-color: var(--theme-border); }
  .public-year-calendar { display: none; }
  .public-calendar-agenda { display: block; margin: 16px 0 26px; }
  .agenda-month { margin: 0 0 22px; }
  .agenda-month > h2 { font-size: 20px; margin: 0 0 12px; }
  .agenda-day { margin: 0 0 17px; }
  .agenda-day h3 { font-size: 14px; margin: 0 0 6px; color: var(--theme-secondary); text-transform: uppercase; letter-spacing: .035em; }
  .agenda-items { display: grid; gap: 7px; }
  .public-site .agenda-item { display: grid; gap: 4px; min-height: 58px; padding: 11px 13px; border: 1px solid var(--theme-border); border-radius: 10px; background: var(--theme-surface); color: var(--theme-text); text-decoration: none; overflow-wrap: anywhere; }
  .agenda-item strong { font-size: 16px; line-height: 1.3; }
  .agenda-item span { color: var(--theme-secondary); font-size: 14px; line-height: 1.4; }
  .agenda-empty { color: var(--theme-secondary); }
  .public-site .agenda-item:hover { border-color: var(--theme-accent); background: var(--theme-surface-raised); }
  .agenda-item:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 2px; }

  .public-event-map { height: 65dvh; min-height: 420px; }
  .public-map-card { padding: 7px; }
  .public-map-popup-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .public-detail-hero { padding: 18px; }
  .public-detail-heading h1 { overflow-wrap: anywhere; }
  .public-detail-section { padding: 17px 0; overflow-wrap: anywhere; }
  .public-detail-tags { flex-wrap: wrap; }
  .public-detail-primary-actions .button { min-height: 44px; }
  .public-site a.taxonomy-pill,
  .app-shell a.taxonomy-pill { min-height: 32px; padding: 5px 8px; }
  .community-public-places, .public-series-other-editions { min-width: 0; }
  .public-series-other-editions a { overflow-wrap: anywhere; }
  .directory-discovery select { min-width: 0; max-width: 100%; }
  .directory-discovery .button-row { align-items: stretch; }
  .directory-discovery .button-row select { width: 100%; min-height: 44px; font-size: 16px; }
  .roadmap-group { padding: 17px 0; }
  .roadmap-group-heading { margin-bottom: 8px; }
  .public-auth-wrap { min-height: 0; padding: 14px 0 24px; place-items: stretch; }
  .public-auth-card { padding: 20px; }
  .public-auth-card input { width: 100%; min-width: 0; font-size: 16px; }
  .app-topbar { min-width: 0; }
  .app-topbar .global-search { min-width: 0; }
  .app-topbar .global-search input { min-width: 0; font-size: 16px; }
  .app-topbar .theme-toggle { min-width: 44px; min-height: 44px; padding: 6px; font-size: 0; }
  .app-topbar .theme-toggle-icon { font-size: 20px; }
  .app-main, .app-stage, .account-card { min-width: 0; }
  .app-main input:not([type="checkbox"]):not([type="radio"]),
  .app-main select,
  .app-main textarea { max-width: 100%; }
  .community-item, .community-item > div { min-width: 0; overflow-wrap: anywhere; }
  .community-item .button-row { display: flex; flex-wrap: wrap; gap: 8px; }
  .public-profile-editor { min-width: 0; }
  .public-profile-form-control input:not([type="checkbox"]),
  .public-profile-form-control select,
  .public-profile-form-control textarea { font-size: 16px; }
}
@media (max-width: 380px) {
  .app-topbar .global-search { max-width: none; }
  .app-topbar .global-search:focus-within { max-width: none; }
  .app-topbar .global-search input::placeholder { color: transparent; }
}
html[data-theme="light"] .discovery-more-filters summary { color: var(--theme-text); }
html[data-theme="light"] .discovery-more-filters[open] summary { border-color: var(--theme-border); }
html[data-theme="light"] .public-site a.public-directions-link,
html[data-theme="light"] .public-site a.discovery-origin-action { color: var(--theme-accent); }
html[data-theme="light"] .public-site a.discovery-origin-action { background: var(--theme-surface-muted); border-color: var(--theme-accent); }
html[data-theme="light"] .public-site a.discovery-origin-action:hover { background: var(--theme-surface-raised); color: var(--theme-accent); }

/* Taxonomy links inherit the original compact metadata badge at rest. */
.public-site a.taxonomy-pill,
.app-shell a.taxonomy-pill {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}
.public-site a.taxonomy-pill:hover,
.app-shell a.taxonomy-pill:hover {
  background: var(--theme-surface-raised);
  color: var(--theme-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.public-site a.taxonomy-pill:active,
.app-shell a.taxonomy-pill:active { background: var(--theme-surface-muted); }
.public-site a.taxonomy-pill:focus-visible,
.app-shell a.taxonomy-pill:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 2px;
  background: var(--theme-surface-raised);
}
.public-site .badge-static,
.app-shell .badge-static { cursor: default; }

/* Quiet parent-brand credit shared by the public footer and workspace footer. */
.parent-brand-attribution { margin: 8px 0 0; color: var(--theme-secondary); font-size: 11px; line-height: 1.4; }
.parent-brand-attribution a,
.public-site .parent-brand-attribution a { color: var(--theme-secondary); text-decoration: underline; text-decoration-color: var(--theme-border); text-underline-offset: 2px; }
.parent-brand-attribution a:hover,
.public-site .parent-brand-attribution a:hover { color: var(--theme-text); text-decoration-color: var(--theme-accent); }
.parent-brand-attribution a:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 2px; }
.app-sidebar .parent-brand-attribution { margin: 10px 10px 2px; }
/* Public-only sponsor: a measured gutter rail or one inline 3:1 fallback. */
.public-parent-brand-rail { display: none; }
.public-parent-brand-inline { display: block; width: min(100%, 800px); max-width: 100%; margin: 0 0 22px; }
.public-site .public-parent-brand-rail a,
.public-site .public-parent-brand-inline a {
  display: block; width: 100%; text-decoration: none; line-height: 0;
}
.public-parent-brand-banner,
.public-parent-brand-horizontal { display: block; width: 100%; height: auto; }
.public-parent-brand-rail a:focus-visible,
.public-parent-brand-inline a:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 4px; }
@media screen and (min-width: 1600px) and (min-height: 600px) {
  .public-parent-brand-rail[data-gutter-fit="true"] {
    display: block;
    position: fixed;
    top: var(--parent-banner-top);
    bottom: var(--parent-banner-bottom, 0px);
    left: 16px;
    background: #fff;
    width: var(--parent-banner-width);
  }
  .public-parent-brand-inline[data-gutter-fit="true"] { display: none; }
}
html[data-theme="light"] .public-site .parent-brand-attribution,
html[data-theme="light"] .app-sidebar .parent-brand-attribution { color: var(--theme-secondary); }
