/* All themes share semantic tokens so dialogs and controls retain their contrast. */
:root{--green:#225e4e;--ink:#293d36;--muted:#68766b;--line:#dbe2d5;--paper:#fafbf7;--surface:#fff;--sidebar:#eef2e9;--soft:#f0f4ec;--accent:#8c997b;--hero:#eff3ea;--banner:#fff7e5;--banner-ink:#77643e;--event-ink:#293d36;--shadow:0 4px 18px #223e3010}
body[data-theme="daylight"]{--green:#1648ac;--ink:#101f38;--muted:#405678;--line:#a6bad7;--paper:#f4f8ff;--surface:#fff;--sidebar:#dfebfd;--soft:#e7effc;--accent:#245293;--hero:#e6f0ff;--banner:#fff1ce;--banner-ink:#5b410b;--event-ink:#101f38}
body[data-theme="night"]{color-scheme:dark;--green:#85dab9;--ink:#eef6f2;--muted:#b5c9be;--line:#42594f;--paper:#111c19;--surface:#1b2b25;--sidebar:#16251f;--soft:#2b3e34;--accent:#b4cfbe;--hero:#20362c;--banner:#38301c;--banner-ink:#f3dca2;--event-ink:#f0f7f3;--shadow:none}
body[data-theme="minecraft"]{--green:#376829;--ink:#263722;--muted:#506446;--line:#abb89b;--paper:#f0ecd9;--surface:#fffdf1;--sidebar:#d2debb;--soft:#e6eccf;--accent:#536e39;--hero:#dfebc9;--banner:#ece0b6;--banner-ink:#51431c;--event-ink:#263722;background-image:linear-gradient(90deg,#668b3010 1px,transparent 1px),linear-gradient(#668b3010 1px,transparent 1px);background-size:24px 24px}
body[data-theme="gaming"]{color-scheme:dark;--green:#c4adff;--ink:#f5efff;--muted:#c6badf;--line:#574575;--paper:#151023;--surface:#221933;--sidebar:#1b142b;--soft:#352648;--accent:#d3baff;--hero:#2e2044;--banner:#37294d;--banner-ink:#e4d2ff;--event-ink:#f5efff;--shadow:0 0 18px #b69aff12}
body[data-theme="gymnastics"]{--green:#8d376f;--ink:#44243d;--muted:#78546e;--line:#d9b8ce;--paper:#fff8fc;--surface:#fff;--sidebar:#f5e6f1;--soft:#f9edf6;--accent:#975181;--hero:#f7e7f2;--banner:#fff0db;--banner-ink:#775027;--event-ink:#44243d}
body{background-color:var(--paper);color:var(--ink)}
.sidebar{background:var(--sidebar);border-color:var(--line)}
button,input,textarea,form select,.view-select,.filter.selected,nav button.active,.calendar,.month,.card,dialog{background-color:var(--surface);color:var(--ink);border-color:var(--line)}
button:hover{background:var(--soft)}
.primary,.primary:hover{background:var(--green);color:var(--surface);border-color:var(--green)}
.demo-banner{background:var(--banner);color:var(--banner-ink);border-color:var(--line)}
.demo-banner select{color:var(--banner-ink);border-color:var(--line)}
.day-heading,.day.today .day-heading,.month-cell.outside,.weather-chip{background:var(--soft);border-color:var(--line);color:var(--ink)}
.day.today .day-heading strong{color:var(--surface);background:var(--green)}
.invitation-card,.notice{background:var(--hero);color:var(--ink)}
.brand,.sidebar-note p,.invitation-card p,.event-title,.event-location,.event-person{color:inherit}
.eyebrow,.sidebar-note,.subtext,.muted,.day-heading small,.task small,.task.done .task-title,.empty-day,.day-add,footer{color:var(--muted)}
.tag{background:var(--soft);color:var(--ink)}
.task,.detail-row,.request,.list-event,.day,.calendar,.month-cell{border-color:var(--line)}
.event{background:var(--tint)!important;color:var(--event-ink)!important;border-left:3px solid var(--color)!important}
.event-time{color:var(--muted)!important}
body[data-theme="night"] .event,body[data-theme="gaming"] .event{background:var(--soft)!important}
body[data-theme="night"] .danger{color:#ffaaa0}body[data-theme="gaming"] .danger{color:#ffafa7}
body[data-theme="night"] #form-error,body[data-theme="gaming"] #form-error{color:#ffaaa0}
body[data-theme="minecraft"] button,body[data-theme="minecraft"] .card,body[data-theme="minecraft"] .calendar,body[data-theme="minecraft"] dialog,body[data-theme="minecraft"] .avatar{border-radius:3px}
body[data-theme="minecraft"] h1,body[data-theme="minecraft"] h2,body[data-theme="minecraft"] .brand{font-family:ui-monospace,monospace;letter-spacing:-1px}
body[data-theme="gaming"] h1,body[data-theme="gaming"] h2{letter-spacing:-.5px}
body[data-theme="gymnastics"] .brand-icon{font-size:0}body[data-theme="gymnastics"] .brand-icon::after{content:'✦';font-size:30px}
.event .avatar{width:23px;height:23px}.avatar{overflow:hidden;vertical-align:middle;flex-shrink:0}.avatar img{width:100%;height:100%;object-fit:cover;display:block}.avatar-stack{display:flex;align-items:center;gap:3px;flex-wrap:wrap}.event-person{flex-wrap:wrap}
.weekday-options{display:flex;gap:6px;flex-wrap:wrap}.weekday-options label{position:relative;cursor:pointer;font-size:12px}.weekday-options input{position:absolute;opacity:0;width:1px;height:1px}.weekday-options span{display:inline-grid;place-items:center;min-width:43px;min-height:43px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}.weekday-options input:checked+span{background:var(--green);color:var(--surface);border-color:var(--green)}.weekday-options input:focus-visible+span{outline:3px solid #b78b43;outline-offset:2px}.weekday-options input:disabled+span{opacity:.6;cursor:default}
[hidden]{display:none!important}
#repeat-options{border-left:3px solid var(--line);padding:5px 0 1px 15px;margin:0 0 18px}#repeat-preview{font-size:11px;line-height:1.7}
.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.theme-option{display:flex;flex-direction:column;gap:8px;text-align:left;font-size:11px;position:relative}.theme-option[aria-pressed="true"]{outline:2px solid var(--green);outline-offset:1px}.theme-swatch{display:block;height:26px;border-radius:5px;border:1px solid #7775;background:linear-gradient(90deg,var(--swatch-a) 32%,var(--swatch-b) 32%)}
.preference-view{margin-bottom:20px}.preference-view select{width:100%;margin-top:8px;padding:10px;border-radius:8px;border:1px solid var(--line);background:var(--surface);color:var(--ink)}
.photo-row{display:flex;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}.photo-row:last-child{border:0}.photo-row .avatar{width:48px;height:48px;font-size:18px}.photo-details{flex:1;min-width:100px}.photo-details small{display:block;color:var(--muted);margin-top:5px}.photo-actions{display:flex;gap:6px;align-items:center}.photo-actions button{font-size:11px;padding:7px 10px}.photo-upload{cursor:pointer;padding:10px;border:1px solid var(--line);border-radius:8px;font-size:11px}.photo-upload:hover{background:var(--soft)}.photo-upload:focus-within{outline:3px solid #b78b43;outline-offset:2px}.photo-upload input{position:absolute;width:1px;height:1px;opacity:0}.settings-wide{grid-column:1/-1}
.saved-label{color:var(--muted);font-size:11px;margin:10px 0 20px}.repeat-tag{font-size:10px;color:var(--muted)}
@media(max-width:650px){.theme-options{grid-template-columns:repeat(2,minmax(0,1fr))}.photo-row{gap:10px}.photo-actions{margin-left:auto}.form-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.form-row label{min-width:0}.form-row input{min-width:0}.settings-wide{grid-column:auto}.weekday-options span{min-width:36px;min-height:42px}}
