/* Waypost — Pinterest-style board, Telegram-style structure.
   Mobile-only: one column, screens slide in. Large screens show a centered phone-width column. */
:root {
  --bg: #FFFFFF;
  --bg-2: #F6F6F6;
  --card: #F1F1F1;
  --card-2: #E8E8E8;
  --line: #E6E6E6;
  --text: #111111;
  --muted: #6B6B6B;
  --faint: #9A9A9A;
  --accent: #CC2E1D;
  --accent-ink: #FFFFFF;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --blue: #2747D4;
  --violet: #6A4BD1;
  --teal: #0B7A5E;
  --pink: #B23A6A;
  --slate: #4B5563;
  --ok: #0A7D4F;
  --danger: #C62828;
  --bubble-in: #F1F1F1;
  --bar: rgba(255, 255, 255, 0.86);
  --bar-line: rgba(0, 0, 0, 0.06);
  --shadow-1: 0 1px 2px rgba(17, 17, 17, 0.06), 0 2px 8px rgba(17, 17, 17, 0.05);
  --shadow-2: 0 10px 30px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.06);
  --shadow-3: 0 24px 60px rgba(17, 17, 17, 0.22);
  --scrim: rgba(10, 10, 12, 0.45);
  --av-l: 44%;
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --out: cubic-bezier(0.4, 0, 1, 1);
  --text-size: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E0E10;
  --bg-2: #131316;
  --card: #1B1B1F;
  --card-2: #26262B;
  --line: #2A2A2F;
  --text: #F4F4F5;
  --muted: #A1A1A8;
  --faint: #6E6E76;
  --accent: #FF6A55;
  --accent-ink: #1A0602;
  --blue: #8EA0FF;
  --violet: #A48CFF;
  --teal: #3DDC97;
  --pink: #F08BB8;
  --slate: #8A93A3;
  --ok: #3DDC97;
  --danger: #FF7A6B;
  --bubble-in: #1F1F24;
  --bar: rgba(28, 28, 32, 0.86);
  --bar-line: rgba(255, 255, 255, 0.06);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.6);
  --scrim: rgba(0, 0, 0, 0.6);
  --av-l: 40%;
  color-scheme: dark;
}
:root[data-accent="blue"] { --accent: #2747D4; --accent-ink: #FFFFFF; }
:root[data-accent="teal"] { --accent: #0B7A5E; --accent-ink: #FFFFFF; }
:root[data-accent="violet"] { --accent: #6A4BD1; --accent-ink: #FFFFFF; }
:root[data-accent="amber"] { --accent: #A65412; --accent-ink: #FFFFFF; }
:root[data-accent="ink"] { --accent: #111111; --accent-ink: #FFFFFF; }
:root[data-theme="dark"][data-accent="blue"] { --accent: #8EA0FF; --accent-ink: #0A1240; }
:root[data-theme="dark"][data-accent="teal"] { --accent: #3DDC97; --accent-ink: #032015; }
:root[data-theme="dark"][data-accent="violet"] { --accent: #A48CFF; --accent-ink: #160A40; }
:root[data-theme="dark"][data-accent="amber"] { --accent: #F2A64B; --accent-ink: #2A1500; }
:root[data-theme="dark"][data-accent="ink"] { --accent: #F4F4F5; --accent-ink: #111111; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 500 15px/1.45 var(--font); overflow: hidden; transition: background-color .35s var(--ease), color .35s var(--ease); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea { font: inherit; color: var(--text); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center-text { text-align: center; }
.danger { color: var(--danger) !important; }
.ok { color: var(--ok); }
.live { color: var(--ok) !important; }
.spacer { flex: 1; }
#app { height: 100%; }

/* ---------- motion primitives ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slide-push { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes slide-pop { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes tab-in { from { opacity: 0; transform: scale(.985) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ripple { from { transform: scale(0); opacity: .28; } to { transform: scale(1); opacity: 0; } }
@keyframes shimmer { from { background-position: -320px 0; } to { background-position: 320px 0; } }
@keyframes blink { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes bubble-out { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes wave { from { transform: scale(.8); opacity: .55; } to { transform: scale(1.9); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-10px) rotate(var(--r, 0deg)); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes status-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.pop { animation: pop .45s var(--spring) both; }

.rp { position: relative; overflow: hidden; isolation: isolate; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; pointer-events: none; animation: ripple .6s var(--ease) forwards; z-index: -1; }

/* ---------- app shell ---------- */
.app { height: 100%; position: relative; overflow: hidden; background: var(--bg); max-width: 480px; margin: 0 auto; }
/* Mobile app: on a large screen it shows as one phone-width column. */
@media (min-width: 520px) { html { background: var(--bg-2); } body { background: var(--bg-2); } .app { box-shadow: 0 0 0 1px var(--line), var(--shadow-2); } }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.screen.in-push { animation: slide-push .42s var(--ease) both; }
.screen.in-pop { animation: slide-pop .38s var(--ease) both; }
.screen.in-tab { animation: tab-in .38s var(--ease) both; }
.screen-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.pad { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.pad-bottom { padding-bottom: 120px; }
.stack { display: flex; flex-direction: column; gap: 14px; padding-bottom: 32px; }
.center { display: grid; place-items: center; padding: 48px 0; }
.splash { height: 100%; max-width: 480px; margin: 0 auto; display: grid; place-items: center; }
.splash .brand-mark { animation: breathe 1.6s var(--ease) infinite; }

/* ---------- headers ---------- */
.top { padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 12px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.035em; }
.top-actions { display: flex; gap: 8px; }
.bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); }
.bar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 800; }
.label { margin: 18px 4px 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.day-label { margin-top: 20px; }

/* ---------- buttons ---------- */
.icon-btn { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--text); transition: transform .22s var(--spring), background-color .2s, color .2s, box-shadow .2s; }
.icon-btn:hover { background: var(--card-2); }
.icon-btn:active { transform: scale(.88); }
.icon-btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.icon-btn.accent:hover { transform: translateY(-1px) rotate(-6deg); }
.icon-btn.soft { width: 42px; height: 42px; background: var(--bg); }
.icon-btn.glass { background: rgba(0, 0, 0, .32); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 800; background: var(--card); transition: transform .22s var(--spring), filter .2s, opacity .2s, box-shadow .25s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(.95); }
.btn:disabled { opacity: .45 !important; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.big { height: 54px; width: 100%; font-size: 16px; }
.btn.small { height: 38px; padding: 0 16px; font-size: 14px; }
.btn.danger-soft { background: var(--card); color: var(--danger); }
.pill-btn { height: 40px; padding: 0 18px; border-radius: 999px; background: var(--card); font-weight: 700; transition: transform .2s var(--spring); }
.pill-btn:active { transform: scale(.94); }
.link-btn { color: var(--text); font-weight: 700; padding: 10px 4px; }
.chip { padding: 10px 16px; border-radius: 999px; background: var(--card); font-weight: 600; animation: rise .5s var(--ease) both; animation-delay: calc(200ms + var(--i) * 70ms); transition: transform .2s var(--spring), background-color .2s; }
.chip:hover { background: var(--card-2); transform: translateY(-2px); }
.spinner { display: inline-block; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .85; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; flex: none; font-variant-numeric: tabular-nums; }
.badge.tiny { position: absolute; top: -6px; right: -10px; min-width: 19px; height: 19px; font-size: 10.5px; padding: 0 5px; box-shadow: 0 0 0 2.5px var(--bar-solid, var(--bg)); }

/* ---------- search + segmented ---------- */
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 18px; border-radius: 999px; background: var(--card); color: var(--muted); transition: box-shadow .25s var(--ease), background-color .25s; }
.search:focus-within { background: var(--bg); box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 500; }
.search input::-webkit-search-cancel-button { display: none; }
.clear { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--muted); animation: pop .3s var(--spring); }
.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 5px; border-radius: 999px; background: var(--card); }
.seg-pill { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / var(--n)); border-radius: 999px; background: var(--bg); box-shadow: var(--shadow-1); transform: translateX(calc(var(--i) * 100%)); transition: transform .45s var(--spring); }
:root[data-theme="dark"] .seg-pill { background: var(--card-2); }
.seg-btn { position: relative; height: 40px; border-radius: 999px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; transition: color .25s; }
.seg-btn.on { color: var(--text); }
.seg-btn:active { transform: scale(.96); }
.seg-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; animation: pop .4s var(--spring); }

/* ---------- avatar ---------- */
.avatar { position: relative; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: hsl(var(--hue) 52% var(--av-l)); color: #fff; font-weight: 800; letter-spacing: -.01em; user-select: none; }
.avatar.ring { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6.5px hsl(var(--hue) 60% 55%); }
.online-dot { position: absolute; right: -1px; bottom: -1px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2.5px var(--bg); animation: pop .5s var(--spring); }

/* ---------- chats board (masonry) ---------- */
.board { column-count: 2; column-gap: 10px; padding: 4px 12px 0; }
.board.tight { padding: 0; }
.card { display: block; width: 100%; break-inside: avoid; margin: 0 0 10px; border-radius: 26px; background: var(--card); overflow: hidden; color: var(--text); text-align: left;
  animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms);
  transition: transform .35s var(--spring), box-shadow .35s var(--ease), background-color .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card:active { transform: scale(.97); transition-duration: .12s; }
.card.active { box-shadow: 0 0 0 2.5px var(--accent); }
.card.skeleton, .skeleton { background: linear-gradient(90deg, var(--card) 0, var(--card-2) 40%, var(--card) 80%); background-size: 640px 100%; animation: rise .5s var(--ease) both, shimmer 1.3s linear infinite; animation-delay: calc(var(--i, 0) * 60ms), 0s; }
.row-skel { height: 68px; border-radius: 20px; }
.card-media { overflow: hidden; }
.card-media .photo { width: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .5s; }
.card:hover .card-media .photo { transform: scale(1.06); }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; align-items: center; gap: 9px; }
.card-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-who b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-who span { font-size: 12px; font-weight: 600; color: var(--muted); }
.hot { color: var(--accent) !important; font-weight: 800 !important; }
.card-text { margin: 0; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card.unread .card-text { font-weight: 650; }
.typing-line { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 13.5px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--bg); }
.file-chip span:last-child { min-width: 0; display: flex; flex-direction: column; }
.file-chip b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip small, .file-info small { color: var(--muted); font-size: 12px; }
.file-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--blue); color: var(--bg); display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
.file-ic.big { width: 46px; height: 46px; border-radius: 14px; font-size: 11px; }
.photo { opacity: 0; background: var(--card-2); }
.photo.loaded { opacity: 1; animation: fade .5s var(--ease); }

/* list layout */
.rows { padding: 0 8px; }
.row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 22px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 35ms); transition: background-color .2s, transform .2s var(--spring); }
.row:hover { background: var(--card); }
.row:active { transform: scale(.98); }
.row.active { background: var(--accent-soft); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-top, .row-bot { display: flex; align-items: center; gap: 8px; }
.row-top b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15.5px; }
.row-top small { color: var(--muted); font-size: 12px; font-weight: 600; }
.row-text { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.tick { color: var(--muted); }
.tick.read { color: var(--blue); }
.tick.read.light { color: currentColor; }
.tick.failed { color: var(--danger); }

/* empty states */
.empty { text-align: center; padding: 56px 32px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h2 { margin: 10px 0 0; font-size: 20px; font-weight: 800; }
.empty p { margin: 0 0 12px; max-width: 30ch; }
.empty-art { width: 84px; height: 84px; border-radius: 30px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); animation: float 4s var(--ease) infinite; }

/* ---------- tab bar ---------- */
.tabbar { position: absolute; z-index: 20; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); height: 72px; padding: 0 6px; border-radius: 999px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; background: var(--bar); border: 1px solid var(--bar-line); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); box-shadow: var(--shadow-2); animation: rise .6s var(--ease) both .1s; --bar-solid: var(--bg); }
.tab-glow { position: absolute; top: 8px; bottom: 8px; left: 6px; width: calc((100% - 12px) / 4); border-radius: 999px; background: var(--accent-soft); transform: translateX(calc(var(--i) * 100%)); transition: transform .5s var(--spring); }
.tab { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text); font-size: 11.5px; font-weight: 600; transition: color .25s; }
.tab-ic { position: relative; transition: transform .35s var(--spring); }
.tab:active .tab-ic { transform: scale(.82); }
.tab.on { color: var(--accent); font-weight: 800; }
.tab.on .tab-ic { animation: pop .45s var(--spring); }
.tab.on .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* ---------- conversation ---------- */
.chat-head { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--bar); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); z-index: 2; }
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 999px; transition: background-color .2s; }
.who:hover { background: var(--card); }
.who-text { min-width: 0; display: flex; flex-direction: column; }
.who-text b { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text small { font-size: 12.5px; font-weight: 600; color: var(--muted); animation: status-in .3s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.msg-col { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; padding: 14px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); max-width: 820px; margin: 0 auto; font-size: var(--text-size); }
.day-pill { align-self: center; margin: 12px 0 8px; padding: 5px 13px; border-radius: 999px; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 700; animation: fade .4s var(--ease); }
.bubble { position: relative; max-width: min(78%, 520px); padding: 8px 12px 7px 14px; border-radius: 22px; font-size: 1em; line-height: 1.42; overflow-wrap: anywhere; white-space: pre-wrap; animation: bubble-out .38s var(--spring) both; }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 7px; transform-origin: bottom left; }
.bubble.out { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 7px; transform-origin: bottom right; }
.bubble:not(.grouped) { margin-top: 7px; }
.bubble.grouped.in { border-top-left-radius: 7px; }
.bubble.grouped.out { border-top-right-radius: 7px; }
.bubble.pending { opacity: .78; }
.bubble.failed { box-shadow: 0 0 0 2px var(--danger); }
.meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -3px 10px; font-size: 11px; font-weight: 600; opacity: .7; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bubble.out .meta { opacity: .85; }
.bubble.media { padding: 4px; width: min(78%, 340px); margin: 0; } /* figure has default side margins */
.media-btn { display: block; width: 100%; border-radius: 18px; overflow: hidden; position: relative; }
.media-btn .photo { width: 100%; max-height: 380px; min-height: 140px; object-fit: cover; transition: transform .5s var(--ease), opacity .5s; }
.media-btn:hover .photo { transform: scale(1.03); }
.bubble.media figcaption { padding: 6px 8px 3px; }
.meta.floating { position: absolute; right: 12px; bottom: 10px; margin: 0; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; opacity: 1; }
.upload-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .35); color: #fff; }
.bubble.file { width: min(78%, 330px); padding: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 16px; transition: background-color .2s; }
.file-row:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.bubble.out .file-ic { background: rgba(255, 255, 255, .22); color: inherit; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble.out .file-info small { color: inherit; opacity: .8; }
.bubble.file p { margin: 6px 6px 0; }
.typing-bubble { padding: 14px 16px; color: var(--muted); }
.chat-intro { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px; }
.chat-intro h2 { margin: 12px 0 0; font-size: 22px; font-weight: 800; }
.chat-intro p { margin: 0 0 14px; max-width: 34ch; }
.hello-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: var(--bg); }
.compose-field { flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; padding: 0 18px; border-radius: 24px; background: var(--card); transition: box-shadow .25s var(--ease), background-color .25s; }
.compose-field:focus-within { background: var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.compose-field textarea, .compose-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; resize: none; padding: 12px 0; font-size: 16px; line-height: 1.4; max-height: 140px; }
.compose-field textarea { overflow-y: hidden; scrollbar-width: none; }
.compose-field textarea::-webkit-scrollbar { display: none; }
.send-btn { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--card); color: var(--text); display: grid; place-items: center; transition: background-color .25s, color .25s, transform .25s var(--spring), box-shadow .3s; }
.send-btn .morph { grid-area: 1 / 1; display: grid; place-items: center; transition: transform .35s var(--spring), opacity .2s; }
.send-btn .morph.b { opacity: 0; transform: scale(.3) rotate(-60deg); }
.send-btn.ready { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.send-btn.ready .morph.a { opacity: 0; transform: scale(.3) rotate(60deg); }
.send-btn.ready .morph.b { opacity: 1; transform: none; }
.send-btn:active { transform: scale(.86); }
.drop-zone { position: absolute; inset: 12px; border-radius: 28px; border: 2.5px dashed var(--accent); background: color-mix(in srgb, var(--bg) 88%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--accent); font-size: 18px; z-index: 5; animation: zoom-in .25s var(--ease); pointer-events: none; }

/* ---------- sheets ---------- */
.scrim { position: absolute; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s var(--ease); }
.scrim.out { animation: fade-out .22s var(--out) forwards; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 30px 30px 0 0; padding: 6px max(18px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); box-shadow: var(--shadow-3); animation: sheet-up .48s var(--spring) both; }
.sheet.out { animation: sheet-down .22s var(--out) forwards; }
.grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 8px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.sheet-head .spacer { width: 60px; flex: none; }
.sheet-label { margin: 18px 4px 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.attach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.attach-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 24px; background: var(--card); font-size: 13.5px; font-weight: 700; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); transition: transform .3s var(--spring), background-color .2s; }
.attach-opt:hover { transform: translateY(-3px); }
.attach-opt:active { transform: scale(.94); }
.attach-ic { width: 56px; height: 56px; border-radius: 20px; display: grid; place-items: center; color: #fff; }
.attach-ic.a1 { background: var(--blue); } .attach-ic.a2 { background: var(--violet); } .attach-ic.a3 { background: var(--accent); color: var(--accent-ink); }
.gallery { column-count: 3; column-gap: 8px; }
.gallery-tile { display: block; width: 100%; margin: 0 0 8px; border-radius: 18px; overflow: hidden; break-inside: avoid; animation: rise .5s var(--ease) both; animation-delay: calc(120ms + var(--i) * 50ms); transition: transform .3s var(--spring); }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; }
.gallery-tile:hover { transform: scale(1.03); }
.picked { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.picked-item, .picked-add { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 20px; overflow: hidden; background: var(--card); animation: pop .45s var(--spring) both; animation-delay: calc(var(--i, 0) * 50ms); }
.picked-item img { width: 100%; height: 100%; object-fit: cover; }
.picked-file { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; }
.picked-file small { font-size: 11.5px; overflow-wrap: anywhere; color: var(--muted); }
.picked-x { position: absolute; top: 7px; right: 7px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.picked-add { display: grid; place-items: center; color: var(--muted); border: 2px dashed var(--line); background: transparent; }
.send-row { display: flex; gap: 8px; margin-top: 14px; align-items: center; }

/* ---------- toasts + viewer ---------- */
.toasts { position: absolute; z-index: 80; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 22px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-3); animation: rise .45s var(--spring) both; text-align: left; }
.toast-text { min-width: 0; display: flex; flex-direction: column; }
.toast-text b { font-size: 14px; }
.toast-text span { font-size: 13.5px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer { position: absolute; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 60px 12px; animation: fade .25s var(--ease); }
.viewer.out { animation: fade-out .2s var(--out) forwards; }
.viewer img { max-height: 100%; border-radius: 16px; animation: zoom-in .35s var(--spring); object-fit: contain; }
.viewer-bar { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; }
.viewer-bar span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- profile ---------- */
.profile-cover { position: relative; padding: calc(10px + env(safe-area-inset-top)) 16px 26px; background: linear-gradient(180deg, hsl(var(--hue) 55% 50% / .22), transparent); }
.cover-bar { display: flex; }
.profile-id { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin-top: 4px; }
.profile-id .avatar { animation: zoom-in .55s var(--spring); }
.profile-id h1 { margin: 14px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.profile-id p { margin: 0; color: var(--muted); font-weight: 600; }
.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.action { height: 74px; border-radius: 22px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 700; animation: rise .5s var(--ease) both; animation-delay: calc(120ms + var(--i) * 50ms); transition: transform .3s var(--spring), background-color .25s, color .25s; }
.action:hover { transform: translateY(-3px); }
.action:active { transform: scale(.93); }
.action.on { background: var(--text); color: var(--bg); }
.info-card { margin: 0; padding: 4px 18px; border-radius: 24px; background: var(--card); }
.info-card div { padding: 12px 0; }
.info-card div + div { border-top: 1px solid var(--line); }
.info-card dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.info-card dd { margin: 2px 0 0; font-size: 15px; }
.info-card .link { color: var(--blue); font-weight: 700; }
.media-card { border-radius: 22px; margin-bottom: 8px; }
.media-card .photo { width: 100%; object-fit: cover; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 22px; background: var(--card); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 50ms); transition: transform .3s var(--spring); }
.file-card:hover { transform: translateY(-2px); }

/* ---------- contacts + calls ---------- */
.story-row { display: flex; gap: 6px; overflow-x: auto; padding: 10px 6px 8px; margin: -6px -6px 0; scrollbar-width: none; }
.story { flex: none; width: 80px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; border-radius: 20px; padding: 9px 0 6px; animation: pop .5s var(--spring) both; animation-delay: calc(var(--i) * 60ms); }
.story:hover .avatar { transform: scale(1.06); }
.story .avatar { transition: transform .3s var(--spring); }
.invite-card { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 26px; background: var(--accent); color: var(--accent-ink); text-align: left; margin-top: 8px; animation: rise .55s var(--ease) both .1s; transition: transform .3s var(--spring), box-shadow .3s; }
.invite-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.invite-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.invite-card small { opacity: .9; }
.invite-ic { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); }
.list-card { border-radius: 26px; background: var(--card); padding: 4px; }
.person, .call-row { display: flex; align-items: center; gap: 6px; padding-right: 6px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.call-row { border-radius: 22px; background: var(--card); margin-bottom: 8px; }
.person-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 22px; transition: background-color .2s; }
.person-main:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.person-main > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.person-main b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-main small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- call screen ---------- */
.call { position: absolute; inset: 0; z-index: 70; color: #fff; display: flex; flex-direction: column; align-items: center; padding: calc(24px + env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom)); background: radial-gradient(120% 80% at 50% 20%, hsl(var(--hue) 55% 32%), hsl(var(--hue) 50% 12%)); animation: zoom-in .45s var(--spring); }
.call.ended { animation: fade-out .5s var(--out) 1.1s forwards; }
.call-video { position: absolute; inset: 0; background: #000; }
.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade .6s var(--ease); }
.remote.placeholder { display: grid; place-items: center; background: hsl(var(--hue) 40% 18%); }
.hidden-audio { display: none; }
.pip { position: absolute; z-index: 2; top: calc(76px + env(safe-area-inset-top)); right: 16px; width: 112px; height: 160px; border-radius: 22px; overflow: hidden; background: #1B2A24; border: 2px solid rgba(255, 255, 255, .85); display: grid; place-items: center; box-shadow: var(--shadow-3); animation: zoom-in .5s var(--spring) .2s both; transition: transform .3s var(--spring); }
.pip:hover { transform: scale(1.04); }
.pip video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.call-top, .call-center, .call-actions { position: relative; z-index: 3; }
.enc { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: rgba(0, 0, 0, .28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px; font-weight: 600; }
.call-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.call.has-video .call-center { justify-content: flex-start; padding-top: 18px; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.call-center h1 { margin: 22px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.call.has-video .call-center h1 { margin-top: 0; font-size: 22px; }
.call-status { margin: 0; font-size: 17px; font-weight: 600; opacity: .85; font-variant-numeric: tabular-nums; animation: status-in .35s var(--ease); }
.call-avatar { position: relative; display: grid; place-items: center; width: 260px; height: 260px; }
.call-avatar .avatar { box-shadow: 0 0 0 5px rgba(255, 255, 255, .9); animation: breathe 3s var(--ease) infinite; }
.wave { position: absolute; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .22); animation: wave 2.4s var(--out) infinite; }
.wave.w2 { animation-delay: .8s; } .wave.w3 { animation-delay: 1.6s; }
.call.active .wave { animation-duration: 3.6s; opacity: .5; }
.call.ended .wave { display: none; }
.call-actions { display: flex; gap: 22px; justify-content: center; min-height: 76px; padding: 12px 18px; border-radius: 999px; }
.call.has-video .call-actions { background: rgba(20, 20, 22, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.call-actions.incoming { gap: 72px; }
.call-btn { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff; animation: pop .5s var(--spring) both; transition: transform .25s var(--spring), background-color .25s, color .25s; }
.call-btn:nth-child(2) { animation-delay: .06s; } .call-btn:nth-child(3) { animation-delay: .12s; }
.call-btn:hover { transform: translateY(-2px); }
.call-btn:active { transform: scale(.88); }
.call-btn.on { background: #fff; color: #111; }
.call-btn.end, .call-btn.decline { background: #E5383B; width: 74px; height: 74px; }
.call-btn.accept { background: #1FA463; width: 74px; height: 74px; animation: pop .5s var(--spring) both, breathe 1.4s var(--ease) infinite .5s; }

/* ---------- settings ---------- */
.settings-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(14px + env(safe-area-inset-top)) 16px 18px; gap: 2px; }
.hero-actions { align-self: stretch; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.settings-hero h1 { margin: 16px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.settings-hero p { margin: 0; }
.hero-bio { margin-top: 8px !important; max-width: 36ch; }
.conn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 700; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.conn.online i { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: breathe 2s infinite; }
.conn.connecting i { background: var(--accent); animation: blink 1s infinite; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 14px; border-radius: 22px; background: var(--card); display: flex; flex-direction: column; }
.stat b { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.set-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 22px; text-align: left; transition: background-color .2s; }
button.set-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
button.set-row:active .set-ic { transform: scale(.85); }
.set-ic { width: 38px; height: 38px; flex: none; border-radius: 13px; display: grid; place-items: center; color: #fff; transition: transform .25s var(--spring); }
:root[data-theme="dark"] .set-ic { color: #0E0E10; }
.set-label { flex: 1; font-weight: 650; font-size: 15.5px; }
.set-value { color: var(--muted); font-size: 14px; }
.chev { color: var(--faint); }
.switch { width: 50px; height: 30px; flex: none; border-radius: 999px; background: var(--card-2); position: relative; transition: background-color .3s var(--ease); }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .4s var(--spring); }
.switch.on { background: var(--accent); }
.switch.on span { transform: translateX(20px); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field textarea { height: 52px; padding: 0 16px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--bg); font-size: 16px; font-weight: 600; outline: none; transition: border-color .2s, box-shadow .25s; }
.field textarea { height: auto; padding: 12px 16px; resize: none; line-height: 1.4; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-prefix { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 18px; background: var(--bg); transition: border-color .2s, box-shadow .25s; }
.field-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-prefix b { padding-left: 16px; color: var(--muted); font-size: 16px; }
.field-prefix input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding-left: 4px; }
.field.inline { padding: 10px 12px; }
.form-card .field input, .form-card .field textarea, .form-card .field-prefix { background: transparent; border: 0; height: auto; padding: 4px 0; box-shadow: none; }
.form-card .field-prefix b { padding-left: 0; }
.form-card .field + .field { border-top: 1px solid var(--line); }
.form-error { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-weight: 700; font-size: 14px; animation: rise .35s var(--ease); }
.hint { margin: 8px 12px 0; }
.edit-avatar { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }

/* ---------- appearance ---------- */
.preview-card { border-radius: 28px; background: var(--card); padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: font-size .25s; }
.preview-card .bubble.in { background: var(--bg); }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.mini { width: 100%; height: 120px; border-radius: 22px; padding: 12px 10px; display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--line); transition: transform .3s var(--spring), box-shadow .3s; }
.theme-opt:hover .mini { transform: translateY(-3px); }
.theme-opt.on .mini { box-shadow: 0 0 0 3px var(--accent); }
.mini i { display: block; height: 15px; width: 72%; border-radius: 8px; }
.mini i.o { width: 58%; align-self: flex-end; background: var(--accent) !important; }
.theme-opt.light .mini { background: #fff; } .theme-opt.light .mini i { background: #EDEDED; }
.theme-opt.dark .mini { background: #0E0E10; } .theme-opt.dark .mini i { background: #26262B; }
.theme-opt.system .mini { background: linear-gradient(90deg, #fff 50%, #0E0E10 50%); } .theme-opt.system .mini i { background: #8F8F96; }
.swatches { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px 16px; border-radius: 24px; background: var(--card); }
.swatch { width: 44px; height: 44px; border-radius: 50%; animation: pop .45s var(--spring) both; animation-delay: calc(var(--i) * 45ms); transition: transform .25s var(--spring), box-shadow .25s; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5.5px currentColor; }
.a-red { background: #CC2E1D; color: #CC2E1D; } .a-blue { background: #2747D4; color: #2747D4; } .a-teal { background: #0B7A5E; color: #0B7A5E; }
.a-violet { background: #6A4BD1; color: #6A4BD1; } .a-amber { background: #A65412; color: #A65412; } .a-ink { background: #111; color: #111; }
:root[data-theme="dark"] .a-ink { background: #F4F4F5; color: #F4F4F5; }
.pad-in { padding: 14px 18px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.slider-row input { flex: 1; accent-color: var(--accent); }
.big-a { font-size: 20px; font-weight: 800; }

/* ---------- sign in ---------- */
.auth { height: 100%; overflow-y: auto; max-width: 480px; margin: 0 auto; background: var(--bg); display: grid; grid-template-rows: auto 1fr; }
.auth-hero { position: relative; min-height: 250px; background: var(--card); overflow: hidden; }
.float-card { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 22px; background: var(--bg); box-shadow: var(--shadow-2); font-weight: 700; font-size: 14px; animation: rise .8s var(--ease) both, float 6s var(--ease) infinite; }
.float-card.mine { background: var(--accent); color: var(--accent-ink); padding: 12px 16px; }
.float-card.c1 { top: 18%; left: 7%; --r: -4deg; animation-delay: .1s, 0s; }
.float-card.c2 { top: 42%; right: 9%; --r: 3deg; animation-delay: .25s, 1s; }
.float-card.c3 { bottom: -30px; left: 32%; padding: 6px; --r: 6deg; animation-delay: .4s, 2s; }
.float-card.c3 img { width: 130px; height: 150px; border-radius: 18px; object-fit: cover; }
.float-card.c4 { top: 8%; right: 4%; --r: 5deg; animation-delay: .55s, 1.5s; }
.float-card.c4 { display: none; }
.auth-panel { padding: 28px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 16px; justify-content: center; max-width: 480px; width: 100%; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; animation: rise .5s var(--ease) both; }
.brand-mark { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.brand-mark.big { width: 72px; height: 72px; border-radius: 24px; }
.auth-title { margin: 0; font-size: clamp(34px, 6vw, 46px); line-height: 1.05; font-weight: 800; letter-spacing: -.04em; text-wrap: balance; animation: rise .6s var(--ease) both .08s; }
.auth-panel > p { margin: 0; animation: rise .6s var(--ease) both .14s; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.shake { animation: shake .45s var(--ease); }
.demo-note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }


/* ---------- AI companion ---------- */
@keyframes orbit { from { transform: rotate(0deg) translateX(6px) rotate(0deg); } to { transform: rotate(360deg) translateX(6px) rotate(-360deg); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 hsl(var(--hue) 70% 55% / .45); } 50% { box-shadow: 0 0 0 10px hsl(var(--hue) 70% 55% / 0); } }
@keyframes caret { 50% { opacity: 0; } }
.seg.dense .seg-btn { font-size: 13.5px; gap: 4px; }
.seg.dense .seg-count { min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; }
.comp-av { position: relative; flex: none; border-radius: 34%; display: inline-grid; place-items: center; color: #fff; background: hsl(var(--hue) 55% var(--av-l)); }
.comp-av.live { animation: glow 1.6s var(--ease) infinite; }
.comp-spark { position: absolute; right: -5px; top: -5px; width: 46%; height: 46%; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: hsl(var(--hue) 70% 50%); box-shadow: var(--shadow-1); animation: pop .5s var(--spring) .2s both; }
.comp-hub, .comp-setup { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.comp-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 26px 18px 18px; border-radius: 30px; background: hsl(var(--hue) 60% 50% / .13); }
.hero-orb { position: absolute; border-radius: 50%; background: hsl(var(--hue) 70% 60% / .18); pointer-events: none; }
.hero-orb.o1 { width: 180px; height: 180px; top: -70px; right: -50px; animation: float 7s var(--ease) infinite; }
.hero-orb.o2 { width: 120px; height: 120px; bottom: -50px; left: -30px; animation: float 9s var(--ease) infinite 1s; }
.comp-hero .comp-av { animation: zoom-in .6s var(--spring) both; }
.comp-hero h2 { margin: 12px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.comp-role { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.ai-tag { padding: 2px 8px; border-radius: 999px; background: hsl(var(--hue) 55% var(--av-l)); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.comp-last { margin: 8px 0 0; max-width: 34ch; font-size: 14px; line-height: 1.45; }
.comp-actions { position: relative; display: flex; gap: 8px; margin-top: 14px; }
.btn.ghost { background: var(--bg); }
.starter-list { display: flex; flex-direction: column; gap: 8px; }
.starter { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: 22px; background: var(--card); font-weight: 650; text-align: left; animation: rise .5s var(--ease) both; animation-delay: calc(150ms + var(--i) * 60ms); transition: transform .3s var(--spring), background-color .2s; }
.starter span { flex: 1; }
.starter > .ic:first-child { color: var(--accent); }
.starter:hover { transform: translateX(4px); background: var(--card-2); }
.starter:active { transform: scale(.98); }
.comp-note { margin: 4px 8px 0; line-height: 1.5; }
.setup-intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 6px 8px 4px; }
.setup-intro h2 { margin: 10px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.setup-intro p { margin: 0; max-width: 32ch; }
.intro-ic { width: 60px; height: 60px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); animation: float 4s var(--ease) infinite; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 14px; border-radius: 26px; background: var(--card); text-align: left; min-height: 150px; animation: rise .55s var(--ease) both; animation-delay: calc(80ms + var(--i) * 70ms); transition: transform .35s var(--spring), box-shadow .3s, background-color .3s; }
.role-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.role-card:active { transform: scale(.96); }
.role-card.on { background: hsl(var(--hue) 60% 50% / .14); box-shadow: 0 0 0 2.5px hsl(var(--hue) 60% 50%); }
.role-card.locked { opacity: .55; }
.role-card b { font-size: 16px; margin-top: 4px; }
.role-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.role-ic { width: 48px; height: 48px; border-radius: 17px; display: grid; place-items: center; color: #fff; background: hsl(var(--hue) 55% var(--av-l)); transition: transform .4s var(--spring); }
.role-card.on .role-ic { transform: rotate(-8deg) scale(1.08); }
.age-badge { position: absolute; top: 12px; right: 12px; padding: 3px 8px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 800; }
.setup-details { display: flex; flex-direction: column; gap: 14px; animation: rise .45s var(--ease) both; }
.field-label { display: block; margin: 0 0 8px 2px; font-size: 13px; font-weight: 700; color: var(--muted); }
.center-btn { align-self: center; }
.link-btn.danger { color: var(--danger); }
.gate { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 22px; }
.gate > span, .gate-head > span { display: flex; flex-direction: column; gap: 2px; }
.gate small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.gate.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.gate.ok b { color: var(--text); }
.gate.no { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.gate.no b { color: var(--text); }
.gate.ask { flex-direction: column; align-items: stretch; gap: 12px; background: var(--card); }
.gate-head { display: flex; gap: 12px; align-items: flex-start; color: var(--accent); }
.gate-head b { color: var(--text); }
.who.static { cursor: default; }
.who.static:hover { background: transparent; }
.ai-banner { align-self: center; display: flex; gap: 8px; align-items: flex-start; max-width: 360px; margin: 4px 0 10px; padding: 10px 14px; border-radius: 18px; background: var(--card); color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.ai-banner .ic { color: hsl(var(--hue) 60% 50%); margin-top: 1px; }
.comp-chat .bubble.in.ai { background: hsl(var(--hue) 60% 50% / .12); }
.bubble.streaming .text { white-space: pre-wrap; }
.caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; animation: caret 1s steps(1) infinite; }
.composer-gate { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.send-btn:disabled { opacity: .5; }

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