:root {
    --ink: #17324d;
    --ink-soft: #536577;
    --paper: #f5f3ee;
    --surface: #ffffff;
    --line: #dce2e5;
    --blue: #0aa5c2;
    --orange: #ff6940;
    --yellow: #f5c555;
    --green: #43b867;
    --shadow: 0 16px 38px rgba(23, 50, 77, .09);
    --radius-lg: 24px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--paper);
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(rgba(23, 50, 77, .026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 50, 77, .026) 1px, transparent 1px),
        var(--paper);
    background-size: 32px 32px;
    font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(10, 165, 194, .28);
    outline-offset: 2px;
}

.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;
}

.topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    padding: 12px max(24px, calc((100vw - 1240px) / 2));
    border-bottom: 1px solid rgba(23, 50, 77, .1);
    background: rgba(250, 249, 246, .91);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 11px;
}

.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: .98rem; letter-spacing: -.01em; }
.brand-copy small { margin-top: 4px; color: var(--ink-soft); font-size: .76rem; }

.source-actions { display: flex; align-items: center; gap: 10px; }

.source-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: .78rem;
}

.source-status-text {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
}

.source-status-mode { color: var(--ink); font-weight: 680; }
.source-status-updated time { font-variant-numeric: tabular-nums; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(67, 184, 103, .12);
}

.source-status.is-warning .status-dot {
    background: var(--yellow);
    box-shadow: 0 0 0 4px rgba(245, 197, 85, .18);
}

.source-link,
.admin-entry,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.source-link {
    padding: 0 16px;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.source-link:hover,
.admin-entry:hover,
.icon-button:hover { border-color: #b9c5ca; background: #fbfcfc; }
.source-link svg { width: 15px; height: 15px; }
.icon-button,
.admin-entry { width: 40px; padding: 0; }
.admin-entry { text-decoration: none; }
.admin-entry svg { width: 17px; height: 17px; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.is-loading svg { animation: spin .75s linear infinite; }

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page-shell {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 26px 0 30px;
}

.intro {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    min-height: 0;
    padding: 22px 28px;
    overflow: hidden;
    border-radius: 24px;
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow);
}

.intro::before,
.intro::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.intro::before {
    right: 23%;
    bottom: -96px;
    width: 168px;
    height: 168px;
    border: 26px solid rgba(10, 165, 194, .24);
    border-radius: 50%;
}

.intro::after {
    right: -72px;
    top: -104px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(255, 255, 255, .11);
    transform: rotate(28deg);
}

.intro-copy,
.intro-overview,
.today-card,
.intro-stats { position: relative; z-index: 1; }

.eyebrow {
    margin: 0 0 7px;
    color: #83deeb;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.intro h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.1rem, 3.4vw, 3.25rem);
    font-weight: 780;
    line-height: 1.04;
    letter-spacing: -.048em;
    text-wrap: balance;
}

.intro h1 span { color: #ffd56b; }

.intro-lead {
    max-width: 700px;
    margin: 9px 0 0;
    color: #cfdae3;
    font-size: .82rem;
}

.intro-overview {
    display: flex;
    align-items: stretch;
    gap: 18px;
}

.today-card {
    display: grid;
    place-items: center;
    width: 94px;
    min-height: 108px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 17px;
    background: rgba(255, 255, 255, .09);
    text-align: center;
}

.today-card span {
    color: #9fb3c3;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.today-card strong {
    margin: -1px 0;
    color: #fff;
    font-size: 2.85rem;
    line-height: 1;
    letter-spacing: -.08em;
}

.today-card small { max-width: 80px; color: #ffd56b; font-size: .61rem; line-height: 1.2; }

.intro-stats {
    display: grid;
    align-content: center;
    gap: 6px;
    min-width: 154px;
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, .13);
}

.intro-stats div { display: flex; align-items: baseline; gap: 9px; }
.intro-stats strong { min-width: 34px; font-size: 1.35rem; letter-spacing: -.05em; }
.intro-stats span { color: #aebdca; font-size: .68rem; }

.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 13px 17px;
    border: 1px solid #e9cd7c;
    border-radius: 14px;
    background: #fff8df;
    color: #6e5720;
    font-size: .86rem;
}

.notice svg { flex: 0 0 auto; width: 20px; height: 20px; }

.calendar-workspace {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid rgba(23, 50, 77, .09);
    border-radius: 28px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-field,
.select-field {
    position: relative;
    display: flex;
    align-items: center;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcfc;
}

.search-field { flex: 1; min-width: 240px; }
.search-field > svg { width: 20px; height: 20px; margin-left: 15px; color: #708391; }
.search-field input {
    width: 100%;
    height: 100%;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}
.search-field input::placeholder { color: #8a99a5; }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 165, 194, .1); }
.search-field kbd {
    margin-right: 10px;
    padding: 3px 7px;
    border: 1px solid #d9e0e3;
    border-radius: 6px;
    background: #fff;
    color: #7b8b97;
    font: 600 .7rem/1.4 inherit;
    white-space: nowrap;
}

.select-field select {
    height: 100%;
    padding: 0 42px 0 14px;
    border: 0;
    outline: 0;
    appearance: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: .84rem;
    font-weight: 650;
}

.select-field svg {
    position: absolute;
    right: 13px;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.future-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 650;
    white-space: nowrap;
}

.future-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
    display: flex;
    align-items: center;
    width: 38px;
    height: 22px;
    padding: 3px;
    border-radius: 999px;
    background: #c9d2d6;
    transition: background .2s ease;
}
.toggle-track span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    transition: transform .2s ease;
}
.future-toggle input:checked + .toggle-track { background: var(--blue); }
.future-toggle input:checked + .toggle-track span { transform: translateX(16px); }
.future-toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(10, 165, 194, .28); outline-offset: 2px; }

.view-switch {
    display: flex;
    min-height: 46px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f1f4f4;
}
.view-switch button {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #758591;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 750;
}
.view-switch button.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(23, 50, 77, .09); }
.view-switch svg { width: 17px; height: 17px; }

.month-rail,
.category-row {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
}
.month-rail::-webkit-scrollbar,
.category-row::-webkit-scrollbar { display: none; }

.month-rail {
    margin: 22px -4px 0;
    padding: 0 4px 12px;
    border-bottom: 1px solid var(--line);
}
.month-rail button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6a7b87;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
}
.month-rail button:hover { background: #f1f5f5; color: var(--ink); }
.month-rail button.is-active { background: var(--ink); color: #fff; }
.month-rail small {
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(23, 50, 77, .08);
    font-size: .66rem;
    text-align: center;
}
.month-rail button.is-active small { background: rgba(255, 255, 255, .17); }

.category-row { margin-top: 14px; padding-bottom: 4px; }
.category-chip {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #667884;
    cursor: pointer;
    font-size: .73rem;
    font-weight: 650;
}
.category-chip:hover { border-color: #b8c4c9; color: var(--ink); }
.category-chip.is-active { border-color: #bae8ed; background: #e9f8fa; color: #08778b; }
.category-chip small { margin-left: 4px; opacity: .65; }

.results-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 0 6px;
}
.results-bar button {
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: #0789a0;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 700;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 238px;
    gap: 28px;
    align-items: start;
    margin-top: 18px;
}

.events-list {
    min-width: 0;
    height: clamp(440px, 58dvh, 720px);
    padding-right: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #cbd5d8 transparent;
    scrollbar-width: thin;
}
.events-list::-webkit-scrollbar { width: 7px; }
.events-list::-webkit-scrollbar-track { background: transparent; }
.events-list::-webkit-scrollbar-thumb { border-radius: 999px; background: #cbd5d8; }
.events-list:focus-visible { outline: 2px solid rgba(10, 165, 194, .5); outline-offset: 5px; }

.day-group {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 0 24px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 100px;
}
.day-group:first-child { border-top: 0; }

.day-heading { position: relative; padding-top: 5px; }
.day-heading time { display: flex; align-items: center; gap: 10px; }
.day-heading strong { font-size: 2.15rem; line-height: 1; letter-spacing: -.06em; }
.day-heading span { color: var(--ink-soft); font-size: .76rem; font-weight: 750; line-height: 1.18; }
.day-heading small { display: block; margin-top: 5px; color: #96a3ab; font-size: .66rem; font-weight: 550; }
.day-heading em {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    margin-top: 9px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff0eb;
    color: #d84e2d;
    font-size: .64rem;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}
.day-group.is-past .day-heading { opacity: .52; }

.day-events { display: grid; gap: 10px; }
.today-empty-message { display: flex; align-items: center; min-height: 70px; margin: 0; padding: 16px 18px; border: 1px dashed #d8e1e3; border-radius: var(--radius-md); color: #84929a; background: #fafbf9; font-size: .76rem; }

.event-card {
    position: relative;
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    min-height: 104px;
    overflow: hidden;
    border: 1px solid #e2e6e8;
    border-radius: var(--radius-md);
    background: #fff;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.event-card:hover { transform: translateY(-1px); border-color: #c8d2d6; box-shadow: 0 9px 24px rgba(23, 50, 77, .075); }
.event-card.is-target { animation: targetPulse 1.2s ease; }
.event-card[data-status="past"] { border-color: #e8eceb; background: #fafbf9; }
.event-card[data-status="past"]:hover { border-color: #dce3e2; box-shadow: 0 7px 19px rgba(23, 50, 77, .045); }
.event-card[data-status="past"] .category-mark { opacity: .38; }
.event-card[data-status="past"] .category-label,
.event-card[data-status="past"] .date-range,
.event-card[data-status="past"] .unit-list span { opacity: .66; filter: saturate(.45); }
.event-card[data-status="past"] .event-body h2 { color: #73818a; }
.event-card[data-status="past"] .event-facts,
.event-card[data-status="past"] .event-facts b { color: #929da3; }

.category-mark { background: var(--category-color, #8aa0ad); }
[data-category-key="dates"] { --category-color: #f1ad32; --category-tint: #fff7e5; }
[data-category-key="community"] { --category-color: #f36845; --category-tint: #fff0eb; }
[data-category-key="study"] { --category-color: #3981c6; --category-tint: #edf5fd; }
[data-category-key="assessment"] { --category-color: #7b65bc; --category-tint: #f2effb; }
[data-category-key="olympiad"] { --category-color: #db6e96; --category-tint: #fff0f5; }
[data-category-key="support"] { --category-color: #28a179; --category-tint: #eaf8f3; }
[data-category-key="method"] { --category-color: #228ba3; --category-tint: #eaf7fa; }
[data-category-key="sport"] { --category-color: #3dad59; --category-tint: #edf9f0; }
[data-category-key="meeting"] { --category-color: #dc7542; --category-tint: #fff2eb; }
[data-category-key="preschool"] { --category-color: #159fbc; --category-tint: #eaf8fb; }
[data-category-key="first"] { --category-color: #d85c67; --category-tint: #fff0f1; }

.event-body { padding: 17px 18px; }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 8px; }
.category-label,
.date-range,
.time-pill,
.unit-list span {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 800;
}
.category-label { background: var(--category-tint, #edf1f3); color: var(--category-color, #627987); }
.date-range { background: #f1f3f4; color: #6d7d88; }
.time-pill { background: #edf3f4; color: #506975; font-variant-numeric: tabular-nums; }
.event-body h2 {
    margin: 0;
    color: #20394e;
    font-size: .96rem;
    font-weight: 680;
    line-height: 1.42;
    letter-spacing: -.012em;
    white-space: pre-line;
}

.event-facts { display: flex; flex-wrap: wrap; gap: 5px 15px; margin: 9px 0 0; color: #6a7d89; font-size: .72rem; }
.event-facts b { color: #40596a; font-weight: 750; }

.unit-list { display: flex; gap: 5px; margin-top: 10px; }
.unit-list span { border: 1px solid #dbe3e6; background: #f8fafb; color: #627581; }

.copy-link {
    align-self: start;
    width: 38px;
    height: 38px;
    margin: 12px 11px 0 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #91a0a9;
    cursor: pointer;
    opacity: 0;
    transition: opacity .18s ease, background .18s ease, color .18s ease;
}
.event-card:hover .copy-link,
.copy-link:focus-visible { opacity: 1; }
.copy-link:hover { background: #edf3f4; color: var(--ink); }
.copy-link svg { width: 17px; height: 17px; }

.summary-panel {
    position: sticky;
    top: 98px;
    padding: 22px;
    border-radius: 20px;
    background: #f1f4f3;
}
.summary-kicker,
.summary-label {
    margin: 0;
    color: #788995;
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.summary-total {
    display: block;
    margin-top: 8px;
    color: var(--ink);
    font-size: 3.35rem;
    line-height: 1;
    letter-spacing: -.08em;
}
.summary-caption { color: #7d8c96; font-size: .75rem; }
.summary-rule { height: 1px; margin: 19px 0; background: #d9e0e1; }
.next-event { margin-top: 10px; }
.next-event strong { display: block; font-size: .85rem; line-height: 1.35; }
.next-event span { display: block; margin-top: 5px; color: #768792; font-size: .72rem; }
.top-category { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: .78rem; font-weight: 700; }
.top-category strong { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: #fff; font-size: .67rem; }

.calendar-view { min-width: 0; }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); }
.calendar-weekdays span { padding: 10px; color: #7d8c97; font-size: .68rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-grid { border-left: 1px solid var(--line); }
.calendar-day {
    min-width: 0;
    min-height: 132px;
    padding: 9px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.calendar-day.is-blank { background: #f8f9f8; }
.calendar-day.is-today { background: #fff9ed; }
.calendar-day-number { display: grid; place-items: center; width: 27px; height: 27px; margin-bottom: 6px; border-radius: 50%; color: #687b87; font-size: .72rem; font-weight: 800; }
.calendar-day.is-today .calendar-day-number { background: var(--orange); color: #fff; }
.calendar-event {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 5px 6px;
    overflow: hidden;
    border: 0;
    border-left: 3px solid var(--event-color, var(--blue));
    border-radius: 5px;
    background: #f1f5f6;
    color: #405869;
    cursor: pointer;
    font-size: .62rem;
    font-weight: 650;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-more { display: block; margin: 7px 0 0 5px; color: #6f808b; font-size: .62rem; font-weight: 750; }
.calendar-prompt { grid-column: 1 / -1; padding: 80px 20px; color: #738490; text-align: center; }

.empty-state {
    padding: 70px 20px 80px;
    border-top: 1px solid var(--line);
    text-align: center;
}
.empty-symbol {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border: 2px solid #c7d1d6;
    border-radius: 50%;
    color: #8a99a3;
    font-size: 1.55rem;
    font-weight: 800;
}
.empty-state h2 { margin: 0; font-size: 1.2rem; }
.empty-state p { margin: 8px 0 20px; color: var(--ink-soft); font-size: .85rem; }
.empty-state button {
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.detail-top-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 750;
    text-decoration: none;
}
.detail-top-link:hover { color: var(--ink); }
.detail-top-link svg { width: 17px; height: 17px; }

.event-page {
    min-height: 100vh;
    background:
        linear-gradient(rgba(23, 50, 77, .026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 50, 77, .026) 1px, transparent 1px),
        var(--paper);
    background-size: 32px 32px;
}

.event-detail-shell {
    display: grid;
    place-items: center;
    width: min(760px, calc(100% - 36px));
    min-height: calc(100vh - 76px);
    margin: 0 auto;
    padding: 56px 0;
}

.event-mini-card {
    position: relative;
    display: grid;
    grid-template-columns: 154px minmax(0, 1fr);
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(23, 50, 77, .12);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(23, 50, 77, .13);
}

.event-mini-accent {
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: var(--category-color, var(--blue));
}

.event-mini-date {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    min-height: 330px;
    padding: 28px 20px 28px 27px;
    background: var(--ink);
    color: #fff;
    text-align: center;
}
.event-mini-date span {
    color: #9fb3c3;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.event-mini-date strong {
    margin: 8px 0 3px;
    font-size: 4.8rem;
    line-height: .9;
    letter-spacing: -.08em;
}
.event-mini-date small { color: #ffd56b; font-size: .76rem; }

.event-mini-content { padding: 34px 36px 32px; }
.event-mini-context {
    margin: 0 0 18px;
    color: #86959f;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.event-mini-content h1 {
    margin: 15px 0 24px;
    color: var(--ink);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    font-weight: 760;
    line-height: 1.18;
    letter-spacing: -.035em;
    white-space: pre-line;
}

.event-mini-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 28px;
}
.event-mini-meta div { min-width: 0; }
.event-mini-meta dt {
    margin: 0 0 3px;
    color: #8998a2;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.event-mini-meta dd { margin: 0; color: #344e62; font-size: .82rem; font-weight: 680; }

body.modal-open { overflow: hidden; }

.event-modal {
    width: min(720px, calc(100vw - 32px));
    max-height: min(780px, calc(100vh - 32px));
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 24px;
    background: transparent;
    box-shadow: 0 30px 90px rgba(10, 28, 43, .3);
}

.event-modal::backdrop {
    background: rgba(15, 35, 52, .55);
    backdrop-filter: blur(6px);
}

.event-modal[open] { animation: modalAppear .2s ease-out; }

.event-modal-card {
    position: relative;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 24px;
    background: #fff;
}

.event-modal-accent {
    position: absolute;
    z-index: 2;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--category-color, #8aa0ad);
}

.event-modal-close {
    position: absolute;
    z-index: 3;
    top: 15px;
    right: 15px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #72838e;
    background: #f0f3f3;
    cursor: pointer;
}

.event-modal-close:hover { color: var(--ink); background: #e6ecec; }
.event-modal-close svg { width: 17px; height: 17px; }

.event-modal-date {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    color: #fff;
    background: var(--ink);
    text-align: center;
}

.event-modal-date span {
    color: #9fc1d0;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.event-modal-date strong {
    margin: 9px 0 3px;
    font-size: 4.25rem;
    line-height: 1;
    letter-spacing: -.08em;
}

.event-modal-date small { color: #ffd46a; font-size: .74rem; }

.event-modal-content { min-width: 0; padding: 31px 56px 29px 30px; }
.event-modal-context { margin: 0 0 12px; color: #8a9aa4; font-size: .65rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.event-modal-content h2 { margin: 13px 0 21px; color: #20394e; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.18; letter-spacing: -.035em; white-space: pre-line; }
.event-modal-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.event-modal-meta div[hidden] { display: none; }
.event-modal-meta dt { margin-bottom: 3px; color: #8a98a1; font-size: .58rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.event-modal-meta dd { margin: 0; color: #344e62; font-size: .8rem; font-weight: 680; line-height: 1.4; }
.event-modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 20px; }
.event-modal-copy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 11px; color: #fff; background: var(--ink); cursor: pointer; font-size: .74rem; font-weight: 760; }
.event-modal-copy:hover { background: #254b67; }
.event-modal-copy svg { width: 15px; height: 15px; }
.event-modal-page-link { color: #55707f; font-size: .71rem; font-weight: 700; text-decoration: none; }
.event-modal-page-link:hover { color: var(--ink); text-decoration: underline; }

.event-return {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 43px;
    padding: 0 15px;
    border-radius: 11px;
    background: var(--ink);
    color: #fff;
    font-size: .78rem;
    font-weight: 750;
    text-decoration: none;
}
.event-return:hover { background: #24455f; }
.event-return svg { width: 17px; height: 17px; }
.event-detail-note { margin: 16px 0 0; color: #788993; font-size: .72rem; text-align: center; }

.site-footer {
    width: 100%;
    margin: 0;
    border-top: 1px solid rgba(23, 50, 77, .08);
    background: rgba(232, 240, 240, .78);
    color: #71818c;
    font-size: .75rem;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 13px 0;
}

.site-footer p { margin: 0; }
.site-footer-note { flex: 0 1 auto; }
.site-footer-credits { text-align: right; }
.site-footer a { color: #087b8d; font-weight: 800; text-underline-offset: 3px; }
.site-footer a:hover { color: #075f70; }

.toast {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 24px;
    padding: 10px 15px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 12px 30px rgba(23, 50, 77, .25);
    font-size: .78rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modalAppear {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes targetPulse { 0%, 100% { box-shadow: none; } 35% { box-shadow: 0 0 0 5px rgba(10, 165, 194, .16); } }

@media (max-width: 1060px) {
    .source-status { display: none; }
    .intro { grid-template-columns: minmax(0, 1fr) auto; }
    .intro h1 { font-size: clamp(2rem, 4.2vw, 2.8rem); }
    .today-card { display: none; }
    .toolbar { flex-wrap: wrap; }
    .search-field { flex: 1 1 calc(100% - 300px); }
    .future-toggle { margin-left: auto; }
}

@media (max-width: 820px) {
    .topbar { padding: 10px 18px; }
    .page-shell { width: min(100% - 28px, 1240px); padding-top: 20px; }
    .intro { gap: 18px; min-height: auto; padding: 20px 22px; border-radius: 20px; }
    .intro h1 { font-size: clamp(1.9rem, 6vw, 2.45rem); line-height: 1.06; }
    .intro-lead { max-width: 520px; }
    .calendar-workspace { padding: 18px; border-radius: 22px; }
    .content-layout { grid-template-columns: 1fr; }
    .summary-panel {
        position: static;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        column-gap: 20px;
        row-gap: 3px;
        align-items: start;
        grid-row: 1;
        padding: 14px 17px;
        border-radius: 16px;
    }
    .summary-kicker { grid-column: 1 / -1; grid-row: 1; margin-bottom: 6px; }
    .summary-total { grid-column: 1; grid-row: 2; align-self: end; margin: 0; font-size: 2.35rem; }
    .summary-caption { grid-column: 1; grid-row: 3; white-space: nowrap; }
    .summary-label { grid-column: 2; grid-row: 2; align-self: end; }
    .next-event { grid-column: 2; grid-row: 3; min-width: 0; margin-top: 1px; }
    .next-event strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .next-event span { margin-top: 2px; }
    .summary-panel .summary-rule { display: none; }
    .summary-panel > :nth-last-child(-n+2) { display: none; }
    .calendar-day { min-height: 112px; padding: 6px; }
    .calendar-event { font-size: .58rem; }
}

@media (max-width: 620px) {
    .topbar { min-height: 64px; }
    .brand img { width: 38px; height: 38px; }
    .brand-copy strong { font-size: .9rem; }
    .brand-copy small { font-size: .7rem; }
    .source-link { width: 40px; padding: 0; font-size: 0; }
    .source-link svg { width: 17px; height: 17px; }
    .page-shell { padding-top: 14px; }
    .intro { grid-template-columns: 1fr; padding: 18px 19px; }
    .intro::before { right: -70px; bottom: -72px; }
    .intro-copy { padding-right: 0; }
    .intro h1 { font-size: clamp(1.85rem, 9vw, 2.45rem); line-height: 1.07; }
    .intro-lead { margin-top: 7px; font-size: .75rem; }
    .intro-overview { display: block; }
    .intro-stats { display: flex; gap: 16px; min-width: 0; padding: 12px 0 0; border-top: 1px solid rgba(255, 255, 255, .13); border-left: 0; }
    .intro-stats div { display: flex; gap: 5px; }
    .intro-stats strong { min-width: 0; font-size: 1.05rem; }
    .intro-stats span { font-size: .59rem; line-height: 1.2; }
    .calendar-workspace { margin: 18px -4px 0; padding: 15px; border-radius: 20px; }
    .toolbar { gap: 9px; }
    .search-field { flex-basis: 100%; }
    .search-field kbd { display: none; }
    .select-field { flex: 1; }
    .select-field select { width: 100%; }
    .future-toggle { order: 3; margin: 0; }
    .view-switch { margin-left: auto; }
    .view-switch button { width: 42px; justify-content: center; padding: 0; }
    .view-switch button span { display: none; }
    .month-rail { margin-top: 16px; }
    .day-group { grid-template-columns: 1fr; gap: 9px; padding: 15px 0 20px; }
    .day-heading { display: flex; align-items: flex-start; gap: 10px; }
    .day-heading strong { font-size: 1.8rem; }
    .day-heading em { margin-top: 4px; }
    .event-card { min-height: 94px; }
    .event-body { padding: 14px 13px; }
    .event-body h2 { font-size: .9rem; }
    .copy-link { display: block; margin-right: 7px; opacity: 1; }
    .summary-panel { grid-template-columns: auto minmax(0, 1fr); column-gap: 17px; padding: 13px 15px; }
    .summary-total { font-size: 2.25rem; }
    .calendar-view { overflow-x: auto; }
    .calendar-weekdays,
    .calendar-grid { min-width: 690px; }
    .site-footer-inner { width: calc(100% - 32px); display: grid; gap: 3px; padding: 11px 0 13px; }
    .site-footer-credits { text-align: left; }
    .detail-top-link { width: 40px; height: 40px; justify-content: center; overflow: hidden; font-size: 0; }
    .event-detail-shell { align-content: start; min-height: calc(100vh - 64px); padding: 26px 0; }
    .event-mini-card { grid-template-columns: 1fr; border-radius: 21px; }
    .event-mini-date { grid-template-columns: auto auto auto; align-items: baseline; justify-content: start; gap: 8px; min-height: 0; padding: 18px 18px 18px 25px; text-align: left; }
    .event-mini-date span { grid-column: 1 / -1; }
    .event-mini-date strong { margin: 0; font-size: 2.4rem; }
    .event-mini-content { padding: 24px 21px 22px; }
    .event-mini-content h1 { font-size: 1.45rem; }
    .event-mini-meta { grid-template-columns: 1fr; }
    .event-return { width: 100%; justify-content: center; }
    .event-modal { width: min(520px, calc(100vw - 20px)); max-height: calc(100vh - 20px); }
    .event-modal-card { grid-template-columns: 1fr; max-height: calc(100vh - 20px); overflow-y: auto; border-radius: 20px; }
    .event-modal-date { min-height: 0; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 8px; padding: 20px 52px 18px 25px; text-align: left; }
    .event-modal-date span { flex-basis: 100%; }
    .event-modal-date strong { margin: 0; font-size: 2.4rem; }
    .event-modal-date small { align-self: flex-end; margin-bottom: 4px; }
    .event-modal-content { padding: 24px 21px 22px; }
    .event-modal-content h2 { font-size: 1.42rem; }
    .event-modal-meta { grid-template-columns: 1fr; gap: 12px; }
    .event-modal-actions { align-items: stretch; flex-direction: column; }
    .event-modal-page-link { padding: 5px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.public-logout { display: contents; }
