/* ============================================================
   BasisBOYS — design tokens
   ============================================================ */
:root {
  --bg: #0B0F17;
  --bg-2: #0F1522;
  --surface: #141B29;
  --surface-2: #1B2335;
  --surface-3: #232D43;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #F3F6FB;
  --text-2: #B7C0D1;
  --muted: #7E8AA3;
  --accent: #7C5CFF;
  --accent-2: #22D3EE;
  --accent-ink: #FFFFFF;
  --live: #34D399;
  --danger: #FB7185;
  --warn: #FBBF24;
  --brand: linear-gradient(135deg, #7C5CFF 0%, #22D3EE 100%);
  --brand-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.14));
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sidebar-w: 320px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.55; }
[hidden] { display: none !important; }
a { color: var(--accent-2); }
svg { width: 22px; height: 22px; display: block; }
::selection { background: rgba(124, 92, 255, 0.4); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.app { height: 100dvh; width: 100%; overflow: hidden; }
.screen { height: 100%; }

/* ------------------------------------------------------------
   Brand
   ------------------------------------------------------------ */
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand);
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 20px;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35);
  flex: none;
}
.wordmark {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
}
.wordmark span {
  background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand--lg { flex-direction: column; gap: 14px; }
.brand--lg .logo { width: 68px; height: 68px; border-radius: 20px; font-size: 38px; }
.brand--lg .wordmark { font-size: 30px; }
.made-by { color: var(--muted); font-size: 12.5px; letter-spacing: 0.02em; }

/* ------------------------------------------------------------
   Auth
   ------------------------------------------------------------ */
.auth {
  display: grid; grid-template-rows: 1fr auto; place-items: center;
  padding: calc(24px + var(--sat)) 20px calc(20px + var(--sab));
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(700px 400px at 110% 110%, rgba(34, 211, 238, 0.16), transparent 60%),
    var(--bg);
  overflow-y: auto;
}
.auth-card {
  width: min(420px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 30px 26px;
  background: rgba(20, 27, 41, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: rise 0.45s var(--ease);
}
.tagline { margin: -6px 0 0; color: var(--text-2); font-size: 14.5px; text-align: center; }
.context-chip {
  width: 100%; padding: 12px 14px; border-radius: var(--r);
  background: var(--brand-soft); border: 1px solid rgba(124, 92, 255, 0.35);
  font-size: 14px; text-align: center;
}
.context-chip strong { color: #fff; }
.segmented {
  width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; background: var(--bg-2); border-radius: 12px; border: 1px solid var(--border);
}
.seg { padding: 9px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; transition: background 0.2s, color 0.2s; }
.seg.is-active { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }
.form { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.form-error { min-height: 1.2em; margin: -6px 0 0; color: var(--danger); font-size: 13.5px; text-align: center; }
.form-error:empty { display: none; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  transition: transform 0.15s var(--ease), background 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--brand); border-color: transparent; color: var(--accent-ink); box-shadow: 0 8px 22px rgba(124, 92, 255, 0.35); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; }
.btn--danger { background: rgba(251, 113, 133, 0.12); color: var(--danger); border-color: rgba(251, 113, 133, 0.3); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 12px; font-size: 13.5px; border-radius: 10px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--text-2); transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ------------------------------------------------------------
   Shell layout
   ------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
.sidebar {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-2); border-right: 1px solid var(--border);
  padding-top: var(--sat);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.avatar-btn { border-radius: 50%; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 8px 14px 14px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease);
}
.qa:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.qa:active { transform: scale(0.97); }
.qa-icon {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-soft); color: #fff; font-weight: 700; font-size: 16px;
}
.group-list { flex: 1; overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.group-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 10px 10px; border-radius: var(--r); text-align: left;
  transition: background 0.15s;
}
.group-item:hover { background: var(--surface); }
.group-item.is-active { background: var(--surface-2); }
.group-item .gi-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.group-item .gi-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.group-item .gi-last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-item.has-unread .gi-last { color: var(--text-2); }
.group-item .gi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.group-item .gi-time { color: var(--muted); font-size: 11.5px; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(52, 211, 153, 0.14); color: var(--live); font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.sidebar-foot { padding: 12px 16px calc(12px + var(--sab)); border-top: 1px solid var(--border); display: flex; justify-content: center; }
.empty-list { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-list strong { display: block; color: var(--text-2); margin-bottom: 4px; }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); text-align: center; padding: 24px;
  background: radial-gradient(600px 300px at 50% 40%, rgba(124, 92, 255, 0.08), transparent 70%);
}
.empty-state h2 { margin: 10px 0 0; font-family: var(--font-display); color: var(--text); font-size: 22px; }
.empty-state p { margin: 0; }
.empty-mark {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  font-family: var(--font-display); font-weight: 800; font-size: 34px;
}

/* ------------------------------------------------------------
   Avatars
   ------------------------------------------------------------ */
.avatar {
  --h: 260;
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 40) 75% 50%));
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
  position: relative;
}
.avatar--group { border-radius: 14px; }
.avatar--sm { width: 30px; height: 30px; font-size: 12px; border-radius: 10px; }
.avatar--xs { width: 26px; height: 26px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.avatar .dot {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); border: 2px solid var(--bg-2);
}
.avatar .dot.is-online { background: var(--live); }

/* ------------------------------------------------------------
   Chat
   ------------------------------------------------------------ */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head {
  display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--sat)) 10px 8px;
  border-bottom: 1px solid var(--border); background: rgba(11, 15, 23, 0.85); backdrop-filter: blur(10px);
}
#btnBack { display: none; }
.chat-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 4px 8px; border-radius: 12px; text-align: left; }
.chat-title:hover { background: var(--surface); }
.chat-title-text { display: flex; flex-direction: column; min-width: 0; }
.chat-title-text strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-actions { display: flex; align-items: center; gap: 4px; }
.btn--voice { padding: 9px 14px; border-radius: 999px; gap: 7px; font-size: 14px; background: rgba(34, 211, 238, 0.12); color: var(--accent-2); border-color: rgba(34, 211, 238, 0.28); }
.btn--voice svg { width: 18px; height: 18px; }
.btn--voice:hover { background: rgba(34, 211, 238, 0.2); }
.btn--voice.is-live { background: rgba(52, 211, 153, 0.14); color: var(--live); border-color: rgba(52, 211, 153, 0.3); }

/* voice dock */
.voice-dock {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.09), rgba(34, 211, 238, 0.03));
  border-bottom: 1px solid rgba(34, 211, 238, 0.18);
  animation: rise 0.3s var(--ease);
}
.voice-roster { flex: 1; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.voice-roster::-webkit-scrollbar { display: none; }
.vp { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: none; width: 56px; }
.vp .avatar { width: 42px; height: 42px; font-size: 15px; box-shadow: 0 0 0 3px transparent; transition: box-shadow 0.12s; }
.vp.is-speaking .avatar { box-shadow: 0 0 0 3px var(--live), 0 0 18px rgba(52, 211, 153, 0.5); }
.vp.is-muted .avatar::after {
  content: ""; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4a2 2 0 0 1 2 2v5a2 2 0 1 1-4 0V6a2 2 0 0 1 2-2zM7 11a5 5 0 0 0 10 0M12 16v3M5 5l14 14' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/11px no-repeat;
  border: 2px solid var(--bg);
}
.vp .vp-name { font-size: 11px; color: var(--text-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp.is-connecting .avatar { opacity: 0.55; }
.voice-controls { display: flex; gap: 8px; }
.vc {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong);
  transition: background 0.2s, transform 0.15s var(--ease);
}
.vc:active { transform: scale(0.94); }
.vc .slash { display: none; }
.vc[aria-pressed="true"] { background: rgba(251, 113, 133, 0.16); color: var(--danger); border-color: rgba(251, 113, 133, 0.4); }
.vc[aria-pressed="true"] .slash { display: block; }
.vc--danger { background: var(--danger); color: #fff; border-color: transparent; }

/* messages */
.messages { flex: 1; overflow-y: auto; padding: 14px 14px 6px; scroll-behavior: smooth; display: flex; flex-direction: column; }
#messageList { margin-top: auto; }
.load-more { display: block; margin: 0 auto 12px; padding: 7px 14px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; border: 1px solid var(--border); }
.day-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sys { display: flex; justify-content: center; margin: 8px 0; }
.sys span { padding: 5px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12.5px; }
.msg-group { display: grid; grid-template-columns: 36px 1fr; gap: 10px; margin: 12px 0 0; animation: rise 0.25s var(--ease); }
.msg-group .avatar { width: 36px; height: 36px; font-size: 13px; margin-top: 20px; }
.msg-group.is-mine { grid-template-columns: 1fr; }
.msg-group.is-mine .avatar { display: none; }
.msg-body { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.msg-group.is-mine .msg-body { align-items: flex-end; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 2px; font-size: 12.5px; }
.msg-meta .name { font-weight: 700; color: var(--text-2); }
.msg-meta .time { color: var(--muted); font-size: 11.5px; }
.bubble {
  position: relative; max-width: min(78%, 620px); padding: 9px 13px; border-radius: 18px;
  background: var(--surface-2); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
  line-height: 1.4;
}
.bubble + .bubble { margin-top: 2px; }
.msg-body .bubble:first-of-type { border-top-left-radius: 8px; }
.is-mine .bubble { background: var(--accent); color: #fff; }
.is-mine .msg-body .bubble:first-of-type { border-top-left-radius: 18px; border-top-right-radius: 8px; }
.bubble a { color: inherit; text-decoration: underline; }
.is-mine .bubble a { color: #fff; }
.typing { min-height: 20px; padding: 0 20px 2px; color: var(--muted); font-size: 12.5px; }

/* composer */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(10px + var(--sab));
  border-top: 1px solid var(--border); background: var(--bg-2);
}
.composer textarea {
  flex: 1; resize: none; max-height: 140px; padding: 11px 14px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); line-height: 1.4;
  transition: border-color 0.2s;
}
.composer textarea:focus { outline: none; border-color: var(--accent); }
.send {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 255, 0.35);
  transition: transform 0.15s var(--ease), opacity 0.2s;
}
.send:active { transform: scale(0.93); }
.send svg { width: 20px; height: 20px; margin-left: 2px; }

/* ------------------------------------------------------------
   Sheet (modal)
   ------------------------------------------------------------ */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 7, 12, 0.6); backdrop-filter: blur(4px); animation: fade 0.2s; }
.sheet-panel {
  position: relative; width: 100%; max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow);
  animation: slide-up 0.32s var(--ease);
  padding-bottom: var(--sab);
}
.sheet-grip { width: 40px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: var(--border-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 6px 22px; }
.sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.sheet-body { overflow-y: auto; padding: 6px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.sheet-body h3 { margin: 10px 0 0; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.code-display {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 16px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.code-digits { font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: 0.18em; color: #fff; }
.qr { width: 180px; height: 180px; padding: 10px; background: #fff; border-radius: 16px; }
.qr svg { width: 100%; height: 100%; }
.code-note { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }

.code-input {
  width: 100%; padding: 14px; text-align: center;
  font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: 0.22em;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 14px; color: #fff;
}
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
.code-input::placeholder { color: var(--surface-3); letter-spacing: 0.22em; }

.member { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; }
.member .m-text { min-width: 0; display: flex; flex-direction: column; }
.member .m-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .m-sub { color: var(--muted); font-size: 12.5px; }
.tag { padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.menu-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); }
.menu-btn:hover { background: var(--surface-2); color: var(--text); }
.menu { display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px; }
.menu button { padding: 10px 12px; border-radius: 8px; text-align: left; font-weight: 500; }
.menu button:hover { background: var(--surface-3); }
.menu button.is-danger { color: var(--danger); }

.invite-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; }
.invite-item .code { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.14em; font-size: 18px; }
.invite-item .exp { color: var(--muted); font-size: 12px; }

.list-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; text-align: left; font-weight: 600;
}
.list-btn:hover { background: var(--surface-2); }
.list-btn .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* ------------------------------------------------------------
   Toasts, offline
   ------------------------------------------------------------ */
.toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--sat)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 10px 16px; border-radius: 999px; background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 500;
  animation: rise 0.3s var(--ease); pointer-events: auto; max-width: min(90vw, 480px);
}
.toast.is-error { background: rgba(251, 113, 133, 0.16); border-color: rgba(251, 113, 133, 0.4); }
.toast.is-ok { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.35); }
.offline { position: fixed; left: 50%; bottom: calc(16px + var(--sab)); transform: translateX(-50%); z-index: 60; padding: 8px 14px; border-radius: 999px; background: var(--warn); color: #111; font-size: 13px; font-weight: 700; }

/* ------------------------------------------------------------
   Motion
   ------------------------------------------------------------ */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (min-width: 900px) {
  .sheet { place-items: center; }
  .sheet-panel { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 80px); border-radius: var(--r-xl); padding-bottom: 0; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 18px; }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .shell[data-pane="list"] .main { display: none; }
  .shell[data-pane="chat"] .sidebar { display: none; }
  #btnBack { display: grid; }
  .empty-state { display: none; }
  .btn--voice span { display: none; }
  .btn--voice { padding: 9px 11px; }
  .bubble { max-width: 84%; }
}
