:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --accent: #1c1917;
  --error: #b91c1c;
  --forecast: #a8a29e;
  --event: #d97706;
  --event-bg: #fef3c7;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --line: #292524;
    --accent: #f5f5f4;
    --error: #f87171;
    --forecast: #57534e;
    --event: #b45309;
    --event-bg: #3a2a12;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
button, input, select {
  font: inherit;
  color: inherit;
}
button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
input, select {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 10px;
}

header.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header.bar h1 { font-size: 16px; margin: 0; font-weight: 600; }
header.bar .spacer { flex: 1; }
header.bar nav a { color: var(--muted); text-decoration: none; margin-left: 14px; }
header.bar nav a:hover { color: var(--text); }

main { max-width: 560px; margin: 0 auto; padding: 20px 16px 80px; }
main.wide { max-width: 860px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Feed */
.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.post-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
}
.post-head a.user { font-weight: 600; text-decoration: none; }
.post-head .time { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
.carousel { position: relative; background: #000; }
.carousel .track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel .track::-webkit-scrollbar { display: none; }
.carousel .slide { flex: 0 0 100%; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; }
.carousel img, .carousel video { width: 100%; max-height: 80vh; object-fit: contain; display: block; }
.carousel .missing { color: #a8a29e; padding: 80px 20px; font-size: 13px; }
.carousel .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: #f5f5f4;
  color: #1c1917;
}
.carousel .arrow.prev { left: 8px; }
.carousel .arrow.next { right: 8px; }
.carousel .count {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #1c1917;
  color: #f5f5f4;
}
.post-body { padding: 12px 14px 14px; }
.caption { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
.caption.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; padding: 0; background: none; color: var(--muted); margin: -6px 0 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }
.meta a { margin-left: auto; }

button.link { border: 0; padding: 0; background: none; color: inherit; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.comment p { margin: 0; overflow-wrap: anywhere; }
.comment .user { font-weight: 600; text-decoration: none; }
.comment-meta { color: var(--muted); font-size: 12px; margin: 2px 0 10px; }
.replies { margin-left: 16px; padding-left: 10px; border-left: 2px solid var(--line); }
.comments-note { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* Story cards */
.story-card .carousel .slide { aspect-ratio: 9 / 16; max-height: 70vh; }
.story-card .carousel img, .story-card .carousel video { height: 100%; }
.story-card .post-head .pill { margin-left: 2px; }
.story-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 13px; }
.story-info a { color: var(--text); }
.story-info .push { margin-left: auto; }
.story-link { border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; text-decoration: none; }

/* Events */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; padding: 4px 12px; background: var(--surface); color: var(--muted); }
.segmented button.on { background: var(--accent); color: var(--bg); }
.event-day h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 28px 0 10px; }
.event { display: grid; grid-template-columns: 124px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.event-time { font-size: 13px; color: var(--muted); padding-top: 2px; }
.event h3 { font-size: 16px; margin: 0 0 4px; }
.event p { margin: 0 0 4px; }
.event-place a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 2px; }
.event-meta { display: flex; gap: 12px; font-size: 13px; }
.event-meta a { color: inherit; }
.event-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.event-sources .source { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.event-sources img, .thumb-blank { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; background: var(--line); display: inline-block; }
button.source { border: 0; background: none; padding: 2px 4px 2px 0; border-radius: 6px; font-size: 12px; color: var(--muted); }
button.source:hover span:last-child { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.source.active { color: var(--text); font-weight: 600; }
.source.gone { opacity: 1; color: var(--line); }
.event h3 .pill { display: inline-block; }
.pill.format { margin-left: 8px; vertical-align: 2px; font-weight: 400; }
.pill.virtual { color: var(--text); border-color: var(--text); }

/* Events admin */
main.events-admin { max-width: 720px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.toolbar .spacer { flex: 1; }
.segmented .count:not(:empty) { margin-left: 4px; font-variant-numeric: tabular-nums; }
.event-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.event-actions button { font-size: 13px; padding: 4px 10px; }
.add-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; background: var(--surface); }
.add-box .event { border-top: 0; padding: 0; }

/* Edit mode: same grid as the view, with inputs where the text was. Inputs are pulled left by their padding and
   border so their text lines up with the view’s. */
.event.editing .event-main { display: flex; flex-direction: column; gap: 6px; }
.ev-input { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 6px; margin-left: -7px; min-width: 0; }
.ev-input:focus { outline: none; border-color: var(--text); }
textarea.ev-input { resize: vertical; line-height: 1.4; width: calc(100% + 7px); }
.ev-input::placeholder { color: var(--muted); opacity: 1; }
.ev-title-row { display: flex; gap: 8px; align-items: center; }
.ev-title { flex: 1; font-size: 16px; font-weight: 600; }
select.ev-format { margin-left: 0; font-size: 12px; padding: 2px 4px; border-radius: 999px; }
.ev-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ev-row:not(:has(.ev-opt:not([hidden]))) { display: none; }
.ev-opt { display: contents; }
.ev-opt[hidden] { display: none; }
.ev-venue { flex: 1 1 140px; } .ev-address { flex: 2 1 200px; }
.ev-price { flex: 0 1 120px; font-size: 13px; } .ev-url { flex: 1 1 200px; font-size: 13px; }
.ev-when { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ev-when .ev-input { font-size: 13px; width: calc(100% + 7px); }
.ev-when .ev-label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.ev-times { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.ev-add { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-add[hidden] { display: none; }
button.chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; color: var(--muted); background: none; }
button.chip:hover { color: var(--text); border-color: var(--text); }
.event.editing .error { margin: 0; }
.event.editing .error:empty { display: none; }
.event.editing .event-sources { margin-top: 2px; }

.event.editing { position: relative; }
.place-menu { position: absolute; z-index: 20; max-width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.08); padding: 4px; display: flex; flex-direction: column; }
.place-menu[hidden] { display: none; }
.place-option { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 0;
  background: none; border-radius: 6px; padding: 6px 8px; font-size: 14px; color: var(--text); }
.place-option.on { background: var(--bg); }
.place-kind { margin-left: 8px; font-size: 12px; color: var(--muted); }
.place-address { font-size: 12px; color: var(--muted); }
.place-credit { font-size: 11px; color: var(--muted); padding: 4px 8px 2px; }

/* Public events page */
.event-from { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.event-from a { color: inherit; }
body.public .event-sources { font-size: 13px; }
body.public .event-sources a { color: inherit; }
.public-note { color: var(--muted); font-size: 13px; margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 640px) { .event { grid-template-columns: 1fr; gap: 4px; } }

/* Admin */
.health { border: 1px solid var(--error); border-radius: var(--radius); padding: 12px 16px; }
.health h2 { color: var(--error); margin-bottom: 6px; }
.health p { margin: 6px 0; }
.attention { color: var(--error); }
section { margin-bottom: 40px; }
section h2 { font-size: 15px; margin: 0 0 12px; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; }
form.inline input[type=text] { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); }
td.actions { white-space: nowrap; text-align: right; }
td.actions button { padding: 3px 9px; font-size: 13px; }
.error { color: var(--error); font-size: 13px; }
.usage-line { margin: 0 0 8px; }
.meter { display: flex; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; max-width: 520px; margin-bottom: 12px; }
.meter > div { height: 100%; }
.meter .spent { background: var(--text); }
.meter .projected { background: var(--forecast); }
select.override { font-size: 13px; padding: 2px 6px; margin-bottom: 2px; max-width: 100%; }
.pill { font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.settings { display: grid; grid-template-columns: auto 120px; gap: 10px 16px; align-items: center; max-width: 520px; }
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
}
.meter .spent.warn { background: var(--error); }

/* Events review: one event at a time, its card beside the posts, stories and event pages it came from. The card
   stays in view while the sources scroll. On phones they stack, card first. */
main.events-admin { max-width: 1180px; }
body.review-page main.events-admin > .toolbar { position: sticky; top: 49px; z-index: 5; background: var(--bg); padding: 8px 0; margin: -8px 0 8px; }
.review-nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
.review-nav .spacer { flex: 1; }
.review-count { font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.review-keys { font-size: 12px; margin-left: 8px; }
.review-one { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.review-event { position: sticky; top: 104px; order: 2; }
.review-event .event { margin: 0; }
.same-day { margin-top: 18px; }
.same-day h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.same-day ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.same-day-row { display: flex; align-items: baseline; gap: 10px; width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: none; padding: 7px 2px; text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.same-day-row:hover, .same-day-row[aria-expanded="true"] { background: var(--surface); }
.same-day-time { flex: 0 0 72px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.same-day-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.same-day-row .pill { flex: none; }
.same-day-row .pill.status-pending { border-color: var(--event); }
.review-event h2.review-day { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.review-sources { display: flex; flex-direction: column; gap: 16px; order: 1; min-width: 0; }
.review-sources .post, .review-feed .post { margin: 0; }
.review-feed { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.page-source .post-head .spacer { flex: 1; }
.page-shot-full { display: block; width: 100%; height: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shot-wait { padding: 12px; margin: 0; font-size: 13px; }
.pane-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
@media (max-width: 899px) {
  .review-one { grid-template-columns: minmax(0, 1fr); }
  .review-event { position: static; order: 0; }
  .review-sources { order: 1; }
  body.review-page main.events-admin > .toolbar { position: static; margin: 0 0 8px; }
  body.review-page main.events-admin > .toolbar > .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  body.review-page main.events-admin > .toolbar > .segmented button { white-space: nowrap; padding: 4px 8px; }
}
.post.has-events { border-color: var(--event); box-shadow: 0 0 0 1px var(--event); }
.card-events { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.event-chip { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--event); background: var(--event-bg); color: var(--text); text-align: left; }
.event-chip[data-event-status="rejected"] { border-color: var(--line); background: none; color: var(--muted); text-decoration: line-through; }
.event-chip[data-event-status="approved"]::before { content: "✓ "; }
.read-state { font-size: 12px; color: var(--muted); margin: 0; padding: 0 12px 10px; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--event); } 100% { box-shadow: 0 0 0 0 transparent; } }
.post.has-events.flash { animation-name: flash-keep; }
@keyframes flash-keep { 0%, 30% { box-shadow: 0 0 0 3px var(--event); } 100% { box-shadow: 0 0 0 1px var(--event); } }
.event.linked h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.event.flash { border-radius: 8px; }

/* Collapsed feed items on the review page */
button.collapse-btn { display: inline-flex; align-items: center; justify-content: center; align-self: center; width: 26px; height: 26px;
  padding: 0; margin: -4px -6px -4px 2px; border: 0; border-radius: 6px; background: none; color: var(--muted); }
button.collapse-btn:hover { color: var(--text); background: var(--bg); }
button.collapse-btn svg { transition: transform 0.15s; }
.post.collapsed button.collapse-btn svg { transform: rotate(180deg); }
.collapsed-snippet { display: none; }
.post.collapsed .carousel, .post.collapsed .post-body, .post.collapsed .read-state { display: none; }
.post.collapsed .collapsed-snippet { display: block; margin: 0; padding: 0 14px 10px; font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post.collapsed { margin-bottom: 8px; }
.post.collapsed .post-head { padding-bottom: 8px; }

/* Public page password */
main.public-login { max-width: 360px; padding-top: 18vh; }
main.public-login h1 { font-size: 20px; margin: 0 0 6px; }
main.public-login form { display: flex; gap: 8px; margin-top: 16px; }
main.public-login input { flex: 1; min-width: 0; }

/* Public page: Subscribe menu */
.subscribe { position: relative; }
.subscribe summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; font-size: 14px; background: var(--surface); }
.subscribe summary::-webkit-details-marker { display: none; }
.subscribe[open] summary { border-color: var(--text); }
.subscribe-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 240px; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); }
.subscribe-menu p { margin: 0; font-size: 13px; }
.subscribe-menu a, .subscribe-menu button.link { color: var(--text); font-size: 14px; text-align: left; text-decoration: none; }
.subscribe-menu a:hover, .subscribe-menu button.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.segmented button { white-space: nowrap; }
/* The public pages have no header bar: the events page opens with its intro, and the calendar menu opens under
   the intro's “add the feed to your calendar app” link (positioned by events.js). */
main.public-home { position: relative; }
main.public-home > .subscribe-menu { right: auto; }
/* The menu sets display: flex, which would otherwise override the hidden attribute and leave it always open. */
.subscribe-menu[hidden] { display: none; }
main.notify { padding-top: 32px; }
.site-home { margin: 0 0 6px; }

/* Public notifications */
.notify-link { font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.notify-link:hover { color: var(--text); }
header.bar h1 a.home { color: inherit; text-decoration: none; }
button.remind { font-size: 12px; padding: 3px 10px; border-radius: 999px; margin-top: 6px; color: var(--muted); }
button.remind:hover { color: var(--text); border-color: var(--text); }
button.remind.on { color: var(--text); background: var(--event-bg); border-color: var(--event); }
main.notify { max-width: 640px; }
main.notify h2 { font-size: 15px; margin: 32px 0 6px; }
main.notify section > h2:first-child { margin-top: 8px; }
main.notify .segmented { margin: 12px 0; }
form.start { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin: 8px 0; }
form.start input[type=email], form.start input[type=tel] { flex: 1 1 220px; min-width: 0; }
form.start > p { flex-basis: 100%; margin: 4px 0 0; }
.consent { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); order: 2; }
.consent input { margin-top: 3px; }
form.start button { order: 1; }
.start-result, .start-result.error { margin-top: 4px; }
.contacts { display: grid; gap: 6px; }
.contact { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.contact-label { width: 48px; color: var(--muted); font-size: 13px; }
table.prefs { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.prefs th, table.prefs td { border-top: 1px solid var(--line); padding: 10px 6px; vertical-align: top; }
table.prefs thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 500; text-align: center; padding-bottom: 4px; }
table.prefs tbody th { text-align: left; font-weight: normal; }
table.prefs td { text-align: center; width: 56px; }
table.prefs input[type=checkbox] { width: 18px; height: 18px; }
.pref-name { display: block; font-weight: 600; }
.pref-desc { display: block; font-size: 13px; color: var(--muted); }
.pref-desc select { font-size: 13px; padding: 1px 4px; }
.pref-format { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 14px; font-size: 14px; }
.pref-format .segmented { margin: 0; }
ul.marks { list-style: none; padding: 0; margin: 8px 0; }
ul.marks li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
ul.marks li button { margin-left: auto; }
.account-actions { display: flex; gap: 18px; margin-top: 36px; font-size: 13px; }
button.link.danger { color: var(--error); }
main.policy { max-width: 640px; padding-top: 32px; }
main.policy h1 { font-size: 22px; margin: 6px 0 14px; }
main.policy h2 { font-size: 15px; margin: 22px 0 4px; }
main.policy li { margin: 4px 0; }
.notify-switch { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
form.notify-names { margin: 8px 0; }
form.notify-review { margin: 12px 0 4px; align-items: center; }
form.notify-review input { flex: 1; max-width: 280px; }
table.notify-log { width: 100%; font-size: 13px; border-collapse: collapse; }
table.notify-log td { border-top: 1px solid var(--line); padding: 6px 8px 6px 0; vertical-align: top; }
.notify-preview pre { white-space: pre-wrap; font: 12px/1.4 ui-monospace, monospace; margin: 4px 0; }
.notify-preview summary { cursor: pointer; }
form.start[hidden], main.notify section[hidden] { display: none; }
table.prefs tbody th { color: var(--text); }
.policy-nav { font-size: 13px; margin-top: 32px; }
.policy-nav a { color: inherit; text-underline-offset: 2px; }
main.policy ul { padding-left: 20px; }
.public-intro { font-size: 20px; line-height: 1.35; font-weight: 500; margin: 24px 0 0; }
.public-lead { color: var(--muted); margin: 8px 0 0; }

/* Category filter (public page) and category labels */
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 4px; }
.cat-filter button.chip.cat { font-size: 13px; padding: 4px 12px; color: var(--text); border: 1px solid var(--line); }
.cat-filter button.chip.cat .count { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.cat-filter button.chip.cat.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.cat-filter button.chip.cat.on .count { color: inherit; }
.cat-clear { font-size: 13px; color: var(--muted); }
.event-cats { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ev-cats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.ev-cats button.chip.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ev-cats .muted { font-size: 12px; }
.pref-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 12px; font-size: 14px; }
.pref-cats .cat-filter { margin: 0; }
.pref-cats .muted { font-size: 13px; }
.email-note {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  background: var(--accent);
  color: var(--bg);
  padding: 8px 8px 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 20;
}
.email-note button { font-size: 13px; padding: 3px 10px; background: none; color: inherit; border: 1px solid currentColor; border-radius: 6px; }
.email-note button.plain { background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; padding: 0 6px; }

/* Recurring events page */
a.button { display: inline-block; font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; background: var(--surface); }
a.button:hover { border-color: var(--text); }
.recurring .toolbar p { margin: 0; font-size: 14px; }
.series-rule { margin: 2px 0 0; font-size: 14px; }
.series-dates { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; align-items: center; }
.series-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 99px; }
.series-date button.link { font-size: 13px; color: var(--muted); padding: 0 6px; text-decoration: none; }
.series-date button.link:hover { color: var(--text); }
.series-date.deleted .series-date-label { text-decoration: line-through; color: var(--muted); }
.series-date.deleted button.link { text-decoration: underline; text-underline-offset: 2px; }
.series-form { display: flex; flex-direction: column; gap: 10px; border-top: 0; }
.series-form input, .series-form select, .series-form textarea { font: inherit; font-size: 14px; }
.series-form .ev-title-row input[name=title] { flex: 1; font-size: 16px; font-weight: 600; }
.sf-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; }
.sf-field { display: contents; }
.sf-label { font-size: 13px; color: var(--muted); }
.sf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sf-row[hidden], .sf-days[hidden], .sf-weekday[hidden] { display: none; }
.sf-num { width: 4.5em; }
.sf-place input { flex: 1; min-width: 200px; }
.sf-row > input[name=price] { width: 10em; }
.sf-row > input[name=url] { flex: 1; }
.sf-preview { margin: 0; font-size: 13px; }
.series-form textarea { width: 100%; box-sizing: border-box; }
.event-actions a.button { font-size: 13px; padding: 4px 10px; }
.series-date a.series-date-label { color: inherit; text-decoration: none; }
.series-date a.series-date-label:hover { text-decoration: underline; text-underline-offset: 2px; }
.series-date.edited { border-color: var(--text); }
.series-note, .ev-series-note { font-size: 13px; margin: 4px 0 0; }

/* Event descriptions keep the line breaks typed or scraped into them. */
.event-details { white-space: pre-line; overflow-wrap: anywhere; }

/* Screenshot → event (events review page) */
.shot-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.shot-thumb { width: 120px; max-height: 200px; object-fit: contain; object-position: top left; border: 1px solid var(--line); border-radius: 6px; flex: none; cursor: zoom-in; }
.shot-thumb.big { width: 100%; max-height: none; cursor: zoom-out; }
.shot-head:has(.big) { flex-direction: column; }
.shot-event + .shot-event { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.shot-event .event { border-top: 0; padding: 0; }
/* Collapsed: the first paragraph, cut at four whole lines; “More” follows. */
.event-details.clamped { max-height: 4lh; overflow: hidden; position: relative; }
/* The last line and a half fade into the page background (a color blend, not see-through text). */
.event-details.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.6lh; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg)); }
.details-wrap .more { background: none; border: 0; padding: 0; margin: -2px 0 6px; font: inherit; font-size: 14px; color: var(--text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.public-lead a { color: inherit; text-underline-offset: 2px; }

/* Public page: Remind me + Add to calendar under each event */
.event-buttons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.event-buttons button.remind { margin-top: 0; }
details.addcal { position: relative; }
details.addcal summary { list-style: none; cursor: pointer; font-size: 12px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); }
details.addcal summary::-webkit-details-marker { display: none; }
details.addcal summary:hover, details.addcal[open] summary { color: var(--text); border-color: var(--text); }
.addcal-menu { left: 0; right: auto; width: 220px; gap: 10px; }
main.notify h3.start-label { font-size: 14px; font-weight: 600; margin: 18px 0 0; }
main.notify .start-result:empty { display: none; }
.privacy-line { font-size: 13px; margin-top: 6px; }
.privacy-line a { color: inherit; text-underline-offset: 2px; }
.contact-check:empty { display: none; }
.contact-check { margin: 8px 0; }

/* The contact email placeholder (“our email address”) until the address loads: underlined, with a tooltip. */
.contact-email.pending { position: relative; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; cursor: help; outline-offset: 2px; }
.contact-tip { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(calc(-50% + var(--shift, 0px)));
  width: max-content; max-width: min(280px, calc(100vw - 16px)); padding: 8px 10px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 13px; line-height: 1.4; font-weight: 400; text-align: left;
  white-space: normal; z-index: 30; pointer-events: none; visibility: hidden; }
.contact-email.pending:hover .contact-tip, .contact-email.pending:focus .contact-tip { visibility: visible; }

/* Public page: in person / virtual chips, then the category chips, under the intro. */
.public-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 14px 0 4px; }
.public-filters .cat-filter { margin: 0; }

/* Public page: List / Month switch at the end of the filters row. */
/* List / Month icons: right of the first day’s heading, or of the month header. */
.view-switch button { display: grid; place-items: center; padding: 5px 9px; }
.view-switch svg { display: block; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 10px; }
.day-head h2 { margin: 0; }
/* Wider than the list column: fills the window (with margins) up to 1440px on big screens. */
.month { width: min(1440px, calc(100vw - 64px)); position: relative; left: 50%; transform: translateX(-50%); margin: 20px 0 4px; }
@media (max-width: 640px) { .month { width: calc(100vw - 32px); } }
.month-head { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; min-height: 32px; }
.month-nav-group { display: flex; align-items: center; gap: 16px; }
.month-head .view-switch { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.month-head h2 { font-size: 17px; margin: 0; min-width: 11em; text-align: center; }
.month-nav { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; width: 32px; height: 32px; font-size: 18px; line-height: 1; padding: 0; }
.month-nav:disabled { color: var(--line); cursor: default; }
.month-dows, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); }
.month-dows { border-top: 1px solid var(--line); }
/* Equal rows, each as tall as the busiest day needs (1fr rows in an auto-height grid share the tallest content). */
.month-grid { grid-auto-rows: minmax(92px, 1fr); }
.month-dows .dow { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month-grid .day { padding: 4px 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.month-grid .day.blank, .month-grid .day.past { background: var(--bg); }
.month-grid .day.past .day-num { color: var(--line); }
.day-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 2px; }
.day.today .day-num { color: var(--bg); background: var(--accent); border-radius: 999px; padding: 0 6px; align-self: flex-start; }
.day-events { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.day-event { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: 4px; padding: 1px 3px;
  font: inherit; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); cursor: pointer; }
.day-event:hover, .day-event:focus-visible { background: var(--bg); }
.day-time { color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.day-dots { display: none; gap: 3px; margin-top: auto; border: 0; background: none; padding: 4px; }
.day-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--event); }
/* Event popover (desktop: beside the event; phones: a bottom sheet). */
.event-pop { position: absolute; z-index: 40; width: min(440px, calc(100vw - 24px)); max-height: min(70vh, 620px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 8px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); }
.pop-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 6px; background: var(--surface);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); z-index: 1; }
.pop-close { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 2px; cursor: pointer; }
.event-pop .event { grid-template-columns: 1fr; gap: 4px; }
.event-pop .event-details.clamped::after { background: linear-gradient(to bottom, color-mix(in srgb, var(--surface) 0%, transparent), var(--surface)); }
/* Phones: dots instead of titles; tapping a day opens its events in a sheet. */
@media (max-width: 640px) {
  .month-grid { grid-auto-rows: minmax(52px, auto); }
  .month-grid .day { align-items: center; }
  .month-grid .day.has { cursor: pointer; }
  .day-events { display: none; }
  .day-dots { display: flex; }
  .month-head h2 { min-width: 0; }
  .month-head { justify-content: flex-start; }
  .month-nav-group { gap: 10px; }
  .event-pop { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 80vh; border-radius: 14px 14px 0 0; border-bottom: 0; }
}
}
/* Until the first render places it. */
main > .view-switch { display: none; }

/* Events review: a source with a “Separate” action beside it. */
.source-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-row .separate { font-size: 12px; }
.source-row .shot-toggle { padding: 0; margin-right: -2px; }
.source-row .shot-toggle img { width: 28px; height: 28px; object-fit: cover; object-position: top; }
.source-row .shot-toggle.active img { outline: 2px solid var(--text); outline-offset: 1px; }
.event-sources .page-shot { display: block; flex-basis: 100%; width: 100%; max-width: 560px; height: auto; border: 1px solid var(--line); border-radius: 6px; margin: 4px 0 6px; }
.event-sources .page-shot[hidden] { display: none; }

/* Phones: the header scrolls away with the page, and the event editor lays out for a narrow column. */
@media (max-width: 640px) {
  header.bar { position: static; }
  .editing .ev-when { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .editing .ev-when .ev-input { width: auto; }
  .editing .ev-when .ev-label { flex-direction: row; align-items: center; gap: 6px; }
  .editing .ev-times { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: auto; }
  .editing .ev-venue, .editing .ev-address { flex: 1 1 100%; }
}
textarea.autogrow { resize: none; overflow: hidden; }

/* Phones and narrow windows: the review page's header scrolls away. */
@media (max-width: 899px) {
  body.review-page header.bar { position: static; }
}
