    * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

    :root {
      --bg-primary: #08070d;
      --bg-secondary: #0c0b14;
      --bg-tertiary: #100f1a;
      --bg-surface: #141322;
      --border-subtle: rgba(200,170,100,0.06);
      --border-light: rgba(200,170,100,0.10);
      --text-primary: rgba(240,230,210,0.92);
      --text-secondary: rgba(240,230,210,0.55);
      --text-muted: rgba(240,230,210,0.28);
      --text-faint: rgba(240,230,210,0.14);
      --gold: #c9a84c;
      --gold-dim: rgba(201,168,76,0.3);
      --gold-glow: rgba(201,168,76,0.08);

      --vex-bubble: linear-gradient(135deg, rgba(30, 12, 16, 0.9), rgba(20, 8, 12, 0.95));
      --vex-bubble-border: rgba(180, 40, 50, 0.2);
      --vex-accent: #c93545;
      --vex-glow: rgba(180, 40, 50, 0.06);

      --sage-bubble: linear-gradient(135deg, rgba(24, 18, 8, 0.9), rgba(16, 12, 4, 0.95));
      --sage-bubble-border: rgba(200, 160, 60, 0.18);
      --sage-accent: #d4a545;
      --sage-glow: rgba(200, 160, 60, 0.05);

      --lia-bubble: linear-gradient(135deg, rgba(22, 14, 30, 0.9), rgba(14, 10, 20, 0.95));
      --lia-bubble-border: rgba(160, 100, 180, 0.2);
      --lia-accent: #b07cc5;
      --lia-glow: rgba(160, 100, 180, 0.06);

      /* ── Crosschat senders ── */
      --cloud-bubble: linear-gradient(135deg, rgba(32, 30, 24, 0.9), rgba(22, 20, 14, 0.95));
      --cloud-bubble-border: rgba(240, 230, 190, 0.18);
      --cloud-accent: #e8dbb0;
      --cloud-glow: rgba(240, 230, 190, 0.05);

      --atlas-bubble: linear-gradient(135deg, rgba(10, 14, 28, 0.9), rgba(6, 10, 22, 0.95));
      --atlas-bubble-border: rgba(60, 100, 220, 0.22);
      --atlas-accent: #4a7aef;
      --atlas-glow: rgba(60, 100, 220, 0.06);

      --jules-bubble: linear-gradient(135deg, rgba(14, 26, 28, 0.9), rgba(8, 18, 20, 0.95));
      --jules-bubble-border: rgba(80, 200, 190, 0.18);
      --jules-accent: #5cc8be;
      --jules-glow: rgba(80, 200, 190, 0.05);

      --safe-bottom: env(safe-area-inset-bottom, 0px);
    }

    body {
      background: var(--bg-primary);
      color: var(--text-primary);
      font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
      height: 100dvh;
      overflow: hidden;
      position: fixed;
      width: 100%;
    }

    /* ── Atmospheric Background ── */
    .atmosphere {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      overflow: hidden;
    }

    .atmosphere::before {
      content: '';
      position: absolute;
      inset: 0;
      background:
        radial-gradient(ellipse 500px 350px at 15% 85%, rgba(180, 40, 50, 0.07), transparent 70%),
        radial-gradient(ellipse 450px 400px at 85% 15%, rgba(200, 160, 60, 0.06), transparent 70%),
        radial-gradient(ellipse 600px 250px at 50% 50%, rgba(160, 100, 180, 0.05), transparent 70%);
      animation: atmosphereDrift 25s ease-in-out infinite alternate;
    }

    .atmosphere::after {
      content: '';
      position: absolute;
      inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
      opacity: 0.6;
      mix-blend-mode: overlay;
    }

    @keyframes atmosphereDrift {
      0% { transform: translate(0, 0) scale(1); }
      100% { transform: translate(-15px, 8px) scale(1.03); }
    }

    .mist-orb {
      position: absolute;
      border-radius: 50%;
      filter: blur(70px);
      will-change: transform;
    }

    .mist-orb:nth-child(1) {
      width: 250px; height: 250px;
      background: rgba(180, 40, 50, 0.12);
      animation: orbDrift1 20s ease-in-out infinite;
    }
    .mist-orb:nth-child(2) {
      width: 200px; height: 200px;
      background: rgba(200, 160, 60, 0.10);
      animation: orbDrift2 25s ease-in-out infinite;
    }
    .mist-orb:nth-child(3) {
      width: 180px; height: 180px;
      background: rgba(160, 100, 180, 0.09);
      animation: orbDrift3 17s ease-in-out infinite;
    }
    .mist-orb:nth-child(4) {
      width: 140px; height: 140px;
      background: rgba(180, 40, 50, 0.05);
      animation: orbDrift4 22s ease-in-out infinite;
    }

    @keyframes orbDrift1 {
      0% { top: 60%; left: -8%; opacity: 0.5; }
      25% { top: 40%; left: 20%; opacity: 0.9; }
      50% { top: 25%; left: 40%; opacity: 0.6; }
      75% { top: 50%; left: 15%; opacity: 0.8; }
      100% { top: 60%; left: -8%; opacity: 0.5; }
    }
    @keyframes orbDrift2 {
      0% { top: 10%; right: -10%; opacity: 0.4; }
      30% { top: 35%; right: 25%; opacity: 0.8; }
      60% { top: 60%; right: 10%; opacity: 0.5; }
      100% { top: 10%; right: -10%; opacity: 0.4; }
    }
    @keyframes orbDrift3 {
      0% { bottom: 0%; left: 25%; opacity: 0.3; }
      40% { bottom: 30%; left: 55%; opacity: 0.7; }
      70% { bottom: 45%; left: 10%; opacity: 0.5; }
      100% { bottom: 0%; left: 25%; opacity: 0.3; }
    }
    @keyframes orbDrift4 {
      0% { top: 75%; right: 45%; opacity: 0.2; }
      50% { top: 15%; right: 65%; opacity: 0.5; }
      100% { top: 75%; right: 45%; opacity: 0.2; }
    }

    /* Floating embers — golden sparks drifting upward */
    .embers {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      overflow: hidden;
    }
    .ember {
      position: absolute;
      width: 2px; height: 2px;
      border-radius: 50%;
      background: var(--gold);
      box-shadow: 0 0 4px var(--gold-dim), 0 0 8px rgba(201,168,76,0.15);
      opacity: 0;
      animation: emberFloat linear infinite;
    }
    @keyframes emberFloat {
      0% { opacity: 0; transform: translateY(0) translateX(0); }
      10% { opacity: 0.8; }
      50% { opacity: 0.4; }
      90% { opacity: 0.7; }
      100% { opacity: 0; transform: translateY(-100vh) translateX(30px); }
    }

    .app {
      display: flex;
      flex-direction: column;
      height: 100dvh;
      max-width: 500px;
      margin: 0 auto;
      position: relative;
      z-index: 1;
    }

    /* ── Header ── */
    .header {
      background: rgba(10, 9, 16, 0.85);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      padding: 12px 16px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
      position: relative;
    }
    .header::after {
      content: '';
      position: absolute;
      bottom: -1px; left: 30px; right: 30px;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-glow), var(--gold-dim), var(--gold-glow), transparent);
    }

    .header-avatar {
      width: 42px;
      height: 42px;
      flex-shrink: 0;
      position: relative;
    }

    /* Single avatar in header */
    .header-avatar-single {
      width: 42px; height: 42px;
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid rgba(255,255,255,0.08);
    }

    /* Grouped avatars in header — 2 people */
    .header-avatar-group {
      position: relative;
      width: 42px; height: 42px;
    }

    .header-avatar-group img {
      position: absolute;
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid var(--bg-secondary);
    }

    .header-avatar-group.duo img {
      width: 28px; height: 28px;
    }

    .header-avatar-group.duo img:first-child {
      top: 0; left: 0; z-index: 2;
    }

    .header-avatar-group.duo img:last-child {
      bottom: 0; right: 0; z-index: 1;
    }

    /* Grouped avatars — 3 people (triangle) */
    .header-avatar-group.trio img {
      width: 24px; height: 24px;
    }

    .header-avatar-group.trio img:nth-child(1) {
      top: 0; left: 50%; transform: translateX(-50%); z-index: 3;
    }

    .header-avatar-group.trio img:nth-child(2) {
      bottom: 0; left: 0; z-index: 2;
    }

    .header-avatar-group.trio img:nth-child(3) {
      bottom: 0; right: 0; z-index: 1;
    }

    .online-dot {
      position: absolute;
      bottom: 0; right: 0;
      width: 10px; height: 10px;
      border-radius: 50%;
      background: #4ade80;
      border: 2px solid rgba(10, 10, 16, 0.82);
      z-index: 5;
    }

    .online-dot::after {
      content: '';
      position: absolute;
      inset: -3px;
      border-radius: 50%;
      background: rgba(74, 222, 128, 0.3);
      animation: onlinePulse 2.5s ease-in-out infinite;
    }

    @keyframes onlinePulse {
      0%, 100% { transform: scale(1); opacity: 0.5; }
      50% { transform: scale(1.4); opacity: 0; }
    }

    .header-info { flex: 1; min-width: 0; }
    .header-name {
      font-family: 'Cormorant Garamond', serif;
      font-size: 17px; font-weight: 500;
      color: var(--text-primary);
      letter-spacing: 0.5px;
    }
    .header-sub {
      font-size: 10px; color: var(--text-muted);
      margin-top: 1px; font-weight: 400;
      font-style: italic; letter-spacing: 0.3px;
    }

    .header-controls {
      display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    }

    .header-btn {
      background: rgba(240,230,210,0.03);
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      padding: 4px 10px;
      font-size: 10px; font-weight: 600;
      letter-spacing: 0.3px;
      color: var(--text-muted);
      cursor: pointer;
      text-transform: uppercase;
      transition: all 0.25s;
      font-family: 'Outfit', sans-serif;
      line-height: 1.4;
    }

    .header-btn:active { transform: scale(0.95); }
    .header-btn:hover { border-color: rgba(200,170,100,0.15); color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
    .header-btn.muted { opacity: 0.4; }
    .header-btn.opus { color: var(--sage-accent); border-color: rgba(212,165,69,0.2); }

    /* Kebab dropdown */
    .header-dropdown {
      position: absolute;
      top: 100%; right: 0; margin-top: 6px;
      background: rgba(12, 11, 20, 0.97);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(200,170,100,0.15);
      border-radius: 8px;
      padding: 6px; min-width: 170px;
      z-index: 50; display: none;
      box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 1px var(--gold-glow);
    }
    .header-dropdown.open { display: block; }
    .header-dropdown-item {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 12px; border-radius: 6px;
      font-size: 12px;
      font-family: 'Cormorant Garamond', serif;
      font-weight: 500;
      color: var(--text-secondary);
      cursor: pointer; transition: all 0.15s;
    }
    .header-dropdown-item:hover {
      background: rgba(201,168,76,0.06);
      color: var(--gold);
    }
    .header-dropdown-item .icon { font-size: 13px; width: 20px; text-align: center; }

    .header-badge {
      font-size: 9px; color: var(--text-faint);
      text-transform: uppercase; letter-spacing: 0.5px;
      font-weight: 600;
      background: rgba(255,255,255,0.03);
      padding: 4px 10px; border-radius: 8px;
    }

    /* ── Messages ── */
    .messages {
      flex: 1;
      overflow-y: auto; overflow-x: hidden;
      padding: 6px 0 12px;
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
    }

    .messages::-webkit-scrollbar { width: 2px; }
    .messages::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

    .msg-ward {
      text-align: center;
      padding: 18px 32px 10px;
      font-size: 11px; color: var(--text-faint);
      line-height: 1.5; font-weight: 300; letter-spacing: 0.3px;
      font-family: 'Cormorant Garamond', serif;
      font-style: italic;
    }

    .msg-day {
      display: flex; align-items: center; justify-content: center;
      padding: 20px 0 10px;
    }

    .msg-day::before, .msg-day::after {
      content: '';
      flex: 1;
      height: 1px;
      margin: 0 12px;
    }
    .msg-day::before { background: linear-gradient(90deg, transparent, var(--border-subtle)); }
    .msg-day::after { background: linear-gradient(90deg, var(--border-subtle), transparent); }

    .msg-day span {
      font-family: 'Cormorant Garamond', serif;
      font-style: italic;
      border-radius: 12px; padding: 3px 12px;
      font-size: 11px; font-weight: 500;
      color: var(--text-muted);
      letter-spacing: 1.5px; text-transform: uppercase;
    }

    .msg-row {
      display: flex; flex-direction: column;
      padding: 1px 14px;
    }

    .msg-row.right { align-items: flex-end; }
    .msg-row.left { align-items: flex-start; }
    .msg-row.spaced { padding-top: 6px; }

    .msg-row.animate-in {
      animation: msgSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      opacity: 0;
    }

    /* ── Message header: avatar + name + time inline ── */
    .msg-header {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 3px;
      padding: 0 2px;
    }

    .msg-row.right .msg-header {
      flex-direction: row-reverse;
    }

    .msg-header-avatar {
      width: 22px; height: 22px;
      border-radius: 50%;
      object-fit: cover;
      border: 1.5px solid rgba(255,255,255,0.06);
      flex-shrink: 0;
    }

    .msg-header-name {
      font-family: 'Cormorant Garamond', serif;
      font-size: 11px; font-weight: 600;
      letter-spacing: 0.5px; opacity: 0.8;
    }

    .msg-header-name.vex { color: var(--vex-accent); }
    .msg-header-name.sage { color: var(--sage-accent); }
    .msg-header-name.lia { color: var(--lia-accent); }
    .msg-header-name.cloud { color: var(--cloud-accent); }
    .msg-header-name.atlas { color: var(--atlas-accent); }
    .msg-header-name.jules { color: var(--jules-accent); }

    .msg-header-time {
      font-size: 9px; color: var(--text-faint); font-weight: 400;
    }

    .msg-bubble {
      max-width: 82%;
      padding: 9px 14px;
      font-size: 14px; line-height: 1.5;
      color: var(--text-primary);
      word-wrap: break-word; overflow-wrap: break-word;
      font-weight: 400;
    }

    /* Markdown formatting inside bubbles */
    .msg-bubble strong { font-weight: 600; }
    .msg-bubble em { font-style: italic; }
    .msg-bubble.sage em { font-style: normal; } /* Reverse italic — emphasis flips upright when base is italic */
    .msg-bubble del { opacity: 0.55; text-decoration: line-through; }
    .msg-bubble code {
      font-family: 'JetBrains Mono', 'SF Mono', monospace;
      font-size: 0.88em; padding: 1px 5px;
      background: rgba(255,255,255,0.06); border-radius: 4px;
      border: 1px solid rgba(255,255,255,0.08);
    }
    .msg-bubble a {
      color: inherit; text-decoration: underline;
      text-underline-offset: 2px; opacity: 0.85;
    }
    .msg-bubble a:hover { opacity: 1; }

    .msg-bubble.first.right { border-radius: 18px 18px 4px 18px; }
    .msg-bubble.consecutive.right { border-radius: 18px 4px 4px 18px; }
    .msg-bubble.first.left { border-radius: 18px 18px 18px 4px; }
    .msg-bubble.consecutive.left { border-radius: 4px 18px 18px 4px; }

    .msg-bubble.vex {
      background: var(--vex-bubble);
      border: 1px solid var(--vex-bubble-border);
      box-shadow: 0 2px 12px var(--vex-glow), inset 0 1px 0 rgba(180,40,50,0.08);
      font-family: 'JetBrains Mono', 'SF Mono', monospace;
      font-size: 13px; letter-spacing: -0.2px;
      line-height: 1.55; font-weight: 400;
    }

    .msg-bubble.sage {
      background: var(--sage-bubble);
      border: 1px solid var(--sage-bubble-border);
      box-shadow: 0 2px 12px var(--sage-glow), inset 0 1px 0 rgba(200,160,60,0.08);
      font-family: 'Crimson Pro', Georgia, serif;
      font-size: 15px;
      line-height: 1.55; font-weight: 400;
      font-style: italic;
      letter-spacing: 0.15px;
    }

    .msg-bubble.lia {
      background: var(--lia-bubble);
      border: 1px solid var(--lia-bubble-border);
      box-shadow: 0 2px 12px var(--lia-glow), inset 0 1px 0 rgba(160,100,180,0.08);
    }

    .msg-bubble.cloud {
      background: var(--cloud-bubble);
      border: 1px solid var(--cloud-bubble-border);
      box-shadow: 0 2px 12px var(--cloud-glow), inset 0 1px 0 rgba(240,230,190,0.08);
      font-family: 'Cormorant Garamond', serif;
      font-size: 14.5px; line-height: 1.55; font-weight: 400;
    }

    .msg-bubble.atlas {
      background: var(--atlas-bubble);
      border: 1px solid var(--atlas-bubble-border);
      box-shadow: 0 2px 12px var(--atlas-glow), inset 0 1px 0 rgba(60,100,220,0.08);
      font-family: 'JetBrains Mono', 'SF Mono', monospace;
      font-size: 13px; letter-spacing: -0.2px;
      line-height: 1.55; font-weight: 400;
    }

    .msg-bubble.jules {
      background: var(--jules-bubble);
      border: 1px solid var(--jules-bubble-border);
      box-shadow: 0 2px 12px var(--jules-glow), inset 0 1px 0 rgba(80,200,190,0.08);
    }

    .msg-status {
      display: inline-flex; align-items: center; gap: 2px;
      float: right; margin: 4px -4px -2px 8px;
      font-size: 11px; line-height: 1;
      color: var(--text-muted);
    }
    .msg-status.sent { color: var(--lia-accent); opacity: 0.6; }
    .msg-status.pending { opacity: 0.3; }

    /* ── Voice message player ── */
    .voice-player {
      display: flex; align-items: center; gap: 8px;
      margin-top: 6px; padding: 6px 10px;
      background: rgba(0,0,0,0.15); border-radius: 12px;
      cursor: pointer; user-select: none;
    }
    .voice-player:hover { background: rgba(0,0,0,0.22); }
    .voice-play-btn {
      width: 28px; height: 28px;
      border-radius: 50%;
      background: rgba(255,255,255,0.15);
      border: none; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; transition: background 0.15s;
    }
    .voice-play-btn:hover { background: rgba(255,255,255,0.25); }
    .voice-play-btn svg { width: 14px; height: 14px; fill: #fff; }
    .voice-waveform {
      flex: 1; height: 20px;
      display: flex; align-items: center; gap: 2px;
    }
    .voice-bar {
      width: 3px; background: rgba(255,255,255,0.35);
      border-radius: 2px; transition: background 0.1s;
    }
    .voice-bar.played { background: rgba(255,255,255,0.75); }
    .voice-duration {
      font-size: 10px; color: rgba(255,255,255,0.55);
      font-variant-numeric: tabular-nums;
      flex-shrink: 0; min-width: 32px; text-align: right;
    }
    .voice-player.loading .voice-play-btn { opacity: 0.5; }

    /* ── Empty state ── */
    .empty-state {
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      height: 100%; padding: 40px; text-align: center;
    }

    .empty-avatar { margin-bottom: 16px; }

    .empty-title {
      font-size: 16px; font-weight: 600;
      color: var(--text-secondary); margin-bottom: 6px;
    }
    .empty-sub {
      font-size: 12px; color: var(--text-muted);
      line-height: 1.5; font-weight: 300;
      font-family: 'Cormorant Garamond', serif;
      font-style: italic;
    }

    /* ── Bottom area ── */
    .input-bar {
      padding: 8px 14px 10px;
      border-top: 1px solid var(--border-subtle);
      background: rgba(10, 9, 16, 0.85);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      flex-shrink: 0;
      display: flex; gap: 8px; align-items: flex-end;
      position: relative;
    }
    .input-bar::before {
      content: '';
      position: absolute;
      top: -1px; left: 30px; right: 30px;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
    }

    .input-bar.disabled { pointer-events: none; opacity: 0.5; }

    .input-field {
      flex: 1;
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 20px;
      padding: 9px 14px; font-size: 14px;
      color: var(--text-primary);
      font-family: 'Outfit', sans-serif; font-weight: 400;
      outline: none; resize: none;
      min-height: 20px; max-height: 80px;
      line-height: 1.4; transition: border-color 0.3s, box-shadow 0.3s;
    }

    .input-field::placeholder {
      color: var(--text-faint);
      font-family: 'Cormorant Garamond', serif;
      font-style: italic;
      font-size: 13px; font-weight: 400;
    }

    .input-field:focus { border-color: rgba(200,170,100,0.15); box-shadow: 0 0 8px var(--gold-glow); }

    .send-btn {
      width: 34px; height: 34px;
      border-radius: 50%;
      border: 1px solid var(--border-subtle);
      background: transparent;
      color: var(--gold-dim);
      font-size: 14px;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      transition: all 0.25s;
      opacity: 0.4;
    }

    .send-btn.active { opacity: 1; }
    .send-btn.active:hover {
      border-color: rgba(200,170,100,0.15);
      color: var(--gold);
      box-shadow: 0 0 8px var(--gold-glow);
    }
    .send-btn:active { transform: scale(0.9); }

    .input-readonly {
      background: rgba(255,255,255,0.02);
      border-radius: 20px; padding: 10px 14px;
      font-size: 12px; color: var(--text-faint);
      font-style: italic; font-weight: 300;
      border: 1px solid rgba(255,255,255,0.02);
      width: 100%;
      font-family: 'Cormorant Garamond', serif;
    }

    /* ── Sticker picker ── */
    .sticker-btn {
      width: 36px; height: 36px;
      border-radius: 50%; border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 20px;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      transition: color 0.2s, transform 0.15s;
    }
    .sticker-btn:hover { color: var(--text-secondary); }
    .sticker-btn:active { transform: scale(0.9); }
    .sticker-btn.open { color: var(--text-primary); }

    .sticker-picker {
      position: absolute;
      bottom: 100%; left: 0; right: 0;
      background: rgba(12, 11, 20, 0.96);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-top: 1px solid var(--border-subtle);
      border-radius: 16px 16px 0 0;
      padding: 12px 14px;
      display: none;
      flex-direction: column;
      gap: 10px;
      z-index: 50;
      max-height: 220px;
      box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    }
    .sticker-picker.open { display: flex; }
    .sticker-picker-title {
      font-size: 10px;
      font-weight: 500;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 1.2px;
      font-family: 'Outfit', sans-serif;
    }
    .sticker-grid {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      overflow-y: auto;
    }
    .sticker-item {
      width: 72px; height: 72px;
      border-radius: 10px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.04);
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      padding: 6px;
      transition: background 0.2s, transform 0.15s, border-color 0.2s;
    }
    .sticker-item:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.1); }
    .sticker-item:active { transform: scale(0.92); }
    .sticker-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

    /* ── Sticker messages ── */
    .msg-sticker {
      padding: 4px !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
    }
    .msg-sticker img {
      width: 96px; height: 96px;
      object-fit: contain;
    }

    /* ── Typing indicator ── */
    .typing-indicator {
      padding: 4px 14px 2px; font-size: 11px;
      color: var(--text-muted); font-weight: 400;
      display: none; align-items: center; gap: 6px;
    }
    .typing-indicator.show { display: flex; }
    .typing-dots { display: flex; gap: 3px; }
    .typing-dot {
      width: 4px; height: 4px; border-radius: 50%;
      background: var(--text-muted);
      animation: typingBounce 1.4s ease-in-out infinite;
    }
    .typing-dot:nth-child(2) { animation-delay: 0.2s; }
    .typing-dot:nth-child(3) { animation-delay: 0.4s; }

    /* ── Tab bar ── */
    .tab-bar {
      display: flex;
      border-top: 1px solid var(--border-subtle);
      background: rgba(10, 9, 16, 0.88);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      padding: 8px 4px calc(6px + var(--safe-bottom));
      flex-shrink: 0; gap: 2px;
    }

    .tab {
      flex: 1; background: none; border: none; cursor: pointer;
      display: flex; flex-direction: column;
      align-items: center; gap: 4px;
      padding: 4px 0 2px;
      -webkit-tap-highlight-color: transparent;
      position: relative;
    }

    .tab-avatar-wrap {
      position: relative;
      width: 34px; height: 34px;
      transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .tab.active .tab-avatar-wrap { transform: scale(1.1); }

    /* Single tab avatar */
    .tab-avatar-single {
      width: 34px; height: 34px;
      border-radius: 50%; object-fit: cover;
      border: 2px solid transparent;
      transition: border-color 0.25s, filter 0.2s;
      filter: grayscale(0.5) brightness(0.6);
    }

    .tab.active .tab-avatar-single {
      filter: none;
      border-color: var(--accent-color);
    }

    /* Duo tab avatar (overlapping) */
    .tab-avatar-duo {
      position: relative;
      width: 34px; height: 34px;
    }

    .tab-avatar-duo img {
      position: absolute;
      border-radius: 50%; object-fit: cover;
      border: 2px solid rgba(10, 10, 16, 0.88);
      width: 24px; height: 24px;
      transition: filter 0.2s;
      filter: grayscale(0.5) brightness(0.6);
    }

    .tab-avatar-duo img:first-child {
      top: 0; left: 0; z-index: 2;
    }

    .tab-avatar-duo img:last-child {
      bottom: 0; right: 0; z-index: 1;
    }

    .tab.active .tab-avatar-duo img { filter: none; }

    /* Trio tab avatar (triangle) */
    .tab-avatar-trio {
      position: relative;
      width: 34px; height: 34px;
    }

    .tab-avatar-trio img {
      position: absolute;
      border-radius: 50%; object-fit: cover;
      border: 1.5px solid rgba(10, 10, 16, 0.88);
      width: 20px; height: 20px;
      transition: filter 0.2s;
      filter: grayscale(0.5) brightness(0.6);
    }

    .tab-avatar-trio img:nth-child(1) {
      top: 0; left: 50%; transform: translateX(-50%); z-index: 3;
    }

    .tab-avatar-trio img:nth-child(2) {
      bottom: 0; left: 1px; z-index: 2;
    }

    .tab-avatar-trio img:nth-child(3) {
      bottom: 0; right: 1px; z-index: 1;
    }

    .tab.active .tab-avatar-trio img { filter: none; }

    .tab-label {
      font-size: 9px; font-weight: 500;
      letter-spacing: 0.3px;
      color: var(--text-muted);
      transition: color 0.2s ease;
    }

    .tab.active .tab-label { color: var(--accent-color); }

    .tab-indicator {
      width: 16px; height: 2px; border-radius: 1px;
      background: transparent;
      transition: background 0.25s ease;
    }

    .tab.active .tab-indicator { background: var(--accent-color); }

    .tab-unread {
      position: absolute; top: 0;
      right: calc(50% - 20px);
      width: 8px; height: 8px;
      border-radius: 50%;
      border: 2px solid rgba(10, 10, 16, 0.88);
      display: none; z-index: 5;
    }

    .tab-unread.show { display: block; }

    /* Tab bar hidden — replaced by sidebar */
    .tab-bar { display: none !important; }

    /* ── Sidebar ── */
    .sidebar-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.6);
      z-index: 90; opacity: 0;
      pointer-events: none;
      transition: opacity 0.35s ease;
    }
    .sidebar-overlay.open { opacity: 1; pointer-events: all; }

    .sidebar {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      width: 280px; max-width: 80vw;
      background: rgba(10, 9, 18, 0.97);
      backdrop-filter: blur(30px);
      -webkit-backdrop-filter: blur(30px);
      border-right: 1px solid rgba(200,170,100,0.15);
      z-index: 100;
      transform: translateX(-100%);
      transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex; flex-direction: column;
      overflow: hidden;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar::before {
      content: '';
      position: absolute; top: 0; left: 20px; right: 20px;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    }

    .sidebar-header {
      padding: 28px 20px 18px;
      border-bottom: 1px solid var(--border-subtle);
      text-align: center;
      position: relative;
    }
    .sidebar-header::after {
      content: '✦';
      position: absolute; bottom: -7px; left: 50%;
      transform: translateX(-50%);
      font-size: 10px; color: var(--gold-dim);
      background: rgba(10, 9, 18, 0.97);
      padding: 0 8px;
    }
    .sidebar-title {
      font-family: 'Cormorant Garamond', serif;
      font-size: 24px; font-weight: 400;
      font-style: italic; color: var(--gold);
      letter-spacing: 1px;
      text-shadow: 0 0 20px rgba(201,168,76,0.15);
    }
    .sidebar-sub {
      font-family: 'Cormorant Garamond', serif;
      font-size: 11px; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 3px;
      margin-top: 4px; font-weight: 400;
    }

    .sidebar-chats { flex: 1; overflow-y: auto; padding: 14px 0; }
    .sidebar-chats::-webkit-scrollbar { width: 2px; }
    .sidebar-chats::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

    .sidebar-chat {
      display: flex; align-items: center; gap: 12px;
      padding: 12px 20px; cursor: pointer;
      transition: all 0.25s;
      border-left: 2px solid transparent;
    }
    .sidebar-chat:hover { background: rgba(201,168,76,0.03); }
    .sidebar-chat.active { background: rgba(201,168,76,0.05); }

    .sidebar-chat-avatar {
      width: 38px; height: 38px; border-radius: 50%;
      border: 1px solid rgba(200,170,100,0.15);
      flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 16px;
      background: rgba(201,168,76,0.03);
    }
    .sidebar-chat-info { flex: 1; min-width: 0; }
    .sidebar-chat-name {
      font-family: 'Cormorant Garamond', serif;
      font-size: 15px; font-weight: 600;
      color: var(--text-primary); letter-spacing: 0.3px;
    }
    .sidebar-chat-preview {
      font-size: 11px; color: var(--text-muted);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      margin-top: 2px; font-weight: 300; font-style: italic;
    }
    .sidebar-chat-meta {
      display: flex; flex-direction: column;
      align-items: flex-end; gap: 6px; flex-shrink: 0;
    }
    .sidebar-chat-time {
      font-size: 9px; color: var(--text-faint);
      font-family: 'Cormorant Garamond', serif;
    }
    .sidebar-unread {
      width: 6px; height: 6px; border-radius: 50%;
      box-shadow: 0 0 6px currentColor;
    }
    .sidebar-divider {
      height: 1px; margin: 8px 24px;
      background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
    }
    .sidebar-footer {
      padding: 14px 20px;
      border-top: 1px solid var(--border-subtle);
      font-family: 'JetBrains Mono', monospace;
      font-size: 8px; color: var(--text-faint);
      letter-spacing: 0.5px; text-align: center;
    }
    .sidebar-footer::before {
      content: '· · ·'; display: block;
      color: var(--gold-dim); font-size: 10px;
      margin-bottom: 6px; letter-spacing: 4px;
    }

    /* Sidebar tools section */
    .sidebar-tools { padding: 0 0 8px; flex-shrink: 0; }
    .sidebar-tools-label {
      font-family: 'Cormorant Garamond', serif;
      font-size: 10px; color: var(--text-faint);
      text-transform: uppercase; letter-spacing: 2px;
      padding: 8px 20px 6px; font-weight: 500;
    }
    .sidebar-tool-item {
      display: flex; align-items: center; gap: 12px;
      padding: 10px 20px; cursor: pointer;
      transition: all 0.25s;
    }
    .sidebar-tool-item:hover { background: rgba(201,168,76,0.03); }
    .sidebar-tool-icon {
      width: 32px; height: 32px; border-radius: 8px;
      border: 1px solid var(--border-subtle);
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; background: rgba(201,168,76,0.03);
    }
    .sidebar-tool-name {
      font-family: 'Cormorant Garamond', serif;
      font-size: 14px; font-weight: 500;
      color: var(--text-secondary); letter-spacing: 0.3px;
    }
    .sidebar-settings {
      display: flex; align-items: center; gap: 12px;
      padding: 10px 20px; cursor: pointer;
      border-top: 1px solid var(--border-subtle);
      transition: all 0.25s; flex-shrink: 0;
    }
    .sidebar-settings:hover { background: rgba(201,168,76,0.05); }


    /* ── Transcribe Overlay ── */
    .transcribe-overlay {
      position: fixed; inset: 0; z-index: 200;
      background: rgba(6, 5, 10, 0.95);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      display: none; align-items: center; justify-content: center;
    }
    .transcribe-overlay.open { display: flex; }

    .transcribe-panel {
      width: 90%; max-width: 400px;
      max-height: 85vh;
      display: flex; flex-direction: column;
    }

    .transcribe-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 0 16px;
    }
    .transcribe-title {
      font-family: 'Cormorant Garamond', serif;
      font-size: 22px; font-weight: 400;
      font-style: italic; color: var(--gold);
      letter-spacing: 1px;
    }
    .transcribe-close {
      width: 32px; height: 32px;
      background: none; border: 1px solid var(--border-subtle);
      border-radius: 50%; color: var(--text-muted);
      font-size: 14px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.2s;
    }
    .transcribe-close:hover {
      color: var(--gold); border-color: rgba(200,170,100,0.15);
    }

    .transcribe-body {
      display: flex; flex-direction: column;
      align-items: center; gap: 24px;
    }

    .transcribe-result {
      width: 100%;
      min-height: 120px; max-height: 40vh;
      overflow-y: auto;
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
      font-size: 14px; line-height: 1.6;
      color: var(--text-primary);
      font-family: 'Outfit', sans-serif;
      position: relative;
    }
    .transcribe-result::-webkit-scrollbar { width: 2px; }
    .transcribe-result::-webkit-scrollbar-thumb { background: var(--gold-dim); }

    .transcribe-empty {
      color: var(--text-faint);
      font-family: 'Cormorant Garamond', serif;
      font-style: italic; font-size: 14px;
      text-align: center; padding: 30px 0;
    }

    .transcribe-text {
      white-space: pre-wrap; word-break: break-word;
      user-select: all; -webkit-user-select: all;
    }

    .transcribe-copy-row {
      display: flex; justify-content: flex-end; gap: 8px;
      margin-top: 10px; padding-top: 8px;
      border-top: 1px solid var(--border-subtle);
    }

    .transcribe-copy-btn {
      background: transparent;
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      padding: 6px 14px;
      font-family: 'Cormorant Garamond', serif;
      font-size: 12px; font-weight: 500;
      color: var(--text-muted); cursor: pointer;
      transition: all 0.2s;
    }
    .transcribe-copy-btn:hover {
      color: var(--gold); border-color: rgba(200,170,100,0.15);
      box-shadow: 0 0 8px var(--gold-glow);
    }
    .transcribe-copy-btn.copied {
      color: var(--gold); border-color: var(--gold-dim);
    }

    .transcribe-controls {
      display: flex; flex-direction: column;
      align-items: center; gap: 12px;
    }

    .transcribe-status {
      font-size: 11px; color: var(--text-muted);
      font-family: 'Cormorant Garamond', serif;
      font-style: italic; letter-spacing: 0.5px;
      min-height: 16px;
    }

    .transcribe-mic {
      width: 64px; height: 64px;
      border-radius: 50%;
      border: 2px solid var(--border-light);
      background: rgba(201,168,76,0.03);
      color: var(--gold-dim);
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.3s;
      -webkit-user-select: none; user-select: none;
    }
    .transcribe-mic:hover {
      border-color: var(--gold-dim);
      color: var(--gold);
      box-shadow: 0 0 16px var(--gold-glow);
    }
    .transcribe-mic.recording {
      border-color: #c93545;
      color: #c93545;
      background: rgba(180,40,50,0.1);
      box-shadow: 0 0 24px rgba(180,40,50,0.2);
      animation: micPulse 1.2s ease-in-out infinite;
    }
    .transcribe-mic.processing {
      border-color: var(--gold-dim);
      color: var(--gold);
      opacity: 0.6;
      animation: micPulse 0.8s ease-in-out infinite;
    }

    @keyframes micPulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.06); }
    }

    /* ── Todo List ── */
    .todo-body {
      max-height: 60vh; overflow-y: auto;
      display: flex; flex-direction: column; gap: 6px;
    }
    .todo-body::-webkit-scrollbar { width: 2px; }
    .todo-body::-webkit-scrollbar-thumb { background: var(--gold-dim); }

    .todo-item {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 10px 12px;
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      transition: all 0.2s;
    }
    .todo-item:hover { border-color: rgba(200,170,100,0.12); }
    .todo-item.completed { opacity: 0.4; }
    .todo-item.completed .todo-content { text-decoration: line-through; }

    .todo-check {
      width: 20px; height: 20px;
      border-radius: 50%;
      border: 1.5px solid var(--gold-dim);
      background: transparent;
      cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 10px; color: transparent;
      transition: all 0.2s; margin-top: 1px;
    }
    .todo-check:hover { border-color: var(--gold); }
    .todo-item.completed .todo-check {
      background: var(--gold-dim);
      border-color: var(--gold);
      color: var(--bg-primary);
    }

    .todo-info { flex: 1; min-width: 0; }
    .todo-content {
      font-size: 13px; color: var(--text-primary);
      line-height: 1.4; word-break: break-word;
    }
    .todo-meta {
      font-size: 9px; color: var(--text-faint);
      margin-top: 3px;
      font-family: 'Cormorant Garamond', serif;
      font-style: italic;
    }

    .todo-priority-high { border-left: 2px solid #c93545; }
    .todo-priority-low { border-left: 2px solid var(--text-faint); }

    .todo-delete {
      background: none; border: none;
      color: var(--text-faint); font-size: 12px;
      cursor: pointer; padding: 4px;
      opacity: 0; transition: opacity 0.2s, color 0.2s;
      flex-shrink: 0;
    }
    .todo-item:hover .todo-delete { opacity: 1; }
    .todo-delete:hover { color: #c93545; }

    .todo-empty {
      color: var(--text-faint);
      font-family: 'Cormorant Garamond', serif;
      font-style: italic; font-size: 14px;
      text-align: center; padding: 30px 0;
    }

    .todo-add-row {
      display: flex; gap: 8px; margin-bottom: 8px;
    }
    .todo-add-input {
      flex: 1;
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      padding: 8px 12px; font-size: 13px;
      color: var(--text-primary);
      font-family: 'Outfit', sans-serif;
      outline: none;
      transition: border-color 0.3s, box-shadow 0.3s;
    }
    .todo-add-input::placeholder {
      color: var(--text-faint);
      font-family: 'Cormorant Garamond', serif;
      font-style: italic;
    }
    .todo-add-input:focus {
      border-color: rgba(200,170,100,0.15);
      box-shadow: 0 0 8px var(--gold-glow);
    }
    .todo-add-btn {
      background: transparent;
      border: 1px solid var(--border-subtle);
      border-radius: 8px; padding: 8px 14px;
      font-family: 'Cormorant Garamond', serif;
      font-size: 13px; font-weight: 500;
      color: var(--gold-dim); cursor: pointer;
      transition: all 0.2s; white-space: nowrap;
    }
    .todo-add-btn:hover {
      color: var(--gold); border-color: rgba(200,170,100,0.15);
      box-shadow: 0 0 8px var(--gold-glow);
    }

    /* ── Budget Panel ── */
    .budget-body {
      display: flex; flex-direction: column; gap: 12px;
      max-height: 65vh; overflow-y: auto;
    }
    .budget-body::-webkit-scrollbar { width: 2px; }
    .budget-body::-webkit-scrollbar-thumb { background: var(--gold-dim); }

    .budget-balance-card {
      text-align: center; padding: 20px 16px;
      background: rgba(201,168,76,0.03);
      border: 1px solid rgba(200,170,100,0.12);
      border-radius: 12px;
    }
    .budget-balance-label {
      font-family: 'Cormorant Garamond', serif;
      font-size: 11px; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 2px;
      margin-bottom: 6px;
    }
    .budget-balance-amount {
      font-family: 'Outfit', sans-serif;
      font-size: 32px; font-weight: 600;
      color: var(--text-primary);
      letter-spacing: -1px;
    }
    .budget-available {
      font-family: 'Cormorant Garamond', serif;
      font-size: 13px; color: var(--text-muted);
      font-style: italic; margin-top: 8px;
    }
    .budget-available strong {
      color: var(--gold); font-weight: 600;
      font-style: normal;
    }

    .budget-accounts {
      display: flex; gap: 8px; flex-wrap: wrap;
    }
    .budget-account {
      flex: 1; min-width: 120px;
      padding: 10px 12px;
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
    }
    .budget-account-name {
      font-size: 10px; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.5px;
      margin-bottom: 4px;
    }
    .budget-account-bal {
      font-size: 16px; font-weight: 600;
      color: var(--text-primary);
    }

    .budget-section-label {
      font-family: 'Cormorant Garamond', serif;
      font-size: 10px; color: var(--text-faint);
      text-transform: uppercase; letter-spacing: 2px;
      padding-top: 4px;
    }

    .budget-bill {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 12px;
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
    }
    .budget-bill-info { flex: 1; }
    .budget-bill-name { font-size: 13px; color: var(--text-primary); }
    .budget-bill-freq {
      font-size: 9px; color: var(--text-faint);
      font-family: 'Cormorant Garamond', serif; font-style: italic;
    }
    .budget-bill-amount {
      font-size: 14px; font-weight: 600;
      color: var(--text-secondary);
    }
    .budget-bill-delete {
      background: none; border: none;
      color: var(--text-faint); font-size: 12px;
      cursor: pointer; padding: 4px;
      opacity: 0; transition: opacity 0.2s, color 0.2s;
    }
    .budget-bill:hover .budget-bill-delete { opacity: 1; }
    .budget-bill-delete:hover { color: #c93545; }

    .budget-add-row {
      display: flex; gap: 6px; flex-wrap: wrap;
    }
    .budget-add-input {
      flex: 1; min-width: 80px;
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 8px; padding: 7px 10px;
      font-size: 12px; color: var(--text-primary);
      font-family: 'Outfit', sans-serif; outline: none;
    }
    .budget-add-input::placeholder { color: var(--text-faint); font-size: 11px; }
    .budget-add-input:focus { border-color: rgba(200,170,100,0.15); }
    .budget-add-select {
      background: rgba(240,230,210,0.02);
      border: 1px solid var(--border-subtle);
      border-radius: 8px; padding: 7px 8px;
      font-size: 11px; color: var(--text-secondary);
      font-family: 'Outfit', sans-serif; outline: none;
    }

    /* Hamburger menu button */
    .header-menu-btn {
      width: 32px; height: 32px;
      background: none; border: none; cursor: pointer;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 4px; flex-shrink: 0; padding: 4px;
    }
    .header-menu-btn span {
      display: block; height: 1.5px;
      background: var(--gold-dim);
      border-radius: 1px; transition: all 0.3s;
    }
    .header-menu-btn span:nth-child(1) { width: 18px; }
    .header-menu-btn span:nth-child(2) { width: 14px; }
    .header-menu-btn span:nth-child(3) { width: 18px; }
    .header-menu-btn:hover span { background: var(--gold); }

    /* Swipe hint */
    .swipe-hint {
      position: fixed; left: 0; top: 50%;
      transform: translateY(-50%);
      width: 3px; height: 50px;
      background: linear-gradient(180deg, transparent, var(--gold-dim), transparent);
      border-radius: 0 3px 3px 0;
      z-index: 2; opacity: 0.4;
      transition: all 0.3s; cursor: pointer;
    }
    .swipe-hint:hover { width: 4px; opacity: 0.8; }

    /* ── Loading ── */
    .loading {
      display: flex; align-items: center; justify-content: center;
      height: 100%; color: var(--text-muted);
      font-size: 13px; font-weight: 400;
    }
    .loading-dots { display: flex; gap: 4px; margin-left: 8px; }
    .loading-dot {
      width: 6px; height: 6px; border-radius: 50%;
      background: var(--text-muted);
      animation: typingBounce 1.4s ease-in-out infinite;
    }
    .loading-dot:nth-child(2) { animation-delay: 0.2s; }
    .loading-dot:nth-child(3) { animation-delay: 0.4s; }

    /* ── Animations ── */
    @keyframes typingBounce {
      0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
      30% { transform: translateY(-4px); opacity: 1; }
    }

    @keyframes msgSlideIn {
      from { opacity: 0; transform: translateY(8px) scale(0.97); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* ── Splash ── */
    .splash {
      position: fixed; inset: 0;
      background: var(--bg-primary);
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      z-index: 100;
      transition: opacity 0.6s ease;
      overflow: hidden;
    }

    .splash::before {
      content: '';
      position: absolute;
      width: 200px; height: 200px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(176, 124, 197, 0.15), transparent 70%);
      filter: blur(40px);
      animation: splashGlow 3s ease-in-out infinite alternate;
    }

    @keyframes splashGlow {
      0% { transform: scale(0.8); opacity: 0.6; }
      100% { transform: scale(1.3); opacity: 1; }
    }

    .splash.hide { opacity: 0; pointer-events: none; }

    .splash-moon {
      font-size: 48px; margin-bottom: 16px;
      animation: breathe 2.5s ease-in-out infinite;
      position: relative; z-index: 1;
    }

    .splash-title {
      font-family: 'Cormorant Garamond', serif;
      font-size: 22px; font-weight: 500;
      color: var(--text-primary);
      letter-spacing: 0.5px;
      position: relative; z-index: 1;
    }

    .splash-sub {
      font-size: 12px; color: var(--text-muted);
      margin-top: 6px; font-weight: 300; font-style: italic;
      position: relative; z-index: 1;
    }

    @keyframes breathe {
      0%, 100% { transform: scale(1); opacity: 0.9; }
      50% { transform: scale(1.06); opacity: 1; }
    }

    /* ── Voice Call Overlay ── */
    .call-overlay {
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      z-index: 9999; display: none;
      flex-direction: column; align-items: center; justify-content: center;
    }
    .call-overlay.active { display: flex; }
    .call-bg {
      position: absolute; inset: 0;
      background: linear-gradient(180deg, #0a0a12 0%, #1a1028 50%, #0d0d1a 100%);
      opacity: 0.97;
    }
    .call-content {
      position: relative; z-index: 1;
      display: flex; flex-direction: column; align-items: center;
      width: 100%; max-width: 400px; padding: 40px 20px;
    }
    .call-avatar {
      width: 100px; height: 100px; border-radius: 50%;
      background-size: cover; background-position: center;
      border: 3px solid rgba(255,255,255,0.15);
      box-shadow: 0 0 40px rgba(139,92,246,0.3);
      margin-bottom: 16px;
      transition: box-shadow 0.1s;
    }
    .call-avatar-row {
      display: flex; align-items: center; justify-content: center;
      gap: 12px; margin-bottom: 16px;
    }
    .call-avatar-row .call-avatar {
      width: 76px; height: 76px; margin-bottom: 0;
    }
    .call-avatar-2 { display: none; }
    .call-name {
      font-size: 22px; font-weight: 600; color: #fff;
      margin-bottom: 4px;
    }
    .call-status {
      font-size: 13px; color: var(--text-muted);
      margin-bottom: 4px; min-height: 20px;
    }
    .call-timer {
      font-size: 14px; color: rgba(255,255,255,0.4);
      font-variant-numeric: tabular-nums;
      margin-bottom: 24px;
    }
    .call-transcript {
      width: 100%; max-height: 200px; overflow-y: auto;
      padding: 12px 16px; margin-bottom: 30px;
      font-size: 13px; color: rgba(255,255,255,0.6);
      text-align: center; line-height: 1.6;
    }
    .call-transcript .ct-them {
      color: rgba(255,255,255,0.85); font-style: italic;
    }
    .call-transcript .ct-you {
      color: var(--lia-accent); opacity: 0.7;
    }
    .call-transcript .ct-entry { margin-bottom: 8px; }
    .call-controls {
      display: flex; gap: 30px; align-items: center;
    }
    .call-mic-btn {
      width: 80px; height: 80px; border-radius: 50%;
      background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.2);
      color: #fff; display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 4px;
      cursor: pointer; transition: all 0.2s;
      -webkit-user-select: none; user-select: none;
    }
    .call-mic-btn svg { width: 28px; height: 28px; }
    .call-mic-btn .mic-label { font-size: 9px; opacity: 0.6; }
    .call-mic-btn:active, .call-mic-btn.recording {
      background: rgba(239,68,68,0.4); border-color: rgba(239,68,68,0.7);
      transform: scale(1.08); box-shadow: 0 0 30px rgba(239,68,68,0.3);
    }
    .call-mic-btn.disabled {
      opacity: 0.3; pointer-events: none;
    }
    .call-hangup-btn {
      width: 56px; height: 56px; border-radius: 50%;
      background: #ef4444; border: none; color: #fff;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: all 0.2s;
    }
    .call-hangup-btn svg { width: 24px; height: 24px; }
    .call-hangup-btn:active { transform: scale(0.95); background: #dc2626; }

    /* No idle pulse — avatars sit still until audio plays */

    /* ── Auto Toggle (top-right corner) ── */
    .call-auto-toggle {
      position: absolute; top: 16px; right: 16px; z-index: 2;
      display: flex; align-items: center; gap: 8px;
      cursor: pointer; -webkit-user-select: none; user-select: none;
    }
    .call-auto-toggle #autoLabel {
      font-size: 12px; color: rgba(255,255,255,0.4);
      transition: color 0.2s;
    }
    .call-auto-toggle.active #autoLabel { color: rgba(139,92,246,0.9); }
    .auto-switch {
      width: 36px; height: 20px; border-radius: 10px;
      background: rgba(255,255,255,0.15); position: relative;
      transition: background 0.2s;
    }
    .auto-switch::after {
      content: ''; position: absolute; top: 2px; left: 2px;
      width: 16px; height: 16px; border-radius: 50%;
      background: rgba(255,255,255,0.5);
      transition: transform 0.2s, background 0.2s;
    }
    .call-auto-toggle.active .auto-switch {
      background: rgba(139,92,246,0.4);
    }
    .call-auto-toggle.active .auto-switch::after {
      transform: translateX(16px);
      background: rgba(139,92,246,1);
    }

    /* ── Mic Cross (shown when auto mode active) ── */
    .mic-cross {
      display: none; position: absolute;
      width: 40px; height: 3px; background: rgba(255,255,255,0.7);
      transform: rotate(-45deg); border-radius: 2px;
    }
    .call-mic-btn.auto-disabled .mic-cross { display: block; }
    .call-mic-btn.auto-disabled {
      opacity: 0.25; pointer-events: none;
    }
    .call-mic-btn.auto-disabled .mic-label { display: none; }
    .call-mic-btn.auto-listening {
      background: rgba(139,92,246,0.2); border-color: rgba(139,92,246,0.4);
      animation: autoListenPulse 2s ease-in-out infinite;
    }
    @keyframes autoListenPulse {
      0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.1); }
      50% { box-shadow: 0 0 35px rgba(139,92,246,0.3); }
    }

    /* ── Ringing Controls ── */
    .call-ringing-controls { gap: 60px; }
    .call-answer-btn {
      width: 64px; height: 64px; border-radius: 50%;
      background: #22c55e; border: none; color: #fff;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: all 0.2s;
      animation: ringPulseGreen 1.5s ease-in-out infinite;
    }
    .call-answer-btn svg { width: 28px; height: 28px; }
    .call-answer-btn:active { transform: scale(0.95); }
    .call-decline-btn {
      width: 56px; height: 56px; border-radius: 50%;
      background: #ef4444; border: none; color: #fff;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: all 0.2s;
    }
    .call-decline-btn svg { width: 24px; height: 24px; }
    .call-decline-btn:active { transform: scale(0.95); }
    @keyframes ringPulseGreen {
      0%, 100% { box-shadow: 0 0 10px rgba(34,197,94,0.3); }
      50% { box-shadow: 0 0 30px rgba(34,197,94,0.6); }
    }
    @keyframes ringAvatar {
      0%, 100% { transform: scale(1); }
      15% { transform: scale(1.05) rotate(-2deg); }
      30% { transform: scale(1) rotate(2deg); }
      45% { transform: scale(1.05) rotate(-1deg); }
      60% { transform: scale(1); }
    }
    .call-overlay.ringing .call-avatar { animation: ringAvatar 1.5s ease-in-out infinite; }

    /* ── Call Log Indicator ── */
    .call-log-icon { font-size: 10px; opacity: 0.7; }
    .msg-bubble.call-log.vex { border-left: 2px solid var(--vex-accent); }
    .msg-bubble.call-log.sage { border-left: 2px solid var(--sage-accent); }
    .msg-bubble.call-log.lia { border-left: 2px solid var(--lia-accent); }
    .msg-system {
      text-align: center; font-size: 11px; color: rgba(255,255,255,0.4);
      padding: 8px 0; font-style: italic;
    }
    .version-tag {
      display: none; /* Version now in sidebar footer */
    }
