@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #dfece6;
  --surface: #f6faf8;
  --surface-elevated: #fbfdfc;
  --surface-subtle: #d3e5dc;
  --surface-muted: #e7f2ed;
  --border: #b4cec2;
  --border-strong: #8eb3a2;
  --ink: #092219;
  --ink-secondary: #1d4234;
  --muted: #456659;
  --emerald-950: #071f16;
  --emerald-900: #0b2e22;
  --emerald-800: #103d2d;
  --emerald-700: #14523c;
  --emerald-600: #19684c;
  --accent: #114c38;
  --accent-hover: #0b3627;
  --accent-soft: #d2eadf;
  --accent-border: #87bfa5;
  --gold: #d4a843;
  --gold-bright: #eec868;
  --gold-deep: #966b12;
  --gold-soft: #fbf2d8;
  --gold-border: #dfbe6f;
  --warning-bg: #fbf1d4;
  --warning-border: #d9b252;
  --warning-ink: #684908;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(7, 31, 22, 0.08);
  --shadow-md: 0 6px 20px rgba(7, 31, 22, 0.1), 0 1px 3px rgba(7, 31, 22, 0.06);
  --page-max: 1200px;
  --page-gutter: max(24px, calc((100vw - var(--page-max)) / 2));
  --toolbar-sticky-top: 10px;
  --toolbar-height: 0px;
  --calendar-navigation-height: 0px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; }
select {
  white-space: nowrap;
  text-overflow: ellipsis;
}
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
h1, h2, h3, h4, p { margin-top: 0; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--emerald-950);
  background: var(--gold-bright);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Deep Emerald & Gold Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  padding: 10px var(--page-gutter);
  border-bottom: 1px solid rgba(212, 168, 67, 0.26);
  background: rgba(7, 31, 22, 0.45);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f4faf7;
  text-decoration: none;
}
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.wordmark-mark img { width: 100%; height: 100%; display: block; }
.wordmark-text,
.wordmark > span:last-child {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.wordmark small { display: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(235, 245, 240, 0.8);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.nav-link[aria-current="page"] {
  color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.16);
  border-color: rgba(212, 168, 67, 0.48);
}
.nav-export,
#download-csv {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(212, 168, 67, 0.42);
  border-radius: var(--radius-sm);
  color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.1);
  font-size: 0.82rem;
}
.nav-export:hover,
#download-csv:hover {
  color: var(--emerald-950);
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* Shared Primitives */
.eyebrow {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.button-primary {
  color: #fff;
  background: var(--emerald-700);
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.button-primary:hover {
  background: var(--emerald-800);
}
.button-gold {
  color: var(--emerald-950);
  background: linear-gradient(180deg, #eec868 0%, #d4a843 100%);
  border-color: #b88a24;
}
.button-gold:hover {
  background: linear-gradient(180deg, #f3d27a 0%, #ddb24d 100%);
}
.button-secondary {
  color: var(--ink);
  background: var(--surface-elevated);
  border-color: var(--border-strong);
}
.button-secondary:hover {
  color: var(--emerald-900);
  border-color: var(--gold);
  background: var(--gold-soft);
}
.button-compact {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.count-pill {
  margin: 0;
  padding: 4px 11px;
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-deep);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Platform Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--emerald-900);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-past {
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
}
.badge[data-platform="QuickFeis"],
.source-badge[data-platform="QuickFeis"] {
  color: #0b3b29;
  background: #d0ecdf;
  border-color: #79be9f;
}
.badge[data-platform="FeisWorx"],
.source-badge[data-platform="FeisWorx"] {
  color: #6b4906;
  background: #faecc8;
  border-color: #d8b055;
}
.badge[data-platform="iFeis"],
.source-badge[data-platform="iFeis"] {
  color: #114a4f;
  background: #d4eef0;
  border-color: #7dc0c5;
}
.badge[data-platform="FeisFWD"],
.source-badge[data-platform="FeisFWD"] {
  color: #78330d;
  background: #fbe5d4;
  border-color: #e4ac83;
}

/* Deep Forest & Gold Masthead / Hero */
.hero {
  border-bottom: 1px solid rgba(212, 168, 67, 0.28);
  color: #f2f8f5;
  background: linear-gradient(165deg, var(--emerald-950) 0%, var(--emerald-900) 52%, var(--emerald-800) 100%);
}
.hero .eyebrow {
  padding: 3px 9px;
  border: 1px solid rgba(212, 168, 67, 0.45);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.14);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 40px;
  align-items: start;
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 36px;
}
.hero-copy h1 {
  margin: 4px 0 12px;
  color: #ffffff;
  font-size: clamp(2.1rem, 3.7vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.intro {
  max-width: 560px;
  margin: 0 0 22px;
  color: rgba(226, 240, 233, 0.82);
  font-size: 0.98rem;
  line-height: 1.55;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 22px;
  border: 1px solid rgba(212, 168, 67, 0.36);
  border-radius: var(--radius-md);
  background: rgba(6, 24, 17, 0.55);
  overflow: hidden;
}
.stats div {
  padding: 13px 15px;
  border-right: 1px solid rgba(212, 168, 67, 0.22);
}
.stats div:last-child { border-right: 0; }
.stats dt {
  color: var(--gold-bright);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stats dd {
  margin: 3px 0 0;
  color: rgba(218, 235, 227, 0.78);
  font-size: 0.74rem;
  font-weight: 600;
}
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.hero .button-primary {
  color: var(--emerald-950);
  background: linear-gradient(180deg, #eec868 0%, #d4a843 100%);
  border-color: #f5d886;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.hero .button-primary:hover {
  background: linear-gradient(180deg, #f5d57e 0%, #dfB34c 100%);
}
.hero .button-secondary {
  color: #f2f8f5;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 168, 67, 0.45);
}
.hero .button-secondary:hover {
  color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.16);
  border-color: var(--gold-bright);
}
.hero-personal-link {
  margin-left: 6px;
  color: var(--gold-bright);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}
.hero-personal-link:hover { text-decoration: underline; }

/* Next Up Panel inside Deep Emerald Hero */
.next-up-card {
  border: 1px solid rgba(212, 168, 67, 0.36);
  border-radius: var(--radius-lg);
  background: rgba(7, 29, 21, 0.72);
  box-shadow: 0 12px 28px rgba(4, 18, 13, 0.32);
  overflow: hidden;
}
.next-up-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(212, 168, 67, 0.24);
  background: rgba(16, 61, 45, 0.65);
}
.next-up-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(238, 200, 104, 0.22);
}
.next-up-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
}
.next-up-meta {
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
.next-up-list { display: grid; }
.next-up-placeholder {
  margin: 0;
  padding: 20px 16px;
  color: rgba(226, 240, 233, 0.75);
  font-size: 0.85rem;
}
.next-up-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid rgba(212, 168, 67, 0.16);
  background: transparent;
  color: #f4faf7;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}
.next-up-item:last-child { border-bottom: 0; }
.next-up-item:hover { background: rgba(212, 168, 67, 0.1); }
.next-up-date {
  display: grid;
  justify-items: center;
  padding: 4px 0;
  border: 1px solid rgba(212, 168, 67, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(212, 168, 67, 0.14);
  font-variant-numeric: tabular-nums;
}
.next-up-month {
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}
.next-up-day {
  margin-top: 2px;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.1;
}
.next-up-body {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.next-up-name {
  overflow: hidden;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.next-up-sub {
  overflow: hidden;
  color: rgba(214, 232, 223, 0.72);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main Content & Emerald/Gold Sticky Filter Toolbar */
main {
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 72px;
}
.toolbar {
  position: sticky;
  top: var(--toolbar-sticky-top);
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(200px, 0.95fr) minmax(0, 1.55fr);
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(246, 250, 248, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
}
.search-field:focus-within {
  border-color: var(--emerald-700);
  box-shadow: 0 0 0 2px rgba(20, 82, 60, 0.15);
}
.search-field svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--emerald-700);
  stroke-width: 2;
}
.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.9rem;
}
.search-field input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.filters {
  display: grid;
  grid-template-columns: minmax(120px, 0.95fr) minmax(112px, 0.85fr) minmax(156px, 1.2fr);
  gap: 10px;
}
.filters label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--emerald-800);
  font-size: 0.74rem;
  font-weight: 700;
}
.filters select {
  min-width: 0;
  width: 100%;
  height: 36px;
  line-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background-color: var(--surface-elevated);
  font-size: 0.85rem;
  font-weight: 600;
}

/* View Switcher & Section Heading */
.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0 14px;
}
.results-heading h2,
.feeds h2,
.empty-state h2 {
  margin: 0;
  color: var(--emerald-900);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.results-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.view-switcher {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}
.view-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  color: var(--ink-secondary);
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}
.view-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.view-button.is-active {
  color: var(--gold-bright);
  background: var(--emerald-900);
  box-shadow: var(--shadow-sm);
}

/* Monthly Calendar Grid with Deep Emerald Header */
.calendar-view {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: visible;
}
.calendar-navigation {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: calc(var(--toolbar-sticky-top) + var(--toolbar-height) - 1px);
  z-index: 9;
  padding: 13px 16px;
  border-bottom: 1px solid var(--gold);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: #ffffff;
  background: linear-gradient(180deg, var(--emerald-900) 0%, var(--emerald-800) 100%);
}
.calendar-navigation h3 {
  margin: 0;
  color: var(--gold-bright);
  text-align: center;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.calendar-nav-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(212, 168, 67, 0.5);
  border-radius: var(--radius-sm);
  color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.12);
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.calendar-nav-button:hover:not(:disabled) {
  color: var(--emerald-950);
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}
.calendar-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}
.calendar-weekdays,
.calendar-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-grid {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}
.calendar-weekdays {
  position: sticky;
  top: calc(var(--toolbar-sticky-top) + var(--toolbar-height) + var(--calendar-navigation-height) - 2px);
  z-index: 8;
  border-bottom: 1px solid var(--border-strong);
  color: var(--emerald-900);
  background: var(--surface-subtle);
}
.calendar-weekdays span {
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}
.calendar-weekdays span:last-child { border-right: 0; }

body.has-docked-calendar-header .toolbar {
  border-bottom-color: transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: none;
}
body.has-docked-calendar-header .calendar-navigation {
  border-radius: 0;
}
body.has-docked-calendar-header .calendar-weekdays {
  box-shadow: 0 4px 12px rgba(7, 31, 22, 0.1);
}

.calendar-day {
  min-width: 0;
  min-height: 132px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-elevated);
}
.calendar-day:last-child { border-right: 0; }
.calendar-row:last-child .calendar-day { border-bottom: 0; }
.calendar-day.is-outside-month {
  color: #6e8b7e;
  background: #e5f0eb;
}
.calendar-day.is-outside-month .calendar-day-events { display: none; }
.calendar-day-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin: 0 0 6px auto;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.calendar-day.is-today:not(.is-outside-month) .calendar-day-number {
  color: var(--gold-bright);
  background: var(--emerald-900);
  border: 1.5px solid var(--gold);
}
.calendar-day.is-today.is-outside-month .calendar-day-number {
  color: var(--emerald-800);
  border: 1.5px solid var(--gold);
  background: var(--gold-soft);
}
.calendar-day-events {
  display: grid;
  gap: 4px;
}
.calendar-event {
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface-muted);
  cursor: pointer;
  text-align: left;
  transition: filter 0.12s ease;
}
.calendar-event:hover { filter: brightness(0.96); }
.calendar-event.is-continuation { border-style: dashed; }
.calendar-event[data-platform="QuickFeis"] {
  border-color: #82c4a6;
  background: #d9f1e5;
  color: #082e20;
}
.calendar-event[data-platform="FeisWorx"] {
  border-color: #dab866;
  background: #fbf0d2;
  color: #543904;
}
.calendar-event[data-platform="iFeis"] {
  border-color: #86c2c7;
  background: #daf1f3;
  color: #0b3c40;
}
.calendar-event[data-platform="FeisFWD"] {
  border-color: #e0aa80;
  background: #fce9dc;
  color: #632508;
}
.calendar-event-name {
  display: block;
  overflow: hidden;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event-location {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-mobile-hint { display: none; }

/* List View */
.event-list {
  display: grid;
  gap: 8px;
}
.month-heading {
  padding: 22px 2px 6px;
  color: var(--emerald-900);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.event-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}
.date-block {
  display: grid;
  justify-items: center;
  padding: 8px 6px;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}
.date-month {
  color: var(--gold-deep);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.date-day {
  margin: 2px 0;
  color: var(--emerald-900);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.05;
}
.date-range {
  color: var(--muted);
  font-size: 0.68rem;
}
.event-body h3 {
  margin: 0 0 4px;
  color: var(--emerald-900);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.event-place {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.event-note {
  margin: 6px 0 0;
  color: var(--warning-ink);
  font-size: 0.8rem;
}
.event-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.text-action {
  border: 0;
  padding: 0;
  color: var(--emerald-700);
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
  white-space: nowrap;
}
.text-action:hover {
  color: var(--emerald-950);
}

/* Modal Dialog */
.event-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface-elevated);
  box-shadow: 0 24px 64px rgba(7, 31, 22, 0.38);
}
.event-dialog::backdrop {
  background: rgba(7, 31, 22, 0.62);
  backdrop-filter: blur(3px);
}
.event-dialog h2 {
  margin: 8px 0 8px;
  color: var(--emerald-900);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--emerald-900);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}
.dialog-close:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.dialog-date {
  padding-right: 40px;
  color: var(--gold-deep);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.event-dialog .badges { margin-top: 12px; }
.dialog-place {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Empty State & Deep Emerald Calendar Feeds */
.empty-state {
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}
.empty-state p {
  margin: 8px 0 20px;
  color: var(--muted);
}

.feeds {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 36px;
  align-items: start;
  margin-top: 56px;
  padding: 30px;
  border: 1px solid rgba(212, 168, 67, 0.38);
  border-radius: var(--radius-lg);
  color: #f2f8f5;
  background: linear-gradient(160deg, var(--emerald-950) 0%, var(--emerald-900) 100%);
  box-shadow: var(--shadow-md);
}
.feeds .eyebrow {
  color: var(--gold-bright);
}
.feeds h2 {
  color: #ffffff;
}
.feeds > div > p:not(.eyebrow) {
  margin: 10px 0 0;
  color: rgba(220, 237, 229, 0.8);
  font-size: 0.9rem;
  line-height: 1.55;
}
.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.feed-grid > p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(220, 237, 229, 0.8);
}
.feed-grid a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 12px 32px 12px 14px;
  border: 1px solid rgba(212, 168, 67, 0.34);
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: rgba(16, 61, 45, 0.62);
  font-size: 0.88rem;
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.feed-grid a::after {
  content: "↓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
}
.feed-grid a:hover {
  border-color: var(--gold-bright);
  background: rgba(212, 168, 67, 0.18);
}
.feed-grid span {
  color: rgba(214, 232, 223, 0.78);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Sign-In Page */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, var(--emerald-800) 0%, var(--emerald-950) 75%);
}
.login-shell {
  width: min(420px, 100%);
  display: grid;
  gap: 20px;
  justify-items: center;
}
.login-card {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(212, 168, 67, 0.42);
  border-radius: var(--radius-lg);
  color: #f4faf7;
  background: rgba(11, 46, 34, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.login-card .eyebrow { color: var(--gold-bright); }
.login-card h1 {
  margin: 4px 0 8px;
  color: #ffffff;
  font-size: 1.6rem;
  font-weight: 700;
}
.login-copy {
  margin: 0 0 18px;
  color: rgba(220, 237, 229, 0.8);
  font-size: 0.9rem;
}
.login-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-sm);
  color: #fef3c7;
  background: rgba(180, 83, 9, 0.35);
  font-size: 0.84rem;
  font-weight: 600;
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-form label {
  display: grid;
  gap: 5px;
  color: var(--gold-bright);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.login-form input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: rgba(7, 31, 22, 0.75);
  font-size: 0.95rem;
}
.login-back {
  display: inline-block;
  margin-top: 18px;
  color: rgba(220, 237, 229, 0.78);
  font-size: 0.82rem;
  text-decoration: none;
}
.login-back:hover { color: var(--gold-bright); }

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px var(--page-gutter);
  border-top: 1px solid rgba(212, 168, 67, 0.28);
  color: rgba(220, 237, 229, 0.82);
  background: var(--emerald-950);
  font-size: 0.8rem;
}
footer p { margin: 0; }
.noscript {
  margin: 0;
  padding: 14px 20px;
  color: var(--emerald-950);
  background: var(--gold-bright);
  font-weight: 700;
  text-align: center;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 760px) {
  :root { --page-gutter: 16px; --toolbar-sticky-top: 6px; }
  .nav {
    flex-wrap: wrap;
    gap: 10px 12px;
    min-height: auto;
    padding: 10px var(--page-gutter) 12px;
  }
  .wordmark-mark {
    width: 28px;
    height: 28px;
  }
  .wordmark-text,
  .wordmark > span:last-child {
    font-size: 1.08rem;
  }
  #download-csv { display: none; }
  .nav-links {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 3px;
    border: 1px solid rgba(212, 168, 67, 0.28);
    border-radius: var(--radius-sm);
    background: rgba(4, 18, 13, 0.52);
  }
  .nav-link {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.79rem;
    text-align: center;
    white-space: nowrap;
  }
  .hero-grid,
  main { width: calc(100% - 32px); }
  .hero-grid { padding: 20px 0 24px; gap: 20px; }
  .hero-copy h1 { font-size: clamp(1.68rem, 6.2vw, 2.2rem); }
  .intro { font-size: 0.9rem; margin-bottom: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
  .stats div { padding: 10px 12px; }
  .stats dt { font-size: 1.32rem; }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n + 2) { border-bottom: 1px solid rgba(212, 168, 67, 0.22); }
  .toolbar { padding: 9px 10px; gap: 8px; }
  .search-field input,
  .login-form input { font-size: 16px; }
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .filters label {
    grid-template-columns: 1fr;
    gap: 3px;
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
  .filters select {
    height: 34px;
    line-height: 32px;
    padding: 0 20px 0 7px;
    font-size: 0.78rem;
  }
  .calendar-navigation { padding: 10px 12px; }
  .calendar-navigation h3 { font-size: 1rem; }
  .calendar-weekdays span {
    padding: 6px 2px;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    text-align: center;
  }
  .calendar-day { min-height: 68px; padding: 4px; }
  .calendar-day-number {
    width: 22px;
    height: 22px;
    margin: 0 auto 4px;
    font-size: 0.7rem;
  }
  .calendar-event { min-height: 14px; padding: 0; border-radius: 3px; }
  .calendar-event-name,
  .calendar-event-location {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .calendar-mobile-hint {
    display: block;
    margin: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
  }
  .event-card {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }
  .event-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .feeds {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 36px;
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .hero-personal-link {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    text-align: center;
  }
  .next-up-item {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .next-up-item .badge {
    padding: 2px 7px;
    font-size: 0.62rem;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .filters label:last-child {
    grid-column: 1 / -1;
  }
  .feed-grid { grid-template-columns: 1fr; }
  .results-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .results-tools {
    width: 100%;
    justify-content: space-between;
  }
  .event-dialog {
    width: calc(100% - 20px);
    padding: 20px 16px;
  }
  .dialog-actions .button { flex: 1 1 auto; }
  .login-page { padding: 16px; }
  .login-card { padding: 22px 18px; }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 18px var(--page-gutter);
  }
}

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