/**
 * Modern Daycare — shared layout and components (public + employee).
 * Colour tokens live in css/themes/<theme>.css (see APP_CONFIG['ui_theme']).
 * Typography: Plus Jakarta Sans (loaded in includes/header.php).
 */

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
    font-weight: 500;
    background:
        linear-gradient(145deg, var(--bg-shine) 0%, var(--bg) 42%, var(--bg-alt) 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}
body.employee-area {
    background: linear-gradient(145deg, var(--bg-shine) 0%, var(--bg) 42%, var(--bg-alt) 100%);
}
body.high-contrast { background: var(--bg); }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
body.high-contrast a { color: var(--accent); }
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}
.logo {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
body.employee-area .logo { color: var(--employee-accent); }
.logo span { font-size: 1.5rem; }
.site-header-brand-mark {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
}
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: center;
}
nav a {
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
nav a:hover, nav a.active,
nav .nav-dropdown-toggle:hover,
nav .nav-dropdown-toggle.active,
nav .nav-dropdown.is-open .nav-dropdown-toggle {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
body.high-contrast nav a:hover,
body.high-contrast nav a.active,
body.high-contrast nav .nav-dropdown-toggle:hover,
body.high-contrast nav .nav-dropdown-toggle.active,
body.high-contrast nav .nav-dropdown.is-open .nav-dropdown-toggle {
    background: var(--primary);
    color: #000;
}
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: inherit;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    line-height: inherit;
}
.nav-dropdown-toggle::after {
    content: '';
    border: 0.35rem solid transparent;
    border-top-color: currentColor;
    margin-top: 0.2rem;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 11rem;
    margin: 0;
    /* Padding bridges the toggle so the pointer never leaves the dropdown while moving down */
    padding: 0.35rem;
    padding-top: calc(0.35rem + 0.25rem);
    list-style: none;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    white-space: nowrap;
}
.nav-submenu {
    list-style: none;
    margin: 0.25rem 0 0.35rem;
    padding: 0.35rem 0 0;
    border-top: 1px solid var(--border-subtle);
}
.nav-submenu:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}
.nav-submenu-label {
    display: block;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.nav-submenu-items {
    list-style: none;
    margin: 0;
    padding: 0 0 0.15rem;
    /* nav ul { display:flex } applies to all lists in the header; submenu links must stack */
    display: block;
}
.nav-submenu-items a {
    padding-left: 1rem;
    font-size: 0.95rem;
}
@media (max-width: 768px) {
    .header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 0.5rem 0.65rem;
        align-items: center;
    }
    .logo {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .site-nav-menu-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        flex-shrink: 0;
    }
    .header-tools {
        grid-column: 3;
        grid-row: 1;
        flex-shrink: 0;
    }
    .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        display: none;
        flex: none;
        margin: 0.35rem -1.25rem -0.75rem;
        padding: 0.5rem 1.25rem 1rem;
        border-top: 1px solid var(--card-border);
        background: color-mix(in srgb, var(--header-bg) 92%, var(--bg) 8%);
        max-height: min(70vh, 28rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .site-nav.is-open {
        display: block;
    }
    .site-nav__panel {
        display: block;
        width: 100%;
    }
    .site-nav .site-nav__panel > ul {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 0.2rem 0;
        width: 100%;
    }
    .site-nav .site-nav__panel > ul > li {
        width: 100%;
    }
    .site-nav .nav-dropdown-menu a {
        white-space: normal;
    }
    .nav-dropdown { width: 100%; }
    .nav-dropdown-menu {
        position: static;
        margin-top: 0.25rem;
        box-shadow: none;
    }
}
.header-tools { display: flex; align-items: center; gap: 0.5rem; }
.site-nav-menu-toggle {
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    border: 2px solid var(--card-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 70%, var(--bg-shine));
    color: var(--text);
    font-family: inherit;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1;
}
.site-nav-menu-toggle:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}
.site-nav-menu-toggle__chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 0.32rem solid transparent;
    border-right: 0.32rem solid transparent;
    border-top: 0.38rem solid currentColor;
    transition: transform 0.2s ease;
    margin-top: 0.08rem;
}
.site-nav-menu-toggle.is-open .site-nav-menu-toggle__chevron {
    transform: rotate(180deg);
}
body.high-contrast .site-nav-menu-toggle {
    border-color: var(--primary);
    background: #000;
    color: #fff;
}
@media (min-width: 769px) {
    .site-nav-menu-toggle {
        display: none;
    }
    .site-nav {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    .site-nav__panel {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
    }
}
.btn-contrast {
    background: transparent;
    border: 2px solid var(--text);
    color: var(--text);
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.8rem;
}
.btn-contrast:focus { outline: 3px solid var(--focus); }
body.high-contrast .btn-contrast {
    background: #000;
    border-color: var(--primary);
    color: #fff;
}
main { max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.glass-panel {
    /* Theme tokens only — avoids a fixed grey wash that clashes with dark schemes */
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--bg-shine) 58%, var(--card) 42%) 0%,
        var(--card) 46%,
        color-mix(in srgb, var(--bg-alt) 58%, var(--primary) 16%) 100%
    );
    backdrop-filter: blur(20px) saturate(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
body.high-contrast .glass-panel {
    background: #000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 2px solid #fff;
    box-shadow: none;
}
.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 0.5rem; }
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 1.5rem; }
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--primary) 38%, #ffffff) 0%,
        var(--primary) 55%,
        var(--primary-dark) 100%
    );
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 49, 57, 0.22), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.btn-secondary {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--secondary) 35%, #ffffff) 0%,
        var(--secondary) 100%
    );
    color: #fff;
    box-shadow: 0 4px 12px rgba(42, 49, 57, 0.15);
}
.btn-outline {
    background: rgba(255, 255, 255, 0.35);
    border: 2px solid var(--border-subtle);
    color: var(--primary-dark);
    backdrop-filter: blur(8px);
}

/* Glass outline CTA — public home “View all providers”, employee dashboard roster, etc. */
.md-glass-outline-cta-wrap {
    text-align: center;
    margin: 1.5rem 0 0;
}
.md-glass-outline-cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    color: var(--text);
    border: 1px solid var(--card-border);
    background: var(
        --md-landing-feature-card-bg,
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--card) 90%, var(--bg-shine)) 0%,
            color-mix(in srgb, var(--card) 78%, color-mix(in srgb, var(--primary) 16%, var(--bg))) 100%
        )
    );
    backdrop-filter: var(--md-landing-feature-card-backdrop, blur(16px));
    -webkit-backdrop-filter: var(--md-landing-feature-card-backdrop, blur(16px));
    box-shadow: var(--md-landing-feature-card-shadow, var(--shadow));
}
.md-glass-outline-cta:visited {
    color: var(--text);
}
.md-glass-outline-cta:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text);
    border-color: color-mix(in srgb, var(--primary) 42%, var(--card-border));
    box-shadow: var(
        --md-landing-feature-card-hover-shadow,
        0 12px 36px color-mix(in srgb, var(--primary) 14%, transparent)
    );
}
.md-glass-outline-cta:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}
body.high-contrast .md-glass-outline-cta {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
}

.btn-vibrant-purple {
    background: linear-gradient(180deg, #a855f7 0%, #7c3aed 55%, #6d28d9 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.btn-vibrant-purple:hover { color: #fff; }
body.high-contrast .btn-primary { color: #000; }
body.high-contrast .btn-vibrant-purple { color: #000; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Pay grids — prevent grid column blowout; scroll wide grade tables horizontally */
.pay-grids-layout {
    align-items: start;
}
.pay-grids-layout > .glass-panel {
    min-width: 0;
}
.pay-grids-right-scroll {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.pay-grids-right-scroll .pay-grids-grades-table {
    width: max-content;
    min-width: 100%;
}
.pay-grids-right-scroll .pay-grade-progression > div {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

/* Schedule (shifts) — keep grid columns from blowing out; scroll shift list inside panel */
.shifts-page-grid {
    align-items: start;
}
.shifts-page-grid > .glass-panel {
    min-width: 0;
}
.shifts-scheduled-scroll {
    overflow: auto;
    max-width: 100%;
    max-height: min(70vh, 42rem);
    -webkit-overflow-scrolling: touch;
}
.shifts-scheduled-scroll table {
    min-width: max(100%, 28rem);
}
.shifts-form-scroll {
    max-height: min(70vh, 42rem);
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.5rem; }
.muted { color: var(--text-muted); }
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.alert-success { background: rgba(220, 236, 225, 0.85); color: #2d4a36; border: 1px solid rgba(138, 170, 150, 0.45); backdrop-filter: blur(8px); }
.alert-error { background: rgba(240, 220, 220, 0.85); color: #5c3333; border: 1px solid rgba(180, 140, 140, 0.45); backdrop-filter: blur(8px); }
.alert-info { background: rgba(220, 228, 238, 0.9); color: #3a4a5c; border: 1px solid var(--border-subtle); backdrop-filter: blur(8px); }
body.high-contrast .alert-success,
body.high-contrast .alert-error,
body.high-contrast .alert-info {
    background: #000; color: #fff; border: 2px solid #fff;
}
.dev-pin-banner {
    background: linear-gradient(90deg, #3f4d5a, #5a6a7a);
    color: #e8ecf0;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
form label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
form label:has(input[type="radio"]),
form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    max-width: 100%;
    font-weight: 600;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
form input, form select, form textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
}
form input[type="radio"],
form input[type="checkbox"] {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--primary-dark);
}
body.high-contrast form input,
body.high-contrast form select,
body.high-contrast form textarea {
    background: #000; color: #fff; border-color: #fff;
}
table { width: 100%; border-collapse: collapse; }
.pricing-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
table.pricing-table {
    width: max-content;
    min-width: 100%;
}
table.pricing-table th,
table.pricing-table td {
    vertical-align: middle;
}
table.pricing-table th:not(:first-child),
table.pricing-table td:not(:first-child) {
    width: 1%;
    white-space: nowrap;
}
table.pricing-table th:not(:first-child) {
    white-space: normal;
    min-width: 6.5rem;
    max-width: 9rem;
    font-size: 0.9rem;
    line-height: 1.3;
}
table.pricing-table td:first-child,
table.pricing-table th:first-child {
    white-space: nowrap;
    min-width: 10rem;
}
table.pricing-table .price-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
form table.pricing-table .price-cell input[type="number"] {
    width: 6.5rem;
    max-width: 6.5rem;
    margin-bottom: 0;
    flex-shrink: 0;
}
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border-subtle); }
body.high-contrast th, body.high-contrast td { border-color: #fff; }
th { font-weight: 800; }
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.badge-pending { background: rgba(200, 208, 216, 0.9); color: #4a5d6e; }
.badge-confirmed { background: rgba(200, 220, 208, 0.95); color: #2d4a36; }
.badge-cancelled { background: rgba(220, 210, 210, 0.95); color: #5c3333; }
.badge-sick { background: rgba(255, 235, 180, 0.98); color: #8a4b00; border: 1px solid #e65100; }
.badge-vacation { background: rgba(200, 230, 255, 0.98); color: #0d47a1; border: 1px solid #1565c0; }
body.high-contrast .badge-sick,
body.high-contrast .badge-vacation {
    background: #ff0;
    color: #000;
    border-color: #000;
}
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.slot-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.slot-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    backdrop-filter: blur(6px);
}
.slot-btn.selected, .slot-btn:hover {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--primary) 32%, #ffffff) 0%,
        var(--primary) 100%
    );
    color: #fff;
    border-color: var(--primary);
}
.slot-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.holiday-row-open, .shift-holiday-open {
    background: linear-gradient(90deg, #fff9c4 0%, #ffe082 100%) !important;
    color: #3e2723;
}
.holiday-row-closed, .shift-holiday-closed {
    background: linear-gradient(90deg, #ffccbc 0%, #f8bbd0 100%) !important;
    color: #4a148c;
}
.holiday-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    background: #fff59d;
    border: 1px solid #f9a825;
    border-radius: 0;
}
.shift-holiday-closed .holiday-badge {
    background: #f8bbd0;
    border-color: #ec407a;
}
body.high-contrast .holiday-row-open,
body.high-contrast .shift-holiday-open,
body.high-contrast .holiday-row-closed,
body.high-contrast .shift-holiday-closed {
    background: #000 !important;
    color: #fff !important;
}
body.high-contrast .holiday-badge {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
}
@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    nav ul { flex-direction: column; align-items: flex-start; width: 100%; }
}

/**
 * High contrast — always black background + yellow accents, regardless of colour theme.
 * Toggle restores the active theme’s variables from css/themes/<slug>.css.
 */
body.high-contrast {
    --bg: #000;
    --bg-alt: #000;
    --bg-shine: #0a0a0a;
    --text: #fff;
    --text-muted: #ffff00;
    --primary: #ffff00;
    --primary-dark: #ffea00;
    --secondary: #ffff00;
    --accent: #fff;
    --card: #000;
    --card-border: #ffff00;
    --glass-highlight: #222;
    --shadow: none;
    --radius: 0;
    --header-bg: #000;
    --focus: #ffff00;
    --success: #0f0;
    --danger: #f66;
    --employee-accent: #ffff00;
    --border-subtle: #ffff00;
}

body.high-contrast.employee-area {
    background: var(--bg);
}

/* General settings — full width of employee main (same as dashboard), stacked panels */
.md-general-settings {
    width: 100%;
}
.md-general-settings > h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.md-general-settings__lede {
    margin: 0 0 1.25rem;
    font-size: 1rem;
}
.md-general-settings__alert {
    margin-bottom: 1.25rem;
}
.md-general-settings__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 1.75rem;
}
.md-general-settings__form > section[id] {
    scroll-margin-top: 5.5rem;
}
.md-general-settings__toc .md-general-settings__toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
}
.md-general-settings__toc .md-general-settings__toc-list a {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border: 1px solid transparent;
}
.md-general-settings__toc .md-general-settings__toc-list a:hover {
    background: rgba(74, 93, 110, 0.1);
    border-color: var(--border-subtle);
}
body.high-contrast .md-general-settings__toc .md-general-settings__toc-list a:hover {
    background: rgba(255, 255, 0, 0.12);
}
.md-general-settings__panel {
    width: 100%;
    max-width: none;
    margin-bottom: 0;
}
.md-general-settings__hint {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.45;
}
.md-general-settings__check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.md-general-settings__preview-label {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
}
.md-general-settings__logo-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 800;
}
form label.md-general-settings__banner-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    font-weight: 600;
    margin-bottom: 0.75rem;
    cursor: pointer;
}
form label.md-general-settings__banner-toggle input {
    margin-top: 0.25rem;
    flex-shrink: 0;
}
.md-general-settings-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: 1rem;
    align-items: stretch;
}
.md-general-settings-feature-card {
    margin: 0;
    padding: 1rem 1.1rem 0.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.28);
}
.md-general-settings-feature-card__legend {
    padding: 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.md-general-settings-feature-card input,
.md-general-settings-feature-card textarea {
    margin-bottom: 0.75rem;
}
.md-general-settings-feature-card textarea {
    margin-bottom: 0.5rem;
    min-height: 7rem;
    resize: vertical;
}
.md-general-settings__subsection-title {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 800;
}
.md-general-settings__table-wrap {
    overflow-x: auto;
    margin-bottom: 0.5rem;
}
.md-general-settings__tz-table select {
    margin-bottom: 0;
}
.md-general-settings__panel input[readonly] {
    cursor: default;
    background: color-mix(in srgb, var(--card) 88%, var(--border-subtle) 12%);
    color: var(--text-muted);
}
body.high-contrast .md-general-settings__panel input[readonly] {
    background: #000;
    color: #fff;
    border-color: #fff;
}
.md-general-settings__actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}
.md-general-settings-layout-fieldset {
    border: 0;
    margin: 0 0 1.25rem;
    padding: 0;
}
.md-general-settings-layout-legend {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    padding: 0;
}
.md-general-settings-layout-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 0.35rem;
}
.md-general-settings-layout-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 600;
    max-width: 100%;
    cursor: pointer;
}
.md-general-settings-layout-option input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.md-general-settings-stack-options {
    margin-top: 1rem;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.22);
}
.md-general-settings-stack-heading {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
}
.md-general-settings-photo-uploads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.md-general-settings-photo-slot {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.35);
}
.md-general-settings-photo-slot__label {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}
.md-general-settings-photo-slot__preview {
    margin: 0 0 0.5rem;
}
.md-general-settings__check-label--inline {
    margin-top: 0.65rem;
    font-size: 0.88rem;
}
.md-general-settings-emoji-fieldset {
    margin-top: 1.25rem;
}
.md-general-settings-emoji-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 0.75rem 1rem;
    margin-top: 0.75rem;
}
.md-general-settings-emoji-fields--dual {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 0.75rem;
}
@media (min-width: 768px) {
    .md-general-settings-emoji-fields--dual {
        flex-direction: row;
        align-items: flex-start;
    }
    .md-general-settings-emoji-fields--dual > .md-general-settings-emoji-channel {
        flex: 1 1 45%;
        min-width: 0;
    }
}
.md-general-settings-emoji-channel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 0.75rem 1rem;
}
.md-general-settings-emoji-fields.is-disabled {
    opacity: 0.55;
}
.md-general-settings-emoji-slot label {
    font-size: 0.88rem;
}
select.home-feature-emoji-select {
    width: 100%;
    max-width: 100%;
    min-height: 2.5rem;
    font-size: 1.05rem;
    line-height: 1.35;
}
select.home-feature-band-transition-select {
    width: 100%;
    max-width: min(100%, 28rem);
    margin-top: 0.35rem;
}
body.high-contrast .md-general-settings-stack-options,
body.high-contrast .md-general-settings-photo-slot {
    background: #000;
    border-color: #fff;
}
body.high-contrast .md-general-settings-feature-card {
    background: #000;
    border-color: #fff;
}
body.high-contrast .md-general-settings-feature-card__legend {
    color: #fff;
}

/* General settings — theme picker preview cards (6 themes: fixed 2×3 / 3×2 so none sit alone stretched) */
.md-theme-preview-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 0;
}
@media (min-width: 48rem) {
    .md-theme-preview-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.md-theme-preview-option {
    min-width: 0;
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.5rem 0.65rem 0.6rem;
    cursor: pointer;
    background: var(--card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.md-theme-preview-option:hover {
    border-color: var(--primary);
}

.md-theme-preview-option:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--accent);
}

.md-theme-preview-option input {
    margin: 0 0 0.35rem;
}

.md-theme-preview-option .md-theme-preview-label {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
}

.md-theme-preview-swatch {
    display: flex;
    height: 1.75rem;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 0.2rem;
}

.md-theme-preview-swatch span {
    flex: 1;
    min-width: 0;
}

.md-general-settings-custom-theme {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--card) 88%, transparent);
}
.md-general-settings-custom-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
    gap: 1rem 1.25rem;
    margin-top: 0.75rem;
}
.md-general-settings-custom-theme-grid label > span:first-child {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}
.md-general-settings-custom-theme-grid input[type="color"] {
    width: 100%;
    height: 2.5rem;
    padding: 0.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    background: var(--card);
}

/* Employee compliance logs (admin) */
.md-compliance-form label {
    display: block;
    margin-top: 0.85rem;
    font-weight: 600;
    font-size: 0.92rem;
}
.md-compliance-form label:first-of-type {
    margin-top: 0;
}
.md-compliance-form input[type="text"],
.md-compliance-form input[type="date"],
.md-compliance-form input[type="time"],
.md-compliance-form input[type="datetime-local"],
.md-compliance-form select,
.md-compliance-form textarea {
    width: 100%;
    max-width: 32rem;
    margin-top: 0.25rem;
}
.md-compliance-form button[type="submit"] {
    margin-top: 1.1rem;
}
