/* ---- Notices: the bell in the top bar and the notices sheet (notices.js) ---- */

/* The bell and the profile pill share the top bar's last column. */
.nt-topbar-end { justify-self: end; display: flex; align-items: center; gap: 10px; min-width: 0; }
.nt-bell { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: #aaa79d; background: none; cursor: pointer; transition: color .2s, background-color .2s; }
.nt-bell:hover, .nt-bell[aria-expanded="true"] { color: var(--paper); background: rgba(242, 238, 223, .06); }
.nt-bell:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.nt-bell.has-unread { color: var(--paper); }
.nt-bell-icon { width: 23px; height: 23px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nt-bell.has-unread .nt-bell-clapper { stroke: var(--red); stroke-width: 2; }
.nt-bell-count { position: absolute; top: 4px; right: 2px; min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--night); border-radius: 10px; color: #fff; background: var(--red); font: 800 10px/1 Arial, sans-serif; font-style: normal; letter-spacing: 0; pointer-events: none; }

/* A long name must not push the pair into the navigation: it is cut short, the avatar stays. */
.nt-topbar-end .profile-pill { min-width: 0; }
.nt-topbar-end .profile-pill b { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1000px) {
    .nt-topbar-end .profile-pill b { max-width: 7ch; }
}
@media (max-width: 760px) {
    .nt-topbar-end { grid-column: 2; gap: 4px; }
}

/* ---- The sheet: a bottom sheet on phones, a panel under the bell on wider screens ---- */
.nt-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: min(86svh, 720px); margin: 0; padding: 0; overflow: visible; border: 0; border-top: 3px solid var(--red); color: var(--ink); background-color: var(--paper); background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(18, 18, 18, .05) 28px); box-shadow: 0 -14px 40px rgba(0, 0, 0, .5); }
.nt-sheet[open] { display: flex; flex-direction: column; }
.nt-sheet::backdrop { background: rgba(8, 8, 8, .66); animation: nt-dim .3s ease-out; }
@keyframes nt-dim { from { opacity: 0; } }

.nt-head { position: relative; flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 20px 16px 12px 20px; border-bottom: 1px solid #c9c4b4; background: var(--paper); touch-action: none; }
.nt-grip { position: absolute; top: 8px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: #bdb8a8; }
.nt-head-mark { display: grid; place-items: center; width: 36px; height: 36px; color: var(--paper); background: var(--red); font: 400 20px/1 "Yu Mincho", "MS Mincho", serif; }
.nt-head-copy small { display: block; color: #77736a; font: 800 10px/1.2 Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.nt-head-copy h2 { margin: 3px 0 0; font: italic 400 24px/1.05 Georgia, serif; letter-spacing: -.02em; }
.nt-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #b0aa98; border-radius: 50%; color: var(--ink); background: transparent; font: 400 26px/1 Georgia, serif; cursor: pointer; }
.nt-close:hover { border-color: var(--red); color: var(--red); }
.nt-close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.nt-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px calc(18px + env(safe-area-inset-bottom)); }
.nt-list { margin: 0; padding: 0; list-style: none; }
.nt-item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid #d3cdbb; }
.nt-item:last-child { border-bottom: 0; }
/* What is new carries a red edge; it fades once the notice counts as read. */
.nt-item::before { content: ''; position: absolute; top: 18px; bottom: 18px; left: -20px; width: 3px; background: var(--red); opacity: 0; transition: opacity .9s ease; }
.nt-item.is-unread::before { opacity: 1; }

.nt-seal { display: grid; place-items: center; width: 40px; height: 40px; color: var(--paper); background: var(--ink); font: 400 22px/1 "Yu Mincho", "MS Mincho", serif; }
.nt-item[data-kind="match.mutual"] .nt-seal { background: var(--red); }
.nt-item[data-kind="photo.removed"] .nt-seal, .nt-item[data-kind="match.restricted"] .nt-seal { color: var(--red); background: var(--ink); }
.nt-item[data-kind="photo.approved"] .nt-seal, .nt-item[data-kind$=".restored"] .nt-seal { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.nt-item[data-kind="report.reviewed"] .nt-seal { background: var(--blue); }

.nt-copy { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; }
.nt-title { grid-column: 1; margin: 0; font: 400 19px/1.2 Georgia, serif; letter-spacing: -.01em; overflow-wrap: anywhere; }
.nt-time { grid-column: 2; grid-row: 1; color: #77736a; font: 700 10px/1.3 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.nt-text { grid-column: 1 / -1; margin: 6px 0 0; color: #3b3832; font: 15px/1.55 Georgia, serif; overflow-wrap: anywhere; }
.nt-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 12px 0 0; }
/* One filled action; anything else is a quiet underlined link beside it, so both fit on a phone. */
.nt-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px; border: 0; color: var(--ink); background: transparent; font: 15px/1.2 Georgia, serif; text-decoration: underline; text-decoration-color: rgba(239, 75, 63, .7); text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.nt-action:hover { color: var(--red); }
.nt-action.is-primary { padding: 0 18px; border: 1px solid var(--ink); color: var(--paper); background: var(--ink); font: 800 11px/1.2 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.nt-action.is-primary:hover { border-color: var(--red); color: var(--paper); background: var(--red); }
.nt-action:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.nt-state { display: grid; justify-items: center; gap: 12px; padding: 34px 8px 26px; text-align: center; }
.nt-state > span { display: grid; place-items: center; width: 64px; height: 64px; border: 1.5px solid var(--ink); border-radius: 50%; color: var(--red); font: 400 30px/1 "Yu Mincho", "MS Mincho", serif; }
.nt-state p { max-width: 32ch; margin: 0; color: #4f4b44; font: italic 16px/1.55 Georgia, serif; }
.nt-state b { color: var(--ink); font-style: normal; }
.nt-state.is-error > span { border-color: var(--red); }

@media (min-width: 761px) {
    .nt-sheet { inset: var(--nt-top, 78px) var(--nt-right, 24px) auto auto; width: min(420px, calc(100vw - 24px)); max-height: min(72vh, 640px); border: 1px solid var(--ink); border-top: 3px solid var(--red); box-shadow: 12px 12px 0 #080808; }
    /* A small red tab points at the bell. */
    .nt-sheet::before { content: ''; position: absolute; top: -11px; right: 14px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--red); }
    .nt-sheet::backdrop { background: rgba(8, 8, 8, .3); }
    .nt-grip { display: none; }
    .nt-head { padding-top: 16px; touch-action: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .nt-sheet::backdrop { animation: none; }
}
