:root {
    color-scheme: light;
    --bg: #f4f4f5;
    --surface: #ffffff;
    --surface2: #f0f0f1;
    --surface3: #e8e8ea;
    --border: #d1d5db;
    --border2: #9ca3af;
    --text: #111827;
    --text-muted: #6b7280;
    --text-dim: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --green: #16a34a;
    --yellow: #d97706;
    --red: #dc2626;
    --sidebar-bg: #111827;
    --header-bg: #ffffff;
    --header-border: #e5e7eb;
    --radius: 8px;
    --radius-sm: 4px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --surface: #111827;
    --surface2: #1f2937;
    --surface3: #273449;
    --border: #374151;
    --border2: #4b5563;
    --text: #f3f4f6;
    --text-muted: #cbd5e1;
    --text-dim: #94a3b8;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --green: #22c55e;
    --yellow: #f59e0b;
    --red: #ef4444;
    --sidebar-bg: #020617;
    --header-bg: #111827;
    --header-border: #1f2937;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

body {
    margin: 0;
}

a, .btn-link {
    color: var(--accent);
}

a:hover, .btn-link:hover {
    color: var(--accent-hover);
}

h1:focus {
    outline: none;
}

h1, h2, h3 {
    margin: 0 0 0.75rem;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.25;
}

p {
    margin: 0 0 1rem;
}

code {
    color: #c02d76;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    inset: calc(20vh + 3.25rem) 0 auto 0;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

#blazor-error-ui {
    background: #fef3c7;
    color: #111827;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem 1rem 1rem 3.7rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.login-display__name {
    color: var(--text-muted);
    margin-right: 0.5rem;
    white-space: nowrap;
}

.login-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.login-display__button {
    padding: 0;
    color: var(--text-muted);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
}

.icon-button:hover {
    background: var(--surface2);
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.profile-link:hover {
    color: inherit;
}

.profile-link__details {
    display: grid;
    gap: 0.05rem;
    min-width: 0;
}

.profile-link__details strong,
.profile-summary__details h2 {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.2;
}

.profile-link__details span,
.profile-summary__details p,
.profile-copy,
.preference-toggle span {
    color: var(--text-muted);
}

.profile-link__details span {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar--large {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 1.25rem;
}

.profile-shell {
    display: grid;
    gap: 1rem;
}

.profile-card {
    display: grid;
    gap: 1rem;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-summary__details {
    display: grid;
    gap: 0.25rem;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.preference-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface2);
}

.preference-toggle strong {
    display: block;
    margin-bottom: 0.15rem;
}

.preference-toggle input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.hero,
.tool-grid,
.detail-grid,
.timeline {
    display: grid;
    gap: 1rem;
}

.hero,
.tool-grid,
.detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero {
    margin-bottom: 1.5rem;
}

.hero h1,
.panel h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.hero-copy,
.panel p,
.tool-card p,
.detail-card p,
.timeline-step p {
    color: var(--text-muted);
}

.hero-card,
.panel,
.tool-card,
.detail-card,
.timeline-step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hero-card,
.panel,
.tool-card,
.detail-card {
    padding: 1.25rem;
}

.hero-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hero-card__label,
.eyebrow {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.tool-card h2,
.detail-card h2,
.timeline-step h2 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.tool-card__status {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.primary-link,
.secondary-button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.primary-link,
.btn-primary,
.btn {
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
}

.primary-link:hover,
.btn-primary:hover,
.btn:hover {
    color: #fff;
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.secondary-button {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}

.secondary-button:hover {
    background: var(--surface3);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

.detail-card ul {
    color: var(--text-muted);
    padding-left: 1.1rem;
}

.timeline-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1rem 1.25rem;
}

.timeline-step__index {
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.text-danger {
    color: var(--red);
}

.meta-note,
.search-status,
.user-email,
.table-subtext,
.search-result span,
.selected-user-panel span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.message-banner {
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
}

.message-banner--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #166534;
}

.message-banner--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.search-shell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.celebration-summary-panel {
    display: grid;
    gap: 1rem;
}

.celebration-summary-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.celebration-month-picker {
    display: grid;
    gap: 0.35rem;
    min-width: 12rem;
}

.celebration-month-picker span {
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.celebration-month-picker select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
}

.celebration-stats {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.celebration-stat {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.celebration-stat span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.celebration-stat strong {
    font-size: 1.7rem;
    line-height: 1;
}

.celebration-results-grid {
    align-items: start;
}

.celebration-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.celebration-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.celebration-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.celebration-item strong {
    display: block;
    margin-bottom: 0.15rem;
}

.celebration-item span {
    display: block;
}

.celebration-item__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    text-align: right;
    flex-shrink: 0;
}

.celebration-item__meta--stacked {
    flex-direction: column;
    align-items: flex-end;
}

.celebration-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.celebration-date {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.search-input {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    padding: 0.75rem 0.9rem;
}

.search-results {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.search-result {
    width: 100%;
    align-items: flex-start;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 0.9rem;
    text-align: left;
}

.search-result:hover {
    background: var(--surface2);
}

.selected-user-panel {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
}

.checkbox-row,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.table-shell {
    overflow-x: auto;
}

.exclusion-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.exclusion-table th,
.exclusion-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

.exclusion-table th {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
button,
select,
textarea {
    font: inherit;
}

.user-name {
    font-weight: 600;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

@media (max-width: 640.98px) {
    .hero h1,
    .panel h1 {
        font-size: 1.6rem;
    }

    .content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .login-display {
        width: 100%;
        justify-content: flex-end;
    }

    .profile-link__details {
        display: none;
    }

    .profile-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .preference-toggle {
        align-items: flex-start;
        flex-direction: column;
    }

    .celebration-item,
    .celebration-summary-panel__header {
        flex-direction: column;
    }

    .celebration-item__meta,
    .celebration-item__meta--stacked {
        align-items: flex-start;
        text-align: left;
    }
}
