/* «Що нового» (web/news.js, BB-60). Andrii, 21.11.2026: «давай якось зробимо прикольніше і по анімаціям (флоу) і по
   апдейту що нового (модалка може якась, і може також лейбли (крапочки+new)) по апдейтам».
   The colour here is the brand's signal (--signal) and nothing else: a dot, a word, an impulse. The rest is ink and paper. */

/* ── the bar of a new version: above the phone's tab bar, out of the way of the page ───────────── */
.newver { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 24px); padding: 7px 7px 7px 12px; border-radius: var(--pill); background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 600; box-shadow: 0 8px 30px rgb(0 0 0 / .25); transform-origin: 23px 50%; animation: nv-in 620ms var(--spring) backwards; }
@keyframes nv-in { from { opacity: 0; transform: translate(-50%, 28px) scale(.86); } }
/* it says once that it is here: two rings of the signal leave it, then it is still */
.newver::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: nv-halo 1.6s var(--enter) 520ms 2 backwards; }
@keyframes nv-halo { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 60%, transparent); } to { box-shadow: 0 0 0 16px color-mix(in srgb, var(--signal) 0%, transparent); } }
.newver.done::before { animation: none; }
.nv-mark { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.nv-mark .neuron { width: 22px; height: 22px; --k: .42; }
.nv-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-s { display: none; }
@media (max-width: 480px) { .nv-l { display: none; } .nv-s { display: inline; } }
.nv-more { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 9px; border-radius: var(--pill); background: color-mix(in srgb, var(--signal) 26%, transparent); color: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background var(--fast); }
.nv-more:hover { background: color-mix(in srgb, var(--signal) 40%, transparent); }
.nv-more[hidden] { display: none; }
.newver.done .nv-more { padding: 0 11px; background: color-mix(in srgb, var(--on-ink) 16%, transparent); }
.newver.done .nv-more:hover { background: color-mix(in srgb, var(--on-ink) 28%, transparent); }
.newver .btn { background: var(--paper); color: var(--fg); flex: none; }
.newver .btn svg { transition: transform 480ms var(--enter); }
.newver .btn:hover svg { transform: rotate(180deg); }
.newver.done { padding: 7px 7px 7px 10px; gap: 8px; }
.newver.done:not(:has(.nv-more)) { padding-right: 16px; }
.nv-ok { width: 20px; height: 20px; flex: none; }
.nv-ok .check-draw { width: 20px; height: 20px; margin: 0; color: #9fe08c; }
:root[data-mode="dark"] .nv-ok .check-draw { color: hsl(108, 45%, 34%); }
/* the list was opened from the bar: the bar waits under it, out of sight */
.newver.under { opacity: 0; pointer-events: none; transition: opacity 160ms; }
.newver.out { opacity: 0; transform: translate(-50%, 10px); transition: opacity 280ms var(--exit), transform 280ms var(--exit); }
/* «Оновити»: the bar gathers into its dot (the dot itself is .nv-dot, it leaves for the middle of the window) */
.newver.going { opacity: 0; transform: translateX(-50%) scale(.5); pointer-events: none; transition: opacity 240ms var(--exit), transform 300ms var(--exit); }
.newver.going > * { opacity: 0; transition: opacity 120ms; }
/* the paper and the ink of the first screen of the page that is about to load (index.html: the «fog» look, or the dark one) */
.nv-veil { position: fixed; inset: 0; z-index: 130; background: #E8EDF1; opacity: 0; transition: opacity 340ms var(--enter); }
.nv-veil.on { opacity: 1; }
.nv-dot { position: fixed; z-index: 131; width: 12px; height: 12px; margin: -6px 0 0 -6px; pointer-events: none; transition: transform 460ms cubic-bezier(.5, 0, .15, 1); }
.nv-dot b { position: absolute; inset: 0; border-radius: 50%; background: var(--on-ink); transition: background-color 260ms 140ms; }
.nv-dot.on b { background: #0C1B27; }
.nv-dot i { position: absolute; inset: -1px; border-radius: 50%; border: 1.2px solid #0C1B27; opacity: 0; }
.nv-dot.on i { animation: nv-ring 1100ms linear 420ms infinite; }
.nv-dot.on i + i { animation-delay: 970ms; }
@keyframes nv-ring { from { inset: -1px; opacity: .3; } to { inset: -31px; opacity: 0; } }
:root[data-mode="dark"] .nv-veil { background: #101317; }
:root[data-mode="dark"] .nv-dot.on b { background: #E9EDF1; }
:root[data-mode="dark"] .nv-dot i { border-color: #E9EDF1; }
/* the page loaded again by «Оновити» (web/mode.js): the same dot stands in the middle from the first paint, and the
   brain of the project grows out of it (web/brainload.js) */
html[data-reload] .boot::after { content: ''; position: fixed; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ink); }
html[data-reload] .boot::before { content: ''; position: fixed; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; box-shadow: 0 0 0 1.2px var(--ink); opacity: 0; animation: nv-boot 1100ms linear infinite; }
@keyframes nv-boot { from { transform: scale(1.15); opacity: .3; } to { transform: scale(6.1); opacity: 0; } }

/* ── the list ──────────────────────────────────────────────────────────────────────────────────── */
.modal.news { width: min(560px, 100%); max-height: min(740px, calc(100vh - 40px)); max-height: min(740px, calc(100dvh - 40px)); overflow: hidden; display: flex; flex-direction: column; }
.modal.news.after { animation: news-pop 560ms var(--spring) both; }
@keyframes news-pop { from { opacity: 0; transform: scale(.9) translateY(18px); } }
.news-h { position: relative; flex: none; overflow: hidden; padding: 26px 56px 22px 26px; background: var(--cream); border-bottom: 1px solid var(--line); }
.news-h > .neurons { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.news-ht { position: relative; animation: rise 420ms var(--enter) 60ms both; }
.news-ht h2 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.news-ht p { margin: 5px 0 0; font-size: 13px; color: color-mix(in srgb, var(--ink) 68%, transparent); }
.news-x-btn { position: absolute; top: 10px; right: 10px; color: color-mix(in srgb, var(--ink) 60%, transparent); }
.news-x-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.news-b { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 12px 8px; }
.news-d { padding: 14px 18px 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-subtle); }
.news-row { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 12px 10px 18px; border-radius: var(--r-xl); text-align: left; color: inherit; transition: background var(--fast); }
.news-row.goes { cursor: pointer; }
.news-row.goes:hover { background: var(--bg-subtle); }
.news-row.goes:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.news-d, .news-row { animation: news-in 440ms var(--enter) backwards; animation-delay: calc(110ms + var(--i, 0) * 46ms); }
@keyframes news-in { from { opacity: 0; transform: translateY(10px); } }
/* an entry the person has not seen before: the signal's dot */
.news-row.unread::before { content: ''; position: absolute; left: 5px; top: 25px; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: news-dot 420ms var(--spring) backwards; animation-delay: calc(330ms + var(--i, 0) * 46ms); }
@keyframes news-dot { from { transform: scale(0); } }
.news-x { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.news-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-t b { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--fg); }
.news-k { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: var(--pill); font-size: 10.5px; font-weight: 600; background: var(--bg-subtle); color: var(--fg-subtle); }
.news-k.k-new { background: color-mix(in oklab, var(--signal) 13%, var(--paper)); color: color-mix(in oklab, var(--signal) 72%, var(--fg)); }
.news-p { font-size: 13px; line-height: 1.5; color: var(--fg-muted); }
.news-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--fg); }
.news-go svg { width: 13px; height: 13px; transition: transform var(--base) var(--enter); }
.news-row.goes:hover .news-go svg { transform: translateX(3px); }
/* what the person has already read, folded under one line */
.news-earlier { display: flex; align-items: center; gap: 6px; width: calc(100% - 12px); margin: 8px 6px 6px; padding: 10px 12px; border-radius: var(--r-lg); border: 1px dashed var(--border-strong); background: none; color: var(--fg-muted); font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; transition: background var(--fast), color var(--fast); }
.news-earlier:hover { background: var(--bg-subtle); color: var(--fg); }
.news-earlier svg { width: 14px; height: 14px; margin-left: auto; }
.news-seen { display: flex; align-items: center; gap: 10px; margin: 14px 18px 2px; font-size: 11.5px; font-weight: 600; color: var(--fg-subtle); }
.news-seen::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.news-f { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
@media (max-width: 520px) { .news-h { padding: 22px 50px 18px 20px; } .news-b { padding: 2px 6px 6px; } .news-f { padding: 10px 14px 14px; } .news-f .btn { flex: 1; } }

/* ── the marks: a dot and the word «new» ───────────────────────────────────────────────────────── */
.nav-new, .new-tag { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .01em; color: color-mix(in oklab, var(--signal) 78%, var(--ink)); animation: new-in 380ms var(--spring) backwards; }
.nav-new b, .new-tag b { font-weight: 700; }
@keyframes new-in { from { opacity: 0; transform: scale(.5); } }
.nav-new.out { opacity: 0; transform: scale(.5); transition: opacity 220ms var(--exit), transform 220ms var(--exit); }
.nav-new i, .new-tag i, .nv-more i { position: relative; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
/* the dot calls three times, then it is still: a mark is not an alarm */
.nav-new i::after, .new-tag i::after, .nv-more i::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1.5px solid var(--signal); opacity: 0; animation: new-ring 2.4s var(--enter) 600ms 3; }
@keyframes new-ring { 0% { inset: -1px; opacity: .7; } 70%, 100% { inset: -7px; opacity: 0; } }
/* on the row that is open the word stands on ink */
.nav-row.active .nav-new { color: color-mix(in oklab, var(--signal) 62%, var(--cream)); }
/* a round button of the rail and a tab of the phone's bar get the dot alone, at their corner */
.side-foot .icon-btn, .bnav > button, .auto-btn, .icon-btn.sort-btn { position: relative; }
.side-foot .icon-btn .nav-new, .bnav .nav-new, .new-tag.dot { position: absolute; top: 3px; right: 3px; }
.side-foot .icon-btn .nav-new b, .bnav .nav-new b { display: none; }
.bnav .nav-new { top: 5px; right: auto; left: calc(50% + 8px); }
.bnav button:has(.n:not([hidden])) .nav-new { display: none; }
.bnav > button.has-new::after { content: ''; position: absolute; top: 5px; left: calc(50% + 8px); width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.new-tag.dot { top: -2px; right: -2px; }
.icon-btn > .new-tag.dot { top: 4px; right: 3px; }
.new-tag.dot i { box-shadow: 0 0 0 2px var(--paper); }
.new-tag .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the account's row: the list holds something the person has not read */
.me.has-news > button:first-child { position: relative; }
.me.has-news > button:first-child::after { content: ''; position: absolute; left: 18px; top: -1px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px var(--rail); }

/* ── at the thing itself (BB-115) ──────────────────────────────────────────────────────────────── */
/* Andrii, 22.11.2026: «підсвічувати елемент що додався, або робити маленький попап з картинками … з дуже коротким
   описом». The thing gets a ring of the signal that calls a few times and stays; the card beside it is the paper of
   a menu with the entry's pictures, title and one line. Above the page, under every dialog (.scrim is 80). */
.ns-ring { position: fixed; z-index: 69; pointer-events: none; border-radius: var(--rr, 10px); box-shadow: 0 0 0 2px var(--signal), 0 0 0 6px color-mix(in srgb, var(--signal) 16%, transparent); opacity: 0; transition: opacity 220ms var(--enter); }
.ns-ring.on { opacity: 1; }
.ns-ring.on::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--signal); opacity: 0; animation: ns-call 1.8s var(--enter) 240ms 3; }
@keyframes ns-call { 0% { inset: -2px; opacity: .65; } 75%, 100% { inset: -14px; opacity: 0; } }
.ns-ring.glide { transition: opacity 220ms var(--enter), left 320ms var(--enter), top 320ms var(--enter), width 320ms var(--enter), height 320ms var(--enter); }
.ns-ring.out { opacity: 0; transition: opacity 160ms var(--exit); }

.news-spot { position: fixed; z-index: 70; left: 0; top: 0; width: 320px; max-width: calc(100vw - 16px); background: var(--paper); color: var(--fg); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(6px) scale(.97); transform-origin: var(--at, 50%) 0; transition: opacity 200ms var(--enter), transform 320ms var(--spring); }
.news-spot[data-side="above"] { transform-origin: var(--at, 50%) 100%; transform: translateY(-6px) scale(.97); }
.news-spot[data-side="right"] { transform-origin: 0 var(--at, 50%); transform: translateX(-6px) scale(.97); }
.news-spot[data-side="left"] { transform-origin: 100% var(--at, 50%); transform: translateX(6px) scale(.97); }
.news-spot.on { opacity: 1; transform: none; }
.news-spot.glide { transition: opacity 200ms var(--enter), transform 320ms var(--spring), left 320ms var(--enter), top 320ms var(--enter); }
.news-spot.out { opacity: 0; transform: scale(.97); pointer-events: none; transition: opacity 160ms var(--exit), transform 160ms var(--exit); }
.news-spot.pics { width: 360px; }
@media (max-width: 559px) { .news-spot, .news-spot.pics { width: calc(100vw - 24px); } }
/* the arrow: a corner of the card's own paper and line, toward the thing */
.ns-arrow { position: absolute; width: 12px; height: 12px; background: var(--paper); border: 1px solid var(--border); transform: rotate(45deg); display: none; }
.news-spot[data-side="below"] .ns-arrow { display: block; top: -7px; left: calc(var(--at, 50%) - 6px); border-right: 0; border-bottom: 0; border-top-left-radius: 3px; }
.news-spot[data-side="above"] .ns-arrow { display: block; bottom: -7px; left: calc(var(--at, 50%) - 6px); border-left: 0; border-top: 0; border-bottom-right-radius: 3px; }
.news-spot[data-side="right"] .ns-arrow { display: block; left: -7px; top: calc(var(--at, 50%) - 6px); border-top: 0; border-right: 0; border-bottom-left-radius: 3px; }
.news-spot[data-side="left"] .ns-arrow { display: block; right: -7px; top: calc(var(--at, 50%) - 6px); border-bottom: 0; border-left: 0; border-top-right-radius: 3px; }
.ns-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; z-index: 2; }
.ns-x svg { width: 14px; height: 14px; }
.news-spot.pics .ns-x { top: 12px; right: 12px; background: color-mix(in srgb, var(--paper) 88%, transparent); box-shadow: var(--shadow-xs); }
.news-spot.pics .ns-x:hover { background: var(--paper); }

/* the pictures: one, or a carousel that a finger swipes, dots under it and arrows at its sides on a hover */
.ns-m { position: relative; z-index: 1; margin: 6px 6px 0; aspect-ratio: 16 / 10; border-radius: calc(var(--r-xl) - 5px); overflow: hidden; background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border); }
.ns-frames { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; outline: none; }
.ns-frames::-webkit-scrollbar { display: none; }
.ns-fr { flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.ns-fr img, .ns-fr video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
:root[data-mode="dark"] .ns-fr img, :root[data-mode="dark"] .ns-fr video { filter: brightness(.94); }
.ns-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.ns-m:not(.many) .ns-dots, .ns-m:not(.many) .ns-arr { display: none; }
.ns-dots button { pointer-events: auto; width: 6px; height: 6px; padding: 0; border-radius: 3px; background: color-mix(in srgb, #0C1B27 32%, transparent); box-shadow: 0 0 0 1.5px color-mix(in srgb, #E8EDF1 70%, transparent); transition: width var(--base) var(--enter), background var(--fast); }
.ns-dots button[aria-current="true"] { width: 16px; background: #0C1B27; }
.ns-arr { position: absolute; top: 50%; width: 28px; height: 28px; margin-top: -14px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--paper) 90%, transparent); color: var(--fg); box-shadow: var(--shadow-sm); opacity: 0; transition: opacity var(--fast); }
.ns-arr svg { width: 14px; height: 14px; }
.ns-arr.prev { left: 8px; } .ns-arr.prev svg { transform: scaleX(-1); }
.ns-arr.next { right: 8px; }
.ns-m:hover .ns-arr:not(:disabled), .ns-arr:focus-visible { opacity: 1; }
.ns-arr:disabled { pointer-events: none; }
@media (hover: none) { .ns-arr { display: none; } }

.ns-b { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 13px 16px 2px; }
.news-spot:not(.pics) .ns-b { padding-right: 40px; }
.ns-b .news-k { margin-bottom: 2px; }
.ns-t { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--fg); }
.ns-p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--fg-muted); }
.ns-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 12px 12px 16px; }
.ns-n { margin-right: auto; font-size: 11.5px; font-weight: 600; color: var(--fg-subtle); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .news-spot, .news-spot.glide, .ns-ring.glide { transition: opacity 120ms; transform: none; } .ns-ring.on::after { animation: none; } }
