:root {
  --ink: #17201c; --muted: #65716b; --paper: #f4f2ec; --panel: #fffefa;
  --line: #deddd6;
  --action-primary: #176b52; --action-primary-hover: #0f4d3b; --action-primary-border: #267e62;
  --control-selected-bg: #dfeae5; --control-selected-ink: #285545; --control-selected-border: #a9c4b9;
  --info-date-bg: #527367; --info-date-ink: #fffefa;
  --interactive-border-hover: #829f93;
  --accent: var(--action-primary); --accent-dark: var(--action-primary-hover); --accent-pale: var(--control-selected-bg);
  --gold: #c68a2b; --danger: #9b3b35; --shadow: 0 18px 55px rgba(30,42,36,.12);
  --music: #7a5ab5; --art: #c26584; --festival: #c57631; --sports: #3679a9;
  --theater: #9b5145; --active: #418566; --comedy: #a16225; --dance: #895e9b;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); background: var(--paper); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body:has(dialog[open]) { overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, input { min-height: 38px; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #68ab95; outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
.topbar { height: 78px; display: grid; grid-template-columns: 270px minmax(300px, 1fr) auto auto; gap: 22px; align-items: center; padding: 0 26px; background: #12251e; color: white; box-shadow: 0 1px 0 rgba(255,255,255,.1); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #d4a44c; color: #15251f; font-size: 19px; }
.brand h1 { margin: 0; font: 700 19px/1.1 Georgia, serif; letter-spacing: .1px; }
.brand p { margin: 4px 0 0; color: #adc0b8; font-size: 11px; }
.search { position: relative; display: flex; align-items: center; max-width: 680px; }
.search span { position: absolute; left: 14px; color: #aebdb7; font-size: 22px; }
.search input { width: 100%; border: 1px solid #41544c; border-radius: 7px; padding: 0 15px 0 43px; color: white; background: #20372f; }
.search input::placeholder { color: #aebdb7; }
.view-switcher { display: flex; border: 1px solid #42554e; border-radius: 7px; overflow: hidden; }
.view-switcher button { min-height: 36px; border: 0; border-right: 1px solid #42554e; padding: 0 15px; color: #c8d4cf; background: transparent; }
.view-switcher button:last-child { border: 0; }
.view-switcher button.active { color: #14261f; background: #e6eee9; font-weight: 700; }
.primary { border: 1px solid var(--action-primary-border); border-radius: 7px; padding: 0 16px; color: white; background: var(--action-primary); font-weight: 700; }
.primary:hover { background: var(--accent-dark); }
.app-shell { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100vh - 78px); }
.filters { border-right: 1px solid var(--line); padding: 24px 20px; background: #ebe9e2; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.filter-heading h2 { margin: 0; font: 700 18px Georgia, serif; }
.text-button { min-height: 28px; border: 0; padding: 0; color: var(--accent); background: transparent; }
.filters label { display: grid; gap: 6px; margin-bottom: 16px; color: #445049; font-size: 12px; font-weight: 700; }
.filters input[type="date"], .filters select, .sort-label select { border: 1px solid #cbc9c1; border-radius: 6px; padding: 0 10px; background: var(--panel); font-weight: 500; }
.filters .check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { min-height: auto; accent-color: var(--accent); }
.filter-note { display: flex; gap: 10px; border-top: 1px solid #d2d0c8; margin-top: 26px; padding-top: 20px; color: var(--muted); }
.filter-note p { margin: 3px 0 0; font-size: 12px; }
.filter-note strong { color: var(--ink); font-size: 12px; }
.pulse { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: #3ca378; box-shadow: 0 0 0 4px #cfe8dd; }
main { min-width: 0; padding: 28px 32px 60px; }
.content-header { min-height: 64px; display: flex; align-items: end; gap: 20px; margin-bottom: 22px; }
.group-jump-slot { min-width: 0; flex: 1; }
.sort-label { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.sort-label select { min-width: 145px; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(325px, 1fr)); gap: 15px; }
.event-card { position: relative; min-height: 244px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: var(--panel); box-shadow: 0 2px 2px rgba(31,41,36,.025); transition: box-shadow .15s, border-color .15s; cursor: pointer; }
.event-card:hover, .event-card:focus-visible { transform: none; border-color: var(--interactive-border-hover); box-shadow: 0 7px 20px rgba(31,41,36,.08); }
.event-card.booked { border-color: #78a994; box-shadow: inset 0 3px var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.category { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.category::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--category, #777); }
.favorite { min-height: 28px; width: 30px; border: 0; background: transparent; color: #a19d92; font-size: 20px; }
.favorite.on { color: var(--gold); }
.event-card h3 { margin: 10px 0 8px; font: 700 19px/1.2 Georgia, serif; }
.next-date { display: flex; gap: 12px; align-items: center; margin: 1px 0 12px; color: #36443d; }
.date-tile { width: 54px; flex: 0 0 54px; padding: 6px 3px 7px; border-radius: 7px; color: var(--info-date-ink); background: var(--info-date-bg); text-align: center; }
.date-tile strong { display: block; margin-top: 1px; font-size: 21px; line-height: .95; }
.date-tile span { display: block; font-size: 9px; font-weight: 800; line-height: 1.15; letter-spacing: .55px; text-transform: uppercase; }
.date-tile .date-tile-heading { display: flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.date-tile .date-tile-heading span { display: inline; }
.date-tile .date-tile-heading span:last-child { opacity: .82; }
.date-tile .date-tile-time { margin-top: 8px; font-size: 9px; letter-spacing: 0; }
.next-date b { display: block; }
.next-date small { color: var(--muted); }
.description { display: -webkit-box; overflow: hidden; margin-bottom: 12px; color: var(--muted); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.why { margin-top: auto; color: #46534d; font-size: 12px; font-style: italic; }
.card-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; border-top: 1px solid #e9e6df; margin-top: 13px; padding-top: 12px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; min-height: 23px; border-radius: 12px; padding: 2px 8px; background: #eceae4; font-size: 10px; font-weight: 700; text-transform: capitalize; }
.badge.free, .badge.available { color: #185942; background: #dcece5; }
.badge.sold-out, .badge.rejected { color: #82332f; background: #f1ddda; }
.badge.interested { color: #5e4a18; background: #f2e8cb; }
.badge.tentative { color: #735217; background: #f2e8cb; }
.badge.booked { color: white; background: var(--accent); }
.more-dates { margin-left: auto; color: var(--accent); font-weight: 700; }
.empty, .loading { border: 1px dashed #c7c5bd; border-radius: 10px; padding: 70px 20px; color: var(--muted); background: rgba(255,255,255,.45); text-align: center; }
.notice { border: 1px solid #d5b86e; border-radius: 7px; margin-bottom: 16px; padding: 10px 13px; color: #624b17; background: #fff5d9; }
.hidden, [hidden] { display: none !important; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.calendar-controls strong { min-width: 190px; text-align: center; font: 700 16px Georgia, serif; }
.calendar { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekday { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); background: #eae8e1; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-align: center; }
.day { min-height: 132px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px; background: #fffefa; }
.day:nth-child(7n) { border-right: 0; }
.day.other { background: #f3f1eb; color: #a2a39e; }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-number { margin-bottom: 5px; font-size: 11px; font-weight: 800; }
.cal-event { display: block; width: 100%; min-height: 23px; overflow: hidden; border: 0; border-left: 3px solid var(--category, var(--accent)); border-radius: 3px; margin-bottom: 4px; padding: 3px 5px; background: #edf0ed; font-size: 10px; line-height: 1.2; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.cal-event.favorite-cal { background: #f7edce; }
.cal-event.occurrence-interested { background: #f4ecd4; }
.cal-event.occurrence-tentative { background: #eadbb0; box-shadow: inset 0 0 0 1px #d6bd76; }
.cal-event.occurrence-booked { color: white; background: var(--accent); }
.cal-more { border: 0; color: var(--accent); background: transparent; font-size: 10px; font-weight: 700; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; height: calc(100vh - 205px); min-height: 520px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
#map { min-height: 100%; background: #e1e8e3; }
body.drawer-open .topbar,
body.drawer-open .control-bar,
body.drawer-open .app-shell { pointer-events: none !important; user-select: none; }
body.drawer-open { position: fixed; right: 0; left: 0; width: 100%; overflow: hidden; }
.map-sidebar { overflow: auto; border-left: 1px solid var(--line); padding: 14px; }
.map-sidebar h3 { font: 700 16px Georgia, serif; }
.map-item { width: 100%; min-height: auto; border: 0; border-bottom: 1px solid #e8e5de; padding: 10px 3px; background: transparent; text-align: left; }
.map-item strong, .map-item small { display: block; }
.map-item small { margin-top: 2px; color: var(--muted); }
.leaflet-popup-content button { border: 0; padding: 0; color: var(--accent); background: transparent; text-align: left; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 1990; background: rgba(11,21,17,.28); }
.drawer { position: fixed; top: 0; right: 0; z-index: 2000; isolation: isolate; pointer-events: auto; width: min(510px, 46vw); height: 100dvh; overflow: auto; overscroll-behavior: none; padding: 0; background: var(--panel); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .22s ease; scrollbar-gutter: stable; touch-action: pan-y; }
.drawer.open { transform: translateX(0); }
.drawer-head { position: absolute; inset: 0 0 auto; z-index: 2; display: flex; justify-content: space-between; align-items: start; padding: 18px; }
.icon-button { width: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 22px; }
.drawer h2 { margin: 0 0 8px; font: 700 28px/1.15 Georgia, serif; }
.drawer-description { color: var(--muted); font-size: 15px; }
.detail-date { display: flex; align-items: stretch; gap: 0; border: 0; border-radius: 0; margin: 12px 0; padding: 0; }
.detail-date + .detail-date { margin-top: 12px; }
.detail-date-copy { min-width: 0; display: grid; align-content: center; gap: 6px; padding: 7px 0 7px 14px; }
.detail-date-copy strong { min-width: 0; font-size: 16px; line-height: 1.25; }
.detail-date-meta { min-width: 0; display: flex; align-items: center; gap: 12px; }
.occurrence-choice-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: stretch; }
.occurrence-choice-row > .date-tile { width: auto; display: flex; flex-direction: column; justify-content: center; border-radius: 8px; padding: 6px 5px; }
.occurrence-choice-row > .date-tile strong { font-size: 25px; }
.occurrence-choice-row[hidden] { display: none; }
.occurrence-choice-row[data-status="interested"] .detail-date-copy { background: #fffaf0; }
.occurrence-choice-row[data-status="tentative"] .detail-date-copy { background: #fff8e5; }
.occurrence-choice-row[data-status="booked"] .detail-date-copy { background: #edf6f1; }
.occurrence-choice-row[data-status="rejected"] { opacity: .55; }
.occurrence-choice-row[data-status="rejected"] .detail-date-copy { background: #f0efeb; }
.occurrence-status-buttons { min-width: 0; flex: 1; display: flex; overflow: hidden; border: 1px solid #c9cec8; border-radius: 14px; background: white; }
.occurrence-status-buttons button { min-width: 0; min-height: 27px; flex: 1 1 auto; border: 0; border-left: 1px solid #c9cec8; border-radius: 0; padding: 0 5px; background: white; font-size: 9px; font-weight: 700; white-space: nowrap; }
.occurrence-status-buttons button:first-child { border-left: 0; border-radius: 13px 0 0 13px; }
.occurrence-status-buttons button:last-child { border-radius: 0 13px 13px 0; }
.occurrence-status-buttons button:hover { border-color: #8fa69b; background: #f3f5f2; }
.occurrence-status-buttons button[aria-pressed="true"] { color: var(--control-selected-ink); background: var(--control-selected-bg); box-shadow: inset 0 0 0 1px var(--control-selected-border); }
.occurrence-status-buttons button:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.drawer-action-bar { position: relative; display: flex; align-items: center; gap: 8px; margin: 16px 0; }
.drawer-action-bar > a, .drawer-action-bar summary, .drawer-action-bar > button, .drawer-star { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 18px; padding: 0 12px; color: var(--ink); background: white; font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.drawer-action-bar .primary-link { border-color: var(--action-primary); color: white; background: var(--action-primary); }
.drawer-star { width: 38px; flex: 0 0 38px; padding: 0; color: #8b887f; font-size: 20px; }
.drawer-star.active { border-color: #d0ad4f; color: #8a6411; background: #f8e9ba; }
.listing-options { margin-left: auto; }
.listing-options summary { list-style: none; cursor: pointer; }
.listing-options summary::-webkit-details-marker { display: none; }
.listing-options[open] summary { border-color: var(--accent); }
.listing-options-panel { position: absolute; top: calc(100% + 7px); right: 0; z-index: 4; width: min(310px, calc(100vw - 40px)); border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: var(--panel); box-shadow: 0 14px 35px rgba(30,42,36,.18); }
.listing-options-panel label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.listing-options-panel textarea { width: 100%; border: 1px solid #c9cec8; border-radius: 6px; padding: 9px; resize: vertical; background: white; }
.listing-options-panel .status-buttons { margin-bottom: 12px; }
.listing-note { display: flex; align-items: start; justify-content: space-between; gap: 14px; border-left: 3px solid var(--gold); border-radius: 0 7px 7px 0; margin: 10px 0 17px; padding: 10px 12px; background: #faf3df; }
.listing-note span { color: #765c1c; font-size: 9px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.listing-note p { margin: 3px 0 0; white-space: pre-wrap; }
.drawer-location { min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; margin: 14px 0 9px; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.drawer-location strong { flex: 0 0 auto; color: var(--ink); }
.drawer-location span:last-child { overflow: hidden; text-overflow: ellipsis; }
.drawer-pill-rail { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; scrollbar-width: none; }
.drawer-pill-rail::-webkit-scrollbar { display: none; }
.drawer-pill { min-width: max-content; display: inline-flex; align-items: center; min-height: 25px; border-radius: 13px; padding: 3px 9px; color: #435048; background: #eceae4; font-size: 9px; font-weight: 750; white-space: nowrap; }
.capitalize { text-transform: capitalize; }
.show-choice-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin: 20px 0 8px; }
.show-choice-intro strong { font: 700 15px Georgia, serif; }
.show-choice-intro span { max-width: 230px; color: var(--muted); font-size: 9px; text-align: right; }
.occurrence-month-filter { display: flex; overflow-x: auto; overflow-y: hidden; margin: 0 0 12px; border: 1px solid #c9cec8; border-radius: 18px; background: white; scrollbar-width: none; }
.occurrence-month-filter::-webkit-scrollbar { display: none; }
.occurrence-month-filter button { min-width: max-content; min-height: 34px; flex: 1 0 auto; border: 0; border-left: 1px solid #c9cec8; border-radius: 0; padding: 0 13px; color: var(--muted); background: white; font-size: 11px; font-weight: 750; white-space: nowrap; }
.occurrence-month-filter button:first-child { border-left: 0; border-radius: 17px 0 0 17px; }
.occurrence-month-filter button:last-child { border-radius: 0 17px 17px 0; }
.occurrence-month-filter button:hover { background: #f3f5f2; }
.occurrence-month-filter button[aria-pressed="true"] { color: var(--control-selected-ink); background: var(--control-selected-bg); box-shadow: inset 0 0 0 1px var(--control-selected-border); }
.occurrence-month-filter button:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.drawer-occurrences { display: flow-root; }
.drawer-map-section { position: relative; overflow: hidden; border: 1px solid #bcc9c3; border-radius: 8px; margin: 18px 0 12px; background: #e1e8e3; box-shadow: 0 5px 16px rgba(30,42,36,.13); }
.drawer-map-section:hover { border-color: #91a99f; box-shadow: 0 6px 18px rgba(30,42,36,.17); }
#drawer-map { height: 165px; overflow: hidden; border: 0; border-radius: 0; background: #e1e8e3; pointer-events: none; }
.drawer-map-click-target { position: absolute; inset: 0; z-index: 1000; border-radius: 7px; cursor: pointer; }
.drawer-map-click-target:focus-visible { outline: 3px solid #68ab95; outline-offset: -4px; }
#drawer-map .leaflet-control-attribution { font-size: 8px; }
#map .leaflet-tile-pane,
#drawer-map .leaflet-tile-pane {
  filter: grayscale(.55) saturate(.48) brightness(1.04) contrast(.9);
}
.warning { border-radius: 6px; margin: 8px 0; padding: 9px 11px; color: #68491b; background: #f7ebce; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.status-buttons button { min-height: 32px; border: 1px solid #c9cec8; border-radius: 16px; padding: 0 11px; background: white; font-size: 11px; }
.status-buttons button.active { border-color: var(--accent); color: white; background: var(--accent); }
dialog { width: min(620px, 80vw); border: 0; border-radius: 12px; padding: 0; background: var(--panel); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(11,21,17,.45); }
dialog form { padding: 25px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; }
.dialog-heading h2 { font: 700 24px Georgia, serif; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
.form-grid input, .form-grid select, .form-grid textarea { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: white; text-transform: none; letter-spacing: 0; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }
.dialog-actions button { border: 1px solid var(--line); border-radius: 6px; padding: 0 16px; background: white; }
.dialog-actions .primary { background: var(--accent); }
.error { color: var(--danger); }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 230px minmax(230px,1fr) auto; }
  #add-event { display: none; }
  .event-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
}

/* Second-pass layout: visual cards, horizontal controls, grouped browsing. */
.topbar { grid-template-columns: 235px minmax(500px, 1fr) auto auto; gap: 12px; height: 60px; padding: 0 18px; }
.top-prompt { display: none; }
.brand-mark { width: 31px; height: 31px; font-size: 16px; }
.brand h1 { font-size: 17px; }
.brand p { margin-top: 2px; font-size: 10px; }
.view-switcher button { min-height: 32px; padding-inline: 13px; }
#add-event { min-height: 34px; }
.control-bar {
  min-width: 0; min-height: 0; display: flex; align-items: center; gap: 9px; padding: 0;
  border: 0; background: transparent; position: static; box-shadow: none;
}
.control-bar > label { display: flex; align-items: center; gap: 5px; color: #aebdb7; font-size: 9px; font-weight: 800; white-space: nowrap; }
.range-filter { display: flex; align-items: center; gap: 5px; color: #aebdb7; font-size: 9px; font-weight: 800; white-space: nowrap; }
.range-toggle { display: inline-flex; overflow: hidden; border: 1px solid #43594f; border-radius: 7px; background: #20372f; }
.range-toggle button { min-height: 29px; border: 0; border-left: 1px solid #43594f; border-radius: 0; padding: 0 9px; color: #b9c8c2; background: transparent; font-size: 10px; font-weight: 650; white-space: nowrap; }
.range-toggle button:first-child { border-left: 0; }
.range-toggle button:hover { color: white; background: #29463b; }
.range-toggle button[aria-pressed="true"] { color: #173126; background: #dfeae5; box-shadow: inset 0 0 0 1px #a9c4b9; }
.range-toggle button:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.control-bar select { min-height: 31px; border: 1px solid #43594f; border-radius: 6px; padding: 0 7px; color: white; background: #20372f; font-size: 10px; font-weight: 600; }
.control-bar select { max-width: 112px; }
.interested-toggle { min-height: 32px; display: inline-flex !important; align-items: center; gap: 6px !important; border: 1px solid #43594f; border-radius: 18px; margin-left: auto; padding: 0 6px 0 9px; color: #d3ddd9 !important; background: #20372f; cursor: pointer; transition: border-color .15s, background .15s; }
.interested-toggle:hover { border-color: #769486; }
.interested-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.interested-star { color: #9aa9a3; font-size: 12px; transition: color .15s; }
.toggle-track { width: 25px; height: 15px; display: inline-flex; align-items: center; border-radius: 8px; padding: 2px; background: #60736b; transition: background .15s; }
.toggle-track::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.interested-toggle:has(input:checked) { border-color: #d0ad4f; color: #fff4d5 !important; background: #51441f; }
.interested-toggle input:focus-visible + .interested-star { outline: 3px solid #68ab95; outline-offset: 3px; border-radius: 2px; }
.interested-toggle input:checked + .interested-star { color: #ffd472; }
.interested-toggle input:checked ~ .toggle-track { background: #d0ad4f; }
.interested-toggle input:checked ~ .toggle-track::after { transform: translateX(10px); }
.control-bar .text-button { color: #8ed1b8; font-size: 10px; }
.control-bar.rejected-mode .range-filter,
.control-bar.rejected-mode label:has(#dayOfWeek),
.control-bar.rejected-mode label:has(#interesting) { display: none; }
.control-bar.rejected-mode label:has(#groupBy) { margin-left: 0; }
.control-bar.restaurant-mode .range-filter,
.control-bar.restaurant-mode label:has(#dayOfWeek),
.control-bar.restaurant-mode label:has(#groupBy) { display: none; }
.control-bar.restaurant-mode .interested-toggle { margin-left: auto; }
.app-shell { display: block; min-height: calc(100vh - 60px); }
main { padding: 18px 26px 60px; }
.content-header { min-height: 42px; margin-bottom: 14px; }
.summary-button { min-height: 34px; border: 1px solid #b7c7c0; border-radius: 18px; padding: 0 13px; color: var(--accent); background: #edf3f0; font-size: 11px; font-weight: 800; white-space: nowrap; }
.summary-button:hover { border-color: var(--interactive-border-hover); background: #e3eee9; }
#search-summary-dialog { width: min(590px, calc(100vw - 36px)); }
.summary-dialog-content { padding: 26px; }
.summary-dialog-content .dialog-heading h2 { margin-bottom: 0; }
.summary-intro { max-width: 490px; margin: 4px 0 20px; color: var(--muted); }
.summary-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.summary-tabs button { position: relative; min-height: 42px; border: 0; padding: 0 18px; color: var(--muted); background: transparent; font-weight: 800; }
.summary-tabs button::after { content: ""; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.summary-tabs button[aria-selected="true"] { color: var(--accent); }
.summary-tabs button[aria-selected="true"]::after { background: var(--accent); }
.summary-panel { min-height: 235px; padding: 19px 4px 2px; }
.summary-panel ul { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.summary-panel li { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 7px; }
.summary-panel input { width: 100%; min-height: 42px; border: 1px solid #d9d7d0; border-radius: 8px; padding: 9px 12px; background: #f8f7f2; }
.summary-panel li > button { min-height: 38px; border: 1px solid #e1c9c6; border-radius: 8px; color: var(--danger); background: #faf5f3; font-size: 19px; }
#negative-panel li { background: #faf5f3; }
.add-summary-item { min-height: 34px; border: 0; margin-top: 12px; padding: 0; color: var(--accent); background: transparent; font-size: 11px; font-weight: 800; }
.summary-actions { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 18px; }
.summary-actions .primary { color: white; }
#summary-error:empty { display: none; }
.content-header.map-header-hidden { display: none; }
main.map-view, main.restaurant-view { padding: 12px 18px 18px; }
.group-jump-nav { display: flex; gap: 7px; overflow-x: auto; margin: 0; padding: 2px 1px 6px; scrollbar-width: thin; scrollbar-color: #b8bdb8 transparent; }
.group-jump-nav.two-row { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 32px); grid-auto-columns: max-content; }
.group-jump-nav button { min-height: 32px; flex: 0 0 auto; border: 1px solid #c8d0cb; border-radius: 17px; padding: 0 12px; color: #385248; background: #f9faf7; font-size: 11px; font-weight: 750; white-space: nowrap; }
.group-jump-nav button:hover { border-color: var(--interactive-border-hover); color: var(--accent); background: #edf3f0; }
.group-jump-nav.venue-jumps button { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.grouped-list { display: grid; gap: 36px; }
.event-group { min-width: 0; scroll-margin-top: 78px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.group-heading > div { display: flex; align-items: center; gap: 9px; }
.group-heading h3 { margin: 0; font: 700 20px Georgia, serif; }
.group-heading > span { color: var(--muted); font-size: 11px; }
.group-dot { width: 9px; height: 9px; border-radius: 50%; }
.event-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.event-card { min-height: 0; padding: 0; overflow: hidden; }
.event-card:hover, .event-card:focus-visible { transform: none; border-color: var(--interactive-border-hover); }
.card-media { position: relative; height: 145px; overflow: hidden; background: #52665d; }
.card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,24,19,.05), rgba(12,24,19,.2)); pointer-events: none; }
.card-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-media .category {
  position: absolute; top: 12px; left: 12px; z-index: 2; border-radius: 14px; padding: 5px 9px;
  color: white; background: rgba(14,27,22,.74); backdrop-filter: blur(5px);
}
.card-media .category::before { background: white; }
.card-media .favorite {
  position: absolute; top: 9px; right: 10px; z-index: 2; border-radius: 50%; color: white;
  background: rgba(14,27,22,.6); text-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.card-media .favorite.on { color: #ffd472; }
.occurrence-card { border-color: #d8bf7c; background: #fffdf7; }
.occurrence-card .card-media::after { background: linear-gradient(180deg, rgba(12,24,19,.08), rgba(89,62,10,.32)); }
.occurrence-card-label { position: absolute; top: 11px; right: 11px; z-index: 2; border-radius: 14px; padding: 5px 9px; color: #49380e; background: #f8e9ba; font-size: 9px; font-weight: 900; letter-spacing: .7px; text-transform: uppercase; }
.occurrence-parent { margin: 0 0 5px; color: #7a651f; font-size: 10px; font-weight: 850; letter-spacing: .45px; text-transform: uppercase; }
.event-card.occurrence-card h3 { margin-bottom: 9px; font-size: 22px; }
.event-when.occurrence-when { justify-content: start; border-left: 3px solid var(--gold); padding-left: 9px; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 16px 17px 15px; }
.event-card h3 { margin: 0 0 8px; font-size: 20px; }
.event-when { display: flex; justify-content: space-between; gap: 10px; margin: 0; color: #304139; }
.event-when b { font-size: 13px; }
.event-when span { color: var(--accent); font-size: 11px; font-weight: 800; white-space: nowrap; }
.event-where { margin: 2px 0 13px; color: var(--muted); font-size: 12px; }
.event-card .description { min-height: 40px; margin: 0 0 13px; line-height: 1.45; -webkit-line-clamp: 2; }
.why { margin: 0 0 14px; border-radius: 6px; padding: 10px 11px; color: #415048; background: #f0efe9; font-size: 12px; font-style: normal; }
.why span { display: block; margin-bottom: 3px; color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase; }
.why p { margin: 0; }
.card-footer { border: 0; margin: auto 0 0; padding: 0; }
.card-hide {
  min-height: 27px; margin-left: auto; border: 1px solid transparent; border-radius: 14px; padding: 0 11px;
  color: #5d6661; background: transparent; font-size: 10px; font-weight: 750;
}
.card-hide:hover { border-color: #9b3b35; color: #82332f; background: #f7e9e7; }
.rejected .card-hide:hover { border-color: var(--action-primary-border); color: var(--action-primary); background: var(--accent-pale); }
.badge.quiet { color: #4c5852; background: #eceae4; }
.more-dates { margin-left: 0; }

.calendar { overflow: visible; }
.weekday { display: grid; gap: 1px; padding: 10px 8px; font-size: 10px; }
.weekday span { text-transform: uppercase; }
.weekday strong { color: var(--ink); font-size: 12px; letter-spacing: 0; }
.week-calendar .calendar-grid { min-height: calc(100vh - 188px); align-items: stretch; }
.week-calendar .day { min-width: 0; min-height: calc(100vh - 188px); padding: 10px; }
.week-calendar .day-number { margin-bottom: 9px; color: var(--muted); font-size: 10px; font-weight: 700; }
.week-calendar .cal-event { max-width: 100%; min-height: 42px; display: grid; gap: 1px; border-left-width: 4px; margin-bottom: 6px; padding: 6px 8px; font-size: 12px; line-height: 1.2; white-space: normal; }
.week-calendar .cal-event-time { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.week-calendar .cal-event-title { overflow: hidden; font-weight: 700; text-overflow: ellipsis; }
.calendar:not(.week-calendar) .day { min-width: 0; min-height: 150px; padding: 9px; }
.calendar:not(.week-calendar) .day-number { margin-bottom: 7px; font-size: 13px; }
.calendar:not(.week-calendar) .cal-event { max-width: 100%; min-height: 34px; border-left-width: 4px; margin-bottom: 5px; padding: 7px 8px; font-size: 13px; line-height: 1.25; }
.continuous-calendar .weekday-row { position: sticky; top: 60px; z-index: 4; box-shadow: 0 1px 0 var(--line); }
.continuous-calendar .day, .four-week-calendar .day { height: 230px; max-height: 230px; overflow: hidden; }
.continuous-calendar .day.month-start { box-shadow: inset 3px 0 var(--gold); }
.continuous-calendar .day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-end { display: flex; align-items: baseline; justify-content: center; gap: 8px; border-top: 1px solid var(--line); padding: 18px; color: var(--muted); background: #eae8e1; }
.calendar-end strong { color: var(--ink); font: 700 15px Georgia, serif; }
.calendar-end span { font-size: 11px; }
.cal-more { min-height: 27px; display: inline-block; padding: 2px; font-size: 11px; }
.cal-more:hover { text-decoration: underline; text-underline-offset: 2px; }

#day-events-dialog { width: min(620px, calc(100vw - 36px)); max-height: min(82vh, 720px); padding: 0; overflow: hidden; }
.day-events-dialog-content { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: min(82vh, 720px); padding: 24px; }
.day-events-dialog-content .dialog-heading { margin-bottom: 16px; }
.day-events-dialog-content .dialog-heading h2 { margin: 0; }
#day-events-count { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.day-events-list { min-height: 0; display: grid; gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 5px 2px 2px; }
.day-event-item { width: 100%; min-height: 66px; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 2px 12px; align-content: center; border: 1px solid var(--line); border-left: 5px solid var(--category, var(--accent)); border-radius: 7px; padding: 10px 12px; background: #f8f8f4; text-align: left; }
.day-event-item:hover { border-color: var(--interactive-border-hover); border-left-color: var(--category, var(--accent)); background: white; }
.day-event-time { grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: 11px; font-weight: 800; }
.day-event-item strong { overflow: hidden; font: 700 15px/1.25 Georgia, serif; text-overflow: ellipsis; }
.day-event-venue { overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }

main.calendar-view { padding: 12px 18px 18px; }
main.calendar-view .content-header { margin-bottom: 10px; }

.map-layout {
  grid-template-columns: 430px minmax(0, 1fr); height: calc(100vh - 90px); min-height: 570px;
}
.map-sidebar { order: 0; border-left: 0; border-right: 1px solid var(--line); padding: 0; background: #f7f5ef; }
#map { order: 1; }
.map-list-intro { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #ebe9e2; }
.map-list-intro span { color: var(--muted); font-size: 11px; }
.map-group { padding: 15px 14px 2px; }
.map-group h3 { margin: 0 0 5px; color: var(--muted); font: 800 10px sans-serif; letter-spacing: 1.3px; text-transform: uppercase; }
.map-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 11px; align-items: center; padding: 9px 0; }
.map-item img { width: 64px; height: 52px; border-radius: 6px; object-fit: cover; background: #52665d; }
.map-item strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.map-item small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.map-item:hover strong { color: var(--accent); }
.unmapped-note { margin: 14px; border-radius: 6px; padding: 10px; color: var(--muted); background: #eceae4; font-size: 11px; }
.leaflet-popup-content button { min-height: 26px; font-size: 12px; }

.drawer-body { padding: 22px 31px 60px; }
.drawer-hero { position: relative; height: 176px; overflow: hidden; margin: 0; background: #52665d; }
.drawer-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,24,19,.22), transparent 42%); pointer-events: none; }
.drawer-hero img { width: 100%; height: 100%; display: block; object-fit: cover; }
.drawer-hero .category { border-radius: 14px; padding: 5px 9px; color: white; background: rgba(14,27,22,.74); backdrop-filter: blur(5px); }
.drawer-hero .category::before { background: white; }
.drawer-hero .icon-button { border-color: rgba(255,255,255,.7); color: white; background: rgba(14,27,22,.6); text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.drawer-why { margin: 16px 0; }
.occurrence-drawer-hero::after { background: linear-gradient(180deg, rgba(12,24,19,.25), rgba(73,53,10,.22)); }
.occurrence-drawer-parent { color: #7a651f; }
.occurrence-drawer-parent button { border: 0; padding: 0; color: inherit; background: transparent; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.occurrence-drawer-body h2 { margin-bottom: 14px; font-size: 29px; line-height: 1.08; }
.selected-occurrence { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; align-items: center; border: 1px solid #dfc982; border-radius: 10px; margin-bottom: 12px; padding: 10px; background: #fffaf0; }
.selected-occurrence > .date-tile { width: auto; min-height: 88px; }
.selected-occurrence-copy { min-width: 0; display: grid; gap: 4px; }
.selected-occurrence-copy strong { font: 700 16px Georgia, serif; }
.selected-occurrence-copy span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.selected-occurrence-status { border-radius: 9px; margin: 16px 0; padding: 13px; background: #f0efe9; }
.selected-occurrence-status > strong { display: block; margin-bottom: 9px; font: 700 14px Georgia, serif; }
.selected-occurrence-status .occurrence-status-buttons { margin: 0; }
.occurrence-parent-context { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.occurrence-parent-context > span { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.occurrence-parent-context h3 { margin: 5px 0 7px; font: 700 18px Georgia, serif; }
.occurrence-parent-context p { margin: 0; color: var(--muted); line-height: 1.5; }

@media (max-width: 1500px) {
  .control-bar > label > span { display: none; }
  .range-toggle button { padding-inline: 7px; }
  .control-bar { gap: 6px; }
  .control-bar select { max-width: 98px; }
  .interested-toggle { margin-left: 0; }
  .interested-toggle > span:not(.interested-star):not(.toggle-track) { display: none; }
  .interested-toggle .interested-star { display: inline; }
  .interested-toggle .toggle-track { display: inline-flex; }
  .view-switcher button { padding-inline: 10px; }
}

@media (max-width: 1200px) {
  .topbar { grid-template-columns: 220px minmax(540px, 1fr) auto; gap: 10px; padding-inline: 14px; }
  .control-bar { gap: 6px; }
  .control-bar > label { font-size: 8px; }
  .control-bar select { max-width: 96px; }
  .view-switcher button { padding-inline: 9px; }
  #add-event { display: none; }
  .event-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .map-layout { grid-template-columns: 360px minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .drawer { width: 100vw; }
  .drawer-body { padding: 20px 20px 50px; }
  .drawer-hero { height: 158px; }
  .drawer-action-bar { flex-wrap: wrap; }
  .listing-options { margin-left: 0; }
  .listing-options-panel { right: auto; left: 0; }
  .detail-date-meta { display: grid; gap: 6px; }
}
