:root {
  --paper: #faf9f5;
  --white: #fff;
  --ink: #24372e;
  --muted: #69776f;
  --line: #e2e8df;
  --green: #286346;
  --green-soft: #edf6ed;
  --local: #e97746;
  --campus: #6d8cdb;
  --film: #a278c0;
  --expo: #419e85;
  --shadow: 0 3px 14px #365c4510;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 0 0, #fcebdc70, transparent 480px), radial-gradient(ellipse at 100% 0, #e4f1e8b0, transparent 600px); }
button, input, select { font: inherit; color: inherit; }
button, a, select, input, summary { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #86b59a;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.icon { display: inline-flex; width: 20px; height: 20px; flex-shrink: 0; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button .icon, a .icon { pointer-events: none; }
.wrap, .header-inner { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }

/* A compact header keeps the search and map in the first screen. */
.site-header { position: relative; height: 56px; border-bottom: 1px solid var(--line); background: #fffefbf2; }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--green); white-space: nowrap; }
.brand .icon { width: 22px; height: 22px; }
.brand h1, .brand strong { display: inline; margin: 0; font-size: 20px; font-weight: 750; line-height: 1.2; letter-spacing: -.7px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.saved-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; white-space: nowrap; color: #52665a; background: #fff; }
.saved-toggle .icon { width: 16px; height: 16px; }
.saved-toggle:hover { background: #f7faf7; }
.saved-toggle[aria-pressed=true] { color: var(--green); background: var(--green-soft); border-color: #b8d1bf; }
.saved-toggle[aria-pressed=true] svg { fill: #d5e8db; }
#saved-count { display: inline-flex; min-width: 18px; height: 18px; padding-inline: 4px; border-radius: 4px; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: #edf1ee; color: #58715f; }
.about-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 34px; height: 34px; color: var(--muted); border-radius: 7px; }
.about-button:hover { background: #f0f4f1; }
.about-button .icon { width: 19px; height: 19px; }
main.explore { padding-top: 18px; padding-bottom: 18px; }

/* Search and filters. */
.search-bar { display: flex; align-items: center; min-height: 52px; border: 1px solid #d9e1db; border-radius: 14px; background: #fff; box-shadow: 0 3px 14px #385c3e07; }
.search-input { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; padding: 0 16px; }
.search-input > .icon { width: 19px; height: 19px; color: #7e8b82; }
.search-input input { width: 100%; min-width: 0; border: 0; outline: none; background: none; font-size: 15px; line-height: 1.5; }
.search-input input::placeholder { color: #7c877f; }
.search-input kbd { border: 1px solid #e4e8e5; padding: 1px 5px; border-radius: 4px; font-size: 12px; color: #89948b; }
.select-wrap { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 28px; border-left: 1px solid var(--line); flex-shrink: 0; }
.select-wrap > .icon { width: 17px; height: 17px; color: #7b8a7f; }
.select-wrap select { appearance: none; border: 0; outline: none; background: transparent; font-size: 14px; line-height: 1.5; padding: 5px 20px 5px 0; cursor: pointer; max-width: 180px; }
.select-chevron { pointer-events: none; position: absolute; right: 15px; top: 0; color: #87918a; font-size: 18px; line-height: 24px; }
.reset-button { display: grid; place-items: center; width: 36px; height: 36px; margin-right: 8px; flex-shrink: 0; color: #7b887f; border-radius: 6px; }
.reset-button:hover { background: #f0f5f1; }
.reset-button .icon { width: 17px; height: 17px; }
.custom-dates { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--muted); font-size: 13px; }
.custom-dates label { display: inline-flex; align-items: center; gap: 8px; }
.custom-dates input { border: 1px solid #d7e0d9; border-radius: 5px; padding: 6px 8px; background: white; font-size: 13px; min-height: 33px; }
#date-error { color: #a64739; font-size: 12px; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 0; }
.scale-filter { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid #dfe7dd; border-radius: 8px; background: white; color: #56715e; font-size: 12px; }
.scale-filter select { max-width: 136px; padding: 3px 2px; border: 0; background: white; color: #325b40; cursor: pointer; font-size: 13px; }
.nearby-search { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 12px; border: 1px solid #bfd6c5; border-radius: 999px; background: #eef7f0; color: #2e6949; font-size: 12px; font-weight: 650; white-space: nowrap; }
.nearby-search .icon { width: 15px; height: 15px; }
.nearby-search[aria-pressed=true] { background: #2a684a; color: #fff; border-color: #2a684a; }
.nearby-search:hover:not(:disabled) { box-shadow: 0 2px 8px #28634622; }
.categories { display: flex; align-items: center; gap: 7px; }
.category-chip { --chip-ink: #56715e; --chip-bg: #fff; --chip-line: #dfe7dd; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 14px; border: 1px solid var(--chip-line); border-radius: 999px; background: var(--chip-bg); color: var(--chip-ink); font-size: 13px; font-weight: 550; line-height: 1.3; white-space: nowrap; transition: background .15s, box-shadow .15s, border-color .15s; }
.category-chip:hover { border-color: var(--chip-ink); box-shadow: 0 2px 7px #29442c0b; }
.category-chip.active { border-color: var(--green); background: linear-gradient(135deg, #367853, #22563d); color: white; box-shadow: 0 3px 8px #21523d18; }
.category-chip > .icon { width: 14px; height: 14px; }
.category-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.local { background: var(--local); }
.campus { background: var(--campus); }
.film { background: var(--film); }
.expo { background: var(--expo); }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 36px; }
.results-title { min-width: 0; }
#results-heading { font-size: 17px; font-weight: 650; letter-spacing: -.4px; margin: 0; line-height: 1.5; }
#result-count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; padding: 1px 7px; color: var(--green); background: #e7f1e6; border-radius: 999px; margin-left: 5px; font-size: .88em; font-weight: 700; font-variant-numeric: tabular-nums; }
.view-tabs { display: inline-flex; align-items: center; flex-shrink: 0; padding: 3px; border: 1px solid #dfe8dd; border-radius: 11px; gap: 2px; background: #eaf1e9; }
.view-tabs > button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 29px; padding: 6px 11px; border-radius: 8px; font-size: 12px; color: #6e7d72; line-height: 1.3; }
.view-tabs > button.active { background: #fff; color: var(--green); font-weight: 650; box-shadow: 0 1px 3px #1c362112; }
.view-tabs > button .icon { width: 15px; height: 15px; }
.planning-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; padding: 7px 12px; border: 1px solid #eadfbd; border-radius: 10px; background: #fffaf0; color: #7b6b49; font-size: 12px; line-height: 1.5; }
.planning-bar button { min-height: 30px; padding: 2px 0; color: #775a24; font-size: 12px; font-weight: 650; white-space: nowrap; }
.location-note { flex-shrink: 0; margin: 0; padding: 8px 16px; background: #fffcf6; color: #817151; font-size: 11px; line-height: 1.6; border-bottom: 1px solid #f1e9d9; }
.selection-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px; border: 1px solid #cfe0d3; border-radius: 7px; background: #eff7f1; font-size: 13px; color: #3f6d4d; }
.selection-bar button { font-size: 12px; min-height: 28px; color: var(--green); white-space: nowrap; }

/* On desktop, the map/calendar and list share a single viewport. */
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); gap: 16px; height: clamp(420px, calc(100dvh - 278px), 720px); }
.map-panel, .calendar-panel, .results-panel { position: relative; min-width: 0; min-height: 0; border: 1px solid #dce6dc; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 5px 20px #294e3408; }
.map-panel { background: #eaf2ee; isolation: isolate; }
#festival-map { height: 100%; width: 100%; z-index: 1; background-color: #ecf3ef; background-image: radial-gradient(#a7c4b242 .8px, transparent .8px), radial-gradient(ellipse at 45% 40%, #f9fbf5, transparent 75%); background-size: 18px 18px, 100% 100%; font-family: inherit; }
.map-expand { position: absolute; top: 12px; left: 12px; z-index: 450; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 8px 11px; border: 1px solid #d6dfd8; border-radius: 9px; background: #fff; box-shadow: var(--shadow); color: #42634c; font-size: 12px; font-weight: 600; }
.map-expand .icon { width: 17px; height: 17px; }
.map-expand:hover { background: #f0f7f1; }
body.map-is-expanded { overflow: hidden; }
.map-panel.is-expanded { position: fixed; inset: 0; width: 100%; height: 100dvh !important; z-index: 9999; border: 0; border-radius: 0 !important; }
.map-panel.is-expanded .leaflet-popup-content { max-height: min(370px, calc(100dvh - 145px)); }
.map-buttons { position: absolute; right: 12px; top: 91px; z-index: 450; display: flex; flex-direction: column; gap: 6px; }
.map-buttons button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 76px; height: 34px; border: 1px solid #d6dfd8; border-radius: 8px; background: white; box-shadow: var(--shadow); color: #59725f; font-size: 12px; font-weight: 600; }
.map-buttons button:hover { background: #f0f5f1; }
.map-buttons button:disabled { opacity: .6; cursor: wait; }
.map-buttons .icon { width: 17px; height: 17px; }
.map-options { position: absolute; z-index: 450; left: 12px; bottom: 27px; }
.map-options > summary { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid #d7dfd9; border-radius: 6px; background: #fff; box-shadow: var(--shadow); cursor: pointer; list-style: none; font-size: 12px; color: #5c7163; line-height: 1.3; }
.map-options > summary::-webkit-details-marker { display: none; }
.map-options > summary::after { content: ''; width: 5px; height: 5px; border-left: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); margin: 3px 0 0 3px; }
.map-options[open] > summary::after { transform: rotate(225deg); margin-top: -3px; }
.map-options-menu { position: absolute; bottom: calc(100% + 6px); left: 0; width: 170px; border: 1px solid #dce4dd; border-radius: 8px; background: white; box-shadow: 0 5px 18px #253b3420; overflow: hidden; }
.map-option { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 41px; padding: 10px 12px; text-align: left; font-size: 13px; color: #46614e; }
.map-option + .map-option { border-top: 1px solid #edf1ee; }
.map-option:hover { background: #eff5f0; }
.map-option .icon { width: 16px; height: 16px; }
.map-message { position: absolute; z-index: 480; left: 12px; right: 55px; bottom: 73px; padding: 11px 12px; border: 1px solid #d9dfd2; border-radius: 7px; background: #fffffa; box-shadow: var(--shadow); color: #5d6e60; font-size: 12px; line-height: 1.65; }

/* Leaflet geography, markers and popup controls remain fully interactive. */
.leaflet-control-zoom { margin-top: 12px !important; margin-right: 12px !important; border: 1px solid #d6dfd8 !important; border-radius: 6px !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-control-zoom a { width: 34px !important; height: 34px !important; line-height: 34px !important; font-size: 21px !important; color: #526d59 !important; }
.leaflet-control-attribution { background: #ffffffd9 !important; padding: 3px 6px !important; color: #6f8075 !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: #5e7566 !important; }
.province-label { color: #70856f; font-size: 12px; font-weight: 500; letter-spacing: .5px; white-space: nowrap; text-align: center; text-shadow: 0 1px 0 #fff; pointer-events: none; }
.island-label { color: #7b8c7e; font-size: 10px; white-space: nowrap; text-align: center; }
.festival-marker { border: 0 !important; background: none !important; }
.pin-bubble { position: relative; display: flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border: 3px solid white; border-radius: 18px; background: var(--marker); color: white; font-size: 12px; font-weight: 700; box-shadow: 0 3px 8px #24412b35; transition: transform .15s; }
.pin-bubble::after { content: ''; position: absolute; z-index: -1; left: calc(50% - 4px); bottom: -3px; width: 8px; height: 8px; border-radius: 1px; background: var(--marker); transform: rotate(45deg); }
.pin-bubble .icon { width: 15px; height: 15px; }
.festival-marker:hover .pin-bubble { transform: translateY(-2px); }
.festival-marker:focus-visible .pin-bubble { outline: 3px solid #315d3d; outline-offset: 2px; }
.marker-mixed { background: #355c46; }
.leaflet-popup-content-wrapper { max-width: calc(100vw - 44px); border-radius: 9px; box-shadow: 0 4px 22px #1b372526; }
.leaflet-popup-content { max-width: calc(100vw - 78px); max-height: 270px; overflow: auto; margin: 13px 15px; font-family: inherit; scrollbar-width: thin; overscroll-behavior: contain; overflow-wrap: anywhere; }
.popup-heading { margin: 0 0 6px; color: #748276; font-size: 12px; }
.popup-event { display: block; width: 100%; min-width: 0; padding: 11px 2px; border-bottom: 1px solid #e8ede9; text-align: left; overflow-wrap: anywhere; }
.popup-event:last-child { border-bottom: 0; }
.popup-event strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.55; }
.popup-event span { font-size: 12px; line-height: 1.6; color: #6c7e71; }
.popup-event:hover strong { color: var(--green); }

/* Readable, compact event rows. */
.results-panel { display: flex; flex-direction: column; }
.list-toolbar { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 16px; border-bottom: 1px solid #e9eeea; background: linear-gradient(110deg, #f4f8ef, #fbfcf8); }
.list-toolbar > strong { color: #6b7a70; font-size: 13px; font-weight: 500; }
.list-toolbar select { max-width: 125px; border: 0; background: transparent; padding: 3px 0 3px 5px; color: #607265; font-size: 12px; cursor: pointer; }
.event-list { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #d1dbd3 transparent; }
.event-card { position: relative; display: block; padding: 15px 16px; border-bottom: 1px solid #e9eee6; transition: background .15s; }
.event-card:last-child { border-bottom: 0; }
.event-card:hover { background: #f8fbf5; }
.card-main { display: block; width: 100%; min-width: 0; padding: 0 31px 0 0; text-align: left; }
.card-topline { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: var(--category-color, var(--muted)); font-size: 12px; line-height: 1.5; }
.card-category { font-weight: 500; }
.card-status { display: inline-flex; align-items: center; min-height: 19px; padding: 1px 5px; border-radius: 999px; background: #f0f3f0; color: #728077; font-size: 10px; line-height: 1.4; }
.card-status.ongoing { background: #edf6ef; color: #35714a; }
.card-status.undecided { background: #fff4da; color: #85621e; }
.is-undecided .card-date { flex-shrink: 1; max-width: 100%; overflow-wrap: anywhere; color: #806b40; }
.card-status.upcoming { background: #eef3f0; color: #52705e; }
.card-status.cancelled, .card-status.postponed { background: #fff1ec; color: #a34733; font-weight: 650; }
.card-title { display: block; margin-bottom: 6px; font-size: 16px; font-weight: 700; line-height: 1.45; letter-spacing: -.3px; overflow-wrap: anywhere; word-break: keep-all; }
.card-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 11px; font-size: 14px; color: #6b7b70; line-height: 1.5; }
.card-date { flex-shrink: 0; color: #526e5c; font-weight: 550; font-variant-numeric: tabular-nums; }
.card-location { color: #79867d; }
.card-distance { color: #2d744e; font-size: 12px; font-weight: 650; }
.card-attendance { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: #3e7454; }
.card-attendance.is-unknown { color: #909a91; }
.card-save { position: absolute; top: 12px; right: 10px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #91a095; background: #f5f8f1; }
.card-save .icon { width: 18px; height: 18px; }
.card-save:hover { background: #eaf1ec; }
.card-save.saved { color: var(--green); background: #e6f1e5; }
.card-save.saved svg { fill: #dcebe1; }
.event-card.is-ended .card-status { background: #f1f2f1; color: #7d877e; }
.workspace[data-view=list] { display: block; height: auto; min-height: 260px; }
.workspace[data-view=list] .results-panel { max-height: none; }
.workspace[data-view=list] .event-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
.workspace[data-view=list] .event-card { border-right: 1px solid #e8ede9; border-bottom: 1px solid #e8ede9; }
.workspace[data-view=list] .event-card:nth-child(2n) { border-right: 0; }
.workspace[data-view=list] .empty-state, .workspace[data-view=list] .loading-state { grid-column: 1 / -1; }
.data-note { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; padding: 12px 1px 0; color: #7a887e; font-size: 12px; line-height: 1.5; }
.data-note strong { font-weight: 400; font-variant-numeric: tabular-nums; }

/* Calendar: dates stay legible even in a six-week month. */
.calendar-panel { display: flex; flex-direction: column; padding: 18px 18px 13px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 14px; }
.month-title h3 { margin: 0; font-size: 21px; font-weight: 650; line-height: 1.4; letter-spacing: -.6px; }
.month-controls { display: flex; align-items: center; gap: 4px; }
.month-controls > button { display: grid; place-items: center; height: 31px; min-width: 31px; border: 1px solid #dce4de; border-radius: 5px; color: #5b7162; }
.month-controls > button:hover { background: #f0f5f1; }
.month-controls > button:first-child { padding: 0 9px; margin-right: 4px; font-size: 12px; }
.month-controls .icon { width: 14px; height: 14px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 0; border-bottom: 1px solid #e1e7e2; color: #76867b; font-size: 12px; text-align: center; }
.calendar-weekdays > span:first-child { color: #bb6f60; }
.calendar-weekdays > span:last-child { color: #688aa3; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex: 1; min-height: 0; }
.calendar-day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 0; padding: 6px 4px; border-bottom: 1px solid #e9eee9; border-right: 1px solid #f0f3ef; text-align: left; overflow: hidden; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover { background: #f3f8f2; }
.calendar-day.outside { background: #fafbfa; color: #b7c1b8; }
.calendar-day.selected { border-radius: 9px; background: #eaf4e9; box-shadow: inset 0 0 0 1.5px #6f9b7a; }
.day-number { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 22px; height: 22px; font-size: 12px; line-height: 1; }
.calendar-day:nth-child(7n+1) > .day-number { color: #b66c5d; }
.calendar-day.today > .day-number { background: var(--green); color: white; border-radius: 50%; box-shadow: 0 2px 5px #255b3c26; }
.calendar-event { width: 100%; flex-shrink: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 2px 4px; border-radius: 3px; background: var(--event-bg); color: var(--event-color); font-size: 10px; line-height: 1.4; }
.calendar-more { padding-left: 4px; color: #7f8d80; font-size: 10px; line-height: 1.4; }
.day-dots { display: none; }
.calendar-help { display: flex; align-items: center; gap: 5px; flex-shrink: 0; margin: 11px 0 0; color: #7a897d; font-size: 11px; line-height: 1.4; }
.calendar-help .icon { width: 13px; height: 13px; }

/* Loading, empty and dialog states. */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 260px; padding: 34px 20px; text-align: center; }
.empty-symbol { display: inline-flex; margin-bottom: 14px; color: #96ae9a; }
.empty-symbol .icon { width: 32px; height: 32px; }
.empty-state h3 { margin: 0 0 9px; font-size: 16px; font-weight: 650; color: #4f6955; }
.empty-state p { max-width: 310px; margin: 0; color: #7b897e; font-size: 14px; line-height: 1.7; }
.empty-state button { margin-top: 18px; padding: 10px 14px; min-height: 38px; border: 1px solid #d0dfd3; border-radius: 6px; background: #eff6f0; color: #426d4f; font-size: 13px; }
.loading-state { padding: 55px 20px; min-height: 200px; text-align: center; color: #7e8d81; font-size: 14px; }
.loading-ring { margin: 0 auto 20px; width: 26px; height: 26px; border: 2px solid #e3ebe3; border-top-color: var(--green); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { padding: 0; max-height: 91dvh; overflow: auto; border: 0; border-radius: 18px; color: var(--ink); background: white; box-shadow: 0 14px 60px #16322130; }
dialog::backdrop { background: #19342866; }
.event-dialog { width: min(580px, calc(100% - 28px)); }
.detail-cover { position: relative; padding: 24px 26px 22px; background: linear-gradient(115deg, var(--tile-bg, #f2f6f2), #fffdf8); }
.detail-kind { display: flex; align-items: center; gap: 7px; color: var(--tile-ink, var(--green)); font-size: 13px; font-weight: 500; padding-right: 26px; }
.detail-kind .icon { width: 16px; height: 16px; }
.detail-cover h2 { margin: 13px 28px 8px 0; font-size: 26px; font-weight: 700; letter-spacing: -.7px; line-height: 1.45; overflow-wrap: anywhere; word-break: keep-all; }
.detail-subtitle { font-size: 13px; color: var(--tile-ink, #6c7c6d); }
.dialog-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 6px; background: #ffffffc9; font-size: 25px; font-weight: 400; line-height: 1; color: #66796a; }
.dialog-close:hover { background: #fff; color: var(--ink); }
.dialog-close .icon { width: 18px; height: 18px; }
.detail-body { padding: 23px 26px 25px; }
.detail-summary { margin: 0 0 23px; color: #65776b; font-size: 15px; line-height: 1.8; }
.detail-facts { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 16px 8px; margin: 0; font-size: 14px; line-height: 1.75; }
.detail-facts dt { display: flex; align-items: flex-start; gap: 7px; padding-top: 2px; color: #7c8b80; font-size: 13px; }
.detail-facts dt .icon { width: 15px; height: 15px; margin-top: 3px; }
.detail-facts dd { margin: 0; overflow-wrap: anywhere; word-break: keep-all; }
.detail-facts dd > small { display: block; margin-top: 3px; color: #7a8c7d; font-size: 12px; line-height: 1.7; }
.venue-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; border-bottom: 1px solid #c4d7c9; color: #436f51; font-size: 12px; }
.venue-link .icon { width: 13px; height: 13px; }
.detail-notice { margin-top: 21px; padding: 12px 13px; border: 1px solid #e0e7df; border-radius: 6px; background: #f7faf6; color: #718171; font-size: 12px; line-height: 1.75; }
.detail-notice[role=status] { margin: 0 0 20px; border-color: #efd8ca; background: #fff6ef; color: #a4543e; font-size: 14px; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-height: 44px; padding: 12px 15px; border-radius: 10px; background: linear-gradient(135deg, #367853, #245d42); color: white; box-shadow: 0 3px 10px #26523a15; font-size: 13px; line-height: 1.4; }
.primary-button:hover { background: #1b4934; }
.secondary-button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 11px 12px; border: 1px solid #d4dfd7; border-radius: 7px; color: #587561; font-size: 12px; line-height: 1.4; }
.secondary-button:hover:not(:disabled) { background: #f1f6f2; }
.detail-actions .icon { width: 17px; height: 17px; }
.detail-save, .share-button { flex-shrink: 0; width: 44px; padding: 0; }
.detail-save.saved { color: var(--green); border-color: #9fc4aa; background: #edf6ef; }
.detail-save.saved svg { fill: #d6e9dc; }
.source-line { margin: 16px 0 0; color: #738276; font-size: 11px; line-height: 1.8; text-align: center; overflow-wrap: anywhere; }
.source-line a { text-decoration: underline; text-underline-offset: 2px; }
.about-dialog { position: relative; width: min(520px, calc(100% - 28px)); padding: 28px; }
.about-dialog h2 { margin: 0 24px 15px 0; font-size: 23px; font-weight: 700; letter-spacing: -.6px; line-height: 1.5; }
.about-dialog p { font-size: 14px; line-height: 1.85; color: #6c7c70; }
.about-section { padding-top: 17px; margin-top: 19px; border-top: 1px solid #e5ebe5; }
.about-section h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; }
.about-section p { margin: 0; font-size: 13px; }
.about-source { margin: 18px 0; }
.about-source p { font-size: 11px; }
.about-source a { text-decoration: underline; text-underline-offset: 2px; }
.about-dialog .primary-button { width: 100%; }
.toast { position: fixed; z-index: 10000; bottom: 25px; left: 50%; transform: translate(-50%, 10px); max-width: calc(100% - 32px); width: max-content; padding: 12px 18px; border-radius: 8px; background: #254c35f5; color: white; box-shadow: 0 3px 16px #18332026; font-size: 13px; line-height: 1.6; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.skip-link { position: fixed; z-index: 20000; top: -100px; left: 16px; padding: 10px 14px; border-radius: 0 0 5px 5px; background: var(--green); color: white; }
.skip-link:focus { top: 0; }
.noscript { position: fixed; z-index: 9999; bottom: 0; left: 0; right: 0; padding: 16px; background: #fff8df; color: #615b3f; text-align: center; }

/* Small festival accents keep the compact information layout intact. */
.site-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, #edbea7, #c8d8ed 37%, #ddcce8 68%, #b7d8c6); opacity: .6; pointer-events: none; }
.brand-mark { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(140deg, #387e59, #22573e); color: white; box-shadow: 0 3px 8px #2c61471b; }
.brand .brand-mark .icon { width: 21px; height: 21px; }
.brand-mark::after { content: ''; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border: 2px solid #fffefb; border-radius: 50%; background: #ed9a75; }
.saved-toggle { border-radius: 999px; border-color: #dce6d8; background: #fbfcf7; }
.about-button { border-radius: 50%; background: #f0f5eb; color: #67816e; }
.search-bar:focus-within { border-color: #8bb59b; box-shadow: 0 0 0 3px #dfede2; }
.category-chip::before { content: ''; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; opacity: .75; }
.category-chip[data-category=festival] { --chip-bg: #fff1e8; --chip-ink: #9d4d2c; --chip-line: #f2d9c9; }
.category-chip[data-category=sports] { --chip-bg: #e8f2fc; --chip-ink: #27628e; --chip-line: #cadff0; }
.category-chip[data-category=performance] { --chip-bg: #eaf7ef; --chip-ink: #397353; --chip-line: #d2e9dc; }
.event-card::before { content: ''; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 0 3px 3px 0; background: var(--category-color, #8cad98); opacity: .65; pointer-events: none; }
.card-location::before { content: ''; display: inline-block; width: 3px; height: 3px; margin: 0 7px 3px 0; border-radius: 50%; background: #b1bfb2; }
.calendar-weekdays { border-radius: 7px 7px 0 0; background: #f5f8f0; }
.month-title h3 { color: #315b40; }
.month-controls > button { border-radius: 8px; background: #fbfcf8; }
.calendar-event { border-radius: 5px; }
.map-buttons, .leaflet-control-zoom, .map-options > summary { border-radius: 9px !important; }
.detail-kind { font-weight: 600; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 12px; }
  .select-wrap { padding-inline: 12px; gap: 6px; }
  .select-wrap select { max-width: 165px; font-size: 13px; }
  .select-chevron { right: 11px; }
  .event-card { padding-inline: 14px; }
  .card-title { font-size: 15px; }
  .calendar-panel { padding: 15px 13px 12px; }
  .month-title h3 { font-size: 19px; }
  .calendar-toolbar { gap: 6px; }
  .month-controls > button:first-child { padding-inline: 7px; font-size: 11px; margin-right: 1px; }
}

@media (max-height: 850px) and (min-width: 761px) {
  .calendar-event, .calendar-more { display: none; }
  .day-dots { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 2px; }
  .day-dots i { width: 5px; height: 5px; border-radius: 50%; }
  .day-dots span { color: #6f8273; font-size: 10px; line-height: 1.2; margin-left: 2px; }
}

@media (max-width: 760px) {
  .wrap, .header-inner { width: calc(100% - 32px); }
  .site-header { height: 52px; }
  .header-inner { gap: 8px; }
  .brand { gap: 7px; }
  .brand h1, .brand strong { font-size: 18px; letter-spacing: -.6px; }
  .brand .icon { width: 21px; height: 21px; }
  .header-actions { gap: 5px; }
  .saved-toggle { gap: 5px; min-height: 32px; padding: 6px 8px; font-size: 12px; }
  .saved-toggle .icon { width: 15px; height: 15px; }
  .about-button { width: 30px; height: 32px; }
  .about-button .icon { width: 18px; height: 18px; }
  #saved-count { min-width: 16px; height: 16px; padding-inline: 3px; font-size: 10px; }
  main.explore { padding-top: 12px; padding-bottom: 18px; }
  .search-bar { flex-wrap: wrap; min-height: 88px; padding-inline: 3px; border-radius: 12px; }
  .search-input { flex-basis: 100%; height: 44px; gap: 9px; padding: 0 10px; border-bottom: 1px solid #e9eeea; }
  .search-input input { font-size: 16px; }
  .search-input > .icon { width: 18px; height: 18px; }
  .search-input kbd { display: none; }
  .select-wrap { height: 42px; min-width: 0; flex: 1; border-left: 0; padding: 0 9px; gap: 6px; }
  .period-wrap { border-left: 1px solid #e9eeea; }
  .select-wrap > .icon { width: 15px; height: 15px; }
  .select-wrap select { width: 100%; min-width: 0; max-width: none; padding: 6px 13px 6px 0; font-size: 12px; }
  .select-chevron { right: 8px; top: 8px; font-size: 17px; }
  .reset-button { width: 32px; height: 34px; margin: 0 2px; }
  .reset-button .icon { width: 16px; height: 16px; }
  .filter-row { padding: 6px 0; min-height: 44px; }
  .categories { display: grid; grid-template-columns: .7fr 1fr 1fr 1.25fr; width: 100%; gap: 4px; }
  .nearby-search { min-height: 32px; padding: 6px 10px; font-size: 11px; }
  .category-chip { min-width: 0; min-height: 32px; padding: 6px 4px; gap: 4px; border-radius: 999px; font-size: 12px; }
  .category-chip > .icon { width: 12px; height: 12px; }
  .category-dot { width: 5px; height: 5px; }
  .results-toolbar { min-height: 36px; margin-bottom: 8px; gap: 6px; }
  #results-heading { font-size: 15px; letter-spacing: -.5px; }
  #result-count { margin-left: 3px; }
  .view-tabs { gap: 1px; padding: 3px; border-radius: 10px; }
  .view-tabs > button { gap: 4px; min-height: 28px; padding: 5px 7px; font-size: 11px; }
  .view-tabs > button .icon { width: 13px; height: 13px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; height: auto; }
  .map-panel { height: clamp(220px, 30dvh, 260px); flex-shrink: 0; }
  .map-panel:not(.is-expanded) .leaflet-popup-content { max-height: min(145px, calc(30dvh - 94px)); }
  .map-panel, .calendar-panel, .results-panel { border-radius: 13px; }
  .map-options { left: 10px; bottom: 24px; }
  .map-expand { top: 10px; left: 10px; min-height: 34px; padding: 7px 9px; font-size: 11px; }
  .map-options > summary { padding: 7px 9px; font-size: 11px; }
  .map-option { min-height: 42px; font-size: 13px; }
  .map-options-menu { width: 163px; }
  .map-buttons { right: 10px; top: 85px; }
  .map-buttons button { width: 72px; height: 32px; gap: 5px; font-size: 11px; }
  .leaflet-control-zoom { margin-top: 10px !important; margin-right: 10px !important; }
  .leaflet-control-zoom a { width: 32px !important; height: 32px !important; line-height: 32px !important; }
  .leaflet-control-attribution { font-size: 8px !important; }
  .province-label { font-size: 11px; letter-spacing: 0; }
  .map-message { left: 10px; right: 48px; bottom: 64px; font-size: 11px; padding: 8px 10px; }
  .results-panel { overflow: visible; max-height: none; }
  .list-toolbar { min-height: 40px; padding: 8px 13px; }
  .list-toolbar > strong { font-size: 12px; }
  .list-toolbar select { font-size: 12px; }
  .event-list { flex: none; overflow: visible; max-height: none; }
  .event-card { padding: 12px 13px; }
  .event-card:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }
  .event-card:last-child { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
  .card-main { padding-right: 29px; }
  .card-topline { gap: 6px; margin-bottom: 4px; font-size: 11px; }
  .card-status { min-height: 17px; padding: 1px 4px; font-size: 10px; }
  .card-title { margin-bottom: 5px; font-size: 15px; line-height: 1.45; }
  .card-meta { font-size: 14px; gap: 3px 10px; line-height: 1.4; }
  .card-save { top: 10px; right: 7px; width: 34px; height: 34px; }
  .card-save .icon { width: 17px; height: 17px; }
  .workspace[data-view=list] .event-list { display: block; }
  .workspace[data-view=list] .event-card { border-right: 0; }
  .workspace[data-view=list] .event-card:last-child { border-bottom: 0; }
  .data-note { gap: 4px 9px; padding-top: 11px; font-size: 11px; }
  .calendar-panel { height: 360px; padding: 13px 12px 10px; flex-shrink: 0; }
  .calendar-toolbar { padding-bottom: 10px; }
  .month-title h3 { font-size: 20px; }
  .month-controls > button { height: 30px; min-width: 30px; }
  .month-controls > button:first-child { font-size: 11px; padding: 0 8px; margin-right: 3px; }
  .calendar-weekdays { padding: 6px 0; font-size: 11px; }
  .calendar-day { padding: 3px; gap: 2px; }
  .day-number { width: 21px; height: 21px; font-size: 12px; }
  .calendar-event, .calendar-more { display: none; }
  .day-dots { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 1px 2px; }
  .day-dots i { width: 5px; height: 5px; border-radius: 50%; }
  .day-dots span { margin-left: 1px; color: #708175; font-size: 10px; line-height: 1.1; }
  .calendar-help { margin-top: 8px; font-size: 10px; }
  .planning-bar { padding: 5px 10px; gap: 1px 7px; font-size: 11px; }
  .planning-bar button { font-size: 11px; }
  .location-note { padding: 7px 13px; }
  .selection-bar { padding: 6px 9px; margin-bottom: 8px; font-size: 12px; }
  .selection-bar button { font-size: 11px; min-height: 27px; }
  .custom-dates { padding: 9px 10px; gap: 7px; font-size: 12px; }
  .custom-dates label { gap: 5px; }
  .custom-dates input { width: 120px; max-width: 100%; padding: 5px; font-size: 12px; }
  #date-error { font-size: 11px; }
  .empty-state { min-height: 190px; padding: 28px 18px; }
  .empty-state h3 { font-size: 15px; }
  .empty-state p { font-size: 13px; }
  .loading-state { padding-block: 40px; min-height: 180px; font-size: 13px; }
  .event-dialog { max-height: 93dvh; border-radius: 16px; }
  .detail-cover { padding: 21px 20px 19px; }
  .detail-kind { font-size: 12px; }
  .detail-cover h2 { margin-top: 11px; font-size: 23px; }
  .detail-subtitle { font-size: 12px; }
  .detail-body { padding: 20px; }
  .detail-summary { margin-bottom: 21px; font-size: 14px; }
  .detail-facts { grid-template-columns: 72px minmax(0, 1fr); gap: 14px 6px; font-size: 14px; }
  .detail-facts dt { gap: 5px; font-size: 12px; }
  .detail-facts dt .icon { width: 14px; height: 14px; }
  .detail-facts dd > small { font-size: 11px; }
  .detail-notice { margin-top: 19px; padding: 11px; font-size: 12px; }
  .detail-actions { gap: 7px; margin-top: 20px; }
  .detail-actions > .primary-button { flex-basis: 100%; }
  .detail-actions > .secondary-button { flex: 1; padding: 11px 9px; font-size: 12px; }
  .detail-actions > .detail-save, .detail-actions > .share-button { flex: 0 0 44px; padding: 0; }
  .source-line { font-size: 10px; }
  .about-dialog { padding: 25px 21px; }
  .about-dialog h2 { font-size: 22px; }
  .about-dialog p { font-size: 13px; }
  .about-section h3 { font-size: 14px; }
  .about-section p { font-size: 13px; }
  .about-source p { font-size: 11px; }
  .toast { bottom: 18px; font-size: 12px; padding: 11px 15px; }
}

@media (max-width: 350px) {
  .wrap, .header-inner { width: calc(100% - 24px); }
  .category-chip > .icon, .category-dot, .category-chip::before { display: none; }
  .category-chip { padding-inline: 3px; }
  .view-tabs > button { padding-inline: 6px; }
  .view-tabs > button .icon { display: none; }
  .saved-toggle { font-size: 11px; padding-inline: 6px; }
  .brand h1, .brand strong { font-size: 17px; }
  .brand .icon { width: 19px; height: 19px; }
  .brand-mark { width: 28px; height: 28px; flex-basis: 28px; border-radius: 9px; }
  .brand .brand-mark .icon { width: 19px; height: 19px; }
  .card-meta { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
