/* Волна 8 (0.10), часть b. Классы w8-… Светлая и тёмная темы — через переменные из styles.css. */

/* ---------- §11 приватность: полоса, ограниченный чат ---------- */
.w8-priv-banner { display: flex; align-items: center; gap: 8px; padding: 5px 14px; font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-bottom: 1px solid var(--line); flex: none; }
.w8-priv-banner.restricted { color: #8a4b00; background: #fdeccf; }
:root[data-theme="dark"] .w8-priv-banner.restricted { color: #f0c27a; background: #3a2c12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w8-priv-banner.restricted { color: #f0c27a; background: #3a2c12; } }
.chat.w8-restricted .timeline, .chat.w8-restricted .pinned-bar { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chat.w8-restricted .timeline img { -webkit-user-drag: none; }
.chat.w8-restricted .timeline, .chat.w8-restricted .pinned-bar { transition: filter .12s; }
html[data-w8-blur] .chat.w8-restricted .timeline, html[data-w8-blur] .chat.w8-restricted .pinned-bar { filter: blur(16px); pointer-events: none; }
.w8-priv-hero { display: flex; gap: 12px; align-items: center; color: var(--brand); padding: 0 4px 8px; }
.w8-priv-hero .hint { color: var(--ink-2); }
.w8-priv-list { margin: 0 0 8px; padding-block: 0 0; padding-inline: 20px 0; color: var(--ink-2); font-size: 12.5px; display: grid; gap: 2px; }
.w8-priv-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); }
.w8-priv-warn .pv-ic { flex: none; margin-top: 2px; color: var(--ink-2); }

/* ---------- §7 расшифровка голосовых ---------- */
.w8-tr { margin: 4px 0 2px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--brand) 8%, transparent); font-size: 13.5px; max-width: 360px; }
.w8-tr-text { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.w8-tr-note, .w8-tr-busy, .w8-tr-err { color: var(--ink-2); font-size: 11.5px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.w8-tr-err { color: var(--danger); }
.w8-tr .link-btn { font-size: 11.5px; padding: 0; }
.w8-tr .spinner { width: 12px; height: 12px; border-width: 2px; }

/* ---------- §10 анимированные эмодзи ---------- */
.w8-anim-emoji { cursor: pointer; display: inline-flex; gap: 4px; -webkit-tap-highlight-color: transparent; }
.w8-anim-emoji.off { cursor: default; }
.w8-em { display: inline-block; transform-origin: 50% 70%; will-change: transform; }
.w8-play { animation-duration: 1s; animation-timing-function: ease-in-out; animation-iteration-count: 1; animation-fill-mode: both; }
.w8-play.w8-anim-jump { animation-name: w8-anim-jump; animation-duration: .9s; }
.w8-play.w8-anim-pulse { animation-name: w8-anim-pulse; animation-duration: 1.1s; }
.w8-play.w8-anim-shake { animation-name: w8-anim-shake; animation-duration: 1s; }
.w8-play.w8-anim-grow { animation-name: w8-anim-grow; animation-duration: 1s; }
.w8-play.w8-anim-sway { animation-name: w8-anim-sway; animation-duration: 1.2s; }
.w8-play.w8-anim-flicker { animation-name: w8-anim-flicker; animation-duration: 1.1s; }
.w8-play.w8-anim-spinhop { animation-name: w8-anim-spinhop; animation-duration: 1.2s; }
.w8-play.w8-anim-wave { animation-name: w8-anim-wave; animation-duration: 1.2s; }
.w8-play.w8-anim-turn { animation-name: w8-anim-turn; animation-duration: 1s; }
.w8-play.w8-anim-tremble { animation-name: w8-anim-tremble; animation-duration: .9s; }
.w8-play.w8-anim-tilt { animation-name: w8-anim-tilt; animation-duration: 1.1s; }
.w8-play.w8-anim-clap { animation-name: w8-anim-clap; animation-duration: 1s; }
.w8-play.w8-anim-growspin { animation-name: w8-anim-growspin; animation-duration: 1.2s; }
.w8-play.w8-anim-rise { animation-name: w8-anim-rise; animation-duration: 1s; }
.w8-play.w8-anim-flex { animation-name: w8-anim-flex; animation-duration: 1s; }
.w8-play.w8-anim-pop { animation-name: w8-anim-pop; animation-duration: .9s; }
@keyframes w8-anim-jump { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-16px) scale(1.15); } 55% { transform: translateY(0) scale(.95); } 75% { transform: translateY(-6px); } }
@keyframes w8-anim-pulse { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.3); } 40% { transform: scale(.95); } 60% { transform: scale(1.22); } 80% { transform: scale(1); } }
@keyframes w8-anim-shake { 0%, 100% { transform: translateX(0) rotate(0); } 15% { transform: translateX(-5px) rotate(-8deg); } 30% { transform: translateX(5px) rotate(8deg); } 45% { transform: translateX(-4px) rotate(-6deg); } 60% { transform: translateX(4px) rotate(6deg); } 80% { transform: translateX(-2px) rotate(-2deg); } }
@keyframes w8-anim-grow { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.55); } 70% { transform: scale(1.4); } }
@keyframes w8-anim-sway { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 80% { transform: rotate(-5deg); } }
@keyframes w8-anim-flicker { 0%, 100% { transform: scale(1); opacity: 1; } 15% { transform: scale(1.15, .92); opacity: .75; } 30% { transform: scale(.95, 1.12); opacity: 1; } 50% { transform: scale(1.12, .94); opacity: .8; } 70% { transform: scale(.98, 1.08); opacity: 1; } }
@keyframes w8-anim-spinhop { 0% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-18px) rotate(200deg); } 70% { transform: translateY(0) rotate(360deg); } 85% { transform: translateY(-5px) rotate(360deg); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes w8-anim-wave { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(22deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(22deg); } 60% { transform: rotate(-10deg); } 75% { transform: rotate(14deg); } }
@keyframes w8-anim-turn { 0%, 100% { transform: rotateY(0) scale(1); } 50% { transform: rotateY(180deg) scale(1.2); } }
@keyframes w8-anim-tremble { 0%, 100% { transform: translate(0, 0); } 10% { transform: translate(-3px, 2px); } 20% { transform: translate(3px, -2px); } 30% { transform: translate(-3px, -2px); } 40% { transform: translate(3px, 2px); } 50% { transform: translate(-2px, 1px); } 60% { transform: translate(2px, -1px); } 70% { transform: translate(-2px, -1px); } 80% { transform: translate(2px, 1px); } }
@keyframes w8-anim-tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-18deg) translateY(-2px); } 70% { transform: rotate(-18deg) translateY(-2px); } }
@keyframes w8-anim-clap { 0%, 100% { transform: translateY(0) scale(1); } 20% { transform: translateY(-12px) scale(1.12); } 40% { transform: translateY(0) scale(1); } 60% { transform: translateY(-12px) scale(1.12); } 80% { transform: translateY(0) scale(1); } }
@keyframes w8-anim-growspin { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.5) rotate(180deg); } 80% { transform: scale(1.2) rotate(350deg); } }
@keyframes w8-anim-rise { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-14px) scale(1.2); } 65% { transform: translateY(-14px) scale(1.2); } }
@keyframes w8-anim-flex { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.35, .9); } 50% { transform: scale(.92, 1.25); } 75% { transform: scale(1.2, 1); } }
@keyframes w8-anim-pop { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.35) translateY(-4px); } 65% { transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) { .w8-play { animation: none !important; } }

/* ---------- §8 движущиеся фото ---------- */
.w8-motion-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1.4; pointer-events: none; }
.media-tile .w8-motion-badge, .bubble .w8-motion-badge { position: absolute; inset-inline-start: 6px; top: 6px; z-index: 2; }
.w8-motion-view { position: relative; display: inline-grid; place-items: center; max-width: 100%; max-height: 100%; }
.w8-motion-view img, .w8-motion-view video { max-width: 100%; max-height: 82vh; display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.w8-motion-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
.w8-motion-bar { position: absolute; inset-inline-start: 8px; bottom: 8px; inset-inline-end: 8px; display: flex; align-items: center; gap: 6px; z-index: 3; }
.w8-motion-bar .icon { background: rgba(0, 0, 0, .55); }
.w8-motion-bar .icon.on { background: rgba(255, 255, 255, .85); color: #000; }
.w8-motion-bar .w8-motion-badge:first-child { margin-inline-end: auto; }

/* ---------- §13 история для новых участников ---------- */
.w8-hist-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 240px; max-width: 420px; margin: 4px auto; }
.w8-hist-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; width: 100%; text-align: start; color: var(--ink); }
.w8-hist-head .ic { color: var(--brand); }
.w8-hist-head small { color: var(--ink-2); font-size: 12px; }
.w8-hist-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; border-top: 1px solid var(--line); }
.w8-hist-list li { padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.w8-hist-list li:last-child { border-bottom: 0; }
.w8-hist-who { display: flex; gap: 8px; align-items: baseline; }
.w8-hist-who b { font-size: 12.5px; color: var(--brand); }
.w8-hist-who small { color: var(--ink-3); font-size: 11px; }
.w8-hist-body { overflow-wrap: anywhere; white-space: pre-wrap; color: var(--ink); }
.w8-hist-body em { color: var(--ink-2); font-style: normal; font-weight: 600; }

/* ---------- §12 выбор участников, новая группа ---------- */
.w8-sel-bar { align-items: center; padding-top: 4px; padding-bottom: 8px; }
.w8-pick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-3); display: inline-grid; place-items: center; flex: none; color: var(--brand-ink); }
.w8-pick.on { background: var(--brand); border-color: var(--brand); }
.w8-newgroup-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.w8-newgroup-chips .chip { gap: 6px; }

/* ---------- §9 сканер документов ---------- */
.w8-scan-root { position: fixed; inset: 0; z-index: 44; background: #0b0f14; color: #fff; display: flex; flex-direction: column; }
.w8-scan-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex: none; }
.w8-scan-top b { font-size: 16px; }
.w8-scan-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 8px; position: relative; }
.w8-scan-video { max-width: 100%; max-height: 100%; border-radius: 6px; background: #000; }
.w8-scan-nocam { color: rgba(255, 255, 255, .8); text-align: center; max-width: 320px; padding: 0 16px; }
.w8-scan-wrap { position: relative; touch-action: none; }
.w8-scan-canvas { display: block; width: 100%; height: 100%; border-radius: 2px; background: #1b222b; }
.w8-scan-preview { display: block; max-width: 100%; max-height: 100%; background: #fff; border-radius: 2px; box-shadow: 0 2px 14px rgba(0, 0, 0, .6); object-fit: contain; }
.w8-quad { position: absolute; inset: 0; }
.w8-quad-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.w8-quad-shade { fill: rgba(0, 0, 0, .5); }
.w8-quad-line { fill: none; stroke: #4ea8ee; stroke-width: 2; }
.w8-handle { position: absolute; width: 30px; height: 30px; margin-block: -15px 0; margin-inline: -15px 0; border-radius: 50%; background: rgba(78, 168, 238, .35); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); touch-action: none; cursor: grab; }
.w8-scan-bar { flex: none; display: flex; align-items: center; justify-content: space-around; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .12); }
.w8-scan-root .pe-tool { min-width: 72px; }
.w8-scan-root .pe-tool.ghost { visibility: hidden; }
.w8-scan-root .pe-hint { flex: 1; }
.w8-shutter { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 5px solid #0b0f14; box-shadow: 0 0 0 3px #fff; flex: none; }
.w8-shutter:disabled { opacity: .35; }
.w8-shutter:active:not(:disabled) { transform: scale(.93); }
.w8-scan-filters { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; }
.w8-scan-root .chip { color: rgba(255, 255, 255, .85); border-color: rgba(255, 255, 255, .3); flex: none; }
.w8-scan-root .chip:hover { background: rgba(255, 255, 255, .1); }
.w8-scan-root .chip.on { background: #fff; color: #0b0f14; }
.w8-scan-root .icon:disabled { opacity: .3; }
.w8-scan-strip { flex: none; display: flex; gap: 8px; padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; }
.w8-scan-thumb { position: relative; width: 52px; height: 68px; flex: none; border-radius: 6px; border: 2px solid transparent; background: #1b222b; display: grid; place-items: center; overflow: hidden; color: #fff; }
.w8-scan-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.w8-scan-thumb.on { border-color: var(--brand); }
.w8-scan-thumb i { position: absolute; inset-inline-end: 3px; bottom: 2px; font-style: normal; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .6); border-radius: 8px; padding: 0 5px; }
.w8-scan-thumb.add { border: 2px dashed rgba(255, 255, 255, .4); background: transparent; }
.w8-scan-thumb.add:disabled { opacity: .3; }
.w8-scan-root .spinner { width: 20px; height: 20px; }
