/* White controls on a quiet neutral canvas. */
:root { --bg: #F5F5F7; --surface: #FFFFFF; }
body { background: #F5F5F7; }
body::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  top: -72px; left: -18%; width: 136%; height: 260px;
  border-radius: 0 0 48% 52% / 0 0 58% 62%;
  background:
    radial-gradient(ellipse 42% 76% at 8% 4%, rgb(255 255 255 / .96) 0 36%, transparent 72%),
    radial-gradient(ellipse 48% 82% at 52% -2%, rgb(255 255 255 / .88) 0 34%, transparent 73%),
    radial-gradient(ellipse 42% 72% at 94% 7%, rgb(255 255 255 / .72) 0 32%, transparent 72%);
  background-size: 115% 100%, 125% 105%, 115% 100%;
  filter: blur(10px) saturate(112%);
  mask-image: radial-gradient(ellipse 92% 100% at 50% 0%, #000 0 58%, rgba(0,0,0,.9) 66%, rgba(0,0,0,.35) 82%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 100% at 50% 0%, #000 0 58%, rgba(0,0,0,.9) 66%, rgba(0,0,0,.35) 82%, transparent 100%);
  animation: home-ambient-drift 7.5s cubic-bezier(.45,.05,.55,.95) infinite;
  transition: background 400ms ease;
  transform-origin: 50% 0;
}
@keyframes home-ambient-drift {
  0% { background-position: -30% 2%, 46% -8%, 128% 5%; transform: translate3d(-1.5%,0,0) scaleX(1.02) scaleY(.98); }
  25% { background-position: 0% 10%, 68% 4%, 103% -5%; transform: translate3d(1%,5px,0) scaleX(1.07) scaleY(1.03); }
  50% { background-position: 42% -3%, 35% 12%, 72% 8%; transform: translate3d(2%,0,0) scaleX(.98) scaleY(1.06); }
  75% { background-position: 12% 9%, 58% -4%, 112% 12%; transform: translate3d(-1%,4px,0) scaleX(1.05) scaleY(1); }
  100% { background-position: -30% 2%, 46% -8%, 128% 5%; transform: translate3d(-1.5%,0,0) scaleX(1.02) scaleY(.98); }
}
#bottom-navigation {
  transform: none;
  left: 0; right: 0; bottom: 0; width: 100%; max-width: none; margin: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding: 2px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  border-radius: 22px 22px 0 0; border-bottom: 0;
}
body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); overflow-x: clip; }
#bottom-navigation .bottom-nav-button { height: 52px; min-height: 52px; }
.hero { min-height: 0; background: none; border: 0; overflow: visible; }
.hero-content { min-height: 0; padding: 0; }
.event-filter-button {
  position: relative;
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(30 41 59 / .1);
  border-radius: 50%;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 120ms ease;
}
.event-filter-button:active { transform: scale(.94); }
.event-filter-button img { width: 21px; height: 21px; }
.event-filter-button.has-active-filters { border-color: #2563EB; background: #EFF6FF; }
.event-filter-active-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border: 1px solid #FFFFFF;
  border-radius: 50%;
  background: #2563EB;
}
.event-filter-active-dot[hidden] { display: none !important; }

/* Native dialog keeps the filter accessible, while the mobile layout reads as a bottom sheet. */
.event-filter-dialog {
  position: fixed !important;
  z-index: 2000;
  inset: auto 0 0 0 !important;
  width: min(430px, 100%);
  max-height: min(88dvh, 720px);
  margin: 0 auto !important;
  padding: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  border: 1px solid rgb(30 41 59 / .12);
  border-radius: 26px 26px 0 0;
  background: #F5F5F7;
  color: #1E293B;
  box-shadow: 0 28px 80px rgb(15 23 42 / .28);
}
body.event-filter-open { overflow: hidden !important; }
.event-filter-dialog::backdrop {
  background: rgb(15 23 42 / .52);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.event-filter-dialog[open] { animation: event-filter-enter 220ms cubic-bezier(.2,.8,.25,1); }
@keyframes event-filter-enter {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
.event-filter-dialog-content { padding: 22px; }
.event-filter-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.event-filter-dialog-heading .eyebrow {
  margin: 0 0 4px;
  color: #64748B;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}
.event-filter-dialog-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -.025em;
}
.event-filter-dialog .dialog-close {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  color: #475569;
  font-size: 27px;
  line-height: 1;
  box-shadow: 0 4px 12px rgb(15 23 42 / .08);
  cursor: pointer;
}
.event-filter-fieldset {
  min-width: 0;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}
.event-filter-fieldset legend {
  margin-bottom: 9px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}
.event-filter-options { display: grid; gap: 8px; }
.event-filter-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid rgb(148 163 184 / .26);
  border-radius: 16px;
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}
.event-filter-choice:active { transform: scale(.99); }
.event-filter-choice:has(input:checked) {
  border-color: #2563EB;
  background: #EFF6FF;
}
.event-filter-choice input {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid #94A3B8;
  border-radius: 50%;
  background: #FFFFFF;
}
.event-filter-choice input:checked { border: 6px solid #2563EB; }
.event-filter-choice input:focus-visible { outline: 3px solid rgb(37 99 235 / .25); outline-offset: 3px; }
.event-filter-choice span { display: grid; gap: 2px; min-width: 0; }
.event-filter-choice strong { font-size: 14px; line-height: 1.25; }
.event-filter-choice small { color: #64748B; font-size: 12px; line-height: 1.25; }
.event-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}
.event-filter-actions button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  font: 800 14px/1 var(--font-sans);
  cursor: pointer;
}
.event-filter-reset { background: #FFFFFF; color: #475569; box-shadow: 0 5px 14px rgb(15 23 42 / .08); }
.event-filter-apply { background: #2563EB; color: #FFFFFF; box-shadow: 0 8px 18px rgb(37 99 235 / .24); }

html[data-theme="dark"] .event-filter-button img { filter: brightness(0) invert(1); opacity: .78; }
html[data-theme="dark"] .event-filter-button.has-active-filters { border-color: #60A5FA; background: rgb(37 99 235 / .18); }
html[data-theme="dark"] .event-filter-dialog {
  border-color: rgb(148 163 184 / .16);
  background: #111827;
  color: #F8FAFC;
}
html[data-theme="dark"] .event-filter-dialog .dialog-close,
html[data-theme="dark"] .event-filter-choice,
html[data-theme="dark"] .event-filter-reset { background: #1F2937; color: #E2E8F0; }
html[data-theme="dark"] .event-filter-fieldset legend { color: #E2E8F0; }
html[data-theme="dark"] .event-filter-choice:has(input:checked) { border-color: #60A5FA; background: rgb(37 99 235 / .2); }
html[data-theme="dark"] .event-filter-choice input { background: #111827; }
html[data-theme="dark"] .event-filter-choice input:checked { border-color: #60A5FA; }
html[data-theme="dark"] .event-filter-choice small,
html[data-theme="dark"] .event-filter-dialog-heading .eyebrow { color: #94A3B8; }

@media (max-width: 560px) {
  .event-filter-dialog {
    width: 100%;
    max-width: none;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 26px 26px 0 0;
  }
  .event-filter-dialog-content { padding: 20px max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
}
.quick-navigation,
.quick-navigation:hover,
.quick-navigation::before,
.quick-navigation::after { background: transparent !important; background-image: none !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.quick-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 2px 0 0;
}
.home-section-divider {
  height: 1px;
  margin-top: 4px;
  margin-bottom: 20px;
  background: rgba(30, 41, 59, .15);
}
.quick-navigation #city-selector,
.quick-navigation #city-selector:hover,
.quick-navigation #city-selector:active {
  display: inline-flex; flex: 0 1 auto; max-width: 100%; width: auto;
  justify-content: flex-start; gap: 8px; padding: 8px 0; min-height: 48px;
  border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important;
  color: #111827; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; transform: none;
  overflow: visible; line-height: 1.35;
}
.quick-navigation #city-selector::before { background: transparent; }
.quick-navigation #city-selector::after { background: transparent !important; background-image: none !important; }
#city-selector .location-icon { width: 25px; height: 25px; fill: currentColor; }
#city-selector-label { display: block; padding-block: 2px; font-size: 14px; font-weight: 600; line-height: 1.35; }
#city-selector .city-chevron { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.quick-navigation .quick-weather {
  display: inline-flex;
  position: static;
  width: auto;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  transform: none;
}
.quick-navigation .quick-weather span { font-size: 20px; line-height: 1; }
.quick-navigation #quick-weather { font: 600 14px/1.35 var(--font-sans); }
.quick-navigation .quick-date {
  margin-left: auto;
  justify-self: end;
  color: #111827;
  font: 600 14px/1.35 var(--font-sans);
  white-space: nowrap;
}

/* Browse topics as a compact horizontal rail, following the reference layout. */
#category-filters,
#events-grid .event-group-filters,
#calendar-filters {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 0 10px !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
#category-filters::-webkit-scrollbar,
#events-grid .event-group-filters::-webkit-scrollbar,
#calendar-filters::-webkit-scrollbar { display: none; }
#category-filters .filter-button,
#events-grid .event-group-filters .filter-button,
#calendar-filters .filter-button {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-height: 44px !important;
  min-width: max-content !important;
  gap: 8px !important;
  padding: 9px 13px !important;
  border: 1px solid rgb(30 41 59 / .13) !important;
  border-radius: 14px !important;
  background: #FFFFFF !important;
  box-shadow: 0 1px 3px rgb(30 41 59 / .05) !important;
  color: #1E293B !important;
  font: 600 14px/1.2 var(--font-sans) !important;
  scroll-snap-align: start;
  opacity: 1 !important;
  transform: none !important;
}
#category-filters .filter-button .filter-emoji,
#events-grid .event-group-filters .filter-button .filter-emoji,
#calendar-filters .filter-button .filter-emoji {
  display: inline-flex;
  width: 21px;
  height: 21px;
  align-items: center;
  justify-content: center;
}
#category-filters .filter-button .ui-icon,
#events-grid .event-group-filters .filter-button .ui-icon,
#calendar-filters .filter-button .ui-icon {
  width: 21px !important;
  height: 21px !important;
  filter: none !important;
}
#category-filters.has-selection .filter-button:not(.active),
#events-grid .event-group-filters.has-selection .filter-button:not(.active),
#calendar-filters.has-selection .filter-button:not(.active) { opacity: .46 !important; }
#category-filters .filter-button.active,
#category-filters .filter-button.active:hover,
#events-grid .event-group-filters .filter-button.active,
#events-grid .event-group-filters .filter-button.active:hover,
#calendar-filters .filter-button.active,
#calendar-filters .filter-button.active:hover,
html[data-theme="dark"] #category-filters .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button.active,
html[data-theme="dark"] #calendar-filters .filter-button.active {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border-color: #1E293B !important;
  box-shadow: 0 0 0 2px rgb(30 41 59 / .11), 0 3px 8px rgb(30 41 59 / .08) !important;
}

/* The permanent-program icon follows the navigation scale with softly rounded artwork bounds. */
.bottom-nav-icon.permanent-nav-icon {
  display: block;
  width: 21px;
  height: 21px;
  border-radius: 5px;
  clip-path: inset(0 round 5px);
}
html[data-theme="dark"] .bottom-nav-icon.permanent-nav-icon { filter: brightness(0) invert(1); }
.bottom-nav-icon.one-time-nav-icon {
  display: block;
  width: 21px;
  height: 21px;
  border-radius: 5px;
  clip-path: inset(0 round 5px);
  filter: brightness(0);
}
html[data-theme="dark"] .bottom-nav-icon.one-time-nav-icon { filter: brightness(0) invert(1); }
#category-filters .gooey-filter,
#events-grid .event-group-filters .gooey-filter { display: none !important; }
html[data-theme="dark"] #category-filters .filter-button,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button,
html[data-theme="dark"] #calendar-filters .filter-button {
  background: #334155 !important;
  border-color: rgb(248 250 252 / .16) !important;
  color: #F8FAFC !important;
}
html[data-theme="dark"] #category-filters .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button.active,
html[data-theme="dark"] #calendar-filters .filter-button.active {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border-color: #FFFFFF !important;
}
.points-counter {
  position: fixed !important;
  z-index: 1000;
  /* Matches the upper-right price-mode switch once that control has scrolled away. */
  top: max(20px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: inline-flex;
  width: 66px;
  min-width: 66px;
  height: 52px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: none;
  color: #1E293B;
  cursor: default;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.88);
  transition: opacity 160ms ease, transform 180ms cubic-bezier(.2,.8,.2,1), visibility 160ms ease;
}
.points-counter.is-visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.points-counter .points-icon { width: 23px; height: 23px; filter: brightness(0); }
.points-counter strong { font: 700 16px/1 var(--font-sans); }
.events-section { padding-top: 16px; }
#featured-section {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(30, 41, 59, .15);
}
.all-events { margin-top: 16px; }
#featured-grid {
  padding-bottom: 0;
  scrollbar-width: none !important;
}
#featured-grid::-webkit-scrollbar { display: none !important; width: 0; height: 0; }
#featured-section .carousel-return { display: none !important; }
#events-grid .event-group { margin-top: 16px; }
#events-grid .event-group:first-child { margin-top: 0; }
#events-grid .event-group-filters { margin-bottom: 10px; }
.calendar-section { margin-top: 24px; }
.calendar-shell,
html[data-theme="dark"] .calendar-shell {
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.calendar-day.today {
  outline: 0;
  border: 2px solid transparent;
  background:
    linear-gradient(#F5F5F7, #F5F5F7) padding-box,
    linear-gradient(125deg, #2563EB, #10B981, #60A5FA, #10B981, #2563EB) border-box;
  background-size: 100% 100%, 280% 280%;
  color: #1E293B;
  animation: calendar-today-border 6.5s ease-in-out infinite;
}
#category-filters .filter-button.active .ui-icon,
#events-grid .event-group-filters .filter-button.active .ui-icon,
#calendar-filters .filter-button.active .ui-icon {
  filter: none !important;
}

/* Final selected-state override: the outline matches the category icon and has no layout or motion change. */
#category-filters .filter-button,
#events-grid .event-group-filters .filter-button,
#calendar-filters .filter-button {
  border: 2px solid transparent !important;
  background: #FFFFFF !important;
  box-shadow: inset 0 0 0 1px rgb(30 41 59 / .12) !important;
}
html[data-theme="dark"] #category-filters .filter-button,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button,
html[data-theme="dark"] #calendar-filters .filter-button {
  background: #334155 !important;
  color: #F8FAFC !important;
  box-shadow: inset 0 0 0 1px rgb(248 250 252 / .16) !important;
}
#category-filters .filter-button.active,
#category-filters .filter-button.active:hover,
#events-grid .event-group-filters .filter-button.active,
#events-grid .event-group-filters .filter-button.active:hover,
#calendar-filters .filter-button.active,
#calendar-filters .filter-button.active:hover,
html[data-theme="dark"] #category-filters .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button.active,
html[data-theme="dark"] #calendar-filters .filter-button.active {
  border-color: var(--category-color, #1E293B) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: #1E293B !important;
  box-shadow: none !important;
  animation: none !important;
}

/* Calendar selection has the same specificity as its legacy state rules. */
#calendar-filters.has-selection .filter-button.active,
#calendar-filters.has-selection .filter-button.active:hover,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active:hover {
  border: 2px solid var(--category-color, #1E293B) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: #1E293B !important;
  box-shadow: none !important;
  animation: none !important;
}
#calendar-filters.has-selection .filter-button.active .ui-icon,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active .ui-icon { filter: none !important; }

/* Reserve the same border width for every button, so selecting it never shifts the rail. */
#category-filters .filter-button,
#events-grid .event-group-filters .filter-button,
#calendar-filters .filter-button {
  border: 2px solid transparent !important;
  background: #FFFFFF !important;
  box-shadow: inset 0 0 0 1px rgb(30 41 59 / .12) !important;
}
html[data-theme="dark"] #category-filters .filter-button,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button,
html[data-theme="dark"] #calendar-filters .filter-button {
  background: #334155 !important;
  color: #F8FAFC !important;
  box-shadow: inset 0 0 0 1px rgb(248 250 252 / .16) !important;
}
#category-filters .filter-button.active,
#category-filters .filter-button.active:hover,
#events-grid .event-group-filters .filter-button.active,
#events-grid .event-group-filters .filter-button.active:hover,
#calendar-filters .filter-button.active,
#calendar-filters .filter-button.active:hover,
html[data-theme="dark"] #category-filters .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button.active,
html[data-theme="dark"] #calendar-filters .filter-button.active {
  border-color: var(--category-color, #1E293B) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: #1E293B !important;
  box-shadow: none !important;
  animation: none !important;
}
@keyframes calendar-today-border {
  0%, 100% { background-position: 0 0, 0% 50%; }
  22% { background-position: 0 0, 62% 18%; }
  48% { background-position: 0 0, 100% 78%; }
  71% { background-position: 0 0, 36% 100%; }
}
.calendar-day.selected,
.calendar-day.selected:hover,
.calendar-day.selected:focus-visible {
  border-color: rgba(30, 41, 59, .16);
  background: #FFFFFF;
  box-shadow: none;
  color: #1E293B;
}
.calendar-day.today.selected {
  border: 2px solid transparent;
  background:
    linear-gradient(#FFFFFF, #FFFFFF) padding-box,
    linear-gradient(125deg, #2563EB, #10B981, #60A5FA, #10B981, #2563EB) border-box;
  background-size: 100% 100%, 280% 280%;
  animation: calendar-today-border 6.5s ease-in-out infinite;
}
html[data-theme="dark"] .calendar-day.today {
  background:
    linear-gradient(#0F172A, #0F172A) padding-box,
    linear-gradient(125deg, #60A5FA, #10B981, #93C5FD, #10B981, #60A5FA) border-box;
  color: #F8FAFC;
}
html[data-theme="dark"] .calendar-day.selected { background: #FFFFFF; color: #1E293B; }
.event-card .event-title,
.event-card .event-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.event-card .event-meta {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.event-card .event-location { justify-content: flex-start; }
.event-card .event-location-value { min-width: 0; }
.event-card:not(.featured-card) .event-content {
  display: grid;
  grid-template-rows: 2.5em auto 2.9em;
  row-gap: 8px;
  padding-bottom: 16px;
}
.event-card:not(.featured-card) .event-title {
  min-height: 0;
  max-height: 2.5em;
  margin: 0;
  line-height: 1.25;
  align-self: end;
}
.event-card:not(.featured-card) .event-title.is-single-line-title { transform: none; }
.event-card:not(.featured-card) .event-meta { align-self: center; }
.event-card:not(.featured-card) .event-description {
  min-height: 0;
  height: 2.9em;
  margin: 0;
  line-height: 1.45;
  align-self: start;
}
/* Cards themselves are the detail affordance; the dedicated action is no longer shown. */
.event-card .details-button { display: none !important; }
.featured-grid .featured-card .event-title {
  display: -webkit-box;
  min-height: 0;
  max-height: 2.4em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.featured-grid .featured-card .event-title.is-single-line-title { transform: none; }
.featured-grid .featured-card .event-description {
  height: auto;
  min-height: 0;
  height: 3em;
  max-height: none;
  -webkit-line-clamp: 2 !important;
}
.featured-grid .featured-card .event-content {
  grid-template-rows: 2.4em auto minmax(0, 1fr);
  padding: 20px 16px 18px;
}
.featured-grid .featured-card .event-title { align-self: end; }
.featured-grid .featured-card .event-meta { align-self: center; }
.featured-grid .featured-card .event-description { align-self: end; }
/* Let the photo dissolve into the application canvas rather than whitening it. */
.featured-grid .featured-card .event-content::before {
  background: linear-gradient(to bottom, rgb(245 245 247 / 0) 0%, #F5F5F7 38%, #F5F5F7 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  mask-image: none;
  -webkit-mask-image: none;
}
html[data-theme="dark"] .featured-grid .featured-card .event-content::before {
  background: linear-gradient(to bottom, rgb(15 23 42 / 0) 0%, #0F172A 38%, #0F172A 100%);
}
html[data-theme="dark"] #featured-section { border-bottom-color: rgba(248, 250, 252, .16); }
@media (max-width: 520px) {
  .featured-grid .event-card.featured-card {
    /* Match the card's right edge to the left content edge. */
    flex-basis: calc(100dvw - 36px);
    height: clamp(410px, 112vw, 460px);
  }
}
/* Keep swipe navigation, but remove the progress scrollbar below event rows. */
.events-grid,
.favorite-pair { scrollbar-width: none; }
.events-grid::-webkit-scrollbar,
.favorite-pair::-webkit-scrollbar { display: none; }
.event-card,
.event-card.compact,
.favorite-pair .event-card,
.featured-grid .event-card.featured-card,
html[data-theme="dark"] .event-card {
  border: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
.event-card:not(.featured-card) .image-wrap { margin: 0; border-radius: 22px; }
.event-card:not(.featured-card) .event-content { padding-left: 0; padding-right: 0; }
.featured-grid .featured-card .image-wrap { border-radius: 24px; }
.event-card .details-button,
.event-card .details-button:hover,
.featured-grid .featured-card .details-button,
.featured-grid .featured-card .details-button:hover,
.event-card:not(.featured-card) .details-button,
.event-card:not(.featured-card) .details-button:hover {
  background: #FFFFFF; color: #1E293B; border: 0; box-shadow: none;
}
#events-grid .event-group-filters .filter-button,
#events-grid .event-group-filters .filter-button:hover,
#calendar-filters .filter-button,
.preference-options .filter-button,
.preference-options .filter-button:hover {
  background: #FFFFFF !important; color: #1E293B !important; border-color: transparent !important; box-shadow: none !important;
}
.ticket-button, .events-refresh-button, .event-share-button, .account-settings-button,
.profile-city-button, .transport-button, .calendar-nav-button { background: #FFFFFF; color: #1E293B; border-color: transparent; box-shadow: none; }
.bottom-navigation { background: rgba(245,245,247,.8); }
/* Keep the existing dark theme readable while using the new white controls. */
html[data-theme="dark"] body { background: #0F172A; }
html[data-theme="dark"] .quick-navigation #city-selector { color: #F5F5F7; }
html[data-theme="dark"] .quick-navigation .quick-weather { color: #F5F5F7; }
html[data-theme="dark"] .quick-navigation .quick-date { color: #F5F5F7; }
html[data-theme="dark"] .home-section-divider { background: rgba(248, 250, 252, .16); }
html[data-theme="dark"] .points-counter { background: #334155; color: #F8FAFC; }
html[data-theme="dark"] .points-counter .points-icon { filter: brightness(0); }
html[data-theme="dark"] .bottom-navigation { background: rgba(15,23,42,.8); }
#events-grid .event-group-filters.has-selection .filter-button.active,
#events-grid .event-group-filters.has-selection .filter-button.active:hover,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button,
html[data-theme="dark"] #events-grid .event-group-filters.has-selection .filter-button,
html[data-theme="dark"] #events-grid .event-group-filters.has-selection .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters.has-selection .filter-button.active:hover,
#calendar-filters .filter-button.active,
#calendar-filters.has-selection .filter-button.active:hover,
html[data-theme="dark"] #calendar-filters .filter-button.active,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active:hover {
  background: #FFFFFF !important; color: #1E293B !important; box-shadow: none !important;
}

/* A filter must visibly communicate that it is shaping the feed. */
#events-grid .event-group-filters.has-selection .filter-button.active,
#events-grid .event-group-filters.has-selection .filter-button.active:hover,
#calendar-filters.has-selection .filter-button.active,
#calendar-filters.has-selection .filter-button.active:hover,
html[data-theme="dark"] #events-grid .event-group-filters.has-selection .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters.has-selection .filter-button.active:hover,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active:hover {
  background: #1E293B !important;
  color: #FFFFFF !important;
  border-color: #1E293B !important;
  box-shadow: 0 5px 14px rgb(30 41 59 / .16) !important;
}
#events-grid .event-group-filters.has-selection .filter-button.active .filter-emoji,
#events-grid .event-group-filters.has-selection .filter-button.active .ui-icon,
#calendar-filters.has-selection .filter-button.active .filter-emoji,
#calendar-filters.has-selection .filter-button.active .ui-icon,
html[data-theme="dark"] #events-grid .event-group-filters.has-selection .filter-button.active .filter-emoji,
html[data-theme="dark"] #events-grid .event-group-filters.has-selection .filter-button.active .ui-icon,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active .filter-emoji,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active .ui-icon {
  color: #FFFFFF;
  filter: brightness(0) invert(1);
}

/* Event cards are direct detail controls now; give touch and keyboard users feedback. */
.event-card[role="button"],
.event-card[tabindex] { cursor: pointer; }
.event-card:not(.featured-card) .image-wrap,
.featured-grid .featured-card .image-wrap,
.event-card .event-content {
  transition: transform 160ms ease, opacity 160ms ease;
}
.event-card:not(.featured-card):active .image-wrap,
.featured-grid .featured-card:active .image-wrap { transform: scale(.985); }
.event-card:focus-visible {
  outline: 3px solid rgb(30 41 59 / .48);
  outline-offset: 4px;
  border-radius: 24px;
}
@media (prefers-reduced-motion: reduce) {
  .event-card:not(.featured-card) .image-wrap,
  .featured-grid .featured-card .image-wrap,
  .event-card .event-content { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .event-filter-button { transition: none; }
}

/* Two compact rows preserve the category overview while allowing a horizontal browse rail. */
#category-filters,
#events-grid .event-group-filters,
#calendar-filters {
  display: grid !important;
  grid-template-columns: none !important;
  grid-template-rows: repeat(2, 44px) !important;
  grid-auto-flow: column !important;
  grid-auto-columns: max-content !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  align-items: start !important;
  column-gap: 10px !important;
  row-gap: 8px !important;
  padding-bottom: 10px !important;
}
#category-filters .filter-button,
#events-grid .event-group-filters .filter-button,
#calendar-filters .filter-button {
  height: 44px !important;
  min-height: 44px !important;
  width: max-content !important;
  max-width: none !important;
  white-space: nowrap !important;
}

/* Each row packs its own labels, so a long button never creates a gap above it. */
#category-filters,
#events-grid .event-group-filters,
#calendar-filters {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 8px !important;
  padding: 2px 0 10px !important;
}
.category-filter-row {
  display: flex;
  width: max-content;
  gap: 10px;
  min-width: max-content;
}

/* A selected topic keeps its white fill; only the animated calendar-style border signals state. */
#category-filters .filter-button.active,
#category-filters .filter-button.active:hover,
#events-grid .event-group-filters .filter-button.active,
#events-grid .event-group-filters .filter-button.active:hover,
#calendar-filters .filter-button.active,
#calendar-filters .filter-button.active:hover,
html[data-theme="dark"] #category-filters .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button.active,
html[data-theme="dark"] #calendar-filters .filter-button.active {
  border: 2px solid transparent !important;
  background:
    linear-gradient(#FFFFFF, #FFFFFF) padding-box,
    linear-gradient(125deg, #2563EB, #10B981, #60A5FA, #10B981, #2563EB) border-box !important;
  background-size: 100% 100%, 280% 280% !important;
  color: #1E293B !important;
  box-shadow: none !important;
  animation: calendar-today-border 6.5s ease-in-out infinite;
}

/* Keep the category artwork colorful after earlier selection rules. */
#category-filters .filter-button.active .ui-icon,
#events-grid .event-group-filters .filter-button.active .ui-icon,
#calendar-filters .filter-button.active .ui-icon {
  filter: none !important;
}

/* Final selected-state override: icon-colored outline without an animated or resizing button. */
#category-filters .filter-button,
#events-grid .event-group-filters .filter-button,
#calendar-filters .filter-button { border: 2px solid transparent !important; background: #FFFFFF !important; box-shadow: none !important; }
html[data-theme="dark"] #category-filters .filter-button,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button,
html[data-theme="dark"] #calendar-filters .filter-button { background: #334155 !important; color: #F8FAFC !important; box-shadow: none !important; }
#category-filters .filter-button.active,
#category-filters .filter-button.active:hover,
#events-grid .event-group-filters .filter-button.active,
#events-grid .event-group-filters .filter-button.active:hover,
#calendar-filters .filter-button.active,
#calendar-filters .filter-button.active:hover,
html[data-theme="dark"] #category-filters .filter-button.active,
html[data-theme="dark"] #events-grid .event-group-filters .filter-button.active,
html[data-theme="dark"] #calendar-filters .filter-button.active {
  border-color: var(--category-color, #1E293B) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: #1E293B !important;
  box-shadow: none !important;
  animation: none !important;
}

/* Final calendar parity: overrides the older filled selected state. */
#calendar-filters.has-selection .filter-button.active,
#calendar-filters.has-selection .filter-button.active:hover,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active:hover {
  border: 2px solid var(--category-color, #1E293B) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: #1E293B !important;
  box-shadow: none !important;
  animation: none !important;
}
#calendar-filters.has-selection .filter-button.active .ui-icon,
html[data-theme="dark"] #calendar-filters.has-selection .filter-button.active .ui-icon {
  filter: none !important;
}

/* Shared home and calendar category rail — identical structure and selected state. */
.shared-category-filters {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 2px 0 10px !important;
  scrollbar-width: none;
}
.shared-category-filters::-webkit-scrollbar { display: none; }
.shared-category-filters .category-filter-row { display: flex; width: max-content; min-width: max-content; gap: 10px; }
.shared-category-filters .filter-button {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: max-content !important;
  max-width: none !important;
  min-height: 44px !important;
  height: 44px !important;
  gap: 8px !important;
  padding: 9px 13px !important;
  border: 2px solid transparent !important;
  border-radius: 14px !important;
  background: #FFFFFF !important;
  box-shadow: none !important;
  color: #1E293B !important;
  font: 600 14px/1.2 var(--font-sans) !important;
  white-space: nowrap !important;
  transform: none !important;
  animation: none !important;
}
.shared-category-filters.has-selection .filter-button:not(.active) { opacity: .46 !important; }
.shared-category-filters .filter-button.active,
.shared-category-filters .filter-button.active:hover {
  border-color: var(--category-color, #1E293B) !important;
  background: #FFFFFF !important;
  background-image: none !important;
  color: #1E293B !important;
  box-shadow: none !important;
  animation: none !important;
}
.shared-category-filters .filter-button .ui-icon,
.shared-category-filters .filter-button.active .ui-icon { width: 21px !important; height: 21px !important; filter: none !important; }
html[data-theme="dark"] .shared-category-filters .filter-button { background: #334155 !important; color: #F8FAFC !important; }
html[data-theme="dark"] .shared-category-filters .filter-button.active,
html[data-theme="dark"] .shared-category-filters .filter-button.active:hover { background: #FFFFFF !important; color: #1E293B !important; }

/* Event-card reading order: title, date/location, then description. */
.event-card:not(.featured-card) .event-content {
  display: grid !important;
  grid-template-areas: "title" "meta" "description" !important;
  grid-template-rows: 2.5em auto 2.9em !important;
  row-gap: 8px !important;
}
.event-card:not(.featured-card) .event-title { grid-area: title; align-self: start !important; }
.event-card:not(.featured-card) .event-meta { grid-area: meta; align-self: center !important; }
.event-card:not(.featured-card) .event-description { grid-area: description; align-self: start !important; margin: 0 !important; }
.featured-grid .featured-card .event-meta,
.featured-grid .featured-card .event-description { margin-inline: 0 !important; }
.featured-grid .featured-card .event-description {
  padding-left: 0 !important;
  justify-self: stretch;
  align-self: end !important;
}

/* Home feed order: featured events, All heading, shared filters, then the feed. */
.all-events > .filter-bar.shared-category-filters { display: flex !important; margin: 0 0 14px !important; }
.all-events-heading { margin: 0 0 10px !important; }
.all-events-heading h2 { margin: 0; }
#events-grid .event-group { margin-top: 0 !important; }
#events-grid .event-group-filters { display: none !important; }
.calendar-section { margin-top: 30px; }
.calendar-section > .shared-category-filters { margin: 0 0 14px !important; }

/* Featured events use the same clear reading order as the feed: image, title,
   date/location, description. No image-to-content dissolve is used here. */
.featured-grid .event-card.featured-card {
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border-radius: 24px !important;
  background: transparent !important;
}
.featured-grid .featured-card .image-wrap {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  aspect-ratio: 16 / 10 !important;
  margin: 0 !important;
  border-radius: 24px !important;
  overflow: hidden !important;
}
.featured-grid .featured-card .event-image { width: 100%; height: 100% !important; }
.featured-grid .featured-card .event-content {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-areas: "title" "meta" "description" !important;
  grid-template-rows: auto auto auto !important;
  gap: 6px !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 14px 0 0 !important;
  overflow: visible !important;
  color: #111827 !important;
}
.featured-grid .featured-card .event-content::before,
.featured-grid .featured-card::before,
.featured-grid .featured-card::after { display: none !important; content: none !important; }
.featured-grid .featured-card .event-content > * { position: static !important; }
.featured-grid .featured-card .event-title {
  grid-area: title;
  align-self: start !important;
  min-height: 0 !important;
  max-height: 2.4em !important;
  margin: 0 !important;
  color: #111827 !important;
}
.featured-grid .featured-card .event-meta { grid-area: meta; align-self: start !important; margin: 0 !important; }
.featured-grid .featured-card .event-description {
  grid-area: description;
  align-self: start !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  color: #111827 !important;
  line-height: 1.45 !important;
}
.featured-grid .featured-card .event-bottom,
.featured-grid .featured-card .inline-details { display: none !important; }
html[data-theme="dark"] .featured-grid .featured-card .event-content,
html[data-theme="dark"] .featured-grid .featured-card .event-title,
html[data-theme="dark"] .featured-grid .featured-card .event-meta,
html[data-theme="dark"] .featured-grid .featured-card .event-description { color: #F8FAFC !important; }

/* Fixed featured-card text slots keep the metadata row aligned across cards. */
.featured-grid .featured-card .event-content {
  grid-template-rows: 2.4em 1.55em 2.9em !important;
  row-gap: 3px !important;
  column-gap: 0 !important;
}
.featured-grid .featured-card .event-title {
  align-self: end !important;
  line-height: 1.2 !important;
  -webkit-line-clamp: 2 !important;
}
.featured-grid .featured-card .event-meta {
  align-self: center !important;
  min-height: 1.55em !important;
}
.featured-grid .featured-card .event-description {
  display: -webkit-box !important;
  visibility: visible !important;
  height: 2.9em !important;
  max-height: 2.9em !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

/* One vertical rhythm for every event card: image, title, metadata, description. */
.event-card:not(.featured-card) .event-content {
  padding-top: 10px !important;
  row-gap: 10px !important;
}
.featured-grid .featured-card .event-content {
  padding-top: 20px !important;
  row-gap: 10px !important;
}

/* Fixed text tracks: a one-line title sits on its second line, while metadata
   stays in one predictable place on every card. */
.event-card:not(.featured-card) .event-content {
  grid-template-rows: 50px 26px 47px !important;
  padding-top: 10px !important;
  row-gap: 8px !important;
}
.event-card:not(.featured-card) .event-title { align-self: end !important; }
.featured-grid .featured-card .event-content {
  grid-template-rows: 58px 26px 47px !important;
  padding-top: 10px !important;
  row-gap: 8px !important;
}
.featured-grid .featured-card .event-title { align-self: end !important; }
.featured-grid .featured-card .event-meta,
.event-card:not(.featured-card) .event-meta { align-self: center !important; }
.featured-grid .featured-card .event-description,
.event-card:not(.featured-card) .event-description { align-self: start !important; }

/* Featured-card distance remains on the image layer, independent of hidden badges. */
.featured-grid .featured-card .image-wrap .featured-distance {
  display: inline-flex !important;
  position: absolute !important;
  z-index: 3 !important;
  right: 12px !important;
  bottom: calc(var(--featured-panel-height, 120px) + 16px) !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 7px 10px !important;
  border: 1px solid rgb(255 255 255 / .38) !important;
  border-radius: 12px !important;
  background: rgb(15 23 42 / .84) !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 12px rgb(0 0 0 / .18) !important;
}
.featured-grid .featured-card .image-wrap .featured-distance .distance-value { color: #FFFFFF !important; }

/* Match the space below both home-feed dividers. */
#featured-section { margin-top: -48px; }

/* Balanced spacing after the header divider. */
#featured-section { margin-top: -18px; }

/* Calendar states use the same quiet black and divider-gray language. */
.calendar-day.has-events {
  border-color: rgb(30 41 59 / .16) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.calendar-day.today,
.calendar-day.today.selected,
.calendar-day.today:hover,
.calendar-day.today:focus-visible {
  outline: 0 !important;
  border: 2px solid #111827 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #111827 !important;
  animation: none !important;
}
.calendar-day.has-favorite .calendar-favorite-heart,
.calendar-day.selected .calendar-favorite-heart {
  color: rgb(30 41 59 / .28) !important;
  opacity: 1 !important;
}
.calendar-day.has-favorite .calendar-favorite-heart .ui-icon { filter: grayscale(1) !important; }
@media (prefers-reduced-motion: no-preference) {
  .favorite-button.is-heart-feedback {
    animation: favorite-heart-glow 760ms cubic-bezier(.2,.82,.22,1) both !important;
  }
  .favorite-button.is-heart-feedback svg {
    animation: favorite-heart-pop 760ms cubic-bezier(.2,.82,.22,1) both !important;
    transform-origin: center;
  }
}
@keyframes favorite-heart-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.38) rotate(-5deg); }
  56% { transform: scale(.92) rotate(3deg); }
  78% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@keyframes favorite-heart-glow {
  0%, 100% { box-shadow: 0 5px 14px rgb(127 29 29 / .24); }
  34% { box-shadow: 0 0 0 7px rgb(220 38 38 / .15), 0 8px 24px rgb(220 38 38 / .48); }
  70% { box-shadow: 0 0 0 3px rgb(220 38 38 / .1), 0 6px 18px rgb(220 38 38 / .34); }
}

/* A selected calendar date receives a clean white fill. */
.calendar-day.selected,
.calendar-day.selected:hover,
.calendar-day.selected:focus-visible {
  background: #FFFFFF !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #1E293B !important;
}

/* End-of-feed refresh: a compact circular action with pull-to-refresh feedback. */
.events-refresh-wrap {
  justify-content: center !important;
  padding: 28px 0 calc(18px + env(safe-area-inset-bottom)) !important;
}
.events-refresh-button,
.events-refresh-button:hover,
.events-refresh-button.is-refreshed {
  --refresh-pull-progress: 0;
  display: grid !important;
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid rgb(30 41 59 / .14) !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
  box-shadow: 0 5px 14px rgb(15 23 42 / .08) !important;
  opacity: calc(1 - var(--refresh-pull-progress) * .42) !important;
  transform: scale(calc(1 - var(--refresh-pull-progress) * .22)) !important;
  transition: opacity 120ms linear, transform 120ms ease, box-shadow 180ms ease !important;
}
.events-refresh-button img {
  width: 25px !important;
  height: 25px !important;
  filter: brightness(0) saturate(100%) invert(13%) sepia(17%) saturate(1308%) hue-rotate(176deg) brightness(94%) contrast(93%);
  transition: transform 120ms linear;
}
.events-refresh-button.is-pulling img { transform: rotate(calc(var(--refresh-pull-progress) * 320deg)); }
.events-refresh-button.is-refreshed img { animation: refresh-button-spin 760ms cubic-bezier(.22,1,.36,1) both; }
html[data-theme="dark"] .events-refresh-button,
html[data-theme="dark"] .events-refresh-button:hover { background: #334155 !important; border-color: rgb(248 250 252 / .16) !important; }
html[data-theme="dark"] .events-refresh-button img { filter: brightness(0) invert(1); }

/* Values are set during the end-of-feed pull gesture. */
.events-refresh-button,
.events-refresh-button:hover,
.events-refresh-button.is-refreshed {
  --refresh-opacity: 1;
  --refresh-scale: 1;
  --refresh-rotation: 0deg;
  opacity: var(--refresh-opacity) !important;
  transform: scale(var(--refresh-scale)) !important;
}
.events-refresh-button.is-pulling img { transform: rotate(var(--refresh-rotation)) !important; }

/* The calendar begins as a peer section, with the same divider rhythm. */
.calendar-section {
  border-top: 1px solid rgb(30 41 59 / .15) !important;
  padding-top: 32px !important;
}
html[data-theme="dark"] .calendar-section { border-top-color: rgb(248 250 252 / .16) !important; }

/* Only the featured image is rounded; text must never be clipped by its card shell. */
.featured-grid .event-card.featured-card {
  border-radius: 0 !important;
  overflow: visible !important;
}

/* Rails may scroll locally, but must never expand the document horizontally. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

/* Event cards retain their full contrast throughout horizontal scrolling. */
.event-carousel .event-card {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .event-carousel .event-card { transition: none; }
}

/* Compact event cards: one-line title, metadata, and up to two description lines. */
.event-card:not(.featured-card) .event-content,
.featured-grid .featured-card .event-content {
  grid-template-rows: auto auto auto !important;
  row-gap: 8px !important;
  padding: 10px 0 0 !important;
  min-height: 0 !important;
}
.event-card .event-title,
.featured-grid .featured-card .event-title {
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  -webkit-line-clamp: unset !important;
}
.event-card .event-description,
.featured-grid .featured-card .event-description {
  display: -webkit-box !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 2.9em !important;
  margin: 0 !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}
.event-card .event-bottom { display: none !important; }
/* Saved hearts and distance text share the app canvas color; the feedback is
   expressed only through three progressively smaller beats of the heart. */
.favorite-button.is-favorite,
.favorite-button.is-heart-feedback,
.featured-grid .featured-card .favorite-button.is-favorite,
.featured-grid .featured-card .favorite-button.is-heart-feedback {
  background: rgb(20 20 24 / .66) !important;
  color: #F5F5F7 !important;
  box-shadow: none !important;
  animation: none !important;
}
.distance-pill .distance-value,
.distance-pill.is-nearby .distance-value,
.featured-grid .featured-card .featured-distance .distance-value {
  color: #F5F5F7 !important;
}
@media (prefers-reduced-motion: no-preference) {
  .favorite-button.is-heart-feedback svg {
    animation: favorite-heart-three-beats 1300ms cubic-bezier(.22,.82,.26,1) both !important;
    transform-origin: center;
  }
}
@keyframes favorite-heart-three-beats {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.34); }
  23% { transform: scale(1); }
  39% { transform: scale(1.23); }
  50% { transform: scale(1); }
  66% { transform: scale(1.13); }
  77% { transform: scale(1); }
}

/* Normal card copy must not be clipped by rounded lower card corners. */
.event-card:not(.featured-card) {
  border-radius: 0 !important;
  overflow: visible !important;
}

/* A return control occupies a short tail after the final card in every event rail. */
.event-carousel .carousel-return {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1 !important;
  display: grid !important;
  flex: 0 0 56px !important;
  width: 52px !important;
  height: 52px !important;
  margin: auto 6px auto 2px !important;
  place-items: center !important;
  border: 1px solid rgb(30 41 59 / .14) !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
  box-shadow: 0 5px 14px rgb(15 23 42 / .08) !important;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.82);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(.2,.8,.2,1), visibility 180ms ease;
}
.event-carousel .carousel-return[hidden] { display: none !important; }
.event-carousel .carousel-return.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}
.event-carousel .carousel-return svg {
  width: 25px !important;
  height: 25px !important;
  fill: currentColor !important;
  filter: none !important;
}
html[data-theme="dark"] .event-carousel .carousel-return { background: #334155 !important; color: #F8FAFC !important; border-color: rgb(248 250 252 / .16) !important; }

/* Dynamic rails never become a browser scroll anchor during filter or favorite updates. */
#events-grid,
#featured-grid,
#calendar-events,
.events-grid,
.event-card { overflow-anchor: none; }

/* Keep the top divider immediately below the city row. */
.home-section-divider { margin-top: 3px !important; }

/* Featured rails use the same end-of-row return control as every event rail. */
#featured-section .event-carousel .carousel-return { display: grid !important; }
#featured-section .event-carousel .carousel-return[hidden] { display: none !important; }

/* Prevent horizontal reflow from being exposed while a feed swaps its cards. */
#events-grid .event-carousel { contain: inline-size; }

/* Header hierarchy: date and city remain at the upper right. */
.all-events-heading .event-filter-button { flex: 0 0 36px; }
.quick-navigation {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 1fr max-content !important;
  grid-template-rows: 30px 48px !important;
  align-items: center !important;
  width: min(1180px, calc(100% - 32px)) !important;
  min-height: 86px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
}
.quick-navigation .quick-date {
  grid-column: 2;
  grid-row: 1;
  margin: 0 !important;
  justify-self: end;
  align-self: start;
}
.quick-navigation #city-selector {
  grid-column: 2;
  grid-row: 2;
  width: max-content !important;
  min-width: 0;
  min-height: 48px !important;
  justify-self: end;
  align-self: end;
}
.home-section-divider { margin-top: 3px !important; }
@media (max-width: 800px) {
  .quick-navigation { width: calc(100% - 24px) !important; }
}

/* Two slow, progressively softer heart beats; no surrounding pulse effect. */
@keyframes favorite-heart-three-beats {
  0%, 100% { transform: scale(1); }
  18% { transform: scale(1.3); }
  35% { transform: scale(1); }
  60% { transform: scale(1.16); }
  77% { transform: scale(1); }
}

/* The right-hand date/city stack now owns the top row by itself. */
.quick-navigation {
  grid-template-rows: 26px 26px !important;
  min-height: 68px !important;
  height: 68px !important;
  padding-top: 16px !important;
  box-sizing: border-box;
}
.quick-navigation .quick-date {
  align-self: start !important;
  padding-top: 3px;
  line-height: 1.2 !important;
}
.quick-navigation #city-selector {
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  align-items: flex-end !important;
  line-height: 1.2 !important;
}
#city-selector-label { padding-bottom: 0 !important; line-height: 1.2 !important; }
#city-selector .location-icon { width: 23px !important; height: 23px !important; }

/* Keep both header lines in their own row. */
.quick-navigation .quick-date { transform: none !important; }
.quick-navigation #city-selector,
.quick-navigation #city-selector:hover,
.quick-navigation #city-selector:focus,
.quick-navigation #city-selector:focus-visible,
.quick-navigation #city-selector:active {
  transform: none !important;
  align-items: center !important;
}

/* Keep the header city name as compact as “Budapest”; longer names truncate cleanly. */
#city-selector-label {
  max-width: 8.6ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Section-divider rhythm: a little more air before Featured, less before later sections. */
.home-section-divider { margin-top: 12px !important; }
#featured-section { padding-bottom: 6px !important; }
.calendar-section { margin-top: 8px !important; }

/* A quiet elevation separates white controls from the canvas without making them heavy. */
.filter-button,
.event-filter-button,
.calendar-nav-button,
.events-refresh-button,
.bottom-nav .nav-item.is-active,
.favorite-button {
  box-shadow: 0 3px 10px rgb(15 23 42 / .09), 0 1px 2px rgb(15 23 42 / .05) !important;
}

/* Every interactive button, including theme choices, shares the same subtle depth. */
button {
  box-shadow: var(--control-shadow, 0 3px 10px rgb(15 23 42 / .09), 0 1px 2px rgb(15 23 42 / .05)) !important;
}

/* Category choices need a slightly clearer edge against the canvas. */
#category-filters .filter-button,
#calendar-category-filters .filter-button,
#calendar-filters .filter-button,
#events-grid .event-group-filters .filter-button {
  box-shadow: 0 5px 14px rgb(15 23 42 / .11), 0 1px 2px rgb(15 23 42 / .06) !important;
}

/* Calendar stays quiet: only dates that contain events appear as white controls. */
.calendar-day:not(.has-events):not(.selected) {
  background: transparent !important;
  box-shadow: none !important;
}
.calendar-day.has-events {
  background: #FFFFFF !important;
  box-shadow: 0 3px 10px rgb(15 23 42 / .07), 0 1px 2px rgb(15 23 42 / .04) !important;
  border-color: transparent !important;
}
.calendar-day.today,
.calendar-day.today.selected,
.calendar-day.today:hover,
.calendar-day.today:focus-visible {
  border-width: 1px !important;
  border-color: rgb(30 41 59 / .15) !important;
}
.calendar-day.has-favorite .calendar-favorite-heart,
.calendar-day.selected .calendar-favorite-heart {
  color: rgb(30 41 59 / .14) !important;
  opacity: .45 !important;
}

/* Images float just enough above the canvas to retain their visual edge. */
.event-card .image-wrap {
  box-shadow: 0 7px 18px rgb(15 23 42 / .12), 0 2px 5px rgb(15 23 42 / .06) !important;
}

.calendar-day.selected .calendar-day-number { font-weight: 800 !important; }

/* City selection is an inline error message, not a card or empty-state panel. */
.location-empty {
  margin: 8px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #64748B !important;
  font: 500 13px/1.45 var(--font-sans) !important;
}
.location-empty strong { color: #1E293B; font-weight: 700; }

/* Detail-view controls use the same white, lightly elevated material as the home controls. */
#event-details-dialog .ticket-button,
#event-details-dialog .event-details-favorite-button,
#event-details-dialog .event-share-button {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border: 1px solid rgb(30 41 59 / .10) !important;
  box-shadow: 0 3px 10px rgb(15 23 42 / .09), 0 1px 2px rgb(15 23 42 / .05) !important;
}
#event-details-dialog .ticket-button {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
}
#event-details-dialog .ticket-button.is-free {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border-color: rgb(30 41 59 / .10) !important;
  box-shadow: 0 3px 10px rgb(15 23 42 / .09), 0 1px 2px rgb(15 23 42 / .05) !important;
}
#event-details-dialog .event-details-favorite-button.is-favorite,
#event-details-dialog .event-details-favorite-button.is-heart-feedback { color: #111827 !important; }
#event-details-time { color: #2563EB !important; }
#event-details-dialog .event-details-badges .badge { color: #2563EB !important; }

/* Calendar favorite markers remain present but intentionally whisper-quiet. */
.calendar-day.has-favorite .calendar-favorite-heart,
.calendar-day.selected .calendar-favorite-heart {
  color: rgb(30 41 59 / .09) !important;
  opacity: .24 !important;
}

/* Empty category results remain a simple inline message, not a panel. */
.compact-empty-state {
  display: flex !important;
  align-items: baseline !important;
  width: auto !important;
  margin: 10px 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.compact-empty-message {
  color: #64748B !important;
  font-size: 13px !important;
}
.compact-empty-hint { color: #1E293B !important; font-size: 13px !important; }
.compact-empty-recommendation {
  min-height: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  color: #2563EB !important;
  font-size: 13px !important;
}

/* Errors are centred and red; the suggested category keeps its own blue action color. */
.location-empty,
.compact-empty-state {
  justify-content: center !important;
  text-align: center !important;
  flex-direction: column !important;
}
.location-empty {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  color: #DC2626 !important;
}
.location-empty strong,
.compact-empty-message { color: #DC2626 !important; }
.location-empty-city-link {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #DC2626 !important;
  font: inherit !important;
  font-weight: 700 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.compact-empty-state .empty-error-icon { margin: 0 0 2px; }
.empty-error-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  filter: brightness(0) saturate(100%) invert(20%) sepia(86%) saturate(3486%) hue-rotate(348deg) brightness(89%) contrast(90%);
}
.compact-empty-hint { color: #64748B !important; }

.compact-empty-recommendation-row {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

/* Trait/category controls use a rounded, crisp perimeter instead of a square fading shadow. */
.filter-button,
.preference-options .filter-button {
  border-radius: 14px !important;
  box-shadow: 0 0 0 1px rgb(15 23 42 / .08) !important;
}
.filter-button.active,
.filter-button.active:hover,
.preference-options .filter-button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--category-color, rgb(30 41 59 / .20)) !important;
}

/* One-time calendar: event days have a quiet rounded outline; today is the stronger anchor. */
.calendar-day.has-events {
  border: 1px solid rgb(30 41 59 / .15) !important;
}
.calendar-day.today,
.calendar-day.today.selected,
.calendar-day.today:hover,
.calendar-day.today:focus-visible {
  border: 2px solid rgb(30 41 59 / .34) !important;
}

/* Category pills must not inherit the broad rectangular control shadow. */
#category-filters .filter-button,
#calendar-category-filters .filter-button,
#calendar-filters .filter-button,
#events-grid .event-group-filters .filter-button,
.shared-category-filters .filter-button,
.preference-options .filter-button {
  box-shadow: none !important;
  filter: none !important;
  border-radius: 14px !important;
}

/* The recurring view turns the monthly grid into one compact weekday row. */
.weekly-calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
.weekly-calendar-day {
  min-width: 0 !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1E293B !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: default !important;
}
.weekly-calendar-day.has-events {
  background: #FFFFFF !important;
  box-shadow: 0 2px 5px rgb(15 23 42 / .07) !important;
}
.weekly-calendar-day.today,
.weekly-calendar-day.today:hover,
.weekly-calendar-day.today:focus-visible {
  border: 1px solid rgb(30 41 59 / .15) !important;
}

/* Calendar layout rules otherwise override the semantic hidden attribute. */
.calendar-weekdays[hidden],
.calendar-grid[hidden] { display: none !important; }

.calendar-toolbar { grid-template-columns: 1fr !important; }
.calendar-toolbar h3 { text-align: left !important; }
.calendar-toolbar h3 { text-transform: none !important; }

/* Trait pills retain a compact rounded elevation without the earlier broad shadow. */
#category-filters .filter-button,
#calendar-category-filters .filter-button,
#calendar-filters .filter-button,
#events-grid .event-group-filters .filter-button,
.shared-category-filters .filter-button,
.preference-options .filter-button {
  box-shadow: 0 3px 8px rgb(15 23 42 / .13), 0 1px 2px rgb(15 23 42 / .06) !important;
}

/* Discovery feed: nearby items stay compact; recommendations keep the primary card treatment. */
.discovery-feed-section { margin-top: 22px; }
.recommendation-grid { display: grid !important; gap: 16px !important; }
.recommendation-row { min-width: 0; }
.discovery-heading { margin: 0 0 10px !important; }
.discovery-heading h3 {
  margin: 0;
  color: #1E293B;
  font: 800 22px/1.15 var(--font-sans);
  letter-spacing: -.03em;
}
.mini-event-rail {
  display: flex !important;
  gap: 12px !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 1px 0 5px !important;
}
.mini-event-rail::-webkit-scrollbar { display: none; }
.mini-event-rail .event-card {
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) !important;
  grid-template-areas: "image content" !important;
  flex: 0 0 calc(100% - 34px) !important;
  min-width: 0 !important;
  min-height: 94px !important;
  margin: 0 !important;
  scroll-snap-align: start;
  column-gap: 12px;
  background: transparent !important;
}
.mini-event-rail .event-card .image-wrap {
  grid-area: image;
  width: 88px !important;
  height: 88px !important;
  min-height: 88px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 5px 14px rgb(15 23 42 / .12) !important;
}
.mini-event-rail .event-card .event-content {
  grid-area: content;
  min-width: 0;
  min-height: 88px !important;
  padding: 1px 0 !important;
  display: grid !important;
  grid-template-areas: "title" "meta" "description" !important;
  grid-template-rows: minmax(0, 2.4em) auto minmax(0, 2.2em) !important;
  row-gap: 3px !important;
}
.mini-event-rail .event-card .event-title {
  align-self: start !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 16px !important;
  line-height: 1.18 !important;
}
.mini-event-rail .event-card .event-meta {
  min-width: 0;
  font-size: 11px !important;
  gap: 8px !important;
  white-space: nowrap;
  overflow: hidden;
}
.mini-event-rail .event-card .event-location { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mini-event-rail .event-card .event-description {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 12px !important;
  line-height: 1.28 !important;
}
.mini-event-rail .event-card .distance-pill,
.mini-event-rail .event-card .event-bottom { display: none !important; }
.mini-event-rail .event-card .favorite-button {
  width: 32px !important;
  height: 32px !important;
  right: 4px !important;
  top: 4px !important;
}
.mini-event-rail .event-card .favorite-button svg { width: 18px !important; height: 18px !important; }

/* The discovery sections have deliberate, fixed layouts instead of exposing a clipped page edge. */
html, body { max-width: 100%; overflow-x: hidden; }
html, body { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
#events-grid, #nearby-grid, #recommended-grid, #upcoming-grid, #viewed-grid { max-width: 100%; }
.all-event-grid { display: grid !important; gap: 14px !important; overflow: visible !important; padding: 2px 0 4px !important; }
.all-event-grid .recommendation-row { display: flex !important; overflow-x: auto !important; padding: 2px 0 8px !important; }
.medium-event-rail {
  display: flex !important;
  gap: 14px !important;
  overflow-x: auto !important;
  padding: 2px 0 8px !important;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.medium-event-rail::-webkit-scrollbar { display: none; }
.medium-event-rail .event-card,
.all-event-grid .recommendation-row .event-card { flex: 0 0 min(72vw, 330px) !important; scroll-snap-align: start; }
.vertical-event-list {
  display: flex !important;
  gap: 12px !important;
  width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 1px 0 !important;
  scroll-padding-inline: 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.vertical-event-list::-webkit-scrollbar { display: none; }
.compact-event-page {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  flex: 0 0 calc(100% - 22px);
  min-width: 0;
  gap: 12px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.compact-event-page:only-child {
  flex-basis: 100%;
}
.vertical-event-list .event-card {
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) !important;
  grid-template-areas: "image content" !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 88px !important;
  margin: 0 !important;
  column-gap: 12px;
  background: transparent !important;
}
.vertical-event-list .image-wrap {
  grid-area: image;
  width: 88px !important;
  height: 88px !important;
  min-height: 88px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 5px 14px rgb(15 23 42 / .12) !important;
}
.vertical-event-list .event-card.compact-list-card .event-content {
  grid-area: content;
  min-width: 0;
  min-height: 88px !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 44px !important;
  grid-template-areas: "title title" "meta meta" "description favorite" !important;
  grid-template-rows: minmax(0, 1.2em) auto minmax(44px, 2.6em) !important;
  row-gap: 3px !important;
  column-gap: 8px !important;
}
.vertical-event-list .event-card.compact-list-card .event-title {
  grid-area: title !important;
  align-self: start !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  font-size: 16px !important;
  line-height: 1.18 !important;
}
.vertical-event-list .event-card h3 { margin: 0 !important; }
.vertical-event-list .event-card.compact-list-card .event-meta { grid-area: meta !important; min-width: 0; gap: 8px !important; font-size: 11px !important; white-space: nowrap; overflow: hidden; }
.vertical-event-list .event-location { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vertical-event-list .event-card.compact-list-card .event-description {
  grid-area: description !important;
  align-self: start !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding-right: 0;
  font-size: 12px !important;
  line-height: 1.28 !important;
}
.vertical-event-list .distance-pill,
.vertical-event-list .event-bottom,
.vertical-event-list .carousel-return { display: none !important; }
.vertical-event-list .event-card.compact-list-card .favorite-button {
  grid-area: favorite !important;
  align-self: end !important;
  justify-self: end !important;
  position: static !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
}
.vertical-event-list .event-card.compact-list-card .favorite-button svg { width: 24px !important; height: 24px !important; }

/* Compact horizontal cards use the same one-title/two-description-line structure. */
.mini-event-rail .event-card .event-content { grid-template-rows: minmax(0, 1.2em) auto minmax(0, 2.6em) !important; }
.mini-event-rail .event-card .event-title { -webkit-line-clamp: 1; }
.mini-event-rail .event-card .event-description { padding-right: 40px; }
.mini-event-rail .event-card .favorite-button { right: 0 !important; top: auto !important; bottom: 0 !important; }

/* The month label belongs to the calendar heading, so the date context is visible before the grid. */
.calendar-heading > div { display: flex; width: 100%; align-items: baseline; gap: 10px; }
.calendar-month-label {
  margin-left: auto;
  text-align: right;
  color: rgb(30 41 59 / .48);
  font: 700 var(--type-heading)/1.25 var(--font-sans);
  letter-spacing: -.025em;
  text-transform: capitalize;
}
.calendar-toolbar { display: none !important; }

/* Cards remain flat on the page; only their photographs carry elevation. */
body .event-card:not(.featured-card),
body .featured-grid .event-card.featured-card {
  box-shadow: none !important;
}
body .event-card .image-wrap {
  box-shadow: 0 5px 14px rgb(15 23 42 / .12) !important;
}

/* The active filter has a visible, rounded elevation after horizontal scrolling. */
.shared-category-filters .filter-button.active,
.shared-category-filters .filter-button.active:hover {
  box-shadow: 0 6px 14px rgb(15 23 42 / .18), 0 2px 4px color-mix(in srgb, var(--category-color, #1E293B) 28%, transparent) !important;
}

/* A selected calendar day receives a short, quiet cyan-to-green flowing confirmation. */
.calendar-day.selected.is-selected-flow,
.calendar-day.selected.is-selected-flow:hover,
.calendar-day.selected.is-selected-flow:focus-visible {
  border-color: transparent !important;
  background-color: #14B8A6 !important;
  background-image: linear-gradient(115deg, #16A085 0%, #10B981 30%, #38BDF8 64%, #2563EB 82%, #16A085 100%) !important;
  background-size: 260% 100% !important;
  color: #FFFFFF !important;
  animation: calendar-selected-flow 2.4s cubic-bezier(.2,.75,.3,1) infinite;
}
@keyframes calendar-selected-flow {
  0% { background-position: 110% 0; box-shadow: 0 0 0 0 rgb(34 211 238 / 0); }
  42% { background-position: 50% 0; box-shadow: 0 0 0 5px rgb(45 212 191 / .12); }
  100% { background-position: -115% 0; box-shadow: 0 0 0 0 rgb(34 211 238 / 0); }
}
@media (prefers-reduced-motion: reduce) {
  .calendar-day.selected.is-selected-flow { animation: none; }
  .event-filter-dialog[open],
  .event-filter-button { animation: none; transition: none; }
}

/* The event filter lives beside the “Összes” heading. */
.all-events-heading {
  width: 100%;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

/* Date and location use one strong gray hierarchy in every event surface. */
.event-meta,
.event-meta .event-date,
.event-meta .event-location,
.event-meta .event-date-value,
.event-meta .event-location-value,
.event-meta .favorite-note-date,
.event-meta .favorite-note-location,
#event-details-date,
#event-details-location,
.inline-date-value,
.inline-location-value {
  color: #64748B !important;
}
.event-meta .event-meta-icon {
  border-color: rgb(255 255 255 / .34) !important;
  background: #64748B !important;
  color: #FFFFFF !important;
}
.event-meta .event-location .event-meta-icon svg circle { fill: #64748B !important; }
.event-card .event-meta .event-date.is-urgent .event-date-value,
.event-card .event-meta .event-date.is-today .event-date-value,
.event-card .event-meta .event-location.is-nearby .event-location-value,
.featured-grid .featured-card .event-meta .event-date.is-today .event-date-value,
.featured-grid .featured-card .event-meta .event-location.is-nearby .event-location-value {
  color: #64748B !important;
}
html[data-theme="dark"] .event-meta,
html[data-theme="dark"] .event-meta .event-date,
html[data-theme="dark"] .event-meta .event-location,
html[data-theme="dark"] .event-meta .event-date-value,
html[data-theme="dark"] .event-meta .event-location-value,
html[data-theme="dark"] #event-details-date,
html[data-theme="dark"] #event-details-location,
html[data-theme="dark"] .inline-date-value,
html[data-theme="dark"] .inline-location-value {
  color: #94A3B8 !important;
}
html[data-theme="dark"] .event-card .event-meta .event-date.is-urgent .event-date-value,
html[data-theme="dark"] .event-card .event-meta .event-date.is-today .event-date-value,
html[data-theme="dark"] .event-card .event-meta .event-location.is-nearby .event-location-value,
html[data-theme="dark"] .featured-grid .featured-card .event-meta .event-date.is-today .event-date-value,
html[data-theme="dark"] .featured-grid .featured-card .event-meta .event-location.is-nearby .event-location-value {
  color: #94A3B8 !important;
}
html[data-theme="dark"] .event-meta .event-meta-icon { background: #475569 !important; }
html[data-theme="dark"] .event-meta .event-location .event-meta-icon svg circle { fill: #475569 !important; }

/* The entire heart control remains interactive throughout its feedback animation. */
.favorite-button,
.favorite-button.is-heart-feedback {
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.favorite-button svg { pointer-events: none; }

/* Every card ends its two-line description with an always-visible price. */
.event-card .event-description,
.event-card:not(.featured-card) .event-description,
.mini-event-rail .event-card .event-description,
.vertical-event-list .event-card.compact-list-card .event-description,
.featured-grid .featured-card .event-description,
.favorite-expanded-description {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  column-gap: 7px !important;
  min-height: 2.56em !important;
  max-height: none !important;
  overflow: hidden !important;
  -webkit-line-clamp: unset !important;
}
.event-description-text {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.event-description-price {
  align-self: end;
  color: #64748B;
  font-size: .86em;
  font-weight: 750;
  line-height: 1.28;
  white-space: nowrap;
}
html[data-theme="dark"] .event-description-price { color: #94A3B8; }

/* City and date share the first row, aligned to the two page edges. */
.quick-navigation {
  grid-template-columns: minmax(0, 1fr) max-content !important;
  grid-template-rows: 1fr !important;
  min-height: 40px !important;
  height: 40px !important;
  padding-top: 0 !important;
}
.quick-navigation #city-selector {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-self: center !important;
}
.quick-navigation .quick-date {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: center !important;
  padding-top: 0 !important;
}
#city-selector-label { max-width: min(42vw, 18ch); }

/* The filter remains a true circle even when shared button rules are applied. */
.all-events-heading .event-filter-button {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 999px !important;
}

/* Metadata icons stay flat. */
.event-meta .event-meta-icon {
  box-shadow: none !important;
  filter: none !important;
}

/* The price starts at the end of line two, leaving line one and the start of line two available. */
.event-card .event-description,
.event-card:not(.featured-card) .event-description,
.mini-event-rail .event-card .event-description,
.vertical-event-list .event-card.compact-list-card .event-description,
.featured-grid .featured-card .event-description,
.favorite-expanded-description {
  display: block !important;
  line-height: 1.28 !important;
  height: 2.56em !important;
  min-height: 2.56em !important;
  max-height: 2.56em !important;
  overflow: hidden !important;
}
.event-description-price {
  float: right;
  display: flex;
  height: 2.56em;
  margin: 0;
  align-items: flex-end;
  max-width: 48%;
  overflow: hidden;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  shape-margin: 7px;
  shape-outside: inset(1.28em 0 0 0);
  text-overflow: ellipsis;
}
.event-description-text {
  display: inline !important;
  overflow: visible;
  font-size: inherit !important;
  line-height: inherit !important;
  -webkit-line-clamp: unset;
}

/* Search starts with one pill field, followed by current and standard topics. */
#search-view {
  padding-top: 22px;
}
#search-view .event-search-field {
  width: 100%;
  max-width: 680px;
  min-height: 54px;
  margin: 0 0 26px;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 6px 18px rgb(15 23 42 / .08);
}
#search-view .event-search-field input { min-height: 52px; }
.search-category-picker {
  display: grid;
  width: 100%;
  max-width: 680px;
  gap: 26px;
}
.search-category-group { display: grid; gap: 11px; }
.search-category-picker-title {
  margin: 0 !important;
  color: #334155;
  font-size: 16px !important;
  font-weight: 800;
  line-height: 1.25;
}
.search-category-buttons {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 9px !important;
  width: 100%;
  overflow: visible !important;
  padding: 0 !important;
}
.search-category-buttons .filter-button {
  flex: 0 0 auto !important;
  width: auto !important;
  min-height: 42px;
  margin: 0 !important;
}
.search-category-buttons .filter-button,
.search-category-buttons .filter-button:hover,
.search-current-category .filter-button {
  border-color: transparent !important;
  background: #FFFFFF !important;
  color: #334155 !important;
  box-shadow: 0 6px 14px rgb(15 23 42 / .1) !important;
}
html[data-theme="dark"] .search-category-buttons .filter-button,
html[data-theme="dark"] .search-category-buttons .filter-button:hover {
  border-color: transparent !important;
  background: #1F2937 !important;
  color: #E2E8F0 !important;
  box-shadow: 0 6px 14px rgb(0 0 0 / .24) !important;
}
html[data-theme="dark"] #search-view .event-search-field { background: var(--dark-control); }
html[data-theme="dark"] .search-category-picker-title { color: #E2E8F0; }

/* The selected calendar day uses the same quiet gray as the month label. */
.calendar-day.selected,
.calendar-day.selected:hover,
.calendar-day.selected:focus-visible,
.calendar-day.selected.is-selected-flow,
.calendar-day.selected.is-selected-flow:hover,
.calendar-day.selected.is-selected-flow:focus-visible {
  border-color: transparent !important;
  background: #64748B !important;
  background-image: none !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
  animation: none !important;
}

/* Event metadata is one compact text line: date • place. */
.event-card .event-meta {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 4px !important;
  min-width: 0;
}
.event-card .event-meta-icon { display: none !important; }
.event-card .event-date { flex: 0 0 auto; }
.event-card .event-location {
  display: flex !important;
  min-width: 0 !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
}
.event-card .event-location::before {
  content: "•";
  flex: 0 0 auto;
  color: currentColor;
}
.event-card .event-location-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-meta-price,
.inline-meta-price {
  justify-self: end;
  color: #64748B;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}
html[data-theme="dark"] .event-meta-price,
html[data-theme="dark"] .inline-meta-price { color: #94A3B8; }

/* With the price in the metadata row, descriptions use two complete text lines. */
.event-card .event-description,
.event-card:not(.featured-card) .event-description,
.mini-event-rail .event-card .event-description,
.vertical-event-list .event-card.compact-list-card .event-description,
.featured-grid .featured-card .event-description,
.favorite-expanded-description {
  display: -webkit-box !important;
  height: 2.56em !important;
  min-height: 2.56em !important;
  max-height: 2.56em !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}
.event-description-price { display: none !important; }
.event-description-text { display: inline !important; }

/* Favorite controls stay fully tappable while only the heart remains visible. */
.favorite-button,
.favorite-button:hover,
.favorite-button:focus-visible,
.favorite-button.is-favorite,
.favorite-button.is-heart-feedback,
#event-details-dialog .event-details-favorite-button,
#event-details-dialog .event-details-favorite-button:hover,
#event-details-dialog .event-details-favorite-button:focus-visible,
#event-details-dialog .event-details-favorite-button.is-favorite,
#event-details-dialog .event-details-favorite-button.is-heart-feedback {
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #111827 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.favorite-button svg,
#event-details-dialog .event-details-favorite-button svg {
  fill: transparent !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  filter: drop-shadow(0 1px 1px rgb(255 255 255 / .72));
}
.favorite-button.is-favorite,
.favorite-button.is-heart-feedback,
#event-details-dialog .event-details-favorite-button.is-favorite,
#event-details-dialog .event-details-favorite-button.is-heart-feedback { color: #DC2626 !important; }
.favorite-button.is-favorite svg,
.favorite-button.is-heart-feedback svg,
#event-details-dialog .event-details-favorite-button.is-favorite svg,
#event-details-dialog .event-details-favorite-button.is-heart-feedback svg { fill: currentColor !important; }
html[data-theme="dark"] .favorite-button:not(.is-favorite):not(.is-heart-feedback),
html[data-theme="dark"] #event-details-dialog .event-details-favorite-button:not(.is-favorite):not(.is-heart-feedback) { color: #F8FAFC !important; }

/* Hearts belong to the lower-right of the description on every card. */
.event-card .event-description > .favorite-button,
.vertical-event-list .event-card.compact-list-card .event-description > .favorite-button,
.featured-grid .featured-card .event-description > .favorite-button {
  position: static !important;
  float: right;
  display: grid !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 2.56em !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 0 1px !important;
  place-items: end center !important;
  shape-margin: 6px;
  shape-outside: inset(1.28em 0 0 0);
}
.event-card .event-description,
.featured-grid .featured-card .event-description,
.vertical-event-list .event-card.compact-list-card .event-description {
  display: block !important;
  height: 2.56em !important;
  max-height: 2.56em !important;
  padding-right: 0 !important;
  overflow: hidden !important;
  line-height: 1.28 !important;
  -webkit-line-clamp: unset !important;
}

/* Compact cards anchor the heart to the card's lower-right corner. */
.mini-event-rail .event-card,
.vertical-event-list .event-card.compact-list-card {
  position: relative !important;
}
.mini-event-rail .event-card .event-description,
.vertical-event-list .event-card.compact-list-card .event-description {
  padding-right: 44px !important;
}
.mini-event-rail .event-card .event-description > .favorite-button,
.vertical-event-list .event-card.compact-list-card .event-description > .favorite-button {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  float: none !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: end center !important;
  shape-outside: none !important;
}

/* Small-card titles always stay on one line and visibly truncate when needed. */
.mini-event-rail .event-card .event-title,
.vertical-event-list .event-card.compact-list-card .event-title {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  -webkit-line-clamp: unset !important;
}

/* A separator also precedes the right-aligned ticket price. */
.event-meta-price::before,
.inline-meta-price::before { content: "•"; margin-right: 4px; font-weight: 600; }

/* Horizontal rails may scroll internally, but the document itself remains one viewport wide. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip !important;
}
body > * { max-width: 100%; }
.events-section,
.all-events,
.discovery-feed-section,
#events-grid,
.event-carousel { min-width: 0; max-width: 100%; }

.clear-home-filters {
  display: block;
  width: max-content;
  min-height: 44px;
  margin: 24px auto 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: #FFFFFF;
  color: #475569;
  font: 750 14px/1.2 var(--font-sans);
  box-shadow: 0 6px 16px rgb(15 23 42 / .1);
  cursor: pointer;
}
.clear-home-filters[hidden] { display: none !important; }
html[data-theme="dark"] .clear-home-filters { background: #1F2937; color: #E2E8F0; }
.compact-empty-state .clear-home-filters-inline {
  flex: 0 0 100%;
  margin-top: 10px;
}
.compact-empty-state:has(.clear-home-filters-inline) { flex-wrap: wrap !important; }
.weekly-calendar-day:disabled {
  cursor: default;
  opacity: .38;
}

/* Metadata stays compact: the price follows the location whenever the row fits. */
.event-card .event-meta {
  display: flex !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  min-width: 0;
}
.event-card .event-date,
.event-card .event-meta-price,
.event-card .inline-meta-price { flex: 0 0 auto; }
.event-card .event-location {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
}

/* The recurring calendar mirrors the one-time calendar's event and today cues. */
.weekly-calendar-day,
.weekly-calendar-day:disabled {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #64748B !important;
  opacity: 1;
}
.weekly-calendar-day.has-events,
.weekly-calendar-day.has-events:hover,
.weekly-calendar-day.has-events:focus-visible {
  border-color: rgb(30 41 59 / .12) !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
  cursor: pointer;
}
.weekly-calendar-day.today,
.weekly-calendar-day.today.has-events {
  border: 1px solid #94A3B8 !important;
  outline: none !important;
}
.weekly-calendar-day.selected,
.weekly-calendar-day.selected:hover,
.weekly-calendar-day.selected:focus-visible {
  border-color: transparent !important;
  background: #64748B !important;
  color: #FFFFFF !important;
}
.weekly-calendar-grid .weekly-calendar-day.selected,
.weekly-calendar-grid .weekly-calendar-day.selected:hover,
.weekly-calendar-grid .weekly-calendar-day.selected:focus-visible,
html[data-theme="dark"] .weekly-calendar-grid .weekly-calendar-day.selected {
  background: #64748B !important;
  background-image: none !important;
  color: #FFFFFF !important;
  animation: none !important;
}
html[data-theme="dark"] .weekly-calendar-day.has-events {
  border-color: rgb(255 255 255 / .14) !important;
  background: #F8FAFC !important;
  color: #1E293B !important;
}

/* Today has the same clear, heavier outline in both calendar modes. */
.calendar-day.today,
.calendar-day.today.has-events,
.weekly-calendar-day.today,
.weekly-calendar-day.today.has-events,
.weekly-calendar-day.today.selected {
  border: 2px solid #94A3B8 !important;
  outline: none !important;
}

/* Bundled OFL webfont keeps section headings identical across devices. */
#featured-section .section-heading h2,
.all-events-heading h2,
.discovery-feed-section .section-heading h3,
.calendar-heading h2,
.today-section .section-heading h2,
.favorites-section .section-heading h2 {
  font-family: "Inter", sans-serif !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -.03em !important;
}

/* The empty-state stack itself spans the rail, so icon and copy truly centre on the page. */
.compact-empty-state {
  width: 100% !important;
  align-items: center !important;
  justify-content: center !important;
}
@font-face {
  font-family: "Isometra";
  src: url("assets/fonts/isometra/Isometra-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* Search actions: a plain clear icon followed by the circular filter control. */
#search-view .event-search-field {
  gap: 6px;
  padding-right: 9px;
}
#search-view .search-clear {
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569;
  box-shadow: none !important;
}
#search-view .search-filter-button {
  flex: 0 0 36px;
  margin: 0;
}

/* The navigation shares the page colour; only the selected destination is surfaced. */
#bottom-navigation {
  border-color: rgb(30 41 59 / .1);
  background: #F5F5F7;
  box-shadow: 0 -5px 18px rgb(15 23 42 / .06);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#bottom-navigation .bottom-nav-button,
#bottom-navigation .bottom-nav-button:hover {
  background: transparent !important;
  box-shadow: none !important;
  border: 0;
}
#bottom-navigation .bottom-nav-button.is-active {
  background: #FFFFFF !important;
  box-shadow: 0 3px 12px rgb(15 23 42 / .1) !important;
}
html[data-theme="dark"] #bottom-navigation { background: #0F172A; }
html[data-theme="dark"] #bottom-navigation .bottom-nav-button.is-active {
  background: #FFFFFF !important;
  color: #1E293B;
  box-shadow: 0 3px 12px rgb(0 0 0 / .22) !important;
}

#bottom-navigation .bottom-nav-button .nav-solid-icon {
  fill: currentColor;
  stroke: none;
}
