/* ==========================================================================
   AAma — app UI (glass, mobile-first). No external dependencies.
   ========================================================================== */
:root {
	--accent: #2f6bff;
	--accent-2: #7a4dff;
	--blob1: #8fb3ff;
	--blob2: #c3a6ff;
	--blob3: #8ee6ff;
	--call-1: #4d8dff;
	--call-2: #1d3fb3;
	--call-3: #0b154a;
	--orb: 150, 230, 255;
	--accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
	--green: #16c47f;
	--red: #ff4d5e;
	--amber: #ffb020;
	--bg: #eef3ff;
	--bg-2: #e6ecfb;
	--text: #0e1525;
	--muted: #6b7487;
	--faint: #9aa3b5;
	--line: rgba(18, 28, 60, .08);
	--glass: rgba(255, 255, 255, .62);
	--glass-strong: rgba(255, 255, 255, .84);
	--glass-border: rgba(255, 255, 255, .7);
	--bubble-in: rgba(255, 255, 255, .92);
	--bubble-out-1: var(--accent);
	--bubble-out-2: color-mix(in srgb, var(--accent) 70%, var(--accent-2));
	--shadow: 0 10px 30px -12px rgba(30, 50, 110, .25), 0 2px 6px -2px rgba(30, 50, 110, .08);
	--shadow-lg: 0 30px 70px -20px rgba(20, 40, 100, .35);
	--r-sm: 12px;
	--r: 18px;
	--r-lg: 26px;
	--blur: saturate(180%) blur(22px);
	--ease: cubic-bezier(.22, 1, .36, 1);
	--spring: cubic-bezier(.34, 1.56, .64, 1);
	--sat: env(safe-area-inset-top, 0px);
	--sab: env(safe-area-inset-bottom, 0px);
	--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}
html[data-theme="dark"] {
	--bg: #0a0e19;
	--bg-2: #0f1424;
	--text: #eef2ff;
	--muted: #98a2b8;
	--faint: #6c7690;
	--line: rgba(255, 255, 255, .08);
	--glass: rgba(24, 30, 50, .55);
	--glass-strong: rgba(26, 32, 54, .86);
	--glass-border: rgba(255, 255, 255, .09);
	--bubble-in: rgba(36, 44, 70, .9);
	--shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
	--shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.aama-body {
	margin: 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.4;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior: none;
	overflow: hidden;
	text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
input, textarea, select { font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.i { width: 22px; height: 22px; flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- backdrop */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .38; animation: float 22s var(--ease) infinite alternate; }
.bg .b1 { width: 52vmax; height: 52vmax; left: -14vmax; top: -18vmax; background: radial-gradient(circle, var(--blob1), transparent 65%); }
.bg .b2 { width: 46vmax; height: 46vmax; right: -16vmax; top: 10vmax; background: radial-gradient(circle, var(--blob2), transparent 65%); animation-delay: -7s; }
.bg .b3 { width: 40vmax; height: 40vmax; left: 20vmax; bottom: -22vmax; background: radial-gradient(circle, var(--blob3), transparent 65%); animation-delay: -13s; }
html[data-theme="dark"] .bg i { opacity: .3; }
@keyframes float { to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); } }

#aama-app { position: relative; z-index: 1; height: 100%; height: var(--app-h, 100dvh); }

/* ------------------------------------------------------------------ splash */
.splash { height: 100%; display: grid; place-items: center; align-content: center; gap: 16px; }
.splash-logo, .logo {
	width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center;
	background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 65%, #fff), var(--accent) 55%, var(--accent-2));
	box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.4);
	color: #fff; font-weight: 800; font-size: 34px; letter-spacing: -1px;
}
.splash-logo { animation: breathe 1.6s var(--ease) infinite; }
.splash-msg { color: var(--muted); }
@keyframes breathe { 50% { transform: scale(.92); opacity: .8; } }


/* ------------------------------------------------------- colour themes */
/* Noir — black & shades of black with red (default) */
html[data-palette="noir"] { --accent: #e11d48; --accent-2: #ff5a36; --blob1: #ff9a9a; --blob2: #ffb59c; --blob3: #ffd6cc; --bg: #f7f3f3; --bg-2: #efe8e8; --call-1: #5c0f1c; --call-2: #1c0609; --call-3: #050203; --orb: 255, 70, 90; }
html[data-palette="noir"][data-theme="dark"] { --bg: #08080a; --bg-2: #111113; --text: #f4f4f5; --muted: #a1a1aa; --faint: #71717a; --glass: rgba(22, 22, 25, .62); --glass-strong: rgba(26, 26, 29, .9); --glass-border: rgba(255, 255, 255, .07); --bubble-in: rgba(36, 36, 40, .94); --blob1: #8f1d2c; --blob2: #6b1f0f; --blob3: #2a0a10; }
/* Ember — warm orange */
html[data-palette="ember"] { --accent: #f97316; --accent-2: #ef4444; --blob1: #ffc38a; --blob2: #ffa3a3; --blob3: #ffe0a8; --bg: #fbf6f1; --bg-2: #f5ece3; --call-1: #8a3409; --call-2: #2b1006; --call-3: #0b0503; --orb: 255, 150, 70; }
html[data-palette="ember"][data-theme="dark"] { --bg: #0d0907; --bg-2: #15100c; --text: #faf5f0; --muted: #b3a69a; --faint: #7d7064; --glass: rgba(32, 23, 18, .62); --glass-strong: rgba(36, 27, 21, .9); --glass-border: rgba(255, 255, 255, .07); --bubble-in: rgba(46, 35, 28, .94); --blob1: #7c2d12; --blob2: #881337; --blob3: #713f12; }
/* Emerald — fresh green */
html[data-palette="emerald"] { --accent: #10b981; --accent-2: #0891b2; --blob1: #8ee6c0; --blob2: #9fe3f0; --blob3: #c9f2d9; --bg: #f1f8f5; --bg-2: #e6f2ec; --call-1: #0f6b4f; --call-2: #06281e; --call-3: #020b08; --orb: 70, 235, 175; }
html[data-palette="emerald"][data-theme="dark"] { --bg: #050f0b; --bg-2: #0a1712; --text: #effaf5; --muted: #9bb5aa; --faint: #64807a; --glass: rgba(14, 30, 24, .62); --glass-strong: rgba(17, 34, 28, .9); --glass-border: rgba(255, 255, 255, .07); --bubble-in: rgba(24, 44, 36, .94); --blob1: #065f46; --blob2: #155e75; --blob3: #14532d; }
/* Violet — deep royal violet */
html[data-palette="violet"] { --accent: #7c5cff; --accent-2: #a78bfa; --blob1: #d9d0ff; --blob2: #ead7ff; --blob3: #d6dcff; --bg: #f6f5fa; --bg-2: #efedf5; --call-1: #3b2a7a; --call-2: #16112e; --call-3: #07060d; --orb: 170, 150, 255; }
html[data-palette="violet"][data-theme="dark"] { --accent: #8b6dff; --bg: #0c0b12; --bg-2: #13121b; --text: #f3f2f8; --muted: #a09db0; --faint: #6c6a7c; --glass: rgba(24, 23, 33, .62); --glass-strong: rgba(27, 26, 37, .9); --glass-border: rgba(255, 255, 255, .07); --bubble-in: rgba(36, 34, 48, .94); --blob1: #3a2a78; --blob2: #3d1f52; --blob3: #1e1d3a; }
/* Ocean — the original blue (no overrides needed) */

/* theme switch animation */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.palettes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 6px 12px 14px; }
.pal { display: grid; justify-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pal .sw { width: 54px; height: 54px; border-radius: 18px; position: relative; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 8px 18px -10px rgba(0,0,0,.5); transition: transform .25s var(--spring), box-shadow .25s; overflow: hidden; }
.pal .sw::after { content: ""; position: absolute; right: 7px; bottom: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--sw-dot); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.pal .sw .i { width: 22px; height: 22px; opacity: 0; transform: scale(.4); transition: all .25s var(--spring); position: relative; z-index: 1; }
.pal.on { color: var(--text); }
.pal.on .sw { transform: scale(1.06); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), 0 10px 22px -10px rgba(0,0,0,.5); }
.pal.on .sw .i { opacity: 1; transform: none; }
.pal:active .sw { transform: scale(.92); }
.mode-btn .i { transition: transform .5s var(--spring); }
.mode-btn:active .i { transform: rotate(-40deg) scale(.85); }

/* ------------------------------------------------------------------- glass */
.glass {
	background: var(--glass);
	-webkit-backdrop-filter: var(--blur);
	backdrop-filter: var(--blur);
	border: 1px solid var(--glass-border);
	box-shadow: var(--shadow);
}

/* -------------------------------------------------------------------- auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: calc(24px + var(--sat)) 18px calc(24px + var(--sab)); overflow-y: auto; height: 100%; }
.auth-card { width: 100%; max-width: 410px; border-radius: 32px; padding: 34px 26px 26px; animation: rise .7s var(--ease) both; }
.auth-head { display: grid; justify-items: center; gap: 12px; text-align: center; margin-bottom: 22px; }
.auth-head h1 { margin: 6px 0 0; font-size: 28px; letter-spacing: -.6px; }
.auth-head p { margin: 0; color: var(--muted); }
.seg { display: flex; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--text) 6%, transparent); position: relative; gap: 2px; }
.seg button { flex: 1; padding: 9px 10px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .2s, background .25s var(--ease), box-shadow .25s; white-space: nowrap; }
.seg button.on { background: var(--glass-strong); color: var(--text); box-shadow: 0 2px 10px -2px rgba(0,0,0,.12); }
.form { display: grid; gap: 12px; margin-top: 18px; }
.field { position: relative; display: block; }
.field > .i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 19px; height: 19px; pointer-events: none; }
.input, .textarea, .select {
	width: 100%; border: 1px solid var(--line); background: var(--glass-strong); border-radius: 15px;
	padding: 14px 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field > .i + .input { padding-left: 44px; }
.input:focus, .textarea:focus, .select:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
.textarea { resize: vertical; min-height: 90px; }
.field .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 8px; color: var(--faint); }
.label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 4px; display: block; }
.hint { font-size: 12.5px; color: var(--faint); margin: 6px 4px 0; }
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 15px;
	font-weight: 650; transition: transform .15s var(--ease), box-shadow .2s, opacity .2s, background .2s; user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { color: #fff; background: var(--accent); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-dark { color: #fff; background: #0e1525; }
html[data-theme="dark"] .btn-dark { background: #fff; color: #0e1525; }
.btn-soft { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn-danger { color: #fff; background: var(--red); }
.btn-ghost { color: var(--accent); }
.btn-sm { padding: 9px 14px; border-radius: 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-err { color: var(--red); font-size: 14px; text-align: center; min-height: 0; }
.auth-ok { color: var(--green); font-size: 14px; text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.shake { animation: shake .4s; }

/* ------------------------------------------------------------ home screen */
.welcome { height: 100%; display: flex; flex-direction: column; max-width: 440px; margin: 0 auto; padding: calc(14px + var(--sat)) 0 calc(18px + var(--sab)); animation: rise .6s var(--ease) both; }
.w-top { display: flex; align-items: center; gap: 10px; padding: 0 20px; }
.w-top .logo { width: 38px; height: 38px; border-radius: 13px; font-size: 18px; }
.w-top b { flex: 1; font-size: 18px; letter-spacing: -.3px; }
.w-track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.w-track::-webkit-scrollbar { display: none; }
.w-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; justify-content: center; gap: 26px; padding: 10px 26px; min-height: 0; }
.w-art { height: min(300px, 36vh); border-radius: 32px; padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 10px; position: relative; overflow: hidden; flex: none; }
.w-art::before { content: ""; position: absolute; inset: -30%; background: radial-gradient(circle at 70% 20%, var(--accent-soft), transparent 55%); pointer-events: none; }
.w-b { position: relative; max-width: 80%; padding: 10px 14px; border-radius: 20px; font-size: 15px; animation: msgIn .5s var(--spring) both; }
.w-b.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 6px; }
.w-b.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; display: flex; gap: 6px; align-items: center; animation-delay: .25s; }
.w-b.out .i { width: 16px; height: 16px; color: #a6ecff; }
.w-art .typing-bubble { position: relative; animation-delay: .5s; animation-fill-mode: both; }
.w-call { align-items: center; gap: 30px; }
.w-av { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 700; background: linear-gradient(135deg, var(--accent), var(--accent-2)); position: relative; }
.w-av::before, .w-av::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); animation: ring 2.2s ease-out infinite; }
.w-av::after { animation-delay: 1.1s; }
.w-cbtns { display: flex; gap: 26px; position: relative; }
.w-cbtns span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.w-cbtns .r { background: var(--red); }
.w-cbtns .g { background: var(--green); }
.w-priv { align-items: center; gap: 18px; }
.w-lock { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); position: relative; }
.w-lock .i { width: 34px; height: 34px; }
.w-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; position: relative; }
.w-chips span { padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--text) 7%, transparent); display: flex; gap: 6px; align-items: center; }
.w-chips .i { width: 14px; height: 14px; color: var(--green); }
.w-txt h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.7px; line-height: 1.15; }
.w-txt p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.w-dots { display: flex; gap: 6px; justify-content: center; padding: 10px 0 16px; }
.w-dots i { width: 7px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--text) 20%, transparent); transition: all .3s var(--ease); }
.w-dots i.on { width: 22px; background: var(--accent); }
.w-cta { display: grid; gap: 10px; padding: 0 22px; }
.w-foot { text-align: center; color: var(--faint); font-size: 12.5px; margin: 12px 0 0; }
.auth-card { position: relative; }
.auth-card .auth-back { position: absolute; top: 12px; left: 12px; }
a.set { color: inherit; }

/* ------------------------------------------------------------------- shell */
.shell { height: 100%; display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); position: relative; overflow: hidden; }
.rail { display: none; }
.pane-list { height: 100%; min-width: 0; min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.pane-main {
	position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100dvh); z-index: 20; background: var(--bg); transform: translateX(100%);
	transition: transform .42s var(--ease); display: flex; flex-direction: column; will-change: transform;
}
.shell.has-main .pane-main { transform: none; box-shadow: -20px 0 50px -20px rgba(0,0,0,.25); }
.shell.has-main .pane-list { transform: translateX(-24%); filter: brightness(.96); }
.pane-list { transition: transform .42s var(--ease), filter .42s; }
.main-empty { display: none; }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: viewIn .35s var(--ease); }
.view[hidden] { display: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.topbar { padding: calc(10px + var(--sat)) 18px 8px; display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 32px; letter-spacing: -.9px; margin: 0; flex: 1; font-weight: 750; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--text); transition: background .2s, transform .15s; flex: none; position: relative; }
.icon-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.solid { background: var(--glass-strong); box-shadow: var(--shadow); }
.icon-btn.accent { color: var(--text); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 0 12px calc(110px + var(--sab)); }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 14%, transparent); border-radius: 8px; }

.search { position: relative; margin: 4px 6px 10px; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.search input { width: 100%; padding: 11px 14px 11px 40px; border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); outline: none; }
.search input:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
.chips { display: flex; gap: 8px; padding: 0 6px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: all .2s var(--ease); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip b { margin-left: 4px; color: var(--accent); }
.chip.on b { color: inherit; opacity: .7; }

.announce { margin: 0 6px 12px; padding: 12px 14px; border-radius: var(--r); display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.announce .i { color: var(--accent); width: 20px; height: 20px; margin-top: 1px; }

/* tab bar (mobile) */
.tabbar {
	position: fixed; left: 50%; bottom: calc(12px + var(--sab)); transform: translateX(-50%); z-index: 15;
	display: flex; gap: 4px; padding: 6px; border-radius: 26px; width: min(94vw, 440px);
}
.tabbar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 7px 4px 6px; border-radius: 20px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; transition: color .2s, background .25s var(--ease); }
.tabbar button .i { width: 23px; height: 23px; transition: transform .3s var(--spring); }
.tabbar button.on { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.tabbar button.on .i { color: var(--accent); }
.tabbar button.on .i { transform: translateY(-1px) scale(1.06); }
.dot-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--glass-strong); }

.fab {
	position: absolute; right: 18px; bottom: calc(96px + var(--sab)); z-index: 5; width: 56px; height: 56px; border-radius: 20px;
	display: grid; place-items: center; color: #fff; background: var(--accent);
	box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 80%, transparent), 0 2px 6px rgba(0,0,0,.12); transition: transform .2s var(--spring);
}
.fab:active { transform: scale(.9) rotate(-8deg); }

/* ----------------------------------------------------------------- avatars */
.av { position: relative; flex: none; width: var(--s, 48px); height: var(--s, 48px); }
.av .img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s, 48px) * .38); letter-spacing: -.5px; overflow: hidden; }
.av .on-dot { position: absolute; right: 1px; bottom: 1px; width: 26%; height: 26%; min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2.5px var(--bg); animation: pop .4s var(--spring); }
@keyframes pop { from { transform: scale(0); } }

/* -------------------------------------------------------------- list rows */
.row {
	display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: var(--r); position: relative;
	transition: background .2s, transform .15s; user-select: none; -webkit-user-select: none; width: 100%; text-align: left;
	animation: rowIn .4s var(--ease) both;
}
.row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.row:active { transform: scale(.985); }
.row.active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.row-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row-top, .row-sub { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-name { font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; letter-spacing: -.2px; }
.row-time { font-size: 12.5px; color: var(--faint); flex: none; }
.row-time.hot { color: var(--accent); font-weight: 600; }
.row-prev { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.row-prev span { overflow: hidden; text-overflow: ellipsis; }
.row-prev .i { width: 16px; height: 16px; }
.row-prev.typing { color: var(--accent); font-weight: 600; }
.row-meta { display: flex; align-items: center; gap: 5px; color: var(--faint); }
.row-meta .i { width: 15px; height: 15px; }
.badge { min-width: 21px; height: 21px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; animation: pop .35s var(--spring); }
.badge.muted { background: var(--faint); }
.row .act { display: flex; gap: 4px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); margin: 16px 12px 6px; }
.empty { text-align: center; color: var(--muted); padding: 50px 24px; display: grid; justify-items: center; gap: 10px; animation: rise .5s var(--ease); }
.empty .em-ic { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.empty .em-ic .i { width: 32px; height: 32px; }
.empty h3 { margin: 4px 0 0; color: var(--text); font-size: 18px; }
.empty p { margin: 0; max-width: 280px; }

/* ticks */
.ticks { display: inline-flex; color: var(--faint); flex: none; }
.ticks .i { width: 17px; height: 17px; }
.ticks.read { color: #34b7f1; }
.ticks.fail { color: var(--red); }

/* skeleton */
.sk { background: linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 25%, color-mix(in srgb, var(--text) 11%, transparent) 37%, color-mix(in srgb, var(--text) 6%, transparent) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 10px; }
.sk-row .sk.c { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.sk-row .lines { flex: 1; display: grid; gap: 8px; }
.sk-row .l1 { height: 13px; width: 55%; }
.sk-row .l2 { height: 11px; width: 80%; }

/* ------------------------------------------------------------------- chat */
.chat { height: 100%; display: flex; flex-direction: column; position: relative; min-height: 0; }
.chat-head {
	position: absolute; top: 0; left: 0; right: 0; z-index: 4; padding: calc(8px + var(--sat)) 10px 8px; display: flex; align-items: center; gap: 8px;
	border-radius: 0 0 24px 24px; border-top: 0;
}
.chat-head .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 4px; border-radius: 14px; }
.chat-head .who-t { min-width: 0; }
.chat-head .who-n { font-weight: 700; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.2px; }
.chat-head .who-s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.chat-head .who-s.live { color: var(--accent); font-weight: 600; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; touch-action: pan-y; padding: calc(78px + var(--sat)) 12px 12px; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; }
.msgs-inner { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.day { align-self: center; margin: 12px 0 8px; padding: 5px 12px; font-size: 12px; font-weight: 650; color: var(--muted); border-radius: 10px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); position: sticky; top: calc(66px + var(--sat)); z-index: 2; }
.sys { align-self: center; font-size: 12.5px; color: var(--muted); padding: 5px 12px; margin: 6px 0; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); text-align: center; max-width: 85%; }
.loading-older { align-self: center; padding: 8px; }

.m { display: flex; flex-direction: column; max-width: min(78%, 560px); position: relative; touch-action: pan-y; }
.m.in { align-self: flex-start; }
.m.out { align-self: flex-end; align-items: flex-end; }
.m.new { animation: msgIn .38s var(--spring) both; }
.m.out.new { transform-origin: bottom right; }
.m.in.new { transform-origin: bottom left; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.92); } }
.m + .m.gap { margin-top: 8px; }
.m .sender { font-size: 12.5px; font-weight: 700; margin: 0 0 3px 12px; }
.bubble {
	position: relative; padding: 7px 10px 6px 12px; border-radius: 20px; font-size: 15.5px; line-height: 1.38;
	word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; min-width: 64px; transition: transform .15s;
}
.m.in .bubble { background: var(--bubble-in); box-shadow: 0 1px 2px rgba(0,0,0,.06); border-bottom-left-radius: 6px; }
.m.out .bubble { color: #fff; background: var(--bubble-out, var(--accent)); border-bottom-right-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
html[data-theme="dark"] { --bubble-out: color-mix(in srgb, var(--accent) 62%, #1a1824); }
.m.in.cont .bubble { border-top-left-radius: 8px; }
.m.out.cont .bubble { border-top-right-radius: 8px; }
.m.in:not(.last) .bubble { border-bottom-left-radius: 8px; }
.m.out:not(.last) .bubble { border-bottom-right-radius: 8px; }
.bubble .txt { display: inline; }
.bubble .stamp { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 8px 0 -3px 10px; font-size: 11px; opacity: .7; white-space: nowrap; position: relative; top: 2px; }
.m.out .bubble .stamp { opacity: .85; }
.m.out .bubble .ticks { color: rgba(255,255,255,.75); }
.m.out .bubble .ticks.read { color: #a6ecff; }
.m.out .bubble .ticks .i { width: 16px; height: 16px; }
.bubble.deleted { font-style: italic; opacity: .7; }
.bubble .edited { font-size: 11px; opacity: .7; margin-right: 4px; }
.bubble .emoji-only { font-size: 40px; line-height: 1.1; }
.m.big-emoji .bubble { background: none !important; box-shadow: none !important; padding: 0; color: var(--text) !important; }
.m.big-emoji .bubble .stamp { color: var(--muted); opacity: 1; }
.m.big-emoji .bubble .ticks { color: var(--faint) !important; }
.quote { display: block; text-align: left; padding: 6px 10px; margin: 2px -4px 6px -6px; border-radius: 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--text) 6%, transparent); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.m.out .quote { background: rgba(255,255,255,.18); border-left-color: rgba(255,255,255,.8); }
.quote b { display: block; font-size: 12.5px; color: var(--accent); }
.m.out .quote b { color: #fff; }
.media-img { margin: -3px -8px 4px -10px; border-radius: 16px; overflow: hidden; position: relative; background: color-mix(in srgb, var(--text) 8%, transparent); cursor: zoom-in; }
.media-img img { width: 100%; max-height: 360px; object-fit: cover; min-width: 200px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 6px 4px; color: inherit; min-width: 210px; }
.file-chip .fi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 14%, transparent); flex: none; }
.file-chip .fn { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.file-chip .fs { font-size: 12px; opacity: .75; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 2px 0; }
.voice .pl { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, currentColor 16%, transparent); flex: none; }
.voice .pl .i { width: 18px; height: 18px; }
.voice .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.voice .wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .35; transition: opacity .15s; }
.voice .wave i.on { opacity: 1; }
.voice .vt { font-size: 12px; opacity: .8; min-width: 32px; font-variant-numeric: tabular-nums; }
.call-pill { display: flex; align-items: center; gap: 10px; padding: 4px 2px; min-width: 190px; text-align: left; color: inherit; }
.call-pill .ci { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, currentColor 14%, transparent); }
.call-pill .ci.miss { color: var(--red); }
.m.out .call-pill .ci.miss { color: #fff; background: rgba(255,77,94,.55); }
.call-pill b { display: block; font-size: 14.5px; }
.call-pill small { opacity: .75; font-size: 12.5px; }
.reacts { display: flex; gap: 2px; margin: -6px 8px 2px; z-index: 1; position: relative; }
.reacts button { padding: 2px 7px; border-radius: 12px; font-size: 13px; background: var(--glass-strong); box-shadow: 0 2px 8px -2px rgba(0,0,0,.18); border: 1px solid var(--glass-border); animation: pop .3s var(--spring); }
.reacts button.mine { border-color: var(--accent); }
.reacts small { font-size: 11px; color: var(--muted); margin-left: 2px; }
.m .swipe-reply { position: absolute; top: 50%; left: -38px; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-strong); color: var(--accent); opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s; }
.m.out .swipe-reply { left: auto; right: calc(100% + 8px); }
.m.flash .bubble { animation: flash 1.2s var(--ease); }
@keyframes flash { 30% { transform: scale(1.04); box-shadow: 0 0 0 4px var(--accent-soft); } }
.m.pending .bubble { opacity: .85; }
.m.failed .bubble { box-shadow: 0 0 0 2px var(--red); }

.typing-bubble { align-self: flex-start; padding: 12px 15px; border-radius: 20px; border-bottom-left-radius: 6px; background: var(--bubble-in); display: flex; gap: 4px; margin-top: 6px; animation: msgIn .3s var(--spring); }
.typing-bubble i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: dots 1.2s infinite; }
.typing-bubble i:nth-child(2) { animation-delay: .15s; }
.typing-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 30% { transform: translateY(-5px); background: var(--accent); } 60% { transform: none; } }

.to-bottom { position: absolute; right: 16px; bottom: calc(86px + var(--sab)); z-index: 4; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: transform .25s var(--spring), opacity .2s; }
.to-bottom.hide { transform: scale(.4); opacity: 0; pointer-events: none; }
.to-bottom .badge { position: absolute; top: -6px; right: -4px; }

.composer-wrap { padding: 6px 10px calc(10px + var(--sab)); position: relative; z-index: 3; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; margin: 0 4px 6px; border-radius: 16px; border-left: 3px solid var(--accent); animation: rise .25s var(--ease); }
.reply-bar .rb { flex: 1; min-width: 0; font-size: 13.5px; }
.reply-bar .rb b { color: var(--accent); display: block; font-size: 12.5px; }
.reply-bar .rb span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.composer { display: flex; align-items: flex-end; gap: 6px; }
.composer .box { flex: 1; min-width: 0; display: flex; align-items: flex-end; border-radius: 24px; padding: 3px 4px; min-height: 48px; }
.composer textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; padding: 11px 4px; max-height: 140px; line-height: 1.4; min-width: 0; }
.composer .icon-btn { width: 42px; height: 42px; color: var(--muted); }
.send-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; background: var(--accent); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--accent) 90%, transparent); transition: transform .25s var(--spring); }
.send-btn:active { transform: scale(.88); }
.send-btn .i { transition: transform .3s var(--spring); }
.send-btn.rec { background: var(--red); animation: recPulse 1.4s infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 10px rgba(255,77,94,.15); } }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 10px; border-radius: 24px; padding: 4px 6px 4px 14px; min-height: 48px; animation: rise .25s var(--ease); }
.rec-bar .rd { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: breathe 1s infinite; }
.rec-bar .rt { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-bar .lv { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; overflow: hidden; justify-content: flex-end; }
.rec-bar .lv i { width: 3px; border-radius: 2px; background: var(--accent); flex: none; }
.emoji-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; max-height: 240px; overflow-y: auto; padding: 8px; margin: 0 4px 8px; border-radius: 20px; animation: rise .25s var(--ease); }
.emoji-panel button { font-size: 25px; height: 42px; border-radius: 10px; transition: transform .15s var(--spring), background .2s; }
.emoji-panel button:hover { background: color-mix(in srgb, var(--text) 6%, transparent); transform: scale(1.15); }
.blocked-bar { text-align: center; padding: 14px; color: var(--muted); border-radius: 18px; }

/* ---------------------------------------------------- sheets, menus, toasts */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(8, 12, 24, .32); animation: fade .25s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.backdrop.out { animation: fade .22s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.sheet {
	position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 90dvh; display: flex; flex-direction: column;
	border-radius: 30px 30px 0 0; padding: 8px 0 calc(14px + var(--sab)); animation: sheetUp .42s var(--ease); background: var(--glass-strong);
}
.sheet.out { animation: sheetUp .28s var(--ease) reverse forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text) 18%, transparent); margin: 2px auto 8px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 2px 16px 10px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 19px; letter-spacing: -.3px; }
.sheet-body { overflow-y: auto; padding: 0 16px 6px; flex: 1; min-height: 0; }
.sheet-foot { padding: 10px 16px 0; display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.menu { position: fixed; z-index: 61; min-width: 230px; border-radius: 20px; padding: 6px; animation: menuIn .28s var(--spring); transform-origin: var(--ox, 50%) var(--oy, 0); background: var(--glass-strong); }
@keyframes menuIn { from { opacity: 0; transform: scale(.85); } }
.menu .mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 13px; font-size: 15px; font-weight: 500; text-align: left; transition: background .15s; }
.menu .mi:hover, .menu .mi:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent); }
.menu .mi .i { width: 20px; height: 20px; color: var(--muted); }
.menu .mi.danger, .menu .mi.danger .i { color: var(--red); }
.menu .sep { height: 1px; margin: 4px 8px; background: var(--line); }
.react-row { display: flex; gap: 2px; padding: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.react-row button { font-size: 25px; width: 42px; height: 42px; border-radius: 50%; transition: transform .2s var(--spring), background .15s; }
.react-row button:hover { transform: scale(1.25); }
.react-row button.on { background: var(--accent-soft); }
.toasts { position: fixed; z-index: 90; top: calc(12px + var(--sat)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 400px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 16px; font-size: 14.5px; font-weight: 550; display: flex; gap: 10px; align-items: center; animation: toastIn .4s var(--spring); pointer-events: auto; background: var(--glass-strong); }
.toast.err { color: var(--red); }
.toast.out { animation: toastIn .25s reverse forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: grid; place-items: center; animation: fade .2s; }
.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; animation: zoomIn .35s var(--ease); }
.viewer .vbar { position: absolute; top: calc(10px + var(--sat)); right: 10px; display: flex; gap: 8px; }
.viewer .icon-btn { color: #fff; background: rgba(255,255,255,.12); }
@keyframes zoomIn { from { transform: scale(.85); opacity: 0; } }

.pick-list .row { padding: 8px 6px; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 22%, transparent); display: grid; place-items: center; transition: all .2s var(--spring); flex: none; color: #fff; }
.check .i { width: 15px; height: 15px; transform: scale(0); transition: transform .2s var(--spring); }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on .i { transform: none; }
.picked { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
.picked .pk { display: grid; justify-items: center; gap: 4px; font-size: 11.5px; width: 56px; flex: none; animation: pop .3s var(--spring); }
.picked .pk span { max-width: 56px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- settings */
.card { border-radius: var(--r-lg); padding: 6px; margin: 0 4px 14px; }
.card-title { font-size: 13px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; padding: 12px 12px 4px; }
.set { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; width: 100%; text-align: left; transition: background .15s; }
button.set:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.set .sic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--text); flex: none; background: color-mix(in srgb, var(--text) 7%, transparent); }
.set.danger .sic { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.set .val { color: var(--muted); font-size: 14px; white-space: nowrap; }
.set > .i:last-child { width: 18px; height: 18px; color: var(--faint); }
.set .sic .i { width: 19px; height: 19px; }
.set .st { flex: 1; min-width: 0; }
.set .st b { display: block; font-weight: 600; }
.set .st small { color: var(--muted); font-size: 13px; display: block; }
.set.danger { color: var(--red); }
.switch { width: 50px; height: 30px; border-radius: 15px; background: color-mix(in srgb, var(--text) 16%, transparent); position: relative; transition: background .25s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }
.profile { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 20px 12px 16px; }
.profile .av { cursor: pointer; }
.profile .cam { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); box-shadow: 0 0 0 3px var(--glass-strong); }
.profile .cam .i { width: 17px; height: 17px; }
.profile h2 { margin: 8px 0 0; font-size: 23px; letter-spacing: -.4px; }
.profile p { margin: 0; color: var(--muted); }

/* ------------------------------------------------------------------- admin */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 4px 14px; }
.stat { border-radius: 22px; padding: 16px; position: relative; overflow: hidden; animation: rise .5s var(--ease) both; }
.stat .si { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft) !important; margin-bottom: 12px; }
.stat .si .i { width: 19px; height: 19px; }
.stat .sv { font-size: 28px; font-weight: 750; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat .sl { color: var(--muted); font-size: 13px; font-weight: 550; }
.stat .sk { height: 30px; width: 60%; margin-top: 6px; }
.chart { padding: 16px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; }
.tag.admin { background: var(--accent-soft); color: var(--accent); }
.tag.ban { background: rgba(255,77,94,.13); color: var(--red); }
.tag.on { background: rgba(22,196,127,.13); color: var(--green); }
.tag.miss { background: rgba(255,77,94,.13); color: var(--red); }
.tag.ok { background: rgba(22,196,127,.13); color: var(--green); }
.tag.neu { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--muted); }
.admin-sub { position: sticky; top: 0; z-index: 3; padding: 4px 6px 12px; }
.admin-sub .seg { overflow-x: auto; scrollbar-width: none; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px; color: var(--muted); font-size: 14px; }
.grid-form { display: grid; gap: 14px; padding: 14px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); user-select: all; word-break: break-all; text-align: center; font-size: 17px; }

/* -------------------------------------------------------------------- call */
.call {
	position: fixed; inset: 0; z-index: 70; color: #fff; overflow: hidden; display: flex; flex-direction: column;
	background: radial-gradient(120% 80% at 50% 0%, var(--call-1) 0%, var(--call-2) 45%, var(--call-3) 100%);
	animation: callIn .5s var(--ease);
	transition: inset .45s var(--ease), border-radius .45s var(--ease), box-shadow .45s;
}
@keyframes callIn { from { opacity: 0; transform: scale(1.04); } }
.call.out { animation: callIn .3s var(--ease) reverse forwards; }
.call .orb { position: absolute; left: 50%; top: 42%; width: 90vmin; height: 90vmin; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(var(--orb), .9), rgba(var(--orb), .42) 35%, transparent 65%); filter: blur(30px); animation: orb 6s ease-in-out infinite; pointer-events: none; }
.call.speaking .orb { animation-duration: 2.2s; }
@keyframes orb { 50% { transform: translate(-48%, -53%) scale(1.12); opacity: .85; } }
.call video.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .5s; }
.call.has-video video.remote { opacity: 1; }
.call video.local {
	position: absolute; z-index: 3; right: 14px; top: calc(70px + var(--sat)); width: 108px; height: 156px; border-radius: 20px; object-fit: cover;
	background: #111; box-shadow: 0 14px 30px -10px rgba(0,0,0,.6); border: 2px solid rgba(255,255,255,.25); touch-action: none; transform: scaleX(-1); transition: opacity .3s;
}
.call video.local.back { transform: none; }
.call video.local.off { opacity: 0; pointer-events: none; }
.call-top { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--sat)) 14px 0; }
.call-top .icon-btn { color: #fff; background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.call-top .enc { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .8; }
.call-top .enc .i { width: 14px; height: 14px; }
.call-info { position: relative; z-index: 2; flex: 1; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 20px; transition: opacity .4s; }
.call.has-video .call-info { align-content: start; padding-top: 8px; opacity: .95; }
.call.has-video .call-info .av { display: none; }
.call-info .av { --s: 120px; margin-bottom: 12px; }
.call-info .av::before, .call-info .av::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); animation: ring 2.2s ease-out infinite; }
.call-info .av::after { animation-delay: 1.1s; }
.call.live .call-info .av::before, .call.live .call-info .av::after { display: none; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.call-info .av .img { box-shadow: 0 20px 50px -10px rgba(0,0,0,.45); }
.call-name { font-size: 30px; font-weight: 700; letter-spacing: -.6px; text-shadow: 0 2px 20px rgba(0,0,0,.25); }
.call-status { font-size: 16px; opacity: .85; font-variant-numeric: tabular-nums; }
.call-quote { font-size: 13px; opacity: .65; }
.call-ctrls { position: relative; z-index: 4; display: flex; justify-content: center; gap: 14px; padding: 18px 16px calc(26px + var(--sab)); flex-wrap: wrap; }
.cbtn { display: grid; justify-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); }
.cbtn .cc { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.18); transition: transform .2s var(--spring), background .2s; }
.cbtn .cc .i { width: 26px; height: 26px; }
.cbtn:active .cc { transform: scale(.88); }
.cbtn.on .cc { background: #fff; color: #0e1525; }
.cbtn.end .cc { background: linear-gradient(135deg, #ff6b6b, #ff3b4e); border: 0; box-shadow: 0 14px 30px -10px rgba(255,59,78,.8); }
.cbtn.accept .cc { background: linear-gradient(135deg, #2ee59d, #12b76a); border: 0; box-shadow: 0 14px 30px -10px rgba(18,183,106,.8); animation: wiggle 1.4s infinite; }
@keyframes wiggle { 0%, 60%, 100% { transform: none; } 10%, 30%, 50% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
.call.incoming .call-ctrls { gap: 70px; padding-bottom: calc(50px + var(--sab)); }
.call.incoming .cbtn .cc { width: 72px; height: 72px; }
/* minimized call pill */
.call.min { inset: auto 12px auto auto; top: calc(10px + var(--sat)); width: 168px; height: 64px; border-radius: 22px; box-shadow: var(--shadow-lg); cursor: pointer; animation: none; }
.call.min.has-video { width: 120px; height: 170px; }
.call.min .call-top, .call.min .call-ctrls, .call.min video.local, .call.min .call-info .av, .call.min .call-name, .call.min .call-quote { display: none; }
.call.min .call-info { padding: 0; gap: 0; }
.call.min .call-status { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.call.min .call-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #31e391; animation: breathe 1.2s infinite; }
.call.min.has-video .call-info { align-content: end; padding-bottom: 8px; }
.call.min .orb { width: 140px; height: 140px; }

/* ------------------------------------------------------ contacts & extras */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 6px 12px; }
.tile { display: grid; justify-items: center; gap: 6px; padding: 14px 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; transition: transform .15s; }
.tile:active { transform: scale(.96); }
.tile span { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.tile .i { width: 21px; height: 21px; }
.found { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 20px 14px; border-radius: 22px; animation: rise .35s var(--ease); }
.found b { font-size: 18px; margin-top: 4px; }
.found small { color: var(--muted); margin-bottom: 6px; }
.sheet-note { margin: 0 2px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.promo { display: flex; align-items: center; gap: 12px; margin: 0 6px 12px; padding: 12px 8px 12px 12px; border-radius: 20px; animation: rise .45s var(--ease); }
.promo-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); flex: none; }
.promo-t { flex: 1; min-width: 0; display: grid; }
.promo-t small { color: var(--muted); font-size: 12.5px; }
.promo .icon-btn { width: 32px; height: 32px; color: var(--faint); }
.stranger { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; margin: 0 4px 8px; border-radius: 18px; font-size: 14px; animation: rise .3s var(--ease); }
.stranger span { flex: 1; color: var(--muted); }
.radio-list { display: grid; gap: 4px; padding-bottom: 8px; }
.radio { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-radius: 14px; font-weight: 550; text-align: left; }
.radio:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.radio .dotc { width: 22px; height: 22px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 22%, transparent); transition: all .2s var(--spring); }
.radio.on .dotc { border: 7px solid var(--accent); }
.step { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.step .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
.chat-head .icon-btn .i, .topbar .icon-btn .i { width: 21px; height: 21px; }
@media (hover: none) {
	.bubble, .row, .tile, .cbtn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

/* iPhone: lock the page itself so every swipe goes to the app's own scroll areas */
html.ios, html.ios body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; }
html.ios-browser .scroll { padding-bottom: calc(190px + var(--sab)); }
html.ios-browser .tabbar { bottom: calc(14px + var(--sab)); }
html.ios-browser .fab { bottom: calc(100px + var(--sab)); }

/* --------------------------------------------------------------- desktop */
@media (min-width: 900px) {
	body.aama-body { font-size: 14.5px; }
	.shell { grid-template-columns: 78px minmax(320px, 400px) 1fr; padding: 14px; gap: 14px; }
	.shell.wide { grid-template-columns: 78px 1fr; }
	.shell.wide .pane-main { display: none; }
	.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 28px; }
	.rail .logo { width: 46px; height: 46px; border-radius: 16px; font-size: 21px; margin-bottom: 14px; }
	.rail button.nav { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: var(--muted); position: relative; transition: all .2s var(--ease); }
	.rail button.nav:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
	.rail button.nav.on { background: var(--accent-soft); color: var(--accent); }
	.rail .dot-badge { top: 6px; left: auto; right: 6px; }
	.rail .spacer { flex: 1; }
	.pane-list { border-radius: 28px; overflow: hidden; transform: none !important; filter: none !important; }
	.pane-main { position: relative; inset: auto; transform: none !important; border-radius: 28px; overflow: hidden; z-index: 1; box-shadow: var(--shadow) !important; }
	.pane-main, .pane-list { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); }
	.shell:not(.has-main) .main-empty { display: grid; }
	.main-empty { height: 100%; place-items: center; align-content: center; text-align: center; gap: 12px; color: var(--muted); }
	.main-empty .logo { width: 92px; height: 92px; border-radius: 30px; font-size: 42px; animation: breathe 3s var(--ease) infinite; }
	.main-empty h2 { color: var(--text); margin: 8px 0 0; font-size: 26px; letter-spacing: -.5px; }
	.tabbar { display: none; }
	.topbar { padding-top: 16px; }
	.topbar h1 { font-size: 26px; }
	.scroll { padding-bottom: 30px; }
	.fab { bottom: 22px; }
	.chat-head { border-radius: 0 0 22px 22px; }
	.msgs { padding-left: 24px; padding-right: 24px; }
	.composer-wrap { padding: 8px 16px 16px; }
	.to-bottom { bottom: 92px; }
	.sheet { left: 50%; right: auto; bottom: 50%; width: 460px; transform: translate(-50%, 50%); border-radius: 30px; animation: modalIn .35s var(--spring); max-height: 84vh; padding-bottom: 16px; }
	.sheet.out { animation: modalIn .2s reverse forwards; }
	@keyframes modalIn { from { opacity: 0; transform: translate(-50%, 50%) scale(.92); } }
	.sheet .grab { display: none; }
	.sheet-head { padding-top: 10px; }
	.stats { grid-template-columns: repeat(4, 1fr); }
	.call:not(.min) { inset: 24px; border-radius: 32px; box-shadow: var(--shadow-lg); }
	.call video.local { width: 200px; height: 130px; }
	.m { max-width: min(68%, 560px); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
