/* Theme previews share the layout and type scale of the settings. */
.theme-options{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
.theme-options input{top:12px;right:12px;z-index:1}
.theme-preview{height:84px;display:block;position:relative;overflow:hidden;background:var(--preview-bg);border-radius:4px;border:1px solid #00000012}
.preview-bar{position:absolute;inset:0 0 auto;height:15px;background:var(--preview-surface);border-bottom:1px solid #00000010}
.preview-bar:before{content:'';position:absolute;left:7px;top:5px;width:23px;height:5px;background:var(--preview-primary);border-radius:2px}
.preview-sidebar{position:absolute;left:6px;top:22px;bottom:7px;width:22%;background:var(--preview-soft);border-radius:3px}
.preview-calendar{position:absolute;left:33%;right:6px;top:22px;bottom:7px;background:var(--preview-surface);border-radius:3px;display:flex;flex-direction:column;gap:5px;padding:6px}
.preview-calendar i{height:6px;width:70%;background:var(--preview-soft);border-left:3px solid var(--preview-primary)}
.preview-calendar i:nth-child(2){width:90%}.preview-calendar i:nth-child(3){width:50%}
.theme-options small{display:block}
body:not([data-theme=default]) :is(.app-header,.filter-box,.profile-card,.notice-button,.calendar-surface,.detail-panel,.settings-section,.notice-list-panel,.notice-detail,.mica-preview,.event-create-form,dialog,.view-switch,.hours){background:var(--surface);color:var(--ink)}
body:not([data-theme=default]) :is(.weekdays,.outside,.notice-search input,.settings-fields input,.settings-fields select,.settings-fields textarea,.notice-facts){background:var(--bg);color:var(--ink)}
body:not([data-theme=default]) button{background:var(--surface)}
body:not([data-theme=default]) button:hover{background:var(--primary-soft)}
body:not([data-theme=default]) :is(.primary-button,.view-switch button[aria-pressed=true],.notice-row[aria-pressed=true]){background:var(--primary);color:#fff}
body:not([data-theme=default]) :is(.profile-card[aria-current=page],.notice-button[aria-current=page],.notice-categories button[aria-pressed=true],.theme-options label:has(input:checked)){background:var(--primary-soft)}
body:not([data-theme=default]) .theme-options label{background:var(--surface)}
body:not([data-theme=default]) .theme-options label:has(input:checked){background:var(--primary-soft)}
body:not([data-theme=default]) #calendar[data-view=week] .week-header{background:var(--surface)}
body:not([data-theme=default]) .week-grid{background:repeating-linear-gradient(to bottom,transparent 0,transparent 59px,var(--line) 59px,var(--line) 60px)}
body:not([data-theme=default]) :is(.event-description,.notice-copy,.eyebrow,.page-footer,.calendar-toolbar .eyebrow,.filter small,.demo-help){color:var(--muted)}
body:not([data-theme=default]) #calendar .is-selected-date{background:var(--primary-soft)}
body:not([data-theme=default]) #calendar button.date-number[aria-pressed=true]{background:var(--primary-soft);border-color:var(--primary);color:var(--ink)}
body:not([data-theme=default]) #calendar .is-today button.date-number{background:#111418;color:#fff;border-color:#111418}
body:not([data-theme=default]) .settings-fields input:disabled{background:var(--bg);color:var(--muted);-webkit-text-fill-color:var(--muted);opacity:.65}
body:not([data-theme=default]) .add-date-event{background:#fff}
body:not([data-theme=default]) .event-form-actions .delete-event-button{color:#b83a30}
body:not([data-theme=default]) .notice-row[aria-pressed=true] small{color:#fff}

body:not([data-theme=default]) .event.school{background:#eef1f5;color:#202733}body:not([data-theme=default]) .event.department{background:var(--primary-soft);color:var(--ink)}body:not([data-theme=default]) .event.community{background:#fff0e7;color:#202733}body:not([data-theme=default]) .event.personal{background:#eaf4ef;color:#202733}body:not([data-theme=default]) .event.selected{box-shadow:inset 0 0 0 1px var(--primary)}body:not([data-theme=default]) .event-caption{color:#536078}

/* Dark presets: light accents on dark surfaces. */
body[data-mode=dark]{color-scheme:dark}
body[data-mode=dark] :is(.primary-button,.view-switch button[aria-pressed=true],.notice-row[aria-pressed=true]){color:var(--bg)}
body[data-mode=dark] .notice-row[aria-pressed=true] small{color:var(--bg)}
body[data-mode=dark] .logo-symbol{background:#f8fafc;border-radius:8px}
body[data-mode=dark] .event.school{background:#303B4C;color:#EDF3FC}
body[data-mode=dark] .event.community{background:#50372C;color:#FFE6D6}
body[data-mode=dark] .event.personal{background:#294438;color:#E1F3E7}
body[data-mode=dark] .event-caption{color:#C4CFD9}
body[data-mode=dark] :is(.notice-copy,.event-description,.source-note,.outside>.date-number,.filter small){color:var(--muted)}
body[data-mode=dark] #calendar .outside button.date-number{color:var(--muted)}
body[data-mode=dark] #calendar .is-today button.date-number{box-shadow:0 0 0 1px #8D9AAA;background:#111418;color:#fff}
body[data-mode=dark] #calendar .is-today button.date-number[aria-pressed=true]{box-shadow:0 0 0 2px var(--surface),0 0 0 3px var(--primary)}
body[data-mode=dark] .add-date-event{color:#202733;border-color:#D5DCE5}
body[data-mode=dark] .event-form-actions .delete-event-button{color:#FFB4AB;border-color:#93605A}
body[data-mode=dark] .settings-fields input:disabled{opacity:1;color:#97A49E;-webkit-text-fill-color:#97A49E}
body[data-mode=dark] .theme-options input{accent-color:var(--primary)}
body[data-mode=dark] .theme-preview{color-scheme:light}

/* Every category follows the selected theme, including personal schedules. */
body[data-theme] .event.school{background:var(--event-school-bg);border-left-color:var(--event-school-accent);color:var(--event-school-ink)}body[data-theme] .event.school:hover{background:var(--event-school-hover);filter:none}body[data-theme] .event.school .event-caption{color:var(--event-school-caption);opacity:.85}
body[data-theme] .event.department{background:var(--event-department-bg);border-left-color:var(--event-department-accent);color:var(--event-department-ink)}body[data-theme] .event.department:hover{background:var(--event-department-hover);filter:none}body[data-theme] .event.department .event-caption{color:var(--event-department-caption);opacity:.85}
body[data-theme] .event.community{background:var(--event-community-bg);border-left-color:var(--event-community-accent);color:var(--event-community-ink)}body[data-theme] .event.community:hover{background:var(--event-community-hover);filter:none}body[data-theme] .event.community .event-caption{color:var(--event-community-caption);opacity:.85}
body[data-theme] .event.personal{background:var(--event-personal-bg);border-left-color:var(--event-personal-accent);color:var(--event-personal-ink)}body[data-theme] .event.personal:hover{background:var(--event-personal-hover);filter:none}body[data-theme] .event.personal .event-caption{color:var(--event-personal-caption);opacity:.85}
body[data-theme] .event.learnus{background:var(--event-learnus-bg);border-left-color:var(--event-learnus-accent);color:var(--event-learnus-ink)}body[data-theme] .event.learnus:hover{background:var(--event-learnus-hover);filter:none}body[data-theme] .event.learnus .event-caption{color:var(--event-learnus-caption);opacity:.85}
body[data-theme] .event.selected{box-shadow:inset 0 0 0 1px var(--primary)}
