:root {
  --bg: #ffffff;
  --surface: #f6f8f0;
  --line: #e5e9db;
  --line-strong: #cbd3b9;
  --ink: #1f261c;
  --ink-soft: #55604f;
  --ink-faint: #8a9484;
  --header: #5b8c33;
  --header-ink: #ffffff;
  --accent: #4d7c2a;
  --accent-ink: #ffffff;
  --accent-soft: #eef4e2;
  --today: #f2f7ea;
  --today-line: #e3a614;
  --weekend: #fafbf7;
  --warn: #9a3412;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(30, 45, 20, 0.16);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next", "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a13;
    --surface: #1c2219;
    --line: #2c3528;
    --line-strong: #3d4937;
    --ink: #e9eee5;
    --ink-soft: #b5bfae;
    --ink-faint: #7f8a78;
    --header: #3f6524;
    --header-ink: #ffffff;
    --accent: #93c45a;
    --accent-ink: #12190d;
    --accent-soft: #222e1b;
    --today: #1e2a18;
    --today-line: #d9a21b;
    --weekend: #181e16;
    --warn: #fb923c;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--today-line); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site { background: var(--header) url(/ridge.svg) bottom center / 1440px 40px repeat-x; color: var(--header-ink); padding-bottom: 14px; }
.site-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font: 800 20px/1 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; }
.brand-sub { font: 600 13px/1.2 var(--font-display); letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.85; }
.subscribe-link { color: inherit; font-weight: 600; font-size: 15px; text-decoration: none; border: 1.5px solid currentColor; border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
.subscribe-link:hover { background: rgba(255, 255, 255, 0.12); }

.intro { padding: 28px 0 8px; }
.intro h1 { font: 800 clamp(26px, 4vw, 38px)/1.15 var(--font-display); margin: 0 0 6px; letter-spacing: -0.01em; }
.intro p { margin: 0; color: var(--ink-soft); }

/* Controls */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 20px 0 14px; }
.month-nav { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.month-title { font: 750 clamp(22px, 3.2vw, 32px)/1 var(--font-display); letter-spacing: -0.01em; margin: 0 0 0 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--bg); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 16px; height: 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-strong); background: var(--bg); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); color: var(--accent-ink); }

.seg { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 14px; font-weight: 600; font-size: 15px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.filters select { border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--bg); padding: 7px 34px 7px 14px; font-size: 15px; font-weight: 600; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; max-width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; background: var(--bg); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .tick { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-strong); display: inline-grid; place-items: center; }
.chip input:checked + .tick { background: var(--accent); border-color: var(--accent); }
.chip input:checked + .tick::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.chip input:focus-visible + .tick { outline: 3px solid var(--today-line); outline-offset: 2px; }
.chip .count { color: var(--ink-faint); font-weight: 500; }

.kinds { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 16px; }
.kind { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); border-radius: 999px; padding: 4px 11px 4px 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.kind:hover { border-color: var(--line-strong); color: var(--ink); }
.kind[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.kind-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Month grid */
.grid { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.grid-head, .grid-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.grid-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.grid-head div { text-align: center; padding: 9px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.grid-week + .grid-week { border-top: 1px solid var(--line); }
.cell { min-height: 118px; padding: 6px 6px 8px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.cell:first-child { border-left: 0; }
.cell.out { background: var(--surface); }
.cell.out .daynum { color: var(--ink-faint); opacity: 0.6; }
.cell.past .daynum { color: var(--ink-faint); }
.cell.weekend { background: var(--weekend); }
.cell.today { background: var(--today); }
.daynum { font: 650 14px/1 var(--font-display); align-self: center; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 2px; }
.cell.today .daynum { background: var(--accent); color: var(--accent-ink); }
.daybtn { border: 0; background: none; padding: 0; cursor: pointer; width: 100%; }
.bar { display: block; width: 100%; border: 0; border-left: 3px solid; text-decoration: none; border-radius: 3px 5px 5px 3px; padding: 3px 6px 3px 5px; font-size: 12px; font-weight: 600; line-height: 1.3; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.bar:hover { filter: saturate(1.25) brightness(0.98); }
.bar-time { font-weight: 500; opacity: 0.85; }
.bar-star, .star { color: #c58a00; }
.bar.canceled { text-decoration: line-through; opacity: 0.7; }
.more { border: 0; background: none; padding: 1px 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: left; cursor: pointer; }
.more:hover { color: var(--accent); text-decoration: underline; }
.dots { display: none; justify-content: center; gap: 3px; flex-wrap: wrap; padding-top: 2px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }

/* Day panel (phones) and list view */
.day-panel { margin-top: 18px; }
.day-panel h3, .list-day { font: 800 15px/1.3 var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 22px 0 8px; }
.list-day:first-child { margin-top: 4px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { color: inherit; text-decoration: none; display: grid; grid-template-columns: 6px 82px minmax(0, 1fr); gap: 0 14px; align-items: stretch; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: 0; cursor: pointer; overflow: hidden; }
.card:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }
.card .swatch { width: 6px; }
.card .when { padding: 12px 0; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.card .what { padding: 11px 14px 11px 0; min-width: 0; }
.card .t { font-weight: 700; font-size: 16px; line-height: 1.3; }
.card .w { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.card .s { color: var(--ink-faint); font-size: 12px; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.card.has-thumb { grid-template-columns: 6px 82px minmax(0, 1fr) 76px; }
.thumb { width: 76px; height: 100%; min-height: 76px; object-fit: cover; display: block; background: var(--surface); }
.flag-note { color: var(--warn); text-transform: none; letter-spacing: 0; }
.bar-flag { font-weight: 800; }
.tag-canceled { display: inline-block; background: #b91c1c; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px; }
.empty { color: var(--ink-soft); padding: 24px 0; }

/* Event box */
dialog.event { border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow); background: var(--bg); color: var(--ink); overflow: auto; }
dialog.event::backdrop { background: rgba(15, 20, 18, 0.55); }
.ev-head { display: flex; gap: 14px; align-items: center; padding: 16px 52px 16px 18px; position: relative; border-top: 6px solid; }
.ev-date { text-align: center; line-height: 1; flex: none; }
.ev-date b { display: block; font: 800 30px/1 var(--font-display); }
.ev-date span { display: block; font: 700 12px/1.4 var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; }
.ev-title { font: 800 20px/1.2 var(--font-display); margin: 0; text-transform: uppercase; letter-spacing: 0.01em; }
.ev-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.75); color: #fff; cursor: pointer; display: grid; place-items: center; }
.ev-close svg { width: 14px; height: 14px; }
.ev-body { padding: 16px 18px 20px; display: grid; gap: 12px; }
.ev-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.ev-row svg { width: 18px; height: 18px; margin-top: 3px; color: var(--ink-soft); }
.ev-gallery { display: grid; gap: 8px; }
.ev-img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; background: var(--surface); }
.ev-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.ev-thumb { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: var(--surface); }
.ev-thumb[aria-pressed="true"] { border-color: var(--accent); }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-diff { border: 1.5px solid #f0b429; background: #fff8e6; color: #3d2c00; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.ev-diff p { margin: 0 0 6px; display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.ev-diff p svg { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.ev-diff dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.ev-diff dt { font-weight: 700; }
.ev-diff dd { margin: 0; }
.ev-diff-src { font-weight: 600; }
@media (prefers-color-scheme: dark) { .ev-diff { background: #2b2410; color: #f6e7bd; border-color: #8a6a12; } }
.ev-desc { white-space: pre-line; color: var(--ink); margin: 0; }
.ev-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ev-source { font-size: 13px; color: var(--ink-faint); margin: 0; }

/* Server list and info sections */
.ssr-heading { font: 800 18px/1.2 var(--font-display); margin: 18px 0 0; }
.ssr-day { font-size: 15px; margin: 18px 0 6px; color: var(--ink-soft); }
.ssr-list { margin: 0; padding-left: 18px; }
.ssr-time { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.ssr-where { color: var(--ink-soft); }
.about { margin: 44px 0 20px; padding: 22px; border-radius: var(--radius); background: var(--accent-soft); }
.about h2 { font: 800 20px/1.2 var(--font-display); margin: 0 0 6px; }
.about p { margin: 6px 0; }
.sub-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 !important; }
.fine { font-size: 14px; color: var(--ink-soft); }
.fine code { word-break: break-all; }
.site-foot { border-top: 1px solid var(--line); margin-top: 28px; padding: 18px 0 32px; color: var(--ink-soft); font-size: 14px; }
.site-foot p { margin: 0 0 8px; max-width: 72ch; }
.status { font-size: 13px; color: var(--ink-faint); margin: 0; }
.status a { color: inherit; }
.status .warn { color: var(--warn); font-weight: 600; }

/* Phones: the grid shows dots, and the chosen day's events list below */
@media (max-width: 720px) {
  .cell { min-height: 58px; padding: 4px 2px 6px; align-items: center; }
  .cell .bar, .cell .more { display: none; }
  .dots { display: flex; }
  .daynum { font-size: 15px; width: 32px; height: 32px; }
  .cell.selected .daynum { background: var(--accent); color: var(--accent-ink); }
  .cell { cursor: pointer; }
  .grid-head div { font-size: 11px; letter-spacing: 0.04em; padding: 8px 0; }
  .card { grid-template-columns: 6px 64px minmax(0, 1fr); gap: 0 10px; }
  .card.has-thumb { grid-template-columns: 6px 64px minmax(0, 1fr) 64px; }
  .thumb { width: 64px; min-height: 64px; }
  .filters select { flex: 1 1 150px; }
  .kinds { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .kind { flex: none; }
  .cell.today .daynum { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
  .toolbar { gap: 10px; }
  .month-title { font-size: 22px; }
  .subscribe-link { font-size: 13px; padding: 5px 10px; }
}
@media (min-width: 721px) {
  .day-panel { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.event[open] { animation: pop 0.16s ease-out; }
  @keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Duplicate review page */
.review { margin: 24px 0; }
.review table { width: 100%; border-collapse: collapse; font-size: 14px; }
.review th, .review td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
.review .differ { color: var(--warn); font-weight: 700; }

/* Event pages, town pages, breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 18px 0 0; margin: 0; font-size: 14px; color: var(--ink-soft); }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--ink-faint); }
.crumbs a { color: var(--ink-soft); }
.event-page { max-width: 820px; }
.ev-article { margin: 16px 0 8px; }
.ev-article-head { border-left: 6px solid var(--accent); padding: 4px 0 4px 16px; margin-bottom: 18px; }
.ev-article-head h1 { font: 800 clamp(26px, 4.2vw, 40px)/1.15 var(--font-display); margin: 6px 0 10px; letter-spacing: -0.01em; }
.ev-when { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.ev-where { margin: 0 0 6px; color: var(--ink-soft); }
.ev-cat { display: inline-block; margin: 4px 0 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.ev-figure { margin: 0 0 12px; }
.ev-figure img { width: 100%; height: auto; max-height: 560px; object-fit: contain; border-radius: var(--radius); background: var(--surface); display: block; }
.ev-more-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.ev-more-pics img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface); }
.ev-text { font-size: 17px; line-height: 1.6; margin: 16px 0; white-space: normal; }
.ev-article .ev-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.ev-article .ev-diff { margin: 14px 0; }
.related h2 { font: 800 18px/1.3 var(--font-display); margin: 28px 0 8px; }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.mini-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mini-list span { color: var(--ink-faint); font-size: 14px; }
.town-nav { margin: 0 0 14px; }
.town-nav h2 { font: 800 14px/1.3 var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; color: var(--ink-soft); }
.town-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.town-nav span { color: var(--ink-faint); font-size: 12px; }
