:root {
  color-scheme: light;
  --paper: #f7f7ef;
  --surface: #fffcf6;
  --ink: #202d23;
  --muted: #626b5f;
  --line: #dfE3d6;
  --green: #254a37;
  --olive: #687a4d;
  --lime: #e3edc3;
  --sage: #3c7958;
  --ongoing: #689871;
  --upcoming: #7095c2;
  --grey: #77766d;
  --body: 'Atkinson Hyperlegible', 'Avenir Next', Avenir, 'Segoe UI', system-ui, sans-serif;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box }
body { margin: 0; overflow: hidden }
button, input, select { font: inherit }
button { color: inherit; cursor: pointer }
button:disabled { opacity: .49; cursor: default }
a { color: inherit }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid #416d49; outline-offset: 3px }
svg { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex: 0 0 auto }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0 }

.eyebrow { display: flex; align-items: center; gap: 7px; margin: 0; color: #586b47; font-size: 10px; font-weight: 800; letter-spacing: .14em }
.eyebrow svg { width: 14px; height: 14px }

.workspace {
  --edge: clamp(10px, 2vw, 24px);
  --top: max(var(--edge), env(safe-area-inset-top));
  --left: max(var(--edge), env(safe-area-inset-left));
  --right: max(var(--edge), env(safe-area-inset-right));
  --bottom: env(safe-area-inset-bottom);
  --overlay-shadow: 0 2px 9px #252f2324;
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.map-overlay {
  position: absolute;
  z-index: 2;
  inset: var(--top) var(--right) calc(var(--bottom) + 52px) var(--left);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  pointer-events: none;
}
.toolbar { position: relative; z-index: 1; display: grid; min-width: 0; justify-items: start; gap: 6px }
.search-row { display: flex; width: min(100%, 422px); gap: 8px }
.search-wrap, .list-button, .filter-toggle, .filter-options { pointer-events: auto; box-shadow: var(--overlay-shadow) }
.search-wrap { display: flex; align-items: center; flex: 1; min-width: 0; height: 46px; padding: 0 12px; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; color: #697366 }
.search-wrap:focus-within { border-color: #7b916c; box-shadow: 0 0 0 2px #dce8cc }
.search-wrap > span { display: inline-flex }
.search-wrap input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 550 }
.search-wrap input::placeholder { color: #70786d; opacity: 1 }
.search-wrap input::-webkit-search-cancel-button { appearance: none }
.list-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 0 13px; border: 1px solid var(--green); border-radius: 10px; background: var(--green); color: #fffdf8; font-size: 13px; font-weight: 750 }
.list-button:hover, .list-button[aria-expanded="true"] { background: #365d45 }
.list-button svg { width: 16px; height: 16px }
.icon-button { display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; background: transparent }
.clear-search { width: 26px; height: 27px; border-radius: 5px }
.clear-search:hover { background: #edf0e3 }
.clear-search svg { width: 15px; height: 15px }
.filter-row { display: flex; gap: 8px; max-width: 100% }
.filter-menu { position: relative; min-width: 0 }
.filter-toggle { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; color: var(--green); font-size: 13px; font-weight: 750; cursor: pointer }
.filter-toggle::-webkit-details-marker { display: none }
.filter-toggle:hover, .filter-menu[open] > .filter-toggle { background: #edf0e3 }
.filter-toggle svg { width: 15px; height: 15px }
.filter-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.filter-menu[open] [data-icon="chevron-down"] { rotate: 180deg }
.filter-options { position: absolute; inset: calc(100% + 4px) auto auto 0; display: grid; gap: 4px; min-width: 160px; width: max-content; max-width: calc(100vw - var(--left) - var(--right)); max-height: calc(100dvh - var(--top) - var(--bottom) - 108px); overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8 }
#status-menu .filter-options { left: auto; right: 0 }
.filter-menu:not([open]) > .filter-options { display: none }
.filter-option { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 11px; border-radius: 7px; border: 1px solid #e0e3d7; background: #fcfcf5; font-size: 12px; font-weight: 650; white-space: nowrap }
.filter-option svg { width: 15px; height: 15px; color: #627458 }
.filter-option[aria-pressed="true"] { color: #f5f6eb; background: var(--green); border-color: var(--green) }
.filter-option[aria-pressed="true"] svg { color: #e0eacb }
.filter-option:hover:not([aria-pressed="true"]) { background: #eaf0dc; border-color: #ced9c1 }

.results {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(400px, calc(100% - 48px));
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #d9dfd0;
  border-radius: 13px;
  box-shadow: 0 7px 25px #252f2330;
  transform: translateX(calc(-100% - var(--left) - 28px));
  visibility: hidden;
  transition: transform .22s ease, visibility 0s linear .22s;
}
.results:not([inert]) { transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s }
.results-head { padding: 12px 15px 0 }
.results-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px }
.results-title h2 { margin: 0 auto 0 0; font-size: 21px; font-weight: 760; letter-spacing: -.7px }
.count { white-space: nowrap; padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 750; color: #506440; background: #e9eeda }
.list-close, .detail-dialog .dialog-close { padding-inline: 10px; font-size: 12px; font-weight: 750 }
.list-close { flex: 0 0 auto; height: 38px; border: 0; border-radius: 7px; background: #edf0e5; color: var(--green) }
.list-close:hover { background: #e2e8d7 }
.dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.dot.ongoing { color: var(--ongoing) }
.dot.upcoming { color: var(--upcoming) }
.dot.ended { color: var(--grey) }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 10px 8px; font-size: 11px; color: #657063; font-weight: 650 }
.sort select { cursor: pointer; border: 0; background: transparent; font-size: inherit; color: #485646; font-weight: 700; padding-block: 3px }

.event-list { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 12px 10px 15px; scrollbar-width: thin; scrollbar-color: #cbd2c2 transparent; display: flex; flex-direction: column; gap: 8px }
.event-card { width: 100%; min-width: 0; display: grid; gap: 3px; text-align: left; padding: 10px; flex: 0 0 auto; background: #fffef9; border: 1px solid #e8e9df; border-radius: 10px; transition: background .14s, border-color .14s }
.event-card:hover, .event-card.is-selected { background: #f5f7ed; border-color: #bfcdb2 }
.event-card:focus-visible { outline-offset: -2px }
.art-sport { --art-bg: #f0d7c7; --art-ink: #944d3a }
.art-art { --art-bg: #e1e6c9; --art-ink: #52673c }
.art-market { --art-bg: #f5e4b7; --art-ink: #85632d }
.art-music { --art-bg: #e8d9e9; --art-ink: #754674 }
.art-food { --art-bg: #f0d8ce; --art-ink: #935847 }
.art-family { --art-bg: #dbe8ea; --art-ink: #456c76 }
.art-community { --art-bg: #e0e8d9; --art-ink: #586b54 }
.event-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 1px }
.event-tags small { color: #667064; font-size: 9px; font-weight: 700; white-space: nowrap }
.status-pill { display: inline-flex; width: fit-content; align-items: center; gap: 4px; padding: 3px 6px; font-size: 9px; line-height: 11px; font-weight: 800; border-radius: 20px; white-space: nowrap }
.status-pill .dot { width: 5px; height: 5px }
.status-pill.ongoing { background: #e8f4e5; color: #326448 }
.status-pill.upcoming { background: #eaf3fc; color: #48668f }
.status-pill.ended { background: #edeae3; color: #666456 }
.event-card strong { color: #26342a; font-size: 13.5px; font-weight: 780; line-height: 1.18; letter-spacing: -.2px; overflow-wrap: anywhere }
.event-meta { color: #626c60; font-size: 10.5px; font-weight: 580; line-height: 1.2; overflow-wrap: anywhere }
.results-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; border-top: 1px solid #e6e8dd; padding: 8px 15px; color: #687363; font-size: 10px; font-weight: 650 }
.feed-status { display: flex; align-items: center; gap: 7px }
.feed-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #a2824c }
.feed-dot.online { background: var(--sage) }
.source-button { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border: 1px solid #dfe2d5; background: #f8f9f0; border-radius: 7px; font-size: 11px; font-weight: 700 }
.source-button:hover, .secondary-button:hover { background: #edf0e3 }
.empty { display: grid; place-items: center; text-align: center; padding: 30px 12px 16px; color: var(--muted) }
.empty h3 { margin: 0 0 2px; color: var(--ink); font-size: 16px }
.empty p { margin: 0 0 12px; font-size: 12px }

.map-frame { position: absolute; inset: 0; isolation: isolate; background: #e7e7d4 }
.map { overflow: hidden; position: absolute; inset: 0; touch-action: none; cursor: grab; outline-offset: -3px }
.map.dragging { cursor: grabbing }
#base-map, .street-map, .markers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.street-map { opacity: 0 }
.street-map.is-ready { opacity: 1 }
.has-street-map .street-map { pointer-events: auto }
.street-map .maplibregl-canvas:focus-visible { outline-offset: -3px }
.map:has(.street-map:not(.is-ready) .maplibregl-canvas:focus-visible) { outline: 2px solid #416d49 }
.marker { position: absolute; z-index: 1; width: 35px; height: 35px; display: grid; place-items: center; translate: -50% -50%; transform-origin: center; pointer-events: auto; border: 2px solid #fffef9; color: var(--art-ink, white); border-radius: 50%; background: var(--art-bg, var(--marker)); box-shadow: 0 2px 5px #24302336; padding: 0; transition: scale .12s; font-weight: 800; font-size: 13px }
.marker.ongoing { --marker: var(--ongoing) }
.marker.upcoming { --marker: var(--upcoming) }
.marker.ongoing, .marker.upcoming { color: #19271e }
.marker.ended { --marker: #78766e }
.marker.cluster { width: 40px; height: 40px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker), transparent 69%), 0 2px 5px #24302336 }
.marker svg { width: 16px; height: 16px; stroke-width: 2 }
.marker:focus-visible { z-index: 3 }
.marker.selected { z-index: 3; scale: 1.14 }
@media (hover: hover) {
  .marker:hover { z-index: 3; scale: 1.14 }
}
.user-marker { position: absolute; z-index: 2; width: 16px; height: 16px; transform: translate(-50%, -50%); background: #347cbd; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 6px #347cbd40 }

.map-tools button, .zoom-tools, .location-message { background: #fffdf8; border: 1px solid #dce0d3; box-shadow: var(--overlay-shadow) }
.map-tools { position: absolute; z-index: 4; right: var(--right); bottom: calc(var(--bottom) + 52px); display: grid; gap: 7px }
.zoom-tools { display: grid; border-radius: 8px; overflow: hidden }
.map-tools button { width: 38px; height: 38px; border-radius: 8px; color: #344c37 }
.map-tools button:hover { background: #edf1e4 }
.zoom-tools button { border: 0; box-shadow: none; border-radius: 0 }
.zoom-tools button + button { border-top: 1px solid #e1e4d9 }
.zoom-tools button:focus-visible { outline-offset: -3px }
.map-tools svg { width: 16px; height: 16px }
.location-message { position: absolute; z-index: 3; right: calc(var(--right) + 48px); bottom: calc(var(--bottom) + 52px); margin-left: var(--left); border-radius: 7px; font-size: 12px; font-weight: 650; padding: 8px 10px; max-width: 210px; pointer-events: none }
.attribution { position: absolute; right: env(safe-area-inset-right); bottom: var(--bottom); z-index: 2; padding: 1px 5px; background: #fffff4df; color: #525c50; font: 10px/1.5 var(--body); border-top-left-radius: 4px }
.attribution a { text-underline-offset: 1px }
.marker-popover { position: absolute; z-index: 5; width: min(230px, 79%); max-height: 190px; overflow: auto; transform: translateX(-50%); padding: 7px; pointer-events: auto; background: #fffef9; border: 1px solid #d7dfcf; border-radius: 9px; box-shadow: 0 5px 20px #26332632; cursor: default }
.marker-popover.above { transform: translate(-50%, -100%) }
.popover-title { display: flex; justify-content: space-between; align-items: center; padding-inline: 5px; font-size: 12px; font-weight: 800 }
.popover-title button { width: 24px; height: 24px }
.popover-title svg { width: 14px; height: 14px }
.popover-event { width: 100%; background: transparent; border: 0; border-radius: 5px; text-align: left; display: grid; align-items: center; grid-template-columns: 22px minmax(0, 1fr) 7px 14px; gap: 6px; padding: 7px 5px; font-size: 11px; font-weight: 670; overflow-wrap: anywhere }
.popover-event:hover { background: #eaf0e1 }
.popover-event-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--art-bg); color: var(--art-ink) }
.popover-event svg { width: 13px; height: 13px }
.dialog { width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 34px); padding: 0; border: 1px solid #d9dfce; border-radius: 15px; color: var(--ink); background: #fffdf7; box-shadow: 0 18px 80px #13241d4d; overflow: auto }
.dialog::backdrop { background: #20312766; backdrop-filter: blur(2px) }
@media (prefers-reduced-motion: no-preference) {
  .dialog[open], .dialog[open]::backdrop { animation: dialog-fade-in 150ms ease-out }
  @keyframes dialog-fade-in { from { opacity: 0 } to { opacity: 1 } }
}
.dialog-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 32px; height: 32px; background: #fffdf5; border: 1px solid #dce1d4; border-radius: 7px }
.dialog-close:hover { background: #edf1e4 }
.detail-dialog .dialog-close { width: auto }
.dialog-pad { padding: 24px }
.detail-dialog .dialog-pad { padding-top: 12px }
.dialog h2 { font: 400 34px/1 var(--body); letter-spacing: -.04em; margin: 5px 0 12px }
.dialog p { color: var(--muted); font-size: 13px }
.detail-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 32px; padding-right: 54px; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 9px }
.detail-meta { display: grid; gap: 8px; color: #515f50; font-size: 13px; font-weight: 650 }
.detail-description { line-height: 1.55; margin-block: 15px }
.session-heading { margin: 14px 0 6px; font-size: 13px }
.session-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 5px 16px; margin: 0; padding-left: 16px; color: var(--muted); font-size: 12px; line-height: 1.4 }
.detail-source { font-size: 11px !important }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 7px; min-height: 35px; padding: 6px 11px; font-size: 12px; font-weight: 750; border: 1px solid #dce1d4; text-decoration: none }
.primary-button { color: #fdfcf3; background: var(--green); border-color: var(--green) }
.primary-button:hover { background: #365d45 }
.secondary-button { color: #35503a; background: #f9faf2 }
.primary-button svg, .secondary-button svg { width: 14px; height: 14px }
.sources-dialog .dialog-pad > p:not(.eyebrow) { margin-top: 0 }
.source-list { display: grid; gap: 6px; margin: 15px 0 }
.source-row { display: flex; gap: 9px; align-items: center; border: 1px solid #e5e7db; border-radius: 8px; padding: 9px }
.source-icon { background: #ecf0e2; color: #53704e; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; flex: 0 0 auto }
.source-icon svg { width: 16px; height: 16px }
.source-info { min-width: 0; flex: 1; display: grid; gap: 2px }
.source-info strong { font-size: 13px; overflow-wrap: anywhere }
.source-info small { font-size: 11px; color: var(--muted) }
.switch { display: grid; place-items: center }
.switch input { appearance: none; cursor: pointer; background: #b7bdb2; width: 34px; height: 19px; margin: 0; border-radius: 20px; position: relative }
.switch input::before { content: ''; display: block; width: 13px; height: 13px; border-radius: 50%; background: white; position: absolute; left: 3px; top: 3px; transition: transform .15s }
.switch input:checked { background: #4e7755 }
.switch input:checked::before { transform: translateX(15px) }
.delete-source { width: 24px; height: 24px; border-radius: 5px }
.delete-source:hover { background: #f4e4df }
.delete-source svg { width: 14px; height: 14px }
#custom-source-form { display: grid; gap: 9px; margin-top: 12px; padding: 12px; border: 1px solid #dfe4d7; border-radius: 8px; background: #f9faf2 }
#custom-source-form label { display: grid; gap: 3px; font-size: 11px; font-weight: 750 }
#custom-source-form input { width: 100%; min-width: 0; padding: 6px 7px; background: #fffef9; border: 1px solid #d9dfd1; border-radius: 5px; color: var(--ink); font-size: 12px }
#custom-source-form summary { display: flex; align-items: center; gap: 4px; cursor: pointer; font-size: 12px; font-weight: 750 }
#custom-source-form summary::-webkit-details-marker { display: none }
#custom-source-form summary svg { width: 13px; height: 13px }
#custom-source-form details[open] > summary svg { rotate: 90deg }
#custom-source-form p { margin-block: 6px; font-size: 11px }
#custom-source-form [type="submit"] { justify-self: start }
.source-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px }

@media (max-width: 720px) {
  .search-wrap { height: 44px; padding-inline: 9px; gap: 6px }
  .search-wrap input { font-size: 16px }
  .filter-option { min-height: 34px; padding-inline: 9px }
}
@media (max-height: 420px) {
  .results { grid-template-rows: auto auto auto; align-content: start; overflow: auto; overscroll-behavior: contain }
  .event-list { overflow: visible }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important }
}
