html { color-scheme: light; }

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #151e23;
}

html[data-theme="dark"] body {
    --bg: #151e23;
    --surface: #202b31;
    --soft: #2b3942;
    --ink: #ecf1f3;
    --muted: #b2c1c8;
    --line: #42525c;
    --link: color-mix(in srgb, var(--brand) 38%, #f2f7fa);
    --link-strong: var(--link);
    --sidebar-fill: color-mix(in srgb, var(--brand) 39%, #141c21);
    --yes: #a1d9b8;
    --yes-bg: #213d32;
    --no: #ffb8b4;
    --no-bg: #442f33;
    --maybe: #f0d098;
    --maybe-bg: #463b29;
}

html[data-theme="dark"] dialog { background: var(--surface); }
html[data-theme="dark"] .event-card.excluded,
html[data-theme="dark"] .progress { background: var(--soft); }
html[data-theme="dark"] .badge.pending { background: var(--soft); color: var(--muted); }
html[data-theme="dark"] .notice:not(.success):not(.error),
html[data-theme="dark"] .maintenance-banner,
html[data-theme="dark"] .demo-banner,
html[data-theme="dark"] .gallery-hidden-tag { background: var(--maybe-bg); color: var(--maybe); }
html[data-theme="dark"] .btn.danger,
html[data-theme="dark"] .notice.error { color: var(--no); border-color: #835a60; }
html[data-theme="dark"] .notice.success { border-color: #507e66; }
html[data-theme="dark"] .birthday-card { background: linear-gradient(135deg, #3b3327, #263847); }
html[data-theme="dark"] .birthday-caption { color: var(--maybe); }

.appearance-options { display: grid; gap: 14px; border: 0; margin: 0; padding: 0; }
.appearance-options legend { margin-bottom: 12px; color: var(--muted); }
.sidebar .sidebar-utility {
    width: 100%;
    justify-content: flex-start;
    color: inherit;
    background: transparent;
    border: 0;
    padding: 10px 4px;
    font-weight: 400;
    font-size: 1rem;
}
.sidebar .sidebar-utility:hover { background: #ffffff18; }
.sidebar-utility + .choir-switchers { margin-top: 8px; }

.top-home { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; }
.top-logo { width: 34px; height: 29px; object-fit: contain; background: var(--brand); border-radius: 5px; }
.topbar .mobile-brand { color: var(--ink); }

.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.home-response-count { display: flex; align-items: center; gap: 12px; }
.home-response-count strong { color: var(--link); font-size: 2.4rem; line-height: 1; }
.home-arrow { margin-left: auto; color: var(--muted); font-size: 1.4rem; }
.home-list h2 { margin-bottom: 8px; }
.home-list ul { margin: 0; padding: 0; list-style: none; }
.home-list li + li { border-top: 1px solid var(--line); }
.home-list li a { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.home-list a > .icon { flex: 0 0 auto; }
.home-list a > span { min-width: 0; overflow-wrap: anywhere; }
.home-list small { display: block; margin-top: 3px; color: var(--muted); }
.home-overview-link { display: inline-block; margin-top: 8px; }
.home-shortcuts { margin-bottom: 20px; }
.home-shortcuts h2 { margin-bottom: 10px; }
.home-shortcuts ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.home-shortcuts a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    min-height: 48px;
    padding: 8px 10px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
}
.home-shortcuts a:hover { border-color: var(--link); text-decoration: none; }
.home-shortcuts a > .icon { flex: 0 0 18px; height: 18px; color: var(--link); }
.home-shortcuts a > span { min-width: 0; overflow-wrap: anywhere; }
.account-archive-folder { margin: 8px 0 8px 12px; }
.account-archive-folder > summary { cursor: pointer; padding: 5px 0; }
.account-archive-file { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-left: 12px; }
.account-archive-file a { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; overflow-wrap: anywhere; }
.notice-marker {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    color: #202528;
    background: #f4d279;
    border-radius: 50%;
}
.notice-marker[hidden] { display: none; }
.notice-marker .icon { width: 15px; height: 15px; }
.home-list .notice-marker:not([hidden]) + .home-arrow { margin-inline-start: 0; }
.event-title .notice-marker { margin-inline-start: 6px; vertical-align: middle; }
.notification-entry .notice-marker { margin-inline-start: 8px; vertical-align: middle; }
.notice-panel-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }
.notice-panel-heading h2 { margin: 0; }
.notice-panel-heading .btn { max-width: 100%; }
@media (max-width: 660px) {
    .home-grid { grid-template-columns: 1fr; gap: 0; }
    .home-shortcuts ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
