/* /core/assets/notifications.css — notifications, Follow and the slide switch on the public side (1.20.0 Phase 3a).
 *
 * The bell and its dropdown (core/components/notification-bell.php), the /account/notifications page, the account page's
 * Notifications section, and the profile's Follow button and lists. Every colour is a --cms-* token the theme maps, with a
 * fallback, so it follows the theme's light and dark palettes without a rule of its own. Pushed by the header, which is the only
 * place a stylesheet can still join <head>; a theme that draws its own bell restyles .ntf-* instead of copying a view.
 *
 * .cms-switch is the public slide switch (a checkbox with role="switch"): the one drawn control for a yes/no choice here.
 */

/* --- The slide switch ------------------------------------------------------------------------ */
.cms-switch{position:relative;display:inline-flex;align-items:center;gap:.75rem;min-height:2.75rem;cursor:pointer}
.cms-switch .visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cms-switch-input{position:absolute;opacity:0;width:2.75rem;height:1.5rem;margin:0;cursor:pointer}
.cms-switch-track{position:relative;flex:none;width:2.75rem;height:1.5rem;border-radius:999px;background:var(--cms-line-strong,#8c959f);transition:background-color .15s}
.cms-switch-track::after{content:"";position:absolute;top:.1875rem;left:.1875rem;width:1.125rem;height:1.125rem;border-radius:50%;background:var(--cms-surface,#fff);transition:transform .15s}
.cms-switch-input:checked + .cms-switch-track{background:var(--cms-accent,#0b5cad)}
.cms-switch-input:checked + .cms-switch-track::after{transform:translateX(1.25rem)}
.cms-switch-input:focus-visible + .cms-switch-track{outline:2px solid var(--cms-accent,#0b5cad);outline-offset:2px}

/* --- The bell -------------------------------------------------------------------------------- */
.ntf{position:relative;flex-shrink:0}
.ntf-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:var(--cms-radius-sm,8px);color:var(--cms-text,#3a4c5d);text-decoration:none}
.ntf-bell[aria-expanded="true"]{background:var(--cms-sunk,#f0f5fa);color:var(--cms-ink,#0e2132)}
.ntf-badge{position:absolute;top:.15rem;right:.1rem;min-width:1.1rem;height:1.1rem;padding:0 .3rem;border-radius:999px;background:var(--cms-accent,#0b5cad);color:var(--cms-accent-contrast,#fff);font-size:.6875rem;font-weight:700;line-height:1.1rem;text-align:center}
.ntf-badge[hidden]{display:none}
.ntf-panel{display:none;position:absolute;top:calc(100% + .5rem);right:0;z-index:60;width:min(24rem,calc(100vw - 1.5rem));max-height:min(32rem,calc(100vh - 6rem));overflow:auto;border:1px solid var(--cms-line,#e2ecf4);border-radius:var(--cms-radius,12px);background:var(--cms-surface,#fff);color:var(--cms-text,#3a4c5d);box-shadow:var(--cms-shadow,0 12px 32px rgba(0,0,0,.18))}
.ntf.is-open .ntf-panel{display:block}
.ntf-panel-head{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;border-bottom:1px solid var(--cms-line,#e2ecf4)}
.ntf-panel-head h2{flex:1;margin:0;font-size:1rem;color:var(--cms-ink,#0e2132)}
.ntf-panel-head form{margin:0}
.ntf-linkbtn{padding:0;border:0;background:none;color:var(--cms-accent,#0b5cad);font:inherit;font-size:.875rem;cursor:pointer}
.ntf-linkbtn:disabled{color:var(--cms-muted,#5f7284);cursor:default;text-decoration:none;opacity:.7}
.ntf-gear{display:inline-flex;color:var(--cms-muted,#5f7284)}
.ntf-panel-list,.ntf-list{list-style:none;margin:0;padding:0}
.ntf-panel-state{margin:0;padding:1rem;color:var(--cms-muted,#5f7284);font-size:.875rem}
.ntf-panel-state[hidden]{display:none}
.ntf-panel-all{display:block;padding:.75rem 1rem;border-top:1px solid var(--cms-line,#e2ecf4);text-align:center;font-size:.875rem}

/* --- A line, in the dropdown and on the page -------------------------------------------------- */
.ntf-item{position:relative;display:flex;align-items:stretch;border-bottom:1px solid var(--cms-line,#e2ecf4)}
.ntf-link{display:flex;flex:1;align-items:flex-start;gap:.75rem;min-width:0;padding:.75rem 1rem;color:var(--cms-text,#3a4c5d);text-decoration:none}
.ntf-panel-list li{border-bottom:1px solid var(--cms-line,#e2ecf4)}
.ntf-panel-list li:last-child{border-bottom:0}
.ntf-icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:50%;background:var(--cms-accent-wash,#e4f3fc);color:var(--cms-accent,#0b5cad);font-size:.875rem}
.ntf-text{display:flex;flex-direction:column;gap:.15rem;min-width:0;flex:1}
.ntf-what{overflow-wrap:anywhere}
.ntf-what strong{color:var(--cms-ink,#0e2132)}
.ntf-excerpt,.ntf-when{color:var(--cms-muted,#5f7284);font-size:.8125rem}
.ntf-dot{flex:none;width:.6rem;height:.6rem;margin-top:.45rem;border-radius:50%;background:var(--cms-accent,#0b5cad)}
.is-unread .ntf-what strong,.ntf-link.is-unread .ntf-what strong{color:var(--cms-ink,#0e2132)}
.ntf-mark{display:flex;align-items:center;margin:0;padding-right:.75rem}
.ntf-markbtn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;border:1px solid var(--cms-line-strong,#7e8d9b);border-radius:50%;background:var(--cms-surface,#fff);color:var(--cms-text,#3a4c5d);cursor:pointer}

/* --- The page ---------------------------------------------------------------------------------- */
.ntf-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.ntf-title{display:flex;align-items:center;gap:.5rem}
.ntf-title h1,.ntf-title h2{margin:0}
.ntf-actions{display:flex;align-items:center;gap:1rem}
.ntf-actions form{margin:0}
/* The settings link stands beside "Mark all read" (an .account-btn, 44px): the same height, so the row lines up and taps. */
.ntf-settings{display:inline-flex;align-items:center;gap:.4rem;min-height:44px}
.ntf-tabs{display:flex;gap:.5rem;margin-bottom:1rem}
.ntf-tabs a{display:inline-flex;align-items:center;min-height:40px;padding:0 .9rem;border:1px solid var(--cms-line,#e2ecf4);border-radius:999px;color:var(--cms-text,#3a4c5d);text-decoration:none}
.ntf-tabs a[aria-current="page"]{border-color:var(--cms-accent,#0b5cad);background:var(--cms-accent-wash,#e4f3fc);color:var(--cms-ink,#0e2132)}
.ntf-group{margin:1.25rem 0 .5rem;font-size:.8125rem;text-transform:uppercase;letter-spacing:.04em;color:var(--cms-muted,#5f7284)}
.ntf-page .ntf-list{border:1px solid var(--cms-line,#e2ecf4);border-radius:var(--cms-radius,12px);background:var(--cms-surface,#fff);overflow:hidden}
.ntf-page .ntf-item:last-child{border-bottom:0}
.ntf-empty{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:3rem 1rem;text-align:center}
.ntf-empty .ntf-icon{width:3rem;height:3rem;font-size:1.25rem}
.ntf-empty-title{margin:0;font-weight:700;color:var(--cms-ink,#0e2132)}
.ntf-more{margin-top:1rem;text-align:center}

/* --- The followed list, /account/following (1.21.0): one row per follow, its Stop following beside it ------------------------- */
.ntf-followed .ntf-head .account-title{margin:0}
.ntf-followed-list{list-style:none;margin:0;padding:0;border:1px solid var(--cms-line,#e2ecf4);border-radius:var(--cms-radius,12px);background:var(--cms-surface,#fff);overflow:hidden}
.ntf-followed-row{display:flex;align-items:center;gap:.875rem;padding:.8rem 1.25rem;border-bottom:1px solid var(--cms-line,#e2ecf4)}
.ntf-followed-row:last-child{border-bottom:0}
.ntf-followed-row .ntf-icon{width:2.25rem;height:2.25rem;border-radius:var(--cms-radius-sm,8px)}
.ntf-followed-text{display:flex;flex:1;flex-direction:column;gap:.2rem;min-width:0}
.ntf-followed-name{overflow-wrap:anywhere;font-weight:600;color:var(--cms-ink,#0e2132);text-decoration:none}
.ntf-followed-meta{color:var(--cms-muted,#5f7284);font-size:.8125rem}
.ntf-followed-row.is-gone .ntf-icon{background:var(--cms-sunk,#f0f5fa);color:var(--cms-muted,#5f7284)}
.ntf-followed-row.is-gone .ntf-followed-name{font-weight:500;color:var(--cms-muted,#5f7284)}
.ntf-followed-stop{flex:none;margin:0}
/* The row a script stopped: the confirmation in its place (the canvas's "just stopped"), tinted as .auth-ok so a dark palette keeps it. */
.ntf-followed-done{display:flex;align-items:center;gap:.6rem;padding:.8rem 1.25rem;border-bottom:1px solid var(--cms-line,#e2ecf4);background:rgba(40,160,90,.12);color:var(--cms-ink,#0e2132);font-weight:500}
.ntf-followed-done:last-child{border-bottom:0}
.ntf-followed-pages{display:flex;align-items:center;gap:1rem;margin-top:1rem;color:var(--cms-muted,#5f7284);font-size:.875rem}
.ntf-followed-pages a{display:inline-flex;align-items:center;min-height:44px;font-weight:600}


/* --- The account page's section -------------------------------------------------------------- */
.ntf-prefs{list-style:none;margin:1rem 0;padding:0}
.ntf-pref{display:grid;grid-template-columns:1fr 6rem 15rem;align-items:center;gap:.75rem;padding:.25rem 0;border-bottom:1px solid var(--cms-line,#e2ecf4)}
.ntf-pref-head{font-size:.8125rem;color:var(--cms-muted,#5f7284)}
.ntf-pref-col{display:flex;align-items:center}
/* Email per kind: Off | Instant as a segmented switch (the canvas), real radios so it posts without a script. */
.cms-seg{display:inline-flex;width:100%;border:1px solid var(--cms-line-strong,#7e8d9b);border-radius:var(--cms-radius-sm,8px);overflow:hidden}
.cms-seg label{position:relative;flex:1;display:flex}
.cms-seg input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.cms-seg span{flex:1;display:inline-flex;align-items:center;justify-content:center;min-height:2.5rem;padding:0 .625rem;background:var(--cms-surface,#fff);color:var(--cms-text,#3a4c5d);font-size:.875rem;font-weight:500;white-space:nowrap;transition:background-color .15s,color .15s}
.cms-seg label+label span{border-left:1px solid var(--cms-line-strong,#7e8d9b)}
.cms-seg input:checked+span{background:var(--cms-accent,#0b5cad);color:var(--cms-accent-contrast,#fff);font-weight:600}
.cms-seg input:focus-visible+span{outline:2px solid var(--cms-accent,#0b5cad);outline-offset:-4px;box-shadow:inset 0 0 0 4px var(--cms-surface,#fff)}
.ntf-select{width:100%;padding:.4rem .5rem;border:1px solid var(--cms-line-strong,#7e8d9b);border-radius:var(--cms-radius-sm,8px);background:var(--cms-surface,#fff);color:var(--cms-text,#3a4c5d);font:inherit}
/* The digest schedule (C5): its name, how often, "at", the hour and the (i), on one line that wraps on a phone. */
.ntf-digest-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:.75rem 0}
.ntf-digest-name{font-weight:600;color:var(--cms-ink,#0e2132)}
.ntf-digest-select{width:auto;min-height:2.5rem}
.ntf-digest-at{color:var(--cms-muted,#5f7284)}
.ntf-following-lead{color:var(--cms-muted,#5f7284)}
.ntf-follow-row{display:flex;align-items:center;gap:.5rem;margin:.5rem 0}
.ntf-following{margin:.25rem 0 1rem}
.ntf-autosave{min-height:1.25rem;margin:.5rem 0 0;color:var(--cms-muted,#5f7284);font-size:.8125rem}
.ntf-autosave.is-failed{color:var(--cms-danger,#b42318)}
/* --- Follow and the people lists ------------------------------------------------------------- */
.ntf-followform{margin:0;display:inline}
/* .account-btn is a flex box, which drops the space between the icon and the word. */
.ntf-follow-btn{gap:.4rem}
.ntf-follow-btn.is-following{background:var(--cms-surface,#fff);color:var(--cms-text,#3a4c5d);border:1px solid var(--cms-line-strong,#7e8d9b)}
.ntf-follow-sm{padding:.25rem .75rem;font-size:.8125rem}
.ntf-people h2{margin-top:0}
.ntf-people-list{list-style:none;margin:0;padding:0}
.ntf-person{display:flex;align-items:center;gap:.75rem;padding:.5rem 0;border-bottom:1px solid var(--cms-line,#e2ecf4)}
.ntf-person:last-child{border-bottom:0}
.ntf-person a{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ntf-av{display:inline-flex;flex:none;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:50%;background:var(--cms-accent-wash,#e4f3fc);color:var(--cms-accent,#0b5cad);font-size:.8125rem;font-weight:700}

/* A phone: the dropdown is a full-width sheet under the header, not a box hung from the bell. */
@media (max-width:640px){
    .ntf{position:static}
    .ntf-panel{position:fixed;top:var(--ntf-top,3.5rem);left:0;right:0;width:auto;max-height:calc(100vh - var(--ntf-top,3.5rem));border-radius:0 0 var(--cms-radius,12px) var(--cms-radius,12px)}
}
/* The page's list on a phone: the text takes the row's width. The unread dot sits on the icon, and "Mark as read" on the
   date line, instead of each taking a column beside the text, which left it a third of the row and the rows tall. */
@media (max-width:640px){
    .ntf-page .ntf-link{position:relative;padding:.75rem}
    .ntf-page .ntf-dot{position:absolute;top:.75rem;left:calc(.75rem + 1.5rem);margin:0;box-shadow:0 0 0 2px var(--cms-surface,#fff)}
    .ntf-page .ntf-mark{position:absolute;right:.5rem;bottom:.5rem;padding:0}
    .ntf-page .ntf-markbtn{width:2.5rem;height:2.5rem}
    .ntf-page .ntf-item:has(.ntf-mark) .ntf-when{display:flex;align-items:center;min-height:2.5rem;padding-right:3rem}
}
@media (max-width:640px){
    .ntf-pref{grid-template-columns:auto 1fr}
    .ntf-pref .ntf-pref-name{grid-column:1 / -1;font-weight:600}
    .ntf-pref-head{display:none}
}
/* The followed list on a phone: no icon column (the canvas's phone board), so the title keeps the width beside the button. */
@media (max-width:640px){
    .ntf-followed-row{padding:.75rem 1rem}
    .ntf-followed-row .ntf-icon{display:none}
}

/* A finger's height for the profile's follower counts and the people lists' names. */
@media (pointer:coarse){
    .ntf-counts a{display:inline-flex;align-items:center;min-height:44px}
    .ntf-person a{padding-block:.625rem}
}

@media (prefers-reduced-motion:reduce){.cms-switch-track,.cms-switch-track::after,.cms-seg span{transition:none}}

/* Hover looks only where there is a mouse (1.20.0): on a touch screen a tapped control kept its hover look until the
   next tap elsewhere. Kept last, as the media queries are, so each still follows the rules it followed before. */
@media (hover:hover){
    .ntf-bell:hover{background:var(--cms-sunk,#f0f5fa);color:var(--cms-ink,#0e2132)}
    .ntf-linkbtn:not(:where(:disabled)):hover{text-decoration:underline}
    .ntf-gear:hover{color:var(--cms-ink,#0e2132)}
    .ntf-link:hover{background:var(--cms-sunk,#f0f5fa)}
    .ntf-markbtn:hover{background:var(--cms-sunk,#f0f5fa)}
    a.ntf-followed-name:hover{text-decoration:underline}
    .cms-seg input:not(:where(:checked)):hover+span{background:var(--cms-sunk,#f0f5fa)}
}
