/* ═══════════════════════════════════════════════════════════════════════════
   notifprefs.css — Notification settings modal (Run 36, feature C).
   Companion of notifprefs.js. Every colour is one of admin.css's tokens; the
   overlay/content/header/close rules are admin.css's own (.modal-overlay,
   .modal-content, .detail-header, .modal-close) — this file only adds what the
   generic modal lacks: a left-aligned, scrollable body, group headings, the
   switches, and the two notes.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Anchored to a fixed TOP offset, not centred like admin.css's .modal-overlay:
   the body renders a beat after the modal opens, and a centred modal re-centres
   as it grows — measured in headless Chromium, the ✕ moved ~300px between the
   open and the content, so a fast click on it landed on a row instead. With
   the top pinned, growth goes downward and the header never moves. */
.notifprefs-overlay { align-items: flex-start; padding-top: 7.5vh; }

.notifprefs-modal {
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: var(--space-lg);
}

.notifprefs-head { margin-bottom: var(--space-md); }

.notifprefs-intro {
    margin: 0 0 var(--space-sm);
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* Both notes share one style and one size, deliberately DIFFERENT from the
   intro's — two styles resolving to the same size and colour read as one
   run-on paragraph (the Run 28 / Run 34 cold-read defect). */
.notifprefs-status {
    min-height: 0;
    margin: 0 0 var(--space-xs);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.notifprefs-status:empty { display: none; }
.notifprefs-status.error { color: #FCA5A5; }

.notifprefs-body {
    overflow-y: auto;
    min-height: 0;
    margin: 0 calc(-1 * var(--space-sm));
    padding: 0 var(--space-sm);
}

.notifprefs-group {
    padding: var(--space-sm) 0 var(--space-md);
    border-top: 1px solid var(--border-default);
}
.notifprefs-group:first-child { border-top: 0; }

.notifprefs-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-xs) 0;
}

.notifprefs-group-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notifprefs-group-actions { display: flex; gap: var(--space-xs); }

.notifprefs-all {
    padding: 5px 10px;
    font-family: var(--font-body);
    font-size: 0.76rem;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--duration-fast), border-color var(--duration-fast);
}
.notifprefs-all:hover { color: var(--text-primary); border-color: var(--accent-primary); }
.notifprefs-all:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 1px; }

/* M11's line, under the Inbox heading — a note, not a description, so it is
   set apart from the rows (amber accent, its own size). */
.notifprefs-note {
    margin: 2px 0 var(--space-xs);
    padding: 8px 10px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #FBBF24;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
}

.notifprefs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 44px;            /* a finger-sized row on a phone */
    padding: 6px 0;
}

.notifprefs-text { min-width: 0; }

.notifprefs-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.notifprefs-desc {
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-muted);
}

/* The switch: a real button with role="switch", so it is keyboard-reachable
   and its state is the aria-checked attribute the harness reads. */
.notifprefs-switch {
    flex: 0 0 auto;
    position: relative;
    width: 44px;
    height: 24px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--border-default);
    background: var(--bg-input);
    cursor: pointer;
    transition: background var(--duration-fast), border-color var(--duration-fast);
}
.notifprefs-switch[aria-checked="true"] {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
.notifprefs-switch:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.notifprefs-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform var(--duration-fast), background var(--duration-fast);
}
.notifprefs-switch[aria-checked="true"] .notifprefs-knob {
    transform: translateX(20px);
    background: #fff;
}

.notifprefs-empty {
    margin: var(--space-md) 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .notifprefs-overlay { padding-top: 4vh; }
    .notifprefs-modal { padding: var(--space-md); max-height: 92vh; }
    .notifprefs-row { gap: var(--space-sm); }
}
