/* Aura Security Chat. Calm neon: cyan means "can be tapped", magenta is the brand and @mentions, red is only for danger.
 * Shape rule: cards 18px, buttons and inputs 14px, composer and pills fully round, avatars circles.
 * The server's CSP forbids inline styles, so every visual state here is a class; colours change through CSS variables. */
@font-face { font-family: 'Tektur'; font-weight: 500; font-display: swap; src: url(/fonts/tektur-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Tektur'; font-weight: 500; font-display: swap; src: url(/fonts/tektur-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tektur'; font-weight: 600; font-display: swap; src: url(/fonts/tektur-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Tektur'; font-weight: 600; font-display: swap; src: url(/fonts/tektur-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Orbitron'; font-weight: 700; font-display: swap; src: url(/fonts/orbitron-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #0A0B10; --s1: #12141B; --s2: #1A1C24; --s3: #232634; --out: #0F3A44;
  --text: #E6EDF3; --text2: #9AA4B2; --text3: #6B7385; --line: #2A2E3A; --line-in: #6B7385;
  --primary: #00E5FF; --on-primary: #0A0B10; --brand: #FF2BD6; --danger: #FF4D5E; --warning: #FFB020; --verified: #3DDC97;
  --pr-rgb: 0, 229, 255;
  --av1: #6FD3E0; --av2: #E58AD0; --av3: #8BD9A8; --av4: #E8C46A;
  --glow: 0 0 12px rgba(var(--pr-rgb), .35);
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, .85);
  --f-logo: 'Orbitron', system-ui, sans-serif;
  --f-head: 'Tektur', system-ui, sans-serif;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --f-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
html.light {
  --bg: #F3F5F8; --s1: #FFFFFF; --s2: #EBEEF3; --s3: #DEE3EA; --text: #0E1218; --text2: #4A5463; --text3: #6B7385;
  --line: #D6DCE4; --line-in: #8C95A3; --danger: #D92D43; --warning: #A86400; --verified: #12855A;
  --shadow: 0 18px 40px -18px rgba(20, 30, 50, .28); --glow: none; color-scheme: light;
}
html.solid { --glow: none; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
@supports (height: 100dvh) { html, body { height: 100dvh; } }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; fill: currentColor; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ambient background */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(64px); }
.aurora i:nth-child(1) { width: 340px; height: 340px; background: var(--primary); opacity: .13; top: -90px; left: -110px; animation: fl1 18s ease-in-out infinite; }
.aurora i:nth-child(2) { width: 320px; height: 320px; background: var(--brand); opacity: .12; bottom: -70px; right: -130px; animation: fl2 22s ease-in-out infinite; }
.aurora i:nth-child(3) { width: 260px; height: 260px; background: #7B5CFF; opacity: .09; top: 38%; left: 22%; animation: fl1 26s ease-in-out infinite reverse; }
html.light .aurora i { opacity: .06; }
html.solid .aurora { display: none; }
@keyframes fl1 { 50% { transform: translate(70px, 90px) scale(1.15); } }
@keyframes fl2 { 50% { transform: translate(-80px, -100px) scale(.9); } }

.app { position: relative; z-index: 1; height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) var(--gut-r) env(safe-area-inset-bottom, 0px) var(--gut-l); }
@media (min-width: 560px) { .app { border-inline: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); } }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen.enter { animation: enter .22s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* splash */
.splash { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; place-items: center; transition: opacity .35s ease, visibility .35s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash .rings { width: 132px; margin: 0 auto 18px; display: block; }
.splash .rg { stroke: var(--primary); }
.splash .word { font-family: var(--f-logo); font-weight: 700; font-size: 34px; letter-spacing: .42em; padding-left: .42em; text-align: center; }
.splash .word span { display: inline-block; opacity: 0; transform: translateY(10px); animation: letter .4s var(--ease) forwards; text-shadow: 0 0 18px rgba(var(--pr-rgb), .55); }
.splash .word span:nth-child(2) { animation-delay: 80ms; } .splash .word span:nth-child(3) { animation-delay: 160ms; } .splash .word span:nth-child(4) { animation-delay: 240ms; }
.splash .ln2 { height: 2px; margin-top: 16px; background: linear-gradient(90deg, transparent, var(--primary), var(--brand), transparent); transform: scaleX(0); animation: grow .6s .35s var(--ease) forwards; }
.splash small { display: block; text-align: center; margin-top: 12px; font-family: var(--f-head); font-weight: 600; letter-spacing: .28em; font-size: 11px; color: var(--brand); }
@keyframes letter { to { opacity: 1; transform: none; } }
@keyframes grow { to { transform: scaleX(1); } }

/* rings mark */
.rings { width: min(210px, 56vw); aspect-ratio: 1; margin: 0 auto; display: block; overflow: visible; }
.rings .rg { fill: none; stroke: var(--text3); stroke-width: 6; transform-origin: 100px 100px; transform-box: view-box; animation: spin 18s linear infinite; }
.rings g:nth-child(even) .rg { animation-direction: reverse; animation-duration: 26s; }
.rings.active .rg { stroke: var(--primary); }
.rings.done .rg { stroke: var(--verified); transition: stroke .6s; }
.rings.build g { animation: rin .7s var(--ease) both; transform-origin: 100px 100px; transform-box: view-box; }
.rings.build g:nth-child(2) { animation-delay: .1s; } .rings.build g:nth-child(3) { animation-delay: .2s; } .rings.build g:nth-child(4) { animation-delay: .3s; }
.rings .core { fill: var(--brand); }
.rings .halo { fill: none; stroke: var(--brand); opacity: .45; }
.rings.active .halo { animation: halo 1.8s ease-out infinite; transform-origin: 100px 100px; transform-box: view-box; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes halo { from { transform: scale(1); opacity: .6; } to { transform: scale(3.2); opacity: 0; } }
@keyframes rin { from { opacity: 0; transform: scale(.55) rotate(-60deg); } }

/* type */
.brand { display: block; font-family: var(--f-logo); font-weight: 700; font-size: 9.5px; letter-spacing: .3em; color: var(--brand); margin: 0 0 1px; white-space: nowrap; }
h1 { font-family: var(--f-head); font-weight: 600; font-size: 24px; margin: 0; line-height: 1.2; text-wrap: balance; letter-spacing: .005em; }
h2 { font-family: var(--f-head); font-weight: 600; font-size: 22px; margin: 0; line-height: 1.2; text-wrap: balance; }
.lead { margin: 0; color: var(--text2); max-width: 36ch; margin-inline: auto; }
.mono { font-family: var(--f-mono); letter-spacing: .05em; }
.code { font-family: var(--f-mono); font-size: 26px; letter-spacing: .12em; }
.label { font-family: var(--f-head); font-weight: 600; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); margin: 0; }
.foot { margin: 0; font-size: 12.5px; color: var(--text2); }
.foot b { color: var(--text); }
.err { color: var(--danger); font-size: 14px; margin: 0; }

/* center screens: join, wait, errors */
.center-screen { flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; text-align: center; padding-block: 24px; }
.center-screen .stack { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }

/* forms and buttons */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text2); }
.field input { min-height: 50px; background: var(--s2); border: 1px solid var(--line-in); border-radius: 14px; padding: 10px 14px; font-size: 17px; outline: none; width: 100%; }
.field input:focus { border-color: var(--primary); }
.field small { color: var(--text3); font-size: 12.5px; }
.at { position: relative; }
.at::before { content: "@"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 17px; pointer-events: none; }
.at input { padding-left: 32px; }
.btn { position: relative; overflow: hidden; border: 0; border-radius: 14px; min-height: 50px; padding: 10px 18px; font-weight: 650; font-size: 16px; background: var(--primary); color: var(--on-primary); box-shadow: var(--glow);
  display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; transition: transform .1s ease-out; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-in); box-shadow: none; }
.btn.danger { background: var(--danger); color: #0A0B10; box-shadow: none; }
html.light .btn.danger { color: #fff; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.btn svg.i { width: 20px; height: 20px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn { flex: 1 1 130px; }
.lnk { background: none; border: 0; color: var(--danger); font-size: 14px; font-weight: 600; padding: 6px 0; min-height: 36px; align-self: flex-start; }
.key .ripple { display: none; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(var(--pr-rgb), .28), transparent 65%); transform: scale(0); animation: rip .35s ease-out forwards; }
@keyframes rip { to { transform: scale(1); opacity: 0; } }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.card.danger-card { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.chk { list-style: none; margin: 0; padding: 0; text-align: left; }
.chk li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.chk li:first-child { border-top: 0; }
.chk .ok::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--verified); flex: none; margin-inline: 2px; }
.chk .wait::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(var(--pr-rgb), .25); border-top-color: var(--primary); animation: spin .8s linear infinite; flex: none; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(var(--pr-rgb), .2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.steps { text-align: left; margin: 0; padding: 14px 14px 14px 34px; color: var(--text2); }
.steps li { padding: 4px 0; }
.steps b, .hint b { color: var(--text); }
.hint p { margin: 0; color: var(--text2); font-size: 14px; }
.fpline { font-family: var(--f-mono); font-size: 16px; letter-spacing: .06em; color: var(--primary); min-height: 24px; }

/* header */
.bar { display: flex; align-items: center; gap: 8px; padding: 12px var(--gut-r) 10px var(--gut-l); margin-inline: calc(-1 * var(--gut-l)) calc(-1 * var(--gut-r)); background: var(--s1); border-bottom: 1px solid var(--line); }
.bar .ttl { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.bar h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin: 1px 0 0; font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibtn { position: relative; overflow: hidden; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--text2); display: grid; place-items: center; flex: none; }
.ibtn:active { background: var(--s2); }
.ibtn[aria-pressed="true"] { background: var(--s3); color: var(--primary); }
.ibtn.back { margin-left: -10px; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); display: inline-block; margin-right: 6px; vertical-align: 1px; }
.conn.on { background: var(--verified); }
.chead { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 2px 4px 2px 0; text-align: left; border-radius: 12px; color: inherit; }
.chead:active { background: var(--s2); }
.chead .nm { display: block; font-family: var(--f-body); font-weight: 650; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chead .av { width: 40px; height: 40px; font-size: 16px; }

/* logo glyph with the turning neon border */
.glyph { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--s2); color: var(--primary); }
.glyph.logo { position: relative; isolation: isolate; }
.glyph.logo::before { content: ""; position: absolute; inset: -1.5px; border-radius: 14px; z-index: -1; background: conic-gradient(from var(--a, 0deg), var(--primary), var(--brand), var(--primary)); animation: turn 8s linear infinite; }
.glyph.logo::after { content: ""; position: absolute; inset: 1px; border-radius: 12px; z-index: -1; background: var(--s2); }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes turn { to { --a: 360deg; } }
svg.mark { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
svg.mark .core { fill: var(--brand); stroke: none; }

/* avatars */
.av { position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #0A0B10; flex: none; background: var(--av1); }
.av.ph { visibility: hidden; }
.av.c1, .c1 { background: var(--av1); } .av.c2, .c2 { background: var(--av2); } .av.c3, .c3 { background: var(--av3); } .av.c4, .c4 { background: var(--av4); }
.t1 { color: var(--av1); } .t2 { color: var(--av2); } .t3 { color: var(--av3); } .t4 { color: var(--av4); }
html.light .t1 { color: #127E8C; } html.light .t2 { color: #A8338F; } html.light .t3 { color: #23804A; } html.light .t4 { color: #8A6500; }
.av.lg { width: 52px; height: 52px; font-size: 20px; }
.av.xl { width: 104px; height: 104px; font-size: 40px; }
@property --h { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes hue { to { --h: 360deg; } }
/* verified identity: a holographic ring around the avatar (masked so only the ring shows) */
.av.holo::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from var(--h), #00E5FF, #FF2BD6, #FFD23F, #3DDC97, #00E5FF); animation: hue 5s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); }
.av.xl.holo::before { inset: -7px; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
html.solid .av.holo::before { animation: none; }
/* people's names stay in the plain font: the display face makes Cyrillic names hard to read */
.pname { font-family: var(--f-body); font-weight: 650; letter-spacing: 0; }
.pane, .clist, .msgs, .sheet { scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }

/* chat list */
.clist { flex: 1; min-height: 0; overflow-y: auto; padding-block: 8px 16px; display: flex; flex-direction: column; gap: 2px; }
.crow { width: 100%; display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 8px; border: 0; border-radius: 18px; background: transparent; text-align: left; color: inherit; flex: none; }
.crow:active { background: var(--s1); }
.cmid { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cname { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 16.5px; min-width: 0; }
.cname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cname svg.i { width: 16px; height: 16px; color: var(--verified); }
.cname .warn-i { color: var(--warning); }
.cprev { color: var(--text2); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cprev b { font-weight: 500; }
.cprev.unread { color: var(--text); }
.cside { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; font-family: var(--f-mono); font-size: 11.5px; color: var(--text2); }
.cside .t.unread { color: var(--primary); }
.cside .icons { display: flex; align-items: center; gap: 4px; color: var(--text3); min-height: 22px; }
.cside .icons svg.i { width: 16px; height: 16px; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-family: var(--f-body); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.fab { align-self: center; margin-top: 12px; }

/* empty states */
.empty-state { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 290px; color: var(--text2); font-size: 14px; padding: 16px 0; }
.empty-state .ei { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--s2); color: var(--primary); }
.empty-state .ei svg.i { width: 28px; height: 28px; }
.empty-state b { color: var(--text); font-family: var(--f-head); font-weight: 600; font-size: 17px; }

/* messages */
.msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px var(--gut-r) 14px var(--gut-l); margin-inline: calc(-1 * var(--gut-l)) calc(-1 * var(--gut-r)); overscroll-behavior: contain; }
.wp-rings { background: repeating-radial-gradient(circle at 50% 28%, transparent 0 30px, rgba(var(--pr-rgb), .10) 30px 31px, transparent 31px 34px, rgba(var(--pr-rgb), .05) 34px 35px); }
.wp-grid { background: linear-gradient(rgba(var(--pr-rgb), .08) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(var(--pr-rgb), .08) 1px, transparent 1px) 0 0 / 24px 24px; }
.wp-dots { background: radial-gradient(circle, rgba(var(--pr-rgb), .22) 1px, transparent 1.6px) 0 0 / 18px 18px; }
.wp-aurora { background: radial-gradient(120% 55% at 0% 0%, rgba(var(--pr-rgb), .18), transparent 60%), radial-gradient(110% 55% at 100% 100%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 60%); }
.sys { align-self: center; max-width: 88%; text-align: center; font-size: 12.5px; color: var(--text2); background: var(--s1); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.sys.warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.row { display: flex; gap: 8px; align-items: flex-end; max-width: 84%; }
.row.cont { margin-top: -5px; }
.row.me { align-self: flex-end; flex-direction: row-reverse; }
.row.pop { animation: pop .2s ease-out both; }
.row.me.pop { animation: fly .3s cubic-bezier(.2, .9, .3, 1.15) both; transform-origin: right bottom; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
@keyframes fly { from { opacity: 0; transform: translateY(18px) scale(.94); } }
.row.dying { animation: dissolve .8s ease-in forwards; pointer-events: none; }
@keyframes dissolve { 60% { opacity: .7; filter: blur(2px); } 100% { opacity: 0; filter: blur(10px); transform: translateY(-10px) scale(.94); } }
.bub { background: var(--s2); padding: 7px 12px 6px; border-radius: 18px; min-width: 0; }
.row:not(.me) .bub.tail { border-bottom-left-radius: 6px; }
.row.me .bub { background: var(--out); }
.row.me .bub.tail { border-bottom-right-radius: 6px; }
.who { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 1px; }
.bub p { margin: 0; font-size: 17px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub p.scr { font-family: var(--f-mono); color: var(--primary); font-size: 15px; }
.bub.bad p { color: var(--warning); font-size: 14px; }
.mention { color: var(--brand); font-weight: 600; }
.meta { display: flex; gap: 5px; justify-content: flex-end; align-items: center; font-family: var(--f-mono); font-size: 11px; color: var(--text2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.meta svg.i { width: 11px; height: 11px; }
.row.me.pop .meta svg.i:first-of-type { animation: locksnap .7s .2s var(--ease) both; }
@keyframes locksnap { 35% { transform: scale(1.9) rotate(-12deg); color: var(--primary); } }

/* replies and reactions */
.bub[data-mid] { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-y; transition: transform .2s var(--ease), box-shadow .2s; cursor: default; }
.bub.sel { transform: scale(1.02); }
.bub.armed-swipe { box-shadow: inset 0 0 0 1.5px var(--primary); }
.bub.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: inset 0 0 0 2px var(--primary), var(--glow); } }
.qt { --qc: var(--av1); display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--qc); background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 8px; padding: 4px 8px; margin: 3px 0 5px; font-size: 13px; min-width: 0; color: inherit; }
.qt b { display: block; color: var(--qc); font-size: 12px; font-weight: 600; }
.qt span { color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.qt.q1 { --qc: var(--av1); } .qt.q2 { --qc: var(--av2); } .qt.q3 { --qc: var(--av3); } .qt.q4 { --qc: var(--av4); }
html.light .qt.q1 { --qc: #127E8C; } html.light .qt.q2 { --qc: #A8338F; } html.light .qt.q3 { --qc: #23804A; } html.light .qt.q4 { --qc: #8A6500; }
.rx { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 -16px; position: relative; z-index: 1; }
.rx button { border: 1px solid var(--line); background: var(--s3); border-radius: 999px; font-size: 13px; padding: 1px 8px; min-height: 26px; }
.rx button.mine { border-color: var(--primary); }
.row.has-rx { margin-bottom: 14px; }
.row.open { position: relative; z-index: 10; }
.react-bar { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--s3); border: 1px solid var(--line); box-shadow: var(--shadow); animation: morph .22s var(--ease) both; transform-origin: left bottom; }
.react-bar.below { bottom: auto; top: calc(100% + 8px); transform-origin: left top; }
.row.me .react-bar { left: auto; right: 0; transform-origin: right bottom; }
.react-bar button { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 50%; font-size: 20px; display: grid; place-items: center; color: var(--text2); transition: transform .1s; }
.react-bar button:active { transform: scale(.88); }
.react-bar button.mine { background: rgba(var(--pr-rgb), .18); }
.react-bar button svg.i { width: 20px; height: 20px; }
.react-bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
@media (max-width: 380px) { .react-bar button { width: 32px; height: 34px; font-size: 18px; } }
@keyframes morph { from { opacity: 0; transform: scale(.9); } }
.fly { position: fixed; z-index: 70; font-size: 22px; pointer-events: none; }
.replybar { display: flex; align-items: center; gap: 6px; padding-top: 8px; }
.replybar .qt { flex: 1; margin: 0; }

/* what the server stores */
.strip { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--s2); font-size: 13px; color: var(--text2); display: flex; gap: 10px; align-items: center; }
.strip svg.i { color: var(--primary); }
.msgs.term { background: #020604; border: 1px solid #12301F; border-radius: 16px; margin: 10px 0 0; padding: 12px; gap: 5px; font-family: var(--f-mono); font-size: 12px; color: #7CF5B8; }
.ln { overflow-wrap: anywhere; line-height: 1.45; }
.ln .ts { color: #4E8F6E; } .ln .nm { color: #C9FFE6; } .ln.cmd { color: #C9FFE6; }
.cur { display: inline-block; width: 7px; height: 13px; background: #7CF5B8; vertical-align: -2px; animation: blinkc 1s steps(1) infinite; }
@keyframes blinkc { 50% { opacity: 0; } }

/* composer */
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 0 10px; }
.composer textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 140px; resize: none; background: var(--s2); border: 1px solid transparent; border-radius: 22px; padding: 12px 16px; font-size: 17px; line-height: 1.3; outline: none; }
.composer textarea:focus { border-color: var(--line-in); }
.composer textarea::placeholder { color: var(--text3); }
.send { position: relative; overflow: hidden; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--s3); color: var(--text2); display: grid; place-items: center; flex: none; transition: background .15s, color .15s, transform .1s; }
.send.armed { background: var(--primary); color: var(--on-primary); box-shadow: var(--glow); }
.send:active { transform: scale(.94); }

/* floating tabs: the only glass surface */
.tabs { flex: none; margin: 4px 0 10px; height: 64px; border-radius: 24px; padding: 6px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px;
  background: color-mix(in srgb, var(--s2) 86%, transparent); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); border: 1px solid var(--line); box-shadow: var(--shadow); }
html.solid .tabs { background: var(--s2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tab { position: relative; overflow: hidden; border: 0; background: none; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--text2); min-height: 44px; }
.tab .ico { width: 54px; height: 28px; border-radius: 14px; display: grid; place-items: center; transition: background .22s var(--ease), color .22s; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .ico { background: rgba(var(--pr-rgb), .16); color: var(--primary); }
.dot { position: absolute; top: 6px; left: calc(50% + 12px); width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* panes and profile */
.pane { flex: 1; min-height: 0; overflow-y: auto; padding-block: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.pane > * { flex-shrink: 0; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 4px 0; }
.hero .sub { white-space: normal; max-width: 34ch; }
.handle { font-family: var(--f-mono); color: var(--text2); font-size: 14px; }
.acts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pact { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; min-height: 76px; border-radius: 18px; background: var(--s1); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text); }
.pact svg.i { color: var(--primary); }
.pact.done svg.i { color: var(--verified); }
.pact:active { background: var(--s2); }
.trust { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.trust svg.i { width: 16px; height: 16px; }
.t-ver { color: var(--verified); } .t-un { color: var(--text2); } .t-chg { color: var(--warning); }
.fpgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-family: var(--f-mono); font-size: 15px; text-align: center; }
.fpgrid span { background: var(--s2); border-radius: 10px; padding: 9px 0; }
.sn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; font-family: var(--f-mono); font-size: 16px; text-align: center; letter-spacing: .04em; }
.dev { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.dev:first-of-type { border-top: 0; padding-top: 0; }
.dev b { font-weight: 600; font-size: 14.5px; }
.dev small { grid-column: 1 / -1; font-family: var(--f-mono); font-size: 11.5px; color: var(--text2); letter-spacing: .04em; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.ok { color: var(--verified); } .pill.warn { color: var(--warning); } .pill.mute { color: var(--text3); } .pill.me { color: var(--primary); }
.warnbox, .okbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; font-size: 13.5px; text-align: left; }
.warnbox { background: color-mix(in srgb, var(--warning) 9%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); }
.warnbox svg.i { color: var(--warning); width: 20px; height: 20px; }
.okbox { background: color-mix(in srgb, var(--verified) 9%, transparent); border: 1px solid color-mix(in srgb, var(--verified) 35%, transparent); }
.okbox svg.i { color: var(--verified); width: 20px; height: 20px; }
.set { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.set:first-of-type { border-top: 0; padding-top: 0; }
.set .tx { flex: 1; min-width: 0; }
.set .tx b { display: block; font-size: 14.5px; font-weight: 600; }
.set .tx small { color: var(--text2); font-size: 13px; }
.sw { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--s3); border: 1px solid var(--line-in); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text2); transition: transform .2s var(--ease), background .2s; }
.sw:checked { background: var(--primary); border-color: var(--primary); }
.sw:checked::after { transform: translateX(20px); background: var(--on-primary); }
.seg3 { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--s2); }
.seg3.n4 { --n: 4; }
.seg3 button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 13.5px; color: var(--text2); }
.seg3 button[aria-pressed="true"] { background: var(--s1); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swc { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 0; font-size: 12.5px; font-weight: 600; color: var(--text2); }
.swc span { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 3px var(--s1); transition: box-shadow .2s, transform .15s; }
.swc[aria-pressed="true"] { color: var(--text); }
.swc[aria-pressed="true"] span { box-shadow: 0 0 0 3px var(--s1), 0 0 0 5px currentColor; }
.sw-cyan span { background: #00E5FF; } .sw-magenta span { background: #FF4FD8; } .sw-lime span { background: #A6FF4D; } .sw-gold span { background: #FFC94D; }
html.light .sw-cyan span { background: #007E91; } html.light .sw-magenta span { background: #B5179A; } html.light .sw-lime span { background: #4C7A00; } html.light .sw-gold span { background: #8F5E00; }
.wps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.wpt { position: relative; border: 0; padding: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background-color: var(--bg); box-shadow: 0 0 0 1px var(--line); color: var(--text); }
.wpt small { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 2px; font-size: 11px; font-weight: 600; text-align: center; background: color-mix(in srgb, var(--bg) 82%, transparent); }
.wpt[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary), var(--glow); }
.link { font-family: var(--f-mono); font-size: 12.5px; background: var(--s2); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }
.count { font-family: var(--f-head); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.edit { display: flex; flex-direction: column; gap: 12px; }
.sel { background: var(--s2); border: 1px solid var(--line-in); border-radius: 10px; padding: 8px 10px; min-height: 40px; }

/* lock screen */
.lock { gap: 16px; }
.lock .glyph { width: 64px; height: 64px; border-radius: 20px; }
.lock .glyph.logo::before { border-radius: 21px; } .lock .glyph.logo::after { border-radius: 19px; }
.lock svg.mark { width: 34px; height: 34px; }
.lock-t { font-family: var(--f-logo); font-weight: 700; font-size: 15px; letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; }
.dots { display: flex; gap: 12px; min-height: 14px; }
.dots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--text2); transition: background .12s, border-color .12s; }
.dots i.f { background: var(--primary); border-color: var(--primary); }
.shake { animation: shake .28s; }
@keyframes shake { 25%, 75% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; margin-top: 6px; }
.key { position: relative; overflow: hidden; height: 72px; border-radius: 50%; border: 1px solid var(--line); background: var(--s1); font-family: var(--f-head); font-weight: 500; font-size: 26px; display: grid; place-items: center; transition: transform .1s, background .1s; }
.key:active { transform: scale(.94); background: var(--s3); }
.key.fn { border-color: transparent; background: transparent; color: var(--text2); }
.key.ok { color: var(--primary); }
.key svg.i { width: 26px; height: 26px; }
.lnk.muted { color: var(--text2); align-self: center; }
@media (max-height: 640px) { .pad { grid-template-columns: repeat(3, 62px); gap: 10px; } .key { height: 62px; } .lock .glyph { display: none; } }

/* bottom sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(5, 6, 10, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
html.light .sheet-bg { background: rgba(20, 30, 50, .35); }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 520px; max-height: 88%; overflow-y: auto; background: var(--s1); border-radius: 22px 22px 0 0; border: 1px solid var(--line); padding: 18px var(--gut-r) calc(18px + env(safe-area-inset-bottom, 0px)) var(--gut-l); display: flex; flex-direction: column; gap: 14px; animation: up .25s var(--ease); }
.sheet .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet .top .ibtn { margin-right: -10px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.found { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.found b { display: block; font-size: 16px; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); transform: translateX(-50%); background: var(--s3); color: var(--text); border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: var(--shadow); animation: fade .2s; }

html.rm *, html.rm *::before, html.rm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .splash { display: none; } }
@media (prefers-contrast: more) { :root { --glow: none; --line: #9AA4B2; } }

/* ===== groups, attachments, voice, devices, map, SOS ===== */
.tabs { grid-template-columns: repeat(3, 1fr); }
.dot.danger { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.av.gav { background: var(--s3); color: var(--primary); }
.av.gav svg.i { width: 60%; height: 60%; }
.center { text-align: center; }
.sys.ok { color: var(--verified); border-color: color-mix(in srgb, var(--verified) 40%, transparent); }
.sosrow { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); text-align: center; font-size: 14px; max-width: 90%; }
.sosrow b { color: var(--danger); }
.sosrow span, .sosrow small { color: var(--text2); font-size: 12.5px; }
.mini { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-in); background: transparent; border-radius: 10px; padding: 6px 12px; min-height: 36px; font-size: 13px; font-weight: 600; }
.mini svg.i { width: 16px; height: 16px; }
.btns.tight { flex-wrap: nowrap; }
.btns.tight .btn { flex: 0 0 auto; }
.banner { margin-top: 10px; padding: 8px 8px 8px 12px; border-radius: 14px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; background: rgba(var(--pr-rgb), .08); border: 1px solid rgba(var(--pr-rgb), .3); }
.banner svg.i { color: var(--primary); width: 18px; height: 18px; }
.banner span { flex: 1; min-width: 0; }
.lnk.muted-l { color: var(--text2); }

/* composer: attach, mic */
.composer { position: relative; align-items: flex-end; }
.cbtn { width: 40px; height: 48px; border: 0; background: transparent; color: var(--text2); display: grid; place-items: center; border-radius: 12px; flex: none; }
.cbtn[aria-expanded="true"] { color: var(--primary); }
.attach-menu { position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 6; background: var(--s2); border: 1px solid var(--line); border-radius: 18px; padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 200px; animation: morph .2s var(--ease) both; transform-origin: left bottom; }
.sbtn { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer; }
.sbtn:active { background: var(--s3); }
.sbtn svg.i { color: var(--primary); }
.send { touch-action: none; }
.send .ic-send { display: none; }
.send.armed .ic-send { display: grid; } .send.armed .ic-mic { display: none; }
.send .ic-mic, .send .ic-send { place-items: center; }
.send.rec { background: var(--danger); color: #0A0B10; transform: scale(1.14); box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 20%, transparent); }
.recbar { position: absolute; left: 0; right: 56px; top: 8px; bottom: 10px; z-index: 4; background: var(--s2); border-radius: 24px; display: flex; align-items: center; gap: 10px; padding: 0 14px; overflow: hidden; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: none; animation: blinkc 1s steps(1) infinite; }
.rtime { font-family: var(--f-mono); font-size: 13px; min-width: 34px; }
.rwave, .wave { display: flex; align-items: center; gap: 2px; height: 28px; flex: 1; min-width: 0; overflow: hidden; }
.rwave i, .wave i { width: 3px; flex: none; border-radius: 2px; background: var(--danger); }
.wave i { flex: 1; min-width: 2px; max-width: 4px; background: var(--text3); transition: background .1s; }
.wave i.on { background: var(--primary); }
.h1 { height: 14%; } .h2 { height: 25%; } .h3 { height: 37%; } .h4 { height: 50%; } .h5 { height: 62%; } .h6 { height: 75%; } .h7 { height: 87%; } .h8 { height: 100%; }
.rslide { display: flex; align-items: center; gap: 2px; color: var(--text2); font-size: 12.5px; white-space: nowrap; flex: none; }
.rslide svg.i { width: 14px; height: 14px; }

/* attachments in bubbles */
.bub.media-bub { padding: 4px 4px 6px; }
.bub.media-bub .meta { padding-right: 8px; }
.bub.f-voice, .bub.f-file { padding: 8px 12px 6px; }
.media { position: relative; display: block; width: min(260px, 64vw); border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: var(--s3); cursor: zoom-in; }
.media.ar-w { aspect-ratio: 4 / 3; } .media.ar-t { aspect-ratio: 3 / 4; } .media.ar-s { aspect-ratio: 1; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media .thumb { filter: blur(14px); transform: scale(1.12); }
.media .full { opacity: 0; transition: opacity .35s; }
.media.ready .full { opacity: 1; }
.media .spin { position: absolute; left: calc(50% - 14px); top: calc(50% - 14px); }
.media.ready .spin, .media.gone .spin { display: none; }
.media.gone::after { content: "Файлът вече го няма"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--text2); }
.voice { display: flex; align-items: center; gap: 10px; min-width: min(240px, 60vw); }
.vplay { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.vplay svg.i { width: 18px; height: 18px; }
.vdur { font-family: var(--f-mono); font-size: 12px; color: var(--text2); min-width: 32px; }
.vspeed { border: 1px solid var(--line-in); background: transparent; border-radius: 999px; font-family: var(--f-mono); font-size: 11px; padding: 2px 7px; color: var(--text2); min-height: 26px; }
.filecard { display: flex; gap: 10px; align-items: center; padding: 2px 0; min-width: min(230px, 60vw); background: none; border: 0; text-align: left; color: inherit; }
.filecard .fi { width: 42px; height: 42px; border-radius: 12px; background: var(--s3); display: grid; place-items: center; color: var(--primary); flex: none; }
.filecard b { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.filecard small { font-family: var(--f-mono); font-size: 11.5px; color: var(--text2); }
.filecard > svg.i { color: var(--text2); }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px); animation: fade .2s; }
.viewer img { max-width: 100%; max-height: calc(100% - 80px); object-fit: contain; border-radius: 8px; }
.viewer .vbar { display: flex; gap: 10px; }
.viewer .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }

/* people pickers, members */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line-in); background: transparent; font-weight: 600; font-size: 14px; color: var(--text2); }
.chip .av { width: 28px; height: 28px; font-size: 11px; opacity: .5; }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--primary); background: rgba(var(--pr-rgb), .1); }
.chip[aria-pressed="true"] .av { opacity: 1; }
.addrow { display: flex; gap: 8px; align-items: center; }
.addrow .at { flex: 1; }
.addrow input { width: 100%; min-height: 44px; background: var(--s2); border: 1px solid var(--line-in); border-radius: 12px; padding: 8px 12px 8px 30px; font-size: 16px; outline: none; }
.addrow input:focus { border-color: var(--primary); }
.mrow { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mrow:first-of-type { border-top: 0; }
.card > .split + .mrow { border-top: 0; }
.mrow .av { width: 32px; height: 32px; }
.mname { background: none; border: 0; padding: 0; text-align: left; color: inherit; min-width: 0; }
.mname b { display: block; font-size: 15px; }
.mname small { color: var(--text2); font-size: 12.5px; }
.dev .btns.tight .btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }

/* map */
.mapwrap { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--s1); }
.map { height: min(52vh, 420px); width: 100%; background: var(--s2); }
.leaflet-container { font: inherit; background: var(--s2); }
html:not(.light) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
.leaflet-control-zoom a, .leaflet-bar a { background: var(--s2) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--s1) 80%, transparent) !important; color: var(--text2) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--text2) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--s2); color: var(--text); box-shadow: var(--shadow); }
.mpin { border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #0A0B10; border: 2px solid var(--s1); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.mpin span { display: grid; place-items: center; width: 100%; height: 100%; }
.mpin.c1 { background: var(--av1); } .mpin.c2 { background: var(--av2); } .mpin.c3 { background: var(--av3); } .mpin.c4 { background: var(--av4); }
.mpin.me { border-color: var(--primary); }
.mpin.hot { background: var(--danger); animation: pinpulse 1.4s ease-out infinite; }
@keyframes pinpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.leaflet-interactive.acc { stroke: var(--primary); fill: var(--primary); }

/* SOS */
.sos-card { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--s1)); }
.sos-card b { color: var(--danger); }
.sos-wrap { display: flex; justify-content: center; padding: 6px 0; }
.sos { position: relative; width: 120px; height: 120px; border-radius: 50%; border: 0; background: var(--danger); color: #0A0B10; font-family: var(--f-head); font-size: 30px; font-weight: 700; letter-spacing: .04em; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 16%, transparent); }
html.light .sos { color: #fff; }
.sos small { display: block; font-family: var(--f-body); font-size: 11.5px; font-weight: 600; letter-spacing: 0; line-height: 1.2; padding: 0 14px; }
.sos svg.ring2 { position: absolute; inset: -8px; width: 136px; height: 136px; transform: rotate(-90deg); pointer-events: none; }
.sos .prog { stroke: var(--text); stroke-width: 4; fill: none; stroke-dasharray: 408; stroke-dashoffset: 408; stroke-linecap: round; }
.sos.holding .prog { transition: stroke-dashoffset 2s linear; stroke-dashoffset: 0; }
.warn112 { font-size: 13.5px; color: var(--text2); margin: 0; text-align: center; }
.warn112 a { color: var(--text); font-weight: 700; }
.alarm { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) var(--gut-r) calc(env(safe-area-inset-bottom, 0px) + 24px) var(--gut-l); animation: fade .2s; }
.alarm:has(.beacon:not(.calm))::before, .alarm:has(.cdring)::before { content: ""; position: absolute; inset: 0; pointer-events: none; animation: vign 1.3s ease-in-out infinite; }
@keyframes vign { 0%, 100% { box-shadow: inset 0 0 40px 0 color-mix(in srgb, var(--danger) 12%, transparent); } 50% { box-shadow: inset 0 0 140px 24px color-mix(in srgb, var(--danger) 38%, transparent); } }
.alarm h2 { font-size: 22px; }
.alarm dl { display: grid; grid-template-columns: auto auto; gap: 4px 12px; margin: 0; font-size: 14px; text-align: left; }
.alarm dt { color: var(--text2); } .alarm dd { margin: 0; font-variant-numeric: tabular-nums; }
.alarm .btns { width: 100%; max-width: 380px; position: relative; z-index: 1; }
.alarm .chk { width: 100%; max-width: 380px; }
.beacon { position: relative; width: 104px; height: 104px; border-radius: 50%; background: var(--danger); display: grid; place-items: center; color: #0A0B10; font-family: var(--f-head); font-weight: 700; font-size: 24px; flex: none; }
.beacon::before, .beacon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--danger); animation: ring 1.6s infinite; }
.beacon::after { animation-delay: .8s; }
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(2); opacity: 0; } }
.beacon.calm { background: var(--verified); }
.beacon.calm::before, .beacon.calm::after { display: none; }
.cdring { position: relative; width: 200px; height: 200px; display: grid; place-items: center; }
.cdring svg { position: absolute; inset: 0; width: 200px; height: 200px; transform: rotate(-90deg); }
.cdtrack { fill: none; stroke: var(--s3); stroke-width: 6; }
.cdprog { fill: none; stroke: var(--danger); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 578; stroke-dashoffset: 0; animation: drain 5s linear forwards; }
@keyframes drain { to { stroke-dashoffset: 578; } }
.cd { font-family: var(--f-head); font-size: 96px; line-height: 1; font-weight: 700; color: var(--danger); font-variant-numeric: tabular-nums; }
.btn.big { min-height: 56px; font-size: 17px; width: 100%; max-width: 360px; }
/* Leaflet uses z-index 400-1000 inside; keep that inside the map so sheets and the SOS alarm stay on top. */
.mapwrap { position: relative; isolation: isolate; z-index: 0; }
.alarm { z-index: 2000; }
.viewer { z-index: 2100; }

/* Location points that have not been refreshed for 10 minutes */
.mpin.stale { filter: grayscale(1); opacity: .55; border-color: var(--s2); }
.leaflet-interactive.acc.stale { stroke: var(--text3); fill: var(--text3); stroke-dasharray: 4 4; }
.mrow.stale .pname, .mrow.stale small { opacity: .6; }

/* QR code for linking a new device */
.qr { display: block; width: min(220px, 62vw); aspect-ratio: 1; margin: 4px auto 2px; border-radius: 14px; background: #fff; padding: 10px; }
.qr rect.d { fill: #0A0B10; }

/* Aura emblem (the shield). A soft round fade, a slow breath, and a dashed ring that turns around it. */
.emblem { position: relative; width: min(210px, 56vw); aspect-ratio: 1; margin: 0 auto; }
.emblem img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover;
  -webkit-mask-image: radial-gradient(circle, #000 56%, transparent 71%); mask-image: radial-gradient(circle, #000 56%, transparent 71%);
  animation: em-breathe 4.8s ease-in-out infinite; }
.emblem::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 1.5px dashed rgba(var(--pr-rgb), .45); animation: spin 30s linear infinite; pointer-events: none; }
.emblem.active img { animation-duration: 1.8s; }
.emblem.active::after { border-color: rgba(var(--pr-rgb), .8); animation-duration: 8s; }
.emblem.done::after { border-color: var(--verified); border-style: solid; }
.emblem.build { animation: em-in .8s var(--ease) both; }
.splash .emblem { width: 168px; margin-bottom: 14px; }
@keyframes em-breathe { 0%, 100% { transform: scale(1); filter: brightness(.95) saturate(1); } 50% { transform: scale(1.035); filter: brightness(1.15) saturate(1.15); } }
@keyframes em-in { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
img.mark { width: calc(100% - 3px); height: calc(100% - 3px); border-radius: 12px; object-fit: cover; display: block; }
.lock img.mark { border-radius: 18px; }

/* The Guard card (admin) */
.card.guard .label { display: flex; align-items: center; gap: 6px; }
.card.guard .label svg { width: 15px; height: 15px; color: var(--primary); }
.g-state { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); margin-bottom: 10px; }
.g-state b { font-weight: 650; }
.g-state small { color: var(--text2); font-size: 13px; line-height: 1.45; }
.g-state.on { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--s2)); }
.card.guard .btn.small { align-self: flex-start; margin-bottom: 12px; }

/* Profile photos */
.av .avimg, .mpin .avimg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av .avimg:not([src]), .mpin .avimg:not([src]) { display: none; }
.mpin { position: relative; overflow: hidden; }
.av-edit { position: relative; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; color: inherit; }
.av-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: 6px; }
.av-cam { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); border: 3px solid var(--s1); }
.av-cam svg { width: 17px; height: 17px; }
.crop { position: relative; width: min(280px, 72vw); aspect-ratio: 1; margin: 4px auto 2px; overflow: hidden; border-radius: 22px; background: #000; touch-action: none; cursor: grab; }
.crop:active { cursor: grabbing; }
.crop img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-select: none; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); outline: 2px solid rgba(var(--pr-rgb), .9); pointer-events: none; }
.crop-zoom { width: min(280px, 72vw); margin: 6px auto; display: block; accent-color: var(--primary); }

/* Edit and delete */
.react-bar { flex-wrap: wrap; justify-content: center; width: max-content; max-width: min(342px, calc(100vw - 40px)); border-radius: 24px; }
.react-bar button.danger { color: var(--danger); }
.meta .edited { font-style: normal; opacity: .8; margin-right: 4px; }
.qt.edit { --qc: var(--primary); }
.qt.edit b { display: inline-flex; align-items: center; gap: 4px; }
.qt.edit b svg.i { width: 13px; height: 13px; }

/* Search in a chat */
.searchbar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--s1); }
.searchbar input { flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--s2); color: var(--text); padding: 0 12px; font: inherit; font-size: 15px; }
.searchbar input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.searchbar .scount { font-size: 12.5px; color: var(--text2); min-width: 44px; text-align: center; white-space: nowrap; }
.bub mark { background: color-mix(in srgb, var(--warning) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.bub.hit-cur { outline: 2px solid var(--warning); outline-offset: 2px; }

/* Calls */
.callscr { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: max(48px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--primary) 16%, var(--bg)), var(--bg) 65%); color: var(--text); animation: em-in .25s var(--ease) both; }
.callscr .ctop { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; position: relative; z-index: 2; }
.callscr .ctop h2 { margin: 6px 0 0; font-family: var(--f-head); font-size: 28px; font-weight: 600; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.callscr .ctop p { margin: 0; color: var(--text2); font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.callscr .ctop .e2e { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--verified); }
.callscr .ctop .e2e svg.i { width: 13px; height: 13px; }
.callscr.ringing .av.xl, .callscr.calling .av.xl { animation: pinpulse 1.6s ease-out infinite; }
.callscr .cbar { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 2; }
.cbig { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.cbig svg.i { width: 64px; height: 64px; padding: 19px; border-radius: 50%; background: color-mix(in srgb, var(--text) 14%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-sizing: border-box; }
.cbig.on svg.i { background: var(--text); color: var(--bg); }
.cbig.red svg.i { background: var(--danger); color: #fff; }
.cbig.green svg.i { background: var(--verified); color: #0A0B10; }
.cbig:focus-visible svg.i { outline: 2px solid var(--primary); outline-offset: 3px; }
.callscr .rv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; z-index: 0; }
.callscr .lv { position: absolute; right: 16px; top: max(16px, env(safe-area-inset-top)); width: 104px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; border: 2px solid rgba(255,255,255,.25); z-index: 3; background: #111; }
.callscr .lv.mirror { transform: scaleX(-1); }
.callscr.vid .ctop { margin-top: 0; }
.sys.callrow { display: inline-flex; align-items: center; gap: 6px; }
.sys.callrow svg.i { width: 15px; height: 15px; }
.sys.callrow.missed { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.callscr.vid .lv { top: auto; bottom: 200px; }

/* Calls, Instagram style: blurred photo behind, big round photo in front */
.callscr .cbg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(circle at 50% 35%, var(--cbg, var(--av1)) 0%, transparent 70%), var(--bg); }
.callscr .cbg.c1 { --cbg: color-mix(in srgb, var(--av1) 55%, transparent); } .callscr .cbg.c2 { --cbg: color-mix(in srgb, var(--av2) 55%, transparent); }
.callscr .cbg.c3 { --cbg: color-mix(in srgb, var(--av3) 55%, transparent); } .callscr .cbg.c4 { --cbg: color-mix(in srgb, var(--av4) 55%, transparent); }
.callscr .cbg img { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover; filter: blur(42px) brightness(.5) saturate(1.25); }
.callscr .cbg img:not([src]) { display: none; }
.callscr .cbg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 35%, transparent 60%, rgba(0,0,0,.55)); }
.callscr .av.call-av { width: 168px; height: 168px; font-size: 64px; box-shadow: 0 12px 48px rgba(0,0,0,.45); }
.callscr .ctop { margin-top: 10vh; }
.callscr.vid .ctop { margin-top: 0; }
.callscr audio { display: none; }
.callscr .lv-off { display: grid; place-items: center; background: color-mix(in srgb, var(--s2) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.callscr:not(.vid) .lv-off { display: grid; }

/* Calls, more alive: Aura rings, waves while ringing, voice glow in the photo's colour, emoji key */
.callscr { --tint: var(--primary); --lvl: 0; }
.chero { position: relative; width: 168px; height: 168px; display: grid; place-items: center; margin: 36px 0 34px; }
.chero .av.call-av { position: relative; z-index: 2; transform: scale(calc(1 + var(--lvl) * .07)); transition: transform .08s linear;
  box-shadow: 0 0 calc(18px + var(--lvl) * 70px) calc(var(--lvl) * 26px) color-mix(in srgb, var(--tint) 70%, transparent), 0 12px 48px rgba(0,0,0,.45); }
.cring { position: absolute; border-radius: 50%; pointer-events: none; z-index: 1; }
.cring.r1 { inset: -18px; border: 2px dashed color-mix(in srgb, var(--tint) 65%, transparent); animation: spin 16s linear infinite; }
.cring.r2 { inset: -36px; border: 1.5px dashed color-mix(in srgb, var(--brand) 45%, transparent); animation: spin 26s linear infinite reverse; }
.callscr.connecting .cring.r1, .callscr.calling .cring.r1 { animation-duration: 4s; }
.callscr.live .cring.r1 { opacity: calc(.5 + var(--lvl) * .5); }
.cwave { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--tint); opacity: 0; animation: cwave 2.6s cubic-bezier(.2,.7,.3,1) infinite; z-index: 0; }
.cwave:nth-child(2) { animation-delay: .85s; } .cwave:nth-child(3) { animation-delay: 1.7s; }
@keyframes cwave { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(2.3); opacity: 0; } }
.callscr.ringing .cbig.green svg.i { animation: cbounce 1.4s ease-in-out infinite; }
@keyframes cbounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px) rotate(-8deg); } 45% { transform: translateY(0) rotate(6deg); } }
.callscr .cbg { background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--tint) 30%, transparent) 0%, transparent 62%), var(--bg); }
.ckey { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid color-mix(in srgb, var(--text) 18%, transparent); background: color-mix(in srgb, var(--bg) 45%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 16px; padding: 8px 14px; color: var(--text); font: inherit; cursor: pointer; margin-top: 4px; }
.ckey span { font-size: 26px; letter-spacing: 6px; padding-left: 6px; }
.ckey small { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text2); }
.ckey small svg.i { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) { .cwave { display: none; } }

/* =====================================================================================
 * Aura 0.6 look: live motion, the colour of people's photos, and glass everywhere.
 * "Плътни повърхности" (html.solid) and reduced motion switch the extras off.
 * ===================================================================================== */

/* ---- moving between screens (View Transitions) ---- */
@keyframes vt-in-r { from { transform: translateX(26%); opacity: 0; } }
@keyframes vt-out-l { to { transform: translateX(-10%); opacity: 0; } }
@keyframes vt-in-l { from { transform: translateX(-26%); opacity: 0; } }
@keyframes vt-out-r { to { transform: translateX(10%); opacity: 0; } }
html[data-nav="fwd"]::view-transition-old(root) { animation: .3s cubic-bezier(.2,.8,.2,1) both vt-out-l; }
html[data-nav="fwd"]::view-transition-new(root) { animation: .34s cubic-bezier(.2,.8,.2,1) both vt-in-r; }
html[data-nav="back"]::view-transition-old(root) { animation: .3s cubic-bezier(.2,.8,.2,1) both vt-out-r; }
html[data-nav="back"]::view-transition-new(root) { animation: .34s cubic-bezier(.2,.8,.2,1) both vt-in-l; }
::view-transition-group(hero-av) { animation-duration: .42s; animation-timing-function: cubic-bezier(.2,.9,.2,1.05); z-index: 5; }
::view-transition-group(tab-pill) { animation-duration: .38s; animation-timing-function: cubic-bezier(.3,1.3,.4,1); }
.tabs { view-transition-name: tabs; }
.tab[aria-current] .ico { view-transition-name: tab-pill; }
::view-transition-old(tabs), ::view-transition-new(tabs) { animation: none; }

/* ---- messages arrive with a little spring; the list fans in ---- */
@keyframes popR { from { opacity: 0; transform: translate(14px, 14px) scale(.86); } 60% { transform: translate(-1px, -1px) scale(1.02); } }
@keyframes popL { from { opacity: 0; transform: translate(-14px, 10px) scale(.9); } 60% { transform: translate(1px, -1px) scale(1.015); } }
.row.me.pop { animation: popR .42s cubic-bezier(.2,.9,.3,1) both; transform-origin: right bottom; }
.row:not(.me).pop { animation: popL .42s cubic-bezier(.2,.9,.3,1) both; transform-origin: left bottom; }
@keyframes rowIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.screen.stagger .crow { animation: rowIn .45s cubic-bezier(.2,.9,.3,1) both; }
.screen.stagger .crow:nth-child(2) { animation-delay: .04s; } .screen.stagger .crow:nth-child(3) { animation-delay: .08s; }
.screen.stagger .crow:nth-child(4) { animation-delay: .12s; } .screen.stagger .crow:nth-child(5) { animation-delay: .16s; }
.screen.stagger .crow:nth-child(6) { animation-delay: .2s; } .screen.stagger .crow:nth-child(n+7) { animation-delay: .24s; }
@keyframes fly { 0% { transform: none; } 35% { transform: translate(10px, -10px) rotate(-18deg) scale(.86); } 36% { transform: translate(-14px, 10px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.send.fly .ic-send svg { animation: fly .5s cubic-bezier(.3,.8,.3,1); }
.badge { animation: badgeIn .4s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes badgeIn { from { transform: scale(0); } }

/* ---- ripple where you tap ---- */
.rip-host { position: relative; overflow: hidden; isolation: isolate; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; background: radial-gradient(circle, rgba(var(--pr-rgb), .28) 0%, rgba(var(--pr-rgb), .12) 40%, transparent 70%); transform: scale(0); animation: rip .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes rip { to { transform: scale(1); opacity: 0; } }

/* ---- the colour of the person's photo inside their chat and profile ---- */
html.tinted .aurora i:nth-child(1) { background: rgb(var(--ct)); opacity: .2; }
html.tinted .aurora i:nth-child(3) { background: rgb(var(--ct)); opacity: .12; }
html.tinted .chead .av, html.tinted .hero .av.xl { box-shadow: 0 0 0 2px rgba(var(--ct), .55), 0 0 26px rgba(var(--ct), .45); }
html.tinted .bar { border-bottom-color: rgba(var(--ct), .35); box-shadow: 0 10px 32px -18px rgba(var(--ct), .7); }
html.tinted .row:not(.me) .bub { background: color-mix(in srgb, rgb(var(--ct)) 13%, var(--s2)); }
html.tinted .row:not(.me) .bub.tail { box-shadow: -1px 1px 0 rgba(var(--ct), .25); }
html.tinted .composer textarea:focus { border-color: rgba(var(--ct), .6); box-shadow: 0 0 0 3px rgba(var(--ct), .15); }
html.tinted .send.armed { box-shadow: 0 0 22px rgba(var(--ct), .45); }
html.tinted .hero { background: radial-gradient(60% 70% at 50% 25%, rgba(var(--ct), .16), transparent 70%); border-radius: 18px; }
.crow.tinted .av { box-shadow: 0 0 0 2px rgba(var(--rt), .55), 0 0 16px rgba(var(--rt), .35); }
.crow.tinted .badge { background: rgb(var(--rt)); color: #0A0B10; box-shadow: 0 0 12px rgba(var(--rt), .6); }

/* ---- glass ---- */
html:not(.solid) .bar { background: color-mix(in srgb, var(--s1) 58%, transparent); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); border-bottom-color: color-mix(in srgb, var(--text) 10%, transparent); position: relative; z-index: 3; }
html:not(.solid) .card, html:not(.solid) .sheet {
  position: relative;
  background: radial-gradient(260px circle at var(--mx, -400px) var(--my, -400px), rgba(var(--pr-rgb), .11), transparent 65%), color-mix(in srgb, var(--s1) 56%, transparent);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-color: color-mix(in srgb, var(--text) 9%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent), 0 14px 36px -22px rgba(0, 0, 0, .7);
}
html:not(.solid) .card::before, html:not(.solid) .sheet::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(var(--pr-rgb), .55), transparent 32%, transparent 68%, color-mix(in srgb, var(--brand) 55%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .7;
}
html:not(.solid) .sheet { background: radial-gradient(300px circle at var(--mx, -400px) var(--my, -400px), rgba(var(--pr-rgb), .1), transparent 65%), color-mix(in srgb, var(--s1) 72%, transparent); }
html:not(.solid) .sheet-bg { background: rgba(5, 6, 10, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html:not(.solid) .crow { background: radial-gradient(200px circle at var(--mx, -400px) var(--my, -400px), rgba(var(--pr-rgb), .09), transparent 70%); }
html:not(.solid) .crow:hover, html:not(.solid) .crow:focus-visible { background-color: color-mix(in srgb, var(--s1) 50%, transparent); }
html:not(.solid) .composer textarea { background: color-mix(in srgb, var(--s2) 66%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-color: color-mix(in srgb, var(--text) 8%, transparent); }
html:not(.solid) .row:not(.me) .bub { background: color-mix(in srgb, var(--s2) 80%, transparent); border: 1px solid color-mix(in srgb, var(--text) 6%, transparent); }
html:not(.solid).tinted .row:not(.me) .bub { background: color-mix(in srgb, color-mix(in srgb, rgb(var(--ct)) 14%, var(--s2)) 82%, transparent); }
html:not(.solid) .row.me .bub { background: color-mix(in srgb, var(--out) 86%, transparent); border: 1px solid rgba(var(--pr-rgb), .18); }
html:not(.solid) .btn.ghost { background: radial-gradient(160px circle at var(--mx, -400px) var(--my, -400px), rgba(var(--pr-rgb), .14), transparent 70%), color-mix(in srgb, var(--s2) 40%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html:not(.solid) .react-bar { background: color-mix(in srgb, var(--s3) 70%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
html:not(.solid) .searchbar { background: color-mix(in srgb, var(--s1) 58%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
html:not(.solid) .aurora i:nth-child(1) { opacity: .18; } html:not(.solid) .aurora i:nth-child(2) { opacity: .16; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .ripple { display: none; }
}
