/* Luminography design tokens (v2, one warm accent, one light surface). Style with the aliases
   (--accent-primary, --surface-*, --text-*), not raw hex. */
:root {
    --color-amber-100: #fbeee4;
    --color-amber-300: #eeb08d;
    --color-amber-400: #e79a72;
    --color-amber-500: #e08a63;
    --color-amber-600: #c96f47;
    --color-amber-650: #b05a34;
    --color-amber-700: #a35630;
    --color-amber-800: #8f4a28;
    --color-amber-900: #7a3e21;

    --color-slate-50:  #fdfaf4;
    --color-slate-100: #f7f0e4;
    --color-slate-200: #f1e6d2;
    --color-slate-250: #ead9be;
    --color-slate-300: #e3cfb0;
    --color-slate-400: #b7a48c;
    --color-slate-500: #7d6852;
    --color-slate-600: #6b5744;
    --color-slate-700: #5a4835;
    --color-slate-800: #4a3826;
    --color-slate-900: #2e2115;

    /* Bright status colors are for dots, icons and borders only; they fail contrast as text on the
       creams. Words ("Offline", "Error") and filled Radzen buttons use the -text shades, which clear
       4.5:1 on page, card and hero backgrounds. */
    --color-success: #10b981;
    --color-danger:  #ef4444;
    --color-warning: #f59e0b;
    --color-info:    #0ea5e9;
    --color-success-text: #2f7a4f;
    --color-danger-text:  #b3261e;
    --color-warning-text: #9a5b00;
    --color-info-text:    #1f6a8a;
    /* Fills that carry white text (danger buttons, Radzen's coloured buttons). The same shades as the
       -text tokens in light mode, but they stay dark in dark mode while the -text tokens lighten. */
    --color-success-fill: #2f7a4f;
    --color-danger-fill:  #b3261e;
    --color-warning-fill: #9a5b00;
    --color-info-fill:    #1f6a8a;
    /* Tinted backgrounds for status badges and callouts. Each -text shade above clears 4.5:1 on its
       own tint (success 4.7, danger 5.7, warning 4.9, info 5.3). */
    --color-success-soft: #eaf5ee;
    --color-danger-soft:  #fdecea;
    --color-danger-fill-hover: #8f1e18;
    --color-warning-soft: #fdf3e1;
    --color-info-soft:    #e8f3f8;

    /* The page sits a step below the white cards (1.13:1, up from 1.04 on slate-50) so a card reads as
       a card without needing a shadow. Slate-100 is as deep as the page can go and keep every text
       token above 4.5:1 on it: muted 4.67, accent 4.72, success 4.61. */
    --surface-page:        var(--color-slate-100);
    --surface-card:        #ffffff;
    --surface-card-border: var(--color-slate-250);
    --surface-card-border-strong: var(--color-slate-300);
    /* A recessed band or chip inside a white card (toggles, code, tags). --text-muted is 4.6:1 on it.
       Keep it inside a card: it is almost the page colour now, so on the page it would vanish. */
    --surface-sunken:      #f7efe2;
    /* Hairline between rows inside a card — lighter than the card border. */
    --surface-divider:     #f4ece0;
    /* Warm tints for a feature card and the peach tag; they have their own dark values. */
    --surface-tint:        #fbeede;
    --surface-peach:       #fce4d6;
    --gradient-hero: radial-gradient(120% 130% at 82% 8%, #fff7ec 0%, #fdf1e2 46%, #fbecda 100%);

    --text-heading:   var(--color-slate-900);
    --text-body:      var(--color-slate-600);
    /* Slate-600, not 500: this is the most-used secondary tier, and at 500 it was the same colour as
       --text-muted, so most text on a page sat in the faintest shade. Muted stays 500 for captions. */
    --text-body-soft: var(--color-slate-600);
    --text-strong:    var(--color-slate-700);
    /* Muted used to be slate-400 (2.3:1 on the page cream). Slate-400 is still in the ramp for
       borders, placeholders and disabled states, but never for text someone has to read. */
    --text-muted:     var(--color-slate-500);
    --text-on-accent: #ffffff;

    --accent-primary:        var(--color-amber-500);
    --accent-primary-hover:  var(--color-amber-600);
    --accent-primary-deep:   var(--color-amber-700);
    --accent-primary-light:  var(--color-amber-300);
    /* White text needs 4.5:1. amber-500/600 give 2.6/3.6, so anything filled that carries words
       (buttons, CTA banners) uses the fill tokens; amber-500 stays for decoration, glows, sliders. */
    --accent-fill:           var(--color-amber-700);   /* white on it 5.3:1 */
    --accent-fill-hover:     var(--color-amber-800);   /* 6.6:1 */
    --accent-fill-active:    var(--color-amber-900);   /* 8.3:1 */
    /* Copper as text (links, labels): amber-700 is the lightest shade that passes on the creams. */
    --accent-text:           var(--color-amber-700);
    /* Copper text on a copper or amber tint (badges, tags, notices), where amber-700 drops to 4.4:1. */
    --accent-text-strong:    var(--color-amber-800);
    --accent-primary-soft:   rgba(224,138,99,0.12);
    --accent-primary-softer: rgba(224,138,99,0.08);
    --gradient-editorial: linear-gradient(135deg, var(--accent-fill) 0%, var(--accent-fill-hover) 100%);
    --gradient-editorial-hover: linear-gradient(135deg, var(--accent-fill-hover) 0%, var(--accent-fill-active) 100%);
    /* Decorative only (icon tiles, glows): no text sits on it. */
    --gradient-glow: linear-gradient(150deg, var(--color-amber-400), var(--accent-primary-hover));
    /* Copper gradient clipped to headline text. */
    --gradient-headline: linear-gradient(120deg, var(--accent-fill) 0%, var(--color-amber-800) 70%);
    /* The menu button's three bars, drawn in --text-strong. */
    --icon-menu: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%235a4431' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M5 8h20M5 15h20M5 22h20'/%3e%3c/svg%3e");
    /* Motion: a strong ease-out, so movement starts at once and settles softly. */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    color-scheme: light;
}

:root {
    --rz-primary:                  var(--accent-fill);
    --rz-primary-dark:             var(--accent-fill-hover);
    --rz-primary-light:            #f5bfa7;
    --rz-primary-lighter:          #fef0e8;
    --rz-secondary:                var(--color-slate-600);
    --rz-success:                  var(--color-success-fill);
    --rz-danger:                   var(--color-danger-fill);
    --rz-warning:                  var(--color-warning-fill);
    --rz-info:                     var(--color-info-fill);
    /* Alerts and other tinted states: the palette's soft backgrounds and readable -text shades rather
       than Radzen's 20% tints with bright text on them. */
    --rz-success-lighter:          var(--color-success-soft);
    --rz-danger-lighter:           var(--color-danger-soft);
    --rz-warning-lighter:          var(--color-warning-soft);
    --rz-info-lighter:             var(--color-info-soft);
    --rz-on-success-lighter:       var(--color-success-text);
    --rz-on-danger-lighter:        var(--color-danger-text);
    --rz-on-warning-lighter:       var(--color-warning-text);
    --rz-on-info-lighter:          var(--color-info-text);
    --rz-body-background-color:    var(--surface-page);
    --rz-content-background-color: var(--surface-card);

    /* Slider — explicit so these never fall back to a theme default */
    --rz-slider-background-color:             var(--surface-card-border);
    --rz-slider-range-background-color:       var(--accent-primary);
    --rz-slider-handle-background-color:      var(--accent-primary);
    --rz-slider-handle-border:                2px solid var(--accent-primary-hover);
    --rz-slider-handle-hover-background-color:var(--accent-text);
    --rz-slider-handle-hover-border:          2px solid var(--accent-primary-deep);

    /* Switch — same reasoning as the slider block above: Radzen's checked state pulls from
       --rz-primary-lighter for the track and --rz-on-primary-lighter (a text-contrast token, never
       remapped above) for the thumb, so a switch turned "on" came out a washed-out near-white track
       with a thumb color left over from the theme's original blue. Set explicitly instead. */
    --rz-switch-checked-background-color:        #f5bfa7;
    --rz-switch-checked-circle-background-color: var(--accent-primary-hover);
}

img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 0.05em 0 0.1em;
    vertical-align: -0.1em;
}

/* Text follows the reader's own size setting. Radzen pins the root at 16px, which ignores it; 100% is the
   browser default (16px unless the reader changed it), so nothing moves for most people. Sizes in pages
   are rem for the same reason — a px font-size does not scale. */
:root {
    --rz-root-font-size: 100%;
}

/* iPhone and iPad: follow the Text Size setting (Dynamic Type), as native apps do. -apple-system-body is
   17px at the default size, Apple's own body size on iOS. -webkit-touch-callout keeps this to iOS: on a
   Mac the same keyword is 13px. html:root outranks Radzen's :root rule. */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
    html:root {
        font: -apple-system-body;
        font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    }
}

html, body {
    /* The system stack for body text; Raleway is for display headings only (see .login-brand-name
       and the page h1/h2 rules). */
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--surface-page);
    color: var(--text-body);
}

/* Bootstrap's own colours are cool greys and a blue; the Account pages and a few scaffolded bits
   still use its classes. Point them at the warm tokens rather than restyling each page. */
:root {
    --bs-body-color: var(--text-body);
    --bs-body-bg: var(--surface-page);
    --bs-emphasis-color: var(--text-heading);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-color: var(--text-muted);
    --bs-heading-color: var(--text-heading);
    --bs-border-color: var(--surface-card-border);
    --bs-link-color: var(--accent-text);
    --bs-link-color-rgb: 163, 86, 48;
    --bs-link-hover-color: var(--accent-fill-active);
    --bs-link-hover-color-rgb: 143, 74, 40;
    --bs-primary: var(--accent-fill);
    --bs-primary-rgb: 176, 90, 52;
    --bs-danger-text-emphasis: var(--color-danger-text);
    --bs-success-text-emphasis: var(--color-success-text);
    --bs-warning-text-emphasis: var(--color-warning-text);
    --bs-info-text-emphasis: var(--color-info-text);
    --bs-danger-bg-subtle: var(--color-danger-soft);
    --bs-success-bg-subtle: var(--color-success-soft);
    --bs-warning-bg-subtle: var(--color-warning-soft);
    --bs-info-bg-subtle: var(--color-info-soft);
    --bs-focus-ring-color: rgba(224,138,99,0.35);
    --bs-code-color: var(--accent-text-strong);
    --bs-body-color-rgb: 107, 87, 68;
}

.text-muted, .text-secondary, .form-text { color: var(--text-muted) !important; }
.text-danger  { color: var(--color-danger-text) !important; }
.text-success { color: var(--color-success-text) !important; }
.text-warning { color: var(--color-warning-text) !important; }
.text-info    { color: var(--color-info-text) !important; }

.alert-danger  { color: var(--color-danger-text);  background-color: var(--color-danger-soft);  border-color: var(--color-danger-soft); }
.alert-success { color: var(--color-success-text); background-color: var(--color-success-soft); border-color: var(--color-success-soft); }
.alert-warning { color: var(--color-warning-text); background-color: var(--color-warning-soft); border-color: var(--color-warning-soft); }
.alert-info    { color: var(--color-info-text);    background-color: var(--color-info-soft);    border-color: var(--color-info-soft); }

.btn-danger { color: var(--text-on-accent); background-color: var(--color-danger-fill); border-color: var(--color-danger-fill); }
.btn-danger:hover, .btn-danger:focus { color: var(--text-on-accent); background-color: var(--color-danger-fill-hover); border-color: var(--color-danger-fill-hover); }
.btn-secondary, .btn-outline-secondary {
    color: var(--text-strong);
    background-color: var(--surface-card);
    border-color: var(--surface-card-border-strong);
}
.btn-secondary:hover, .btn-outline-secondary:hover {
    color: var(--text-heading);
    background-color: var(--surface-sunken);
    border-color: var(--surface-card-border-strong);
}

.form-control, .form-select { border-color: var(--surface-card-border-strong); color: var(--text-heading); }
.form-control:focus, .form-select:focus { border-color: var(--accent-primary-hover); }

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: var(--accent-primary-deep);
    background-color: var(--accent-primary-soft);
}

/* The scaffolded Manage pages use bare h1/h2/h3. */
article.content h1, article.content h2, article.content h3 {
    font-family: 'Raleway', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-heading);
}

article.content {
    background: var(--surface-page);
}

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

.btn-primary {
    color: var(--text-on-accent);
    background-color: var(--accent-fill);
    border-color: var(--accent-fill-hover);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary:active:focus, .btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    color: var(--text-on-accent);
    background-color: var(--accent-fill-hover);
    border-color: var(--accent-fill-active);
}

/* Solid amber-600 ring: 3.2:1 on the page, 3.6:1 on a card. The old 50% amber-500 haze was ~1.6:1,
   under the 3:1 a focus indicator needs. */
.btn:focus-visible, .btn-link.nav-link:focus-visible, .form-control:focus, .form-check-input:focus-visible {
    box-shadow: 0 0 0 2px var(--accent-primary-hover);
}

.sidebar {
    background: var(--surface-card);
    border-right: 1px solid var(--surface-card-border);
    box-shadow: 1px 0 8px rgba(0,0,0,0.04);
    overflow: hidden;
}

.nav-item .nav-link {
    color: var(--text-body);
    border-radius: 8px;
    margin: 2px 8px;
    transition: background 0.15s, color 0.15s;
}

.nav-item .nav-link:hover {
    background: rgba(224,138,99,0.09);
    color: var(--accent-text);
}

.nav-item .nav-link.active {
    background: var(--accent-primary-soft);
    color: var(--accent-primary-deep);
    font-weight: 600;
}

.top-row {
    background: var(--surface-card);
    border-bottom: 1px solid var(--surface-card-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* No opacity fade: 0.8 took slate-600 on white from 6.0:1 to 4.2:1, under the 4.5:1 floor. */
.top-row a { color: var(--text-body); }

.top-row a:hover { color: var(--accent-text); }

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--accent-primary);
}

.invalid {
    outline: 1px solid var(--color-danger);
}

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--color-danger-text);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--text-on-accent);
}

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

.darker-border-checkbox.form-check-input {
    border-color: var(--color-slate-500);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Account pages (Login, ForgotPassword, etc.) — centered branded card */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--surface-page);
}

.login-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-card-border);
    border-radius: 18px;
    box-shadow: 0 8px 40px var(--accent-primary-soft);
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 420px;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand-icon { font-size: 44px; line-height: 1; margin-bottom: 10px; }

.login-brand-name {
    font-family: 'Raleway', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-heading);
    margin: 0 0 4px;
}

.login-brand-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.login-intro {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-body-soft);
    text-align: center;
    margin: -12px 0 24px;
}

.login-field { margin-bottom: 16px; }

.login-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-body);
    margin-bottom: 6px;
}

.login-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--surface-card-border);
    border-radius: 9px;
    font-size: 0.875rem;
    color: var(--text-heading);
    background: var(--surface-page);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
}

.login-input:focus {
    border-color: var(--accent-primary-hover);
    box-shadow: 0 0 0 1px var(--accent-primary-hover);
    background: var(--surface-card);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-body-soft);
    margin-bottom: 24px;
    cursor: pointer;
}

.login-remember input[type=checkbox] { cursor: pointer; accent-color: var(--accent-primary); }

.login-btn {
    width: 100%;
    padding: 13px;
    background: var(--gradient-editorial);
    color: var(--text-on-accent);
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.3px;
    margin-top: 6px;
}

.login-btn:hover   { background: var(--gradient-editorial-hover); }
.login-btn:active  { transform: scale(0.98); }

/* External sign-in (Google, etc.) — only rendered when a provider is registered. */
.login-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-or::before,
.login-or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--surface-card-border);
}

.login-social { margin: 0; display: flex; flex-direction: column; gap: 10px; }

.login-social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: var(--surface-card);
    border: 1.5px solid var(--surface-card-border-strong);
    border-radius: 9px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-heading);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.login-social-btn:hover  { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(224,138,99,0.14); }
.login-social-btn:active { transform: scale(0.99); }
.login-social-icon { width: 18px; height: 18px; flex-shrink: 0; }

.login-links {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.login-link {
    font-size: 0.8125rem;
    color: var(--accent-text);
    text-decoration: none;
}

.login-link:hover { text-decoration: underline; }

.login-divider {
    width: 100%;
    border: none;
    border-top: 1px solid var(--surface-card-border);
    margin: 4px 0;
}

.login-error {
    background: var(--color-danger-soft);
    border: 1px solid var(--color-danger-soft);
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 0.8125rem;
    color: var(--color-danger-text);
    margin-bottom: 16px;
}

/* ── Shared admin page chrome — Screens, Schedules, Screen Groups ──────────── */
.page-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    margin: 0 0 20px;
}

.page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-body-soft);
    margin-top: 4px;
}

.page-loading {
    padding: 48px 0;
    text-align: center;
}

.page-loading p {
    color: var(--text-muted);
    margin-top: 14px;
    font-size: 0.875rem;
}

/* Card wrapper so the Radzen data grids on Schedules / Screen Groups match the
   Screens page's card language. */
.page-grid {
    background: var(--surface-card);
    border: 1px solid var(--surface-card-border);
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: 0 2px 8px rgba(224,138,99,0.06);
}

.page-add-footer {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/* Every Radzen button gives way slightly when pressed, so the press registers before the round trip
   to the server does. Colour transitions are listed so Radzen's own hover fades survive. */
.rz-button:not(:disabled):not(.rz-state-disabled) {
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 160ms var(--ease-out);
}
.rz-button:not(:disabled):not(.rz-state-disabled):active { transform: scale(0.97); transition-duration: 100ms; }
@media (prefers-reduced-motion: reduce) {
    .rz-button:not(:disabled):not(.rz-state-disabled):active { transform: none; }
}

.page-add-footer .rz-button {
    background: var(--gradient-editorial);
    border-color: var(--accent-primary-hover);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Hide the mouse cursor on signage screens. A display device marks itself with body.display-screen
   (markDisplayScreen in App.razor); the admin UI is never marked, so it keeps its cursor. Chromium
   fills the screen in kiosk mode, so this reliably hides a stray pointer regardless of the
   compositor — where the Wayland/X11 cursor-hiding provisioning scripts may not. */
body.display-screen,
body.display-screen * {
    cursor: none !important;
}

/* ── Dark mode ────────────────────────────────────────────────────────────────────────────────────
   Follows the system setting, as Apple's guidelines ask. The same warm brown ramp, run the other way,
   with copper text lightened to stay readable; copper fills keep white text, so --accent-fill and the
   -fill status shades do not change. Every text token here clears 4.5:1 on page, card and sunken
   surfaces (muted, the tightest, is 6.0:1 on a card), and the -text status shades clear it on their own
   -soft tints.

   Scoped to pages that render the admin layout (.page) or an account card (.login-wrap). Display themes
   go through the same App.razor, and a wall display whose OS is set to dark must look the same as
   before. Radzen's own dark variables are in css/radzen-dark.css under the same scope. */
@media (prefers-color-scheme: dark) {
    :root:has(.page, .login-wrap) {
        color-scheme: dark;

        --color-success-text: #7fd1a0;
        --color-danger-text:  #f4978e;
        --color-warning-text: #f0b860;
        --color-info-text:    #7cc6e8;
        --color-success-soft: #17281d;
        --color-danger-soft:  #33191a;
        --color-warning-soft: #30230f;
        --color-info-soft:    #13252f;

        --surface-page:        #17110c;
        --surface-card:        #241b14;
        --surface-card-border: #3d3025;
        --surface-card-border-strong: #54432f;
        --surface-sunken:      #1c150f;
        --surface-divider:     #31261c;
        --surface-tint:        #2a1d14;
        --surface-peach:       #3a2418;
        --gradient-hero: radial-gradient(120% 130% at 82% 8%, #33241a 0%, #291d14 46%, #21170f 100%);

        --text-heading:   #f7f0e4;
        --text-strong:    #ead9be;
        --text-body:      #dccab1;
        --text-body-soft: #d2bfa5;
        --text-muted:     #ab967d;

        --accent-text:          #eea47f;
        --accent-text-strong:   #f3b896;
        --accent-primary-deep:  #eea47f;
        --accent-primary-soft:   rgba(224,138,99,0.16);
        --accent-primary-softer: rgba(224,138,99,0.10);
        --gradient-headline: linear-gradient(120deg, #f3b896 0%, #e79a72 70%);
        --icon-menu: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ead9be' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M5 8h20M5 15h20M5 22h20'/%3e%3c/svg%3e");

        /* Radzen: a warm version of material-dark's grey ramp, and copper text wherever it would put
           --rz-primary (a fill colour, 3.2:1 on a dark card) on the page as text. */
        --rz-base:         #3f3226;
        --rz-base-50:      #f7f0e4;
        --rz-base-100:     #c9b59b;
        --rz-base-200:     #8c7862;
        --rz-base-300:     #5a4835;
        --rz-base-400:     #45372a;
        --rz-base-500:     #3d3025;
        --rz-base-600:     #33281e;
        --rz-base-700:     #2a2018;
        --rz-base-800:     #241b14;
        --rz-base-900:     #17110c;
        --rz-base-light:   #c9b59b;
        --rz-base-lighter: #241b14;
        --rz-base-dark:    #2a2018;
        --rz-base-darker:  #000000;
        --rz-on-base:        var(--text-heading);
        --rz-on-base-light:  var(--surface-page);
        --rz-on-base-lighter: var(--surface-page);
        --rz-text-title-color:     var(--text-heading);
        --rz-text-color:           var(--text-body);
        --rz-text-secondary-color: var(--text-muted);
        --rz-text-tertiary-color:  var(--text-muted);
        --rz-text-disabled-color:  #7a6753;
        --rz-base-background-color:   var(--surface-card);
        --rz-dialog-background-color: var(--surface-card);
        --rz-dialog-title-background-color: var(--surface-card);
        --rz-border-normal:   var(--rz-border-width) solid var(--surface-card-border-strong);
        --rz-border-hover:    var(--rz-border-width) solid var(--rz-base-100);
        --rz-border-disabled: var(--rz-border-width) solid var(--surface-card-border);
        --rz-primary-light:   var(--color-amber-600);
        --rz-primary-lighter: var(--accent-primary-soft);
        --rz-on-primary-lighter: var(--accent-text);
        --rz-form-field-label-focus-color: var(--accent-text);
        --rz-tabs-tab-selected-color:      var(--accent-text);
        --rz-menu-item-selected-color:     var(--accent-text);
        --rz-menu-top-item-hover-color:    var(--accent-text);
        --rz-menu-top-item-selected-color: var(--accent-text);
        --rz-menu-top-item-icon-hover-color: var(--accent-text);
        --rz-pager-numeric-button-selected-color: var(--accent-text);
        --rz-grid-header-filter-icon-active-color: var(--accent-text);
        --rz-grid-apply-filter-button-color: var(--accent-text);
        --rz-switch-checked-background-color:        rgba(224,138,99,0.45);
        --rz-switch-checked-circle-background-color: var(--accent-primary);

        /* Bootstrap, for the account pages: the colours it does not take from the variables above. */
        --bs-body-color-rgb: 220, 202, 177;
        --bs-emphasis-color-rgb: 247, 240, 228;
        --bs-secondary-bg: var(--surface-sunken);
        --bs-tertiary-bg: var(--surface-sunken);
        --bs-link-color-rgb: 238, 164, 127;
        --bs-link-hover-color: var(--accent-text-strong);
        --bs-link-hover-color-rgb: 243, 184, 150;
    }
    /* Bootstrap declares these on the elements themselves, so they are set there, not on :root. */
    :root:has(.page, .login-wrap) .form-select {
        --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ead9be' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    }
    :root:has(.page, .login-wrap) .form-switch .form-check-input:not(:checked):not(:focus) {
        --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28234, 217, 190, 0.35%29'/%3e%3c/svg%3e");
    }
    :root:has(.page, .login-wrap) .btn-close {
        filter: var(--bs-btn-close-white-filter);
    }
}
