/* =========================================================================
   NxtNova — styles.css
   Clean chat UI inspired by claude.ai / chatgpt / gemini.
   No serif, no italic, no cosmic gradients. Solid neutral surfaces.
   ========================================================================= */


/* =========================================================================
   1. CSS RESET — minimal, modern
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

/* Author rules like `display: flex` on .welcome / .app would otherwise win
   over the UA rule `[hidden] { display: none }`. Force hidden everywhere. */
[hidden] { display: none !important; }

html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

textarea {
  resize: none;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}


/* =========================================================================
   2. CSS VARIABLES — light & dark themes
   ========================================================================= */
:root {
  /* Surfaces (light) */
  --bg:            #ffffff;
  --bg-sidebar:    #f7f7f8;
  --bg-elev:       #ffffff;
  --bg-hover:      #ececec;
  --bg-active:     #e3e3e3;
  --bg-input:      #ffffff;
  --bg-bubble:     #f4f4f4;
  --bg-code:       #f7f7f8;
  --bg-modal:      #ffffff;
  --backdrop:      rgba(0, 0, 0, 0.36);

  /* Text */
  --text:          #1f1f1f;
  --text-muted:    #6b6b6b;
  --text-soft:     #8a8a8a;
  --text-invert:   #ffffff;

  /* Borders */
  --border:        rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --border-input:  rgba(0, 0, 0, 0.12);

  /* Accent — claude.ai bronze */
  --accent:        #b9bcc6;
  --accent-hover:  #aeb2bd;
  --accent-soft:   rgba(184, 188, 200, 0.12);
  --accent-text:   #ffffff;

  /* Functional */
  --danger:        #b3261e;
  --success:       #137a4f;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.10);

  /* Radii */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;
  --r-5: 18px;
  --r-6: 24px;
  --r-full: 9999px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;

  /* Font */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Sidebar width */
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --content-max: 768px;

  /* Motion */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 320ms ease;
}

[data-theme="dark"] {
  --bg:            #0d0d0d;
  --bg-sidebar:    #171717;
  --bg-elev:       #1a1a1a;
  --bg-hover:      #232323;
  --bg-active:     #2a2a2a;
  --bg-input:      #1f1f1f;
  --bg-bubble:     #2f2f2f;
  --bg-code:       #1e1e1e;
  --bg-modal:      #1a1a1a;
  --backdrop:      rgba(0, 0, 0, 0.6);

  --text:          #ececec;
  --text-muted:    #9b9b9b;
  --text-soft:     #7a7a7a;
  --text-invert:   #0d0d0d;

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-input:  rgba(255, 255, 255, 0.14);

  --accent:        #c6cad3;
  --accent-hover:  #d2d5dd;
  --accent-soft:   rgba(190, 194, 205, 0.18);
  --accent-text:   #1a1a1a;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Dracula — bluish-black with magenta/purple accents */
[data-theme="dracula"] {
  --bg:            #282a36;
  --bg-sidebar:    #21222c;
  --bg-elev:       #2d2f3b;
  --bg-hover:      #3a3c4d;
  --bg-active:     #44475a;
  --bg-input:      #2d2f3b;
  --bg-bubble:     #44475a;
  --bg-code:       #21222c;
  --bg-modal:      #282a36;
  --backdrop:      rgba(0, 0, 0, 0.6);

  --text:          #f8f8f2;
  --text-muted:    #bd93f9;
  --text-soft:     #6272a4;
  --text-invert:   #282a36;

  --border:        rgba(248, 248, 242, 0.08);
  --border-strong: rgba(248, 248, 242, 0.16);
  --border-input:  rgba(248, 248, 242, 0.16);

  --accent:        #cdcfd9;
  --accent-hover:  #d8dae2;
  --accent-soft:   rgba(190, 194, 205, 0.18);
  --accent-text:   #282a36;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.65);
}

/* Nord — arctic blue/teal */
[data-theme="nord"] {
  --bg:            #2e3440;
  --bg-sidebar:    #292e39;
  --bg-elev:       #3b4252;
  --bg-hover:      #434c5e;
  --bg-active:     #4c566a;
  --bg-input:      #3b4252;
  --bg-bubble:     #434c5e;
  --bg-code:       #292e39;
  --bg-modal:      #3b4252;
  --backdrop:      rgba(0, 0, 0, 0.5);

  --text:          #eceff4;
  --text-muted:    #d8dee9;
  --text-soft:     #81a1c1;
  --text-invert:   #2e3440;

  --border:        rgba(216, 222, 233, 0.10);
  --border-strong: rgba(216, 222, 233, 0.20);
  --border-input:  rgba(216, 222, 233, 0.18);

  --accent:        #c2c6cf;
  --accent-hover:  #c6cacf;
  --accent-soft:   rgba(190, 194, 205, 0.18);
  --accent-text:   #2e3440;
}

/* Solarized Light — warm beige with cyan */
[data-theme="solarized"] {
  --bg:            #fdf6e3;
  --bg-sidebar:    #eee8d5;
  --bg-elev:       #fdf6e3;
  --bg-hover:      #eee8d5;
  --bg-active:     #e0d8ba;
  --bg-input:      #fdf6e3;
  --bg-bubble:     #eee8d5;
  --bg-code:       #eee8d5;
  --bg-modal:      #fdf6e3;
  --backdrop:      rgba(0, 0, 0, 0.3);

  --text:          #073642;
  --text-muted:    #586e75;
  --text-soft:     #93a1a1;
  --text-invert:   #fdf6e3;

  --border:        rgba(7, 54, 66, 0.12);
  --border-strong: rgba(7, 54, 66, 0.22);
  --border-input:  rgba(7, 54, 66, 0.22);

  --accent:        #9095a1;
  --accent-hover:  #828793;
  --accent-soft:   rgba(150, 155, 168, 0.14);
  --accent-text:   #fdf6e3;
}

/* Tokyo Night — deep navy with neon teal */
[data-theme="tokyo"] {
  --bg:            #1a1b26;
  --bg-sidebar:    #16161e;
  --bg-elev:       #1f2335;
  --bg-hover:      #292e42;
  --bg-active:     #3d59a1;
  --bg-input:      #1f2335;
  --bg-bubble:     #292e42;
  --bg-code:       #16161e;
  --bg-modal:      #1f2335;
  --backdrop:      rgba(0, 0, 0, 0.65);

  --text:          #c0caf5;
  --text-muted:    #9aa5ce;
  --text-soft:     #565f89;
  --text-invert:   #1a1b26;

  --border:        rgba(192, 202, 245, 0.08);
  --border-strong: rgba(192, 202, 245, 0.16);
  --border-input:  rgba(192, 202, 245, 0.18);

  --accent:        #b6bac6;
  --accent-hover:  #c4c8d3;
  --accent-soft:   rgba(185, 189, 200, 0.18);
  --accent-text:   #1a1b26;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.65);
}

/* Sunset — warm plum/magenta with peach */
[data-theme="sunset"] {
  --bg:            #1a0f1c;
  --bg-sidebar:    #150a18;
  --bg-elev:       #2a1530;
  --bg-hover:      #3a1f42;
  --bg-active:     #4d2956;
  --bg-input:      #2a1530;
  --bg-bubble:     #3a1f42;
  --bg-code:       #150a18;
  --bg-modal:      #2a1530;
  --backdrop:      rgba(0, 0, 0, 0.65);

  --text:          #e8e6e2;
  --text-muted:    #f5b399;
  --text-soft:     #b07a8a;
  --text-invert:   #1a0f1c;

  --border:        rgba(255, 230, 213, 0.10);
  --border-strong: rgba(255, 230, 213, 0.18);
  --border-input:  rgba(255, 230, 213, 0.20);

  --accent:        #cdd0da;
  --accent-hover:  #d6d8e0;
  --accent-soft:   rgba(190, 194, 205, 0.20);
  --accent-text:   #1a0f1c;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.65);
}


/* =========================================================================
   3. BASE — body, scrollbars, theme transition
   ========================================================================= */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  transition: background-color var(--t-base), color var(--t-base);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-soft);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }


/* =========================================================================
   4. UTILITY — buttons, inputs (shared building blocks)
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 14px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  user-select: none;
  min-height: 36px;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-hover); }

.btn-outline {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-hover); }

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-2);
  color: var(--text);
  transition: background-color var(--t-fast);
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn:active { background: var(--bg-active); }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 10px;
  border-radius: var(--r-2);
  font-size: 14px;
  color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
  min-height: 36px;
}
.ghost-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}


/* =========================================================================
   5. LOCK MODAL
   ========================================================================= */
.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  background: var(--bg-sidebar);
  animation: fade-in var(--t-base);
}

.lock[aria-hidden="true"] {
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-base);
}

.lock-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: var(--s-7);
  box-shadow: var(--shadow-2);
  animation: pop-in var(--t-base);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-4);
}

.lock-avatar {
  align-self: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: var(--bg-hover);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.lock-avatar img,
.lock-avatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lock-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.lock-sub {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -8px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-input);
  border-radius: var(--r-2);
  font-size: 15px;
  outline: none;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}

.input-wrap input::placeholder { color: var(--text-soft); }

.input-wrap input:focus {
  border-color: var(--accent);
}

.input-wrap.shake {
  animation: shake 200ms ease;
}

.input-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--r-2);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.input-eye:hover { background: var(--bg-hover); color: var(--text); }
.input-eye .eye-off { display: none; }
.input-eye.is-shown .eye-on { display: none; }
.input-eye.is-shown .eye-off { display: block; }

.lock-error {
  min-height: 18px;
  font-size: 13px;
  color: var(--danger);
}

.lock-foot {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: var(--s-2);
}


/* =========================================================================
   6. APP LAYOUT (sidebar + main)
   ========================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100dvh;
  width: 100%;
  background: var(--bg);
}

.backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  z-index: 40;
  animation: fade-in var(--t-base);
}


/* =========================================================================
   7. SIDEBAR
   ========================================================================= */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: var(--s-3);
  gap: var(--s-3);
  height: 100dvh;
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-2) var(--s-1);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}

.brand-avatar {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-avatar img,
.brand-avatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-close {
  display: none;
}

.btn-newchat {
  justify-content: flex-start;
  padding-left: 12px;
  padding-right: 12px;
}

.conv-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: var(--s-2) 0;
  margin-top: var(--s-1);
}

.conv-section-title {
  padding: var(--s-2) var(--s-3) var(--s-1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.conv-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 var(--s-1);
}

.conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 8px 10px;
  border-radius: var(--r-2);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--t-fast);
  min-height: 36px;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.is-active { background: var(--bg-hover); }

.conv-item-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item-del {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-1);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--t-fast), background-color var(--t-fast);
}
.conv-item:hover .conv-item-del,
.conv-item.is-active .conv-item-del { opacity: 1; }
.conv-item-del:hover { background: var(--bg-active); color: var(--text); }

.conv-item-share {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-1);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--t-fast), background-color var(--t-fast);
}
.conv-item:hover .conv-item-share,
.conv-item.is-active .conv-item-share { opacity: 1; }
.conv-item-share:hover { background: var(--bg-active); color: var(--text); }

.conv-search {
  position: relative;
  margin: 12px 14px 8px;
}
.conv-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.conv-search-input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  background: var(--bg-input, rgba(255,255,255,0.05));
  border: 1px solid var(--border-input, rgba(255,255,255,0.1));
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.conv-search-input:focus { border-color: var(--border-strong, rgba(255,255,255,0.25)); }
.search-results {
  list-style: none;
  margin: 0 14px 8px;
  padding: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.search-result-item {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  transition: background-color 150ms;
}
.search-result-item:hover { background: rgba(255,255,255,0.08); }
.search-result-conv { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.search-result-snippet { font-size: 13px; line-height: 1.4; color: var(--text); }
.search-result-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 13px; }

.conv-empty {
  padding: var(--s-3);
  font-size: 13px;
  color: var(--text-soft);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--s-2);
  border-top: 1px solid var(--border);
}

[data-theme="light"] .ic-moon { display: none; }
[data-theme="dark"]  .ic-sun  { display: none; }


/* =========================================================================
   8. MAIN COLUMN
   ========================================================================= */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  background: var(--bg);
  position: relative;
}


/* =========================================================================
   9. TOPBAR
   ========================================================================= */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: var(--topbar-h);
  padding: 0 var(--s-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.hamburger {
  display: none;
}

.model-picker {
  position: relative;
}

.model-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px 10px;
  border-radius: var(--r-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background-color var(--t-fast);
  min-height: 36px;
}
.model-btn:hover { background: var(--bg-hover); }

.model-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-1);
  box-shadow: var(--shadow-2);
  z-index: 30;
  animation: dropdown-in 160ms ease;
  /* The picker can list up to 13 models (Claude×5 / Gemini×3 / GPT×5) for the
     owner — taller than many viewports. The menu is anchored *below* the topbar
     (~64px down) and the composer floats over the bottom (~90px), so the budget
     has to subtract BOTH ends — otherwise the last GPT entries bleed off-screen
     behind the composer (which is exactly what happened with a naive 100dvh cap,
     made worse because refreshMe() un-hides the owner-only rows right after open
     and the menu grows). Leave room top + bottom and scroll the overflow. */
  max-height: calc(100dvh - 170px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-2);
  text-align: left;
  transition: background-color var(--t-fast);
}
.model-item:hover { background: var(--bg-hover); }

.model-item-text { display: flex; flex-direction: column; gap: 2px; }
.model-item-title { font-size: 14px; font-weight: 500; color: var(--text); }
.model-item-sub { font-size: 12px; color: var(--text-muted); }
.model-item .check { opacity: 0; color: var(--accent); }
.model-item.is-active .check { opacity: 1; }

#topbar-new {
  margin-left: auto;
}


/* =========================================================================
   10. WELCOME SCREEN
   ========================================================================= */
.welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  overflow-y: auto;
}

.welcome-inner {
  width: 100%;
  max-width: var(--content-max);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-7);
}

.welcome-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: center;
}

.pill {
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: background-color var(--t-fast), border-color var(--t-fast);
  min-height: 36px;
}
.pill:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}


/* =========================================================================
   11. MESSAGES
   ========================================================================= */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-5) var(--s-4) var(--s-4);
}

.messages-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

.msg {
  display: flex;
  gap: var(--s-3);
  animation: msg-in var(--t-base);
}

.msg-user {
  justify-content: flex-end;
}

.msg-user .bubble {
  background: var(--bg-bubble);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--r-5);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.msg-assistant {
  align-items: flex-start;
}

.msg-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  margin-top: 2px;
}
.msg-avatar img, .msg-avatar svg { width: 100%; height: 100%; object-fit: cover; }

.msg-body {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

/* Cursor while streaming */
.msg-body.is-streaming::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 16px;
  background: var(--text);
  vertical-align: -3px;
  margin-left: 2px;
  animation: caret 1s steps(2, start) infinite;
}

/* Typing indicator */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--text-soft);
  opacity: 0.3;
  animation: typing-dot 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }


/* =========================================================================
   12. MARKDOWN CONTENT (assistant body)
   ========================================================================= */
.markdown > * + * { margin-top: 12px; }

.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  line-height: 1.3;
}
.markdown h1 { font-size: 22px; margin-top: 18px; }
.markdown h2 { font-size: 19px; margin-top: 16px; }
.markdown h3 { font-size: 17px; margin-top: 14px; }
.markdown h4 { font-size: 15px; margin-top: 12px; }

.markdown p { color: var(--text); }

.markdown ul, .markdown ol {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.markdown ul { list-style: disc; }
.markdown ol { list-style: decimal; }
.markdown li { padding-left: 2px; }
.markdown li > p { display: inline; }

.markdown blockquote {
  border-left: 3px solid var(--border-strong);
  padding-left: 12px;
  color: var(--text-muted);
}

.markdown a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--accent-soft);
}
.markdown a:hover { text-decoration-color: var(--accent); }

.markdown strong { font-weight: 600; }

/* italic ONLY allowed inside markdown <em> */
.markdown em { font-style: italic; }

.markdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}


/* =========================================================================
   13. CODE BLOCKS & INLINE CODE
   ========================================================================= */
.markdown code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  padding: 1px 5px;
}

.markdown pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  position: relative;
  margin-top: 12px;
}

.markdown pre .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.markdown pre .code-head .lang {
  text-transform: lowercase;
}

.markdown pre .copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--r-1);
  font-size: 12px;
  color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.markdown pre .copy-btn:hover { background: var(--bg-hover); color: var(--text); }
.markdown pre .copy-btn.is-copied { color: var(--success); }

.markdown pre code {
  display: block;
  background: transparent;
  border: 0;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
  color: var(--text);
}


/* =========================================================================
   14. COMPOSER
   ========================================================================= */
.composer-wrap {
  flex-shrink: 0;
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid transparent;
}

.composer {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--r-6);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  transition: border-color var(--t-fast);
}
.composer:focus-within {
  border-color: var(--border-strong);
}

#prompt {
  flex: 1;
  /* CRITICAL: a flex item's default min-width is its intrinsic size — for a
     textarea that's ~20ch (~170px). With 5 fixed buttons in the row (attach,
     image, dictate, voice, send) the row's min-content exceeded narrow phone
     screens, the page overflowed horizontally, and mobile browsers zoomed the
     whole app out ("everything tiny"). min-width:0 lets the textarea shrink. */
  min-width: 0;
  min-height: 24px;
  max-height: 200px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  resize: none;
  overflow-y: auto;
}
#prompt::placeholder { color: var(--text-soft); }

.send-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--text);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--t-fast), opacity var(--t-fast);
}
.send-btn:hover:not(:disabled) {
  opacity: 0.85;
}
.send-btn:disabled {
  background: var(--text-soft);
  cursor: not-allowed;
}
.send-btn .ic-stop { display: none; }
.send-btn.is-streaming .ic-send { display: none; }
.send-btn.is-streaming .ic-stop { display: block; }

.composer-hint {
  max-width: var(--content-max);
  margin: 6px auto 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-soft);
}


/* =========================================================================
   15. ANIMATIONS
   ========================================================================= */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.3; }
  30%           { opacity: 1; }
}

@keyframes caret {
  to { visibility: hidden; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* =========================================================================
   16. RESPONSIVE — tablets and below
   ========================================================================= */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 240px;
  }

  .messages, .welcome {
    padding-left: var(--s-3);
    padding-right: var(--s-3);
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 84%;
    max-width: 320px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: var(--shadow-3);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  /* On a phone the fixed sections (head, search, filters, new-chat, download
     banner, and the 8-row footer) eat nearly the whole 100dvh, crushing the
     flex:1 chat list to ~one row ("chats don't show"). Guarantee the list a
     real height and let the sidebar itself scroll so the footer stays
     reachable below it. */
  .sidebar { overflow-y: auto; }
  .conv-section { min-height: 38vh; flex-shrink: 0; }
  .sidebar-foot { flex-shrink: 0; }

  .sidebar-close {
    display: inline-flex;
  }

  .hamburger {
    display: inline-flex;
  }

  .topbar {
    padding: 0 var(--s-2);
  }

  .messages {
    padding: var(--s-3) var(--s-3) var(--s-2);
  }

  .composer-wrap {
    padding: var(--s-2) var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom));
  }

  .composer {
    padding: 8px 12px;
    border-radius: 22px;
  }

  .welcome-title {
    font-size: 24px;
  }

  .pill {
    font-size: 13.5px;
    padding: 8px 12px;
  }

  .msg-user .bubble {
    max-width: 88%;
  }

  .model-menu {
    /* Fit within viewport on narrow phones; clamp prevents overflow when the
       button is near the left/right edge */
    width: min(280px, calc(100vw - 24px));
    /* Same top-bar + composer budget as desktop so the bottom GPT rows don't
       hide behind the mobile composer once refreshMe() reveals owner models. */
    max-height: calc(100dvh - 160px);
    overflow-y: auto;
    /* Anchor relative to viewport rather than the small button so long
       option titles don't get clipped on the right */
    left: 0;
    right: auto;
  }
  .model-menu .model-item {
    padding: 12px 12px;
    gap: var(--s-2);
  }
  .model-menu .model-item-text {
    min-width: 0;
    flex: 1;
  }
  .model-menu .model-item-title,
  .model-menu .model-item-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* The topbar label can get long ("NxtNova gemini 3.1 flash-lite") —
     clamp it so it doesn't push the quota ring / new-chat buttons off
     screen. Tightened after adding the GPT models + quota ring to the bar. */
  #model-label {
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .model-picker { min-width: 0; }
  .model-btn { min-width: 0; }
}

@media (max-width: 420px) {
  .welcome-title { font-size: 22px; }

  .suggestions { gap: 6px; }

  .pill { padding: 7px 11px; font-size: 13px; }

  #prompt { font-size: 16px; } /* avoid iOS zoom on focus */

  #model-label { max-width: 32vw; font-size: 12.5px; }
  .model-btn { padding: 6px 6px; }
  /* 5 buttons + textarea don't fit a narrow phone. The standalone image
     button duplicates the plus-menu's "Generate image" entry — hide it here
     so the input keeps a usable typing width. */
  #image-btn { display: none; }
}


/* =========================================================================
   17. UTILITY HELPERS
   ========================================================================= */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.hidden { display: none !important; }

.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }

.mb-1 { margin-bottom: var(--s-1); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }


/* =========================================================================
   18. PRINT
   ========================================================================= */
/* =========================================================================
   MOBILE PWA POLISH
   - safe-area on every layout edge
   - 16px+ font-size on inputs to suppress iOS zoom
   - kill 300ms tap delay + tap highlight
   - prevent overscroll bounce that breaks fixed composer
   - composer follows the on-screen keyboard via dvh
   ========================================================================= */
html, body {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}
button, a, .icon-btn, .conv-item, .lang-btn, .voice-toggle, .conv-item-del,
.conv-item-share, .user-card-action, .composer-icon-btn, .send-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* iOS auto-zooms <input>/<textarea> when font-size < 16px on focus. Force 16+ on mobile. */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
  #prompt { font-size: 16px !important; }
  .persona-text { font-size: 16px !important; }
}

/* Use 100dvh (dynamic viewport height) so the layout shrinks with the on-screen keyboard
   instead of being clipped under it. Falls back to vh on browsers that don't support dvh. */
@supports (height: 100dvh) {
  .app { height: 100dvh; }
}

/* iPhone safe-area on every fixed/edge surface */
.composer-wrap { padding-bottom: env(safe-area-inset-bottom); }
.sidebar { padding-top: env(safe-area-inset-top); }
.topbar  { padding-top: env(safe-area-inset-top); }

/* Bigger touch targets on coarse pointers (touch screens) */
@media (pointer: coarse) {
  .conv-item-del, .conv-item-share, .user-card-action, .composer-icon-btn {
    min-width: 40px; min-height: 40px;
  }
  .send-btn { min-width: 44px; min-height: 44px; }
  .lang-btn { min-height: 36px; }
}

/* On small screens, the persona / push / voice icons in the user-card can crowd. Stack them. */
@media (max-width: 480px) {
  .user-card { flex-wrap: wrap; row-gap: 6px; }
  .voice-overlay .voice-card { padding: 24px 18px 28px; }
  .voice-orb-wrap { width: 180px; height: 180px; }
  .voice-orb { width: 140px; height: 140px; }
  .voice-toggle { width: 64px; height: 64px; }
  .voice-lang { top: max(16px, env(safe-area-inset-top)); }
}

/* Prevent the page from scrolling behind a fixed sidebar when it's open on mobile */
@media (max-width: 768px) {
  .app[data-sidebar="open"] { overflow: hidden; touch-action: none; }
}

@media print {
  .sidebar, .topbar, .composer-wrap, .lock { display: none !important; }
  .main { height: auto; }
  body { overflow: visible; background: white; color: black; }
  .messages { overflow: visible; }
}


/* =========================================================================
   19. REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .msg-body.is-streaming::after { animation: none; opacity: 0.6; }
}


/* =========================================================================
   20. HIGH CONTRAST FALLBACKS
   ========================================================================= */
@media (forced-colors: active) {
  .btn,
  .pill,
  .conv-item,
  .composer,
  .lock-card,
  .model-menu {
    border: 1px solid CanvasText;
  }
}


/* =========================================================================
   21. THEME-SPECIFIC TWEAKS
   ========================================================================= */
[data-theme="dark"] .send-btn {
  background: var(--text);
  color: var(--bg);
}

[data-theme="dark"] .markdown pre code {
  color: #e6e6e6;
}

[data-theme="dark"] .composer:focus-within {
  border-color: rgba(255, 255, 255, 0.25);
}


/* =========================================================================
   22. ICON SIZE NORMALIZATION
   ========================================================================= */
.icon-btn svg,
.ghost-btn svg,
.btn svg,
.pill svg,
.send-btn svg {
  flex-shrink: 0;
  pointer-events: none;
}


/* =========================================================================
   23. FOCUS STATES (accessible but quiet)
   ========================================================================= */
.btn:focus-visible,
.icon-btn:focus-visible,
.ghost-btn:focus-visible,
.pill:focus-visible,
.model-btn:focus-visible,
.model-item:focus-visible,
.conv-item:focus-visible,
.send-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.input-wrap input:focus-visible {
  outline: none;
}


/* =========================================================================
   24. EDGE CASES — long words, RTL fallback, scroll anchoring
   ========================================================================= */
.bubble, .msg-body {
  overflow-wrap: anywhere;
  word-break: normal;
}

.messages, .welcome {
  overscroll-behavior-y: contain;
  scroll-padding-bottom: 80px;
}


/* =========================================================================
   25. AVATAR FALLBACK SVG (used when avatar.png is missing)
   ========================================================================= */
.avatar-fallback {
  width: 100%;
  height: 100%;
  background: var(--bg-hover);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  border-radius: inherit;
}
.avatar-fallback.size-56 { font-size: 22px; }


/* =========================================================================
   26. SCROLL FADE (subtle top fade when messages scroll)
   ========================================================================= */
.messages {
  scrollbar-gutter: stable;
}


/* =========================================================================
   27. ENSURE NO STRAY ITALIC FROM USER AGENT
   ========================================================================= */
i, em, cite, dfn, address, var {
  font-style: normal;
}
.markdown em {
  font-style: italic;
}


/* =========================================================================
   28. LOADING SPINNER (used wherever a busy hint is needed)
   ========================================================================= */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}
.spinner.size-12 { width: 12px; height: 12px; border-width: 2px; }
.spinner.size-18 { width: 18px; height: 18px; border-width: 2px; }
.spinner.size-24 { width: 24px; height: 24px; border-width: 3px; }


/* =========================================================================
   28b. EMPTY STATES (generic placeholder block)
   ========================================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-7) var(--s-5);
  color: var(--text-muted);
  text-align: center;
}
.empty-state .empty-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}
.empty-state .empty-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.5;
}


/* =========================================================================
   29. KEYBOARD SHORTCUTS HINT (composer)
   ========================================================================= */
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--bg-hover);
}


/* =========================================================================
   30. SAFE AREA & DYNAMIC VIEWPORT GUARDS
   ========================================================================= */
@supports (padding: env(safe-area-inset-bottom)) {
  .composer-wrap {
    padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom));
  }
  .sidebar {
    padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom));
  }
}

@supports (height: 100dvh) {
  .app, .sidebar, .main, html, body {
    height: 100dvh;
  }
}


/* =========================================================================
   31. EXTRA — disabled state on composer while streaming
   ========================================================================= */
.composer[data-state="streaming"] #prompt {
  color: var(--text-muted);
}

.composer[data-state="streaming"] {
  border-color: var(--border-strong);
}


/* =========================================================================
   32. ERROR BANNER (transient)
   ========================================================================= */
.error-banner {
  max-width: var(--content-max);
  margin: 0 auto var(--s-3);
  padding: 10px 14px;
  background: rgba(179, 38, 30, 0.08);
  border: 1px solid rgba(179, 38, 30, 0.2);
  border-radius: var(--r-2);
  color: var(--danger);
  font-size: 13.5px;
}


/* =========================================================================
   33. SOFT SCROLL FOR ANCHORS
   ========================================================================= */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* =========================================================================
   34. TOOLTIP (lightweight, CSS-only)
   ========================================================================= */
[data-tip] {
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: var(--text);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: var(--r-1);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 50;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* =========================================================================
   35. TOAST / TRANSIENT NOTIFICATION
   ========================================================================= */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.toast {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 10px 14px;
  font-size: 13.5px;
  box-shadow: var(--shadow-2);
  animation: pop-in var(--t-base);
  pointer-events: auto;
  max-width: 320px;
}
.toast.is-error { color: var(--danger); border-color: rgba(179, 38, 30, 0.3); }
.toast.is-success { color: var(--success); border-color: rgba(19, 122, 79, 0.3); }


/* =========================================================================
   36. SEPARATOR (used in dropdowns / sidebar)
   ========================================================================= */
.sep {
  height: 1px;
  background: var(--border);
  margin: var(--s-2) 0;
}
.sep-v {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 var(--s-2);
}


/* =========================================================================
   37. BADGE / TAG
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-hover);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}
.badge.is-accent {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.is-danger {
  border-color: rgba(255, 90, 90, 0.4);
  background: rgba(255, 90, 90, 0.12);
  color: #ff8a8a;
}


/* =========================================================================
   38. LINK BUTTON (text-only with subtle underline)
   ========================================================================= */
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--t-fast);
}
.link-btn:hover { text-decoration-color: var(--accent); }


/* =========================================================================
   39. ICON-ONLY BUTTON SIZE VARIANTS
   ========================================================================= */
.icon-btn.size-sm { width: 28px; height: 28px; }
.icon-btn.size-lg { width: 44px; height: 44px; }


/* =========================================================================
   40. KEYBOARD-FOCUS HALO (just a quieter outline alt)
   ========================================================================= */
.has-halo:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}


/* =========================================================================
   41. CONVERSATION ITEM RENAME-INPUT (future-friendly)
   ========================================================================= */
.conv-item input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
  color: var(--text);
  padding: 2px 0;
}


/* =========================================================================
   42. MOBILE-ONLY HELPERS
   ========================================================================= */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}


/* =========================================================================
   43. INPUT VARIANTS
   ========================================================================= */
.input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-input);
  border-radius: var(--r-2);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast);
}
.input::placeholder { color: var(--text-soft); }
.input:focus { border-color: var(--accent); }


/* =========================================================================
   44. LANGUAGE TOGGLE (EN / RU)
   ========================================================================= */
.lang-toggle {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  margin: 4px 6px 6px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg);
}

.lang-btn {
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.is-active {
  background: var(--bg-hover);
  color: var(--text);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}


/* =========================================================================
   45. SESSION COUNTDOWN TIMER (sidebar foot)
   ========================================================================= */
.session-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  width: max-content;
  align-self: flex-start;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}

.session-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--success);
  flex-shrink: 0;
}

.session-label {
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.session-time {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
}

.session-timer.is-warning {
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.25);
}
.session-timer.is-warning .session-dot {
  background: var(--danger);
}
.session-timer.is-warning .session-time {
  color: var(--danger);
}

.session-timer.is-owner {
  border-color: rgba(216, 220, 229, 0.35);
  background: linear-gradient(135deg, color-mix(in srgb, #d8dae2 8%, var(--bg)), var(--bg));
  color: #d8dae2;
}
.session-timer.is-owner .session-dot {
  background: linear-gradient(135deg, #d8dae2, #cccfd9);
  box-shadow: 0 0 6px rgba(216, 220, 229, 0.7);
}
.session-timer.is-owner .session-time {
  color: #d8dae2;
  font-size: 14px;
  font-weight: 700;
}


/* =========================================================================
   46. COMPOSER ROW + ATTACHMENTS
   ========================================================================= */
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: var(--s-2);
  width: 100%;
}

.composer-icon-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.composer-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  width: 100%;
}

.attach-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  animation: pop-in 200ms ease;
}
.attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--t-fast);
}
.attach-remove:hover { background: rgba(0, 0, 0, 0.9); }

/* Document chip in the pending-attachments strip — wider than image
   thumbs so the filename fits. Format-tinted accent matches the in-chat
   document card. */
/* Inline video-options bar — shown above the composer when input starts
   with `/video`. Three glassy chips, each with a dropdown. The owner-only
   music-options bar (`/music`) reuses the same container + .vopt-* chips. */
.video-options,
.music-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 4px 2px 2px;
  animation: pop-in 200ms ease;
}
.vopt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(190, 194, 205, 0.10);
  border: 1px solid rgba(190, 194, 205, 0.22);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.vopt-chip:hover {
  background: rgba(190, 194, 205, 0.16);
  border-color: rgba(190, 194, 205, 0.35);
}
.vopt-label {
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  text-transform: uppercase;
}
.vopt-chip select {
  appearance: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 14px 2px 0;
  /* dropdown arrow */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 10px 10px;
}
.vopt-chip select option { background: #14181f; color: #fff; }

.attach-thumb-doc {
  --doc-accent: #c2c7d3;
  width: auto;
  max-width: 240px;
  height: 36px;
  padding: 0 32px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in oklab, var(--doc-accent) 12%, rgba(255,255,255,0.04));
  border-color: color-mix(in oklab, var(--doc-accent) 24%, var(--border, rgba(255,255,255,0.10)));
}
.attach-doc-badge {
  background: var(--doc-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.attach-doc-name {
  font-size: 12px;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* ==============================
   User-card action (persona button) + persona modal
   ============================== */
.user-card-action {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, rgba(255,255,255,0.6));
  background: transparent;
  transition: background-color 150ms, color 150ms;
}
.user-card-action:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text, #fff);
}
.user-card-action.is-on {
  color: #9092a0;
}
.persona-card { max-width: 520px; }
.persona-text {
  width: 100%;
  background: var(--bg-input, rgba(255,255,255,0.05));
  border: 1px solid var(--border-input, rgba(255,255,255,0.12));
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text, #fff);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}
.persona-text:focus { outline: 0; border-color: var(--border-strong, rgba(255,255,255,0.3)); }
.persona-meta {
  text-align: right;
  color: var(--text-muted, rgba(255,255,255,0.55));
  font-size: 12px;
  margin: 6px 0 14px;
}

/* ==============================
   Voice mode overlay
   ============================== */
.voice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: voice-fade-in 200ms ease;
}
@keyframes voice-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
.voice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 36px 48px 40px;
  min-width: 320px;
  max-width: 90vw;
}
.voice-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms;
}
.voice-close:hover { background: rgba(255,255,255,0.16); }

.voice-lang {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 4px;
  z-index: 1;
}
.voice-lang-btn {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.7);
  background: transparent;
  transition: background-color 150ms, color 150ms;
}
.voice-lang-btn:hover { color: #fff; }
.voice-lang-btn.is-active {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.voice-orb-wrap {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-orb {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #cfd0d9, #9092a0 55%, #1a1c24 100%);
  box-shadow: 0 0 80px rgba(120,90,255,0.45), inset 0 0 40px rgba(255,255,255,0.18);
  transition: transform 200ms ease;
}
.voice-orb.is-listening {
  animation: voice-pulse 1200ms ease-in-out infinite;
}
.voice-orb.is-speaking {
  animation: voice-speak 600ms ease-in-out infinite alternate;
}
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
@keyframes voice-speak {
  from { transform: scale(0.94); }
  to   { transform: scale(1.10); }
}

.voice-status {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.voice-transcript {
  color: rgba(255,255,255,0.92);
  font-size: 16px;
  text-align: center;
  max-width: 480px;
  min-height: 24px;
  line-height: 1.5;
}
.voice-toggle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #e6e6e6);
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(255,255,255,0.18);
  transition: transform 150ms;
}
.voice-toggle:hover { transform: scale(1.04); }
.voice-toggle:active { transform: scale(0.96); }
.voice-toggle .voice-toggle-stop { display: none; }
.voice-overlay.is-active .voice-toggle .voice-toggle-mic { display: none; }
.voice-overlay.is-active .voice-toggle .voice-toggle-stop { display: inline-flex; }

/* Action row under each assistant message — copy / regenerate / version arrows */
.msg-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.msg-action-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}
.msg-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.msg-action-btn svg { flex-shrink: 0; }
.msg-action-version-label {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  min-width: 28px;
  text-align: center;
}

/* Mute button — sits below the main start/stop in the voice overlay */
.voice-mute {
  margin-top: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.voice-mute:hover { background: rgba(255, 255, 255, 0.12); }
.voice-mute:active { transform: scale(0.94); }
.voice-mute .vm-off { display: none; }
.voice-mute.is-muted { color: rgba(255, 140, 140, 0.95); background: rgba(255, 80, 80, 0.12); }
.voice-mute.is-muted .vm-on  { display: none; }
.voice-mute.is-muted .vm-off { display: inline-flex; }

.composer.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.user-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 78%;
  min-width: 0;
}
.msg-user { position: relative; }
.msg-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  align-self: flex-end;
  border: none;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.msg-edit-btn:hover { opacity: 1; background: var(--bg-hover); }
.msg-edit-btn svg { flex-shrink: 0; }

/* Inline edit (the bubble itself becomes the editor) */
.msg-user .bubble.is-editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  width: 100%;
}
.msg-edit-input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
  padding: 0;
  margin: 0;
  min-height: 22px;
  max-height: 50vh;
}
.msg-edit-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.msg-edit-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.75;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.msg-edit-action:hover { opacity: 1; background: var(--bg-hover); }
.msg-edit-action:active { transform: scale(0.92); }
/* Soft blue (matches the iOS ✓ glyph) — reads as "continue / yes".
   Distinct from --accent (orange) which is the brand send/CTA color. */
.msg-edit-confirm { color: #97c2ff; }
.msg-edit-confirm:hover { color: #d7dae1; }

/* User-bubble trailing row: branch arrows (when edited) + pencil. */
.msg-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.msg-images img {
  max-width: 220px;
  max-height: 220px;
  border-radius: var(--r-3);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  animation: pop-in 200ms ease;
}


/* =========================================================================
   47. SEND BUTTON — gradient accent (Gemini-style)
   ========================================================================= */
.send-btn {
  background: linear-gradient(135deg, #4f8cff 0%, #9a9ca8 50%, #c8cad6 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.send-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #6aa0ff 0%, #a17aff 50%, #ced0da 100%);
  opacity: 0;
  transition: opacity var(--t-base);
}
.send-btn:hover:not(:disabled)::after { opacity: 1; }
.send-btn > svg { position: relative; z-index: 1; }
.send-btn:disabled {
  background: var(--bg-hover);
  color: var(--text-soft);
}
.send-btn:disabled::after { opacity: 0; }
[data-theme="dark"] .send-btn:disabled {
  background: var(--bg-hover);
  color: var(--text-soft);
}


/* =========================================================================
   48. ADMIN PANEL — layout
   ========================================================================= */
.admin-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 100;
}

.admin {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100dvh;
  width: 100%;
  background: var(--bg);
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: var(--s-3);
  gap: var(--s-3);
  height: 100dvh;
  overflow: hidden;
}

.brand-stack { display: flex; flex-direction: column; line-height: 1.2; }
.brand-role {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-1) 0;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-2);
  font-size: 14px;
  color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
  text-align: left;
  min-height: 36px;
}
.admin-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.admin-nav-btn.is-active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 500;
}

.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: var(--topbar-h);
  padding: 0 var(--s-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0;
}
.admin-topbar .icon-btn:last-child { margin-left: auto; }


/* =========================================================================
   49. ADMIN — TABS
   ========================================================================= */
.admin-tab {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: var(--s-6);
}
.admin-tab.is-active {
  display: block;
  animation: fade-in var(--t-base);
}


/* =========================================================================
   50. STAT CARDS
   ========================================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-3);
  max-width: 1200px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.stat-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stat-card-wide {
  grid-column: 1 / -1;
  margin-top: var(--s-3);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.model-breakdown {
  margin-top: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.model-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.model-row-name { color: var(--text); font-weight: 500; }
.model-row-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: var(--r-full);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 320ms ease;
}


/* =========================================================================
   51. CHAT BROWSER
   ========================================================================= */
.chat-browser {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 0;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--bg-elev);
  max-width: 1400px;
  margin: 0 auto;
  min-height: 480px;
}

.chat-browser-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
}

.chat-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
  position: sticky;
  top: 0;
  z-index: 1;
}
.chat-list-count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  min-height: 28px;
  gap: 6px;
}

/* Delete button per row */
.chat-list-item-del {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}
.chat-list-item:hover .chat-list-item-del,
.chat-list-item.is-active .chat-list-item-del { opacity: 1; }
.chat-list-item-del:hover {
  background: rgba(179, 38, 30, 0.12);
  color: var(--danger);
}

.chat-list { display: flex; flex-direction: column; }

.chat-list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color var(--t-fast);
}
.chat-list-item:hover { background: var(--bg-hover); }
.chat-list-item.is-active { background: var(--bg-hover); }

.chat-list-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.chat-list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.chat-list-item-time {
  font-size: 11.5px;
  color: var(--text-soft);
  white-space: nowrap;
}
.chat-list-item-snippet {
  font-size: 12.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-list-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 2px;
}

/* Author block at the top of every chat row */
.chat-list-item-author {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.chat-list-item-pic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}
.chat-list-item-pic-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.chat-list-item-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-list-item-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-list-item-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tier pill (PRO / FREE / ANON) */
.tier-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 9999px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.tier-pill.is-pro {
  background: linear-gradient(135deg, #4f8cff, #c8cad6);
  color: #fff;
  border-color: transparent;
}
.tier-pill.is-anon {
  color: var(--text-soft);
  background: transparent;
}
.tier-pill.is-owner {
  background: linear-gradient(135deg, #d8dae2, #cccfd9);
  color: #1a0d0d;
  border-color: transparent;
}
.tier-pill.is-admin {
  background: rgba(190, 194, 205, 0.16);
  color: #cdd0da;
  border-color: rgba(190, 194, 205, 0.3);
}
.tier-pill.is-banned-pill {
  background: rgba(179, 38, 30, 0.18);
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.3);
}
.tier-pill.is-top {
  background: linear-gradient(135deg, #4f8cff, #c8cad6);
  color: #fff;
  border-color: transparent;
}
.tier-pill.is-free {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.16);
}
.tier-pill.is-tool {
  background: linear-gradient(135deg, rgba(202, 206, 216, 0.22), rgba(255, 88, 88, 0.18));
  color: #ff9d8a;
  border-color: rgba(202, 206, 216, 0.32);
}

.user-action-top.is-top {
  background: linear-gradient(135deg, color-mix(in srgb, #4f8cff 22%, transparent), color-mix(in srgb, #c8cad6 22%, transparent));
  color: #c8cad6;
  border-color: rgba(208, 92, 255, 0.4);
}

/* Session policy modal */
.sp-section { margin: 4px 0; }
.sp-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.sp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.sp-opt {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.sp-opt input { display: none; }
.sp-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.sp-opt-wide { grid-column: 1 / -1; }
.sp-opt-wide span { display: flex; align-items: center; gap: 8px; width: 100%; }
.sp-opt-wide input[type="number"] {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  font-size: 12.5px;
  display: inline-block !important;
}
.sp-opt-infinite:has(input:checked) {
  border-color: rgba(216, 220, 229, 0.5);
  background: rgba(216, 220, 229, 0.12);
  color: #d8dae2;
}



/* Owner pill in model dropdown */
.model-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.pro-pill.is-owner-pill {
  background: linear-gradient(135deg, #d8dae2, #cccfd9);
  color: #1a0d0d;
}

/* Admin row in admins tab */
.owner-card { margin-bottom: 14px; }
.admins-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
}
.admin-row-owner {
  border-color: rgba(216, 220, 229, 0.3);
  background: linear-gradient(135deg, color-mix(in srgb, #d8dae2 8%, var(--bg-elev)), var(--bg-elev));
}
.admin-row-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--bg-hover);
  color: var(--text);
  flex-shrink: 0;
}
.admin-row-icon.owner {
  background: linear-gradient(135deg, #d8dae2, #cccfd9);
}
.admin-row-text { flex: 1; min-width: 0; }
.admin-row-email {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-row-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-top: 2px;
}

.user-action-admin.is-admin {
  background: rgba(190, 194, 205, 0.15);
  color: #cdd0da;
  border-color: rgba(190, 194, 205, 0.35);
}

/* Detail header user card */
.chat-detail-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.chat-detail-pic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}
.chat-detail-pic-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
}
.chat-detail-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-detail-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.chat-detail-email {
  font-size: 12.5px;
  color: var(--text-muted);
}
.meta-dot { opacity: 0.5; }
.mono { font-family: var(--font-mono); }

.chat-detail {
  overflow-y: auto;
  padding: var(--s-5);
}
.chat-detail-head { margin-bottom: var(--s-4); }
.chat-detail-title { font-size: 15px; font-weight: 600; color: var(--text); }
.chat-detail-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.chat-detail-msgs { display: flex; flex-direction: column; gap: var(--s-4); }

.chat-msg {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 10px 14px;
  background: var(--bg);
}
.chat-msg-user { background: var(--bg-bubble); }
.chat-msg-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.chat-msg-body {
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg-images {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: normal;
}


/* =========================================================================
   52. SETTINGS / DANGER
   ========================================================================= */
.settings-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-5);
}
.settings-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.settings-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 var(--s-4);
  line-height: 1.55;
}
.settings-sub code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-hover);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.settings-msg {
  font-size: 13px;
  min-height: 18px;
  color: var(--text-muted);
}
.settings-msg.is-error   { color: var(--danger); }
.settings-msg.is-success { color: var(--success); }
.settings-meta {
  margin-top: var(--s-3);
  font-size: 12px;
  color: var(--text-soft);
}

.danger-card {
  border-color: rgba(179, 38, 30, 0.25);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}
.btn-danger:hover:not(:disabled) { filter: brightness(0.93); }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }


/* =========================================================================
   53. TOAST positioning override (admin uses bottom-center via .toast-host)
   ========================================================================= */
#toast-host { z-index: 200; }


/* =========================================================================
   54. ANIMATIONS — Gemini-style polish
   ========================================================================= */
@keyframes stagger-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.suggestions .pill {
  animation: stagger-in 360ms ease both;
}
.suggestions .pill:nth-child(1) { animation-delay: 60ms; }
.suggestions .pill:nth-child(2) { animation-delay: 120ms; }
.suggestions .pill:nth-child(3) { animation-delay: 180ms; }
.suggestions .pill:nth-child(4) { animation-delay: 240ms; }

.pill {
  transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.pill:hover {
  transform: translateY(-1px);
}

.welcome-title {
  animation: stagger-in 400ms ease both;
}

.welcome-inner {
  animation: fade-in 320ms ease;
}

.composer:focus-within {
  box-shadow: 0 0 0 3px var(--accent-soft);
}


/* =========================================================================
   55. ADMIN — RESPONSIVE
   ========================================================================= */
@media (max-width: 1024px) {
  .chat-browser {
    grid-template-columns: 280px 1fr;
  }
}

@media (max-width: 768px) {
  .admin {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 84%;
    max-width: 320px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: var(--shadow-3);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-tab { padding: var(--s-3); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 22px; }

  .chat-browser {
    display: block;
    height: auto;
    min-height: 0;
    border: 0;
    background: transparent;
  }
  .chat-browser-list {
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    margin-bottom: var(--s-3);
    background: var(--bg-elev);
    max-height: 60vh;
    overflow-y: auto;
  }
  /* Bigger, full-width tap targets on touch */
  .chat-list-item {
    min-height: 64px;
    -webkit-tap-highlight-color: rgba(190, 194, 205,0.15);
    touch-action: manipulation;
    cursor: pointer;
  }
  .chat-list-item:active { background: var(--bg-active, rgba(190, 194, 205,0.1)); }
  .chat-detail {
    padding: var(--s-3);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    background: var(--bg-elev);
  }

  .composer-row { gap: 6px; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: var(--s-3); }
  .stat-value { font-size: 20px; }
}


/* =========================================================================
   57. LANDING — base body
   ========================================================================= */
.landing-body {
  overflow-y: auto !important;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
}


/* =========================================================================
   58. CURSOR SPOTLIGHT
   ========================================================================= */
.cursor-spot {
  position: fixed;
  top: 0; left: 0;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  pointer-events: none;
  background: radial-gradient(circle at center,
              rgba(106, 160, 255, 0.18) 0%,
              rgba(208, 92, 255, 0.10) 35%,
              transparent 70%);
  z-index: 5;
  transition: width 200ms ease, height 200ms ease, opacity 200ms ease;
  opacity: 0.85;
  mix-blend-mode: screen;
  filter: blur(8px);
  will-change: transform;
}
.cursor-spot.is-active {
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  opacity: 1;
}
@media (pointer: coarse) {
  .cursor-spot { display: none; }
}
[data-theme="light"] .cursor-spot {
  background: radial-gradient(circle at center,
              rgba(106, 160, 255, 0.10) 0%,
              rgba(208, 92, 255, 0.06) 35%,
              transparent 70%);
}


/* =========================================================================
   59. LANDING NAV
   ========================================================================= */
.ln-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.ln-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ln-logo-mark {
  display: inline-flex;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f8cff 0%, #9a9ca8 50%, #c8cad6 100%);
  color: #fff;
}
.ln-logo-text { font-size: 16px; }
.ln-nav-links { display: flex; gap: 4px; margin-left: 16px; }
.ln-link {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
  will-change: transform;
}
.ln-link:hover, .ln-link.is-active { background: var(--bg-hover); color: var(--text); }
.ln-nav-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 768px) {
  .ln-nav { padding: 10px 16px; }
  .ln-nav-links { display: none; }
}


/* =========================================================================
   60. LANDING BUTTONS
   ========================================================================= */
.ln-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
  will-change: transform;
  white-space: nowrap;
}
.ln-btn-primary {
  background: linear-gradient(135deg, #4f8cff 0%, #9a9ca8 50%, #c8cad6 100%);
  color: #fff;
  position: relative;
  box-shadow: 0 4px 14px rgba(138, 92, 255, 0.35);
}
.ln-btn-primary:hover { box-shadow: 0 6px 22px rgba(208, 92, 255, 0.5); }
.ln-btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.ln-btn-ghost:hover { background: var(--bg-hover); }
.ln-btn-lg { padding: 14px 24px; font-size: 15px; }
.ln-btn-block { width: 100%; }


/* =========================================================================
   61. HERO
   ========================================================================= */
.hero {
  position: relative;
  padding: 80px 28px 100px;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
}
.hero-mesh {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  filter: blur(50px) saturate(1.2);
  opacity: 0.7;
  animation: hero-drift 24s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.05); }
}
.hero-orbit {
  position: absolute;
  bottom: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  max-width: 140%;
  opacity: 0.45;
  pointer-events: none;
  animation: orbit-spin 60s linear infinite;
}
.hero-orbit .orbit-core { filter: drop-shadow(0 0 24px rgba(138, 92, 255, 0.5)); }
@keyframes orbit-spin {
  to { transform: translateX(-50%) rotate(360deg); }
}
.hero-inner { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.hero-pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f8cff, #c8cad6);
  box-shadow: 0 0 8px rgba(138, 92, 255, 0.7);
}
.hero-title {
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0 0 24px;
  color: var(--text);
}
.hero-grad {
  background: linear-gradient(135deg, #4f8cff 0%, #9a9ca8 50%, #c8cad6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
/* Mobile: real GSI button mount points */
.gsi-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gsi-wrap > div {
  /* Google's button uses iframe; let it size naturally */
  display: inline-block !important;
}

.signin-fallback {
  margin-top: 28px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.signin-fallback-msg { font-size: 13px; color: var(--text-muted); margin: 0; }
.g-hidden { position: absolute; opacity: 0; pointer-events: none; }


/* =========================================================================
   62. SECTION HEADERS
   ========================================================================= */
.ln-section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 12px;
  color: var(--text);
}
.ln-section-sub {
  text-align: center;
  font-size: clamp(14px, 1.4vw, 16px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 60px;
}
.ln-section-sub em {
  background: linear-gradient(135deg, #4f8cff 0%, #c8cad6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}


/* =========================================================================
   63. FEATURES GRID
   ========================================================================= */
.ln-features { padding: 100px 28px; position: relative; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.feature-card {
  position: relative;
  padding: 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  will-change: transform;
}
.feature-card:hover {
  border-color: color-mix(in srgb, var(--c, #6aa0ff) 50%, var(--border));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.feature-icon {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c, #6aa0ff) 16%, transparent);
  color: var(--c, #6aa0ff);
  margin-bottom: 16px;
  transition: transform var(--t-fast);
}
.feature-card:hover .feature-icon { transform: scale(1.08) rotate(-3deg); }
.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 6px;
  color: var(--text);
}
.feature-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}


/* =========================================================================
   64. HOW STEPS
   ========================================================================= */
.ln-how { padding: 80px 28px; }
.how-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}
.how-step {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  transition: transform 200ms ease, border-color 200ms ease;
}
.how-step:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.how-num {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #4f8cff, #c8cad6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.how-step h3 { font-size: 18px; margin: 0 0 6px; color: var(--text); font-weight: 600; }
.how-step p { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.55; }


/* =========================================================================
   65. ABOUT
   ========================================================================= */
.ln-about { padding: 80px 28px; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
}
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }
.about-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
}
.about-card h3 { font-size: 20px; margin: 0 0 8px; color: var(--text); }
.about-card p { font-size: 14px; color: var(--text-muted); margin: 0 0 16px; }
.about-card-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-hover);
  margin-bottom: 16px;
}
.about-id-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}
.about-id-value { font-size: 16px; color: var(--text); font-weight: 600; }


/* =========================================================================
   66. CTA
   ========================================================================= */
.ln-cta { padding: 100px 28px; }
.cta-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 56px 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, #4f8cff 18%, var(--bg-elev)) 0%, color-mix(in srgb, #c8cad6 18%, var(--bg-elev)) 100%);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: "";
  position: absolute;
  inset: -50% -10%;
  background: radial-gradient(closest-side, rgba(138, 92, 255, 0.25), transparent);
  pointer-events: none;
}
.cta-card h2 {
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text);
}
.cta-card p { color: var(--text-muted); margin: 0 0 24px; font-size: 15px; }


/* =========================================================================
   67. FOOTER
   ========================================================================= */
.ln-footer {
  padding: 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.ln-foot-row {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ln-foot-links { display: flex; gap: 16px; }
.ln-foot-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.ln-foot-links a:hover { color: var(--text); }


/* =========================================================================
   68. SCROLL REVEAL
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }


/* =========================================================================
   69. PRICING PAGE
   ========================================================================= */
.pricing-hero {
  position: relative;
  padding: 80px 28px 40px;
  text-align: center;
  overflow: hidden;
}
.pricing-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 14px 0 12px;
  color: var(--text);
}
.pricing-sub {
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 28px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}
.price-card {
  position: relative;
  padding: 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.price-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.price-card-pro {
  background: linear-gradient(170deg, color-mix(in srgb, #6aa0ff 14%, var(--bg-elev)) 0%, color-mix(in srgb, #c8cad6 14%, var(--bg-elev)) 100%);
  border-color: color-mix(in srgb, #c8cad6 28%, var(--border));
  overflow: hidden;
}
.price-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(closest-side, rgba(208, 92, 255, 0.18), transparent);
  pointer-events: none;
  z-index: 0;
}
.price-card > * { position: relative; z-index: 1; }
.price-tag {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #4f8cff, #c8cad6);
  color: #fff;
  z-index: 2;
}
.price-head { margin-bottom: 24px; }
.price-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.price-name svg { color: #c8cad6; }
.price-amount {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 8px;
}
.price-period { font-size: 13px; color: var(--text-muted); }
.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}
.price-features li.muted { color: var(--text-soft); text-decoration: line-through; }
.price-features .check {
  display: inline-flex;
  width: 20px; height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, #34d399 20%, transparent);
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.price-features .check.muted { background: var(--bg-hover); color: var(--text-soft); }


/* =========================================================================
   70. FAQ
   ========================================================================= */
.pricing-faq { padding: 60px 28px 100px; max-width: 800px; margin: 0 auto; }
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 40px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  background: var(--bg-elev);
  transition: border-color var(--t-fast);
}
.faq-item:hover { border-color: var(--border-strong); }
.faq-item summary {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--text-muted);
  transition: transform 200ms ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}


/* =========================================================================
   71. CHAT — user card in sidebar foot
   ========================================================================= */
.user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-card-pic {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* =========================================================================
   72. PRO PILL (model picker)
   ========================================================================= */
.pro-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #4f8cff, #c8cad6);
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}


/* =========================================================================
   73. UPGRADE MODAL
   ========================================================================= */
.upgrade-card { max-width: 380px; }
.upgrade-icon {
  width: 64px; height: 64px;
  margin: 0 auto;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, #4f8cff 28%, var(--bg)), color-mix(in srgb, #c8cad6 28%, var(--bg)));
  color: var(--text);
}
.tg-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-hover);
  margin: 12px 0;
}
.tg-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.tg-card-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}
.tg-card-value { color: var(--text); font-weight: 500; }
.tg-card-value.muted { color: var(--text-soft); font-weight: 400; }
.upgrade-actions { display: flex; flex-direction: column; gap: 8px; }
.upgrade-cancel { align-self: center; margin-top: 4px; font-size: 13px; }
.tg-hint { font-size: 11.5px; color: var(--text-soft); }


/* =========================================================================
   74. RESPONSIVE — landing tweaks
   ========================================================================= */
@media (max-width: 768px) {
  .hero { padding: 60px 20px 80px; }
  .ln-features, .ln-how, .ln-about, .ln-cta { padding: 60px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; padding: 30px 20px 60px; }
  .ln-section-sub { margin-bottom: 36px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .ln-btn { width: 100%; }
  .ln-nav-cta .ln-btn-ghost { display: none; }
}


/* =========================================================================
   76. PASSWORD GATE PAGE
   ========================================================================= */
.pw-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.pw-bg .hero-mesh { animation: hero-drift 28s ease-in-out infinite alternate; }

.pw-main {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pw-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.pw-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}
.pw-user img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.pw-user-text { display: flex; flex-direction: column; min-width: 0; }
.pw-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-user-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* =========================================================================
   77. CHAT — admin shortcut in sidebar
   ========================================================================= */
.admin-link {
  background: linear-gradient(135deg, color-mix(in srgb, #4f8cff 16%, transparent), color-mix(in srgb, #c8cad6 16%, transparent));
  color: var(--text) !important;
  border: 1px solid color-mix(in srgb, #c8cad6 24%, var(--border));
}
.admin-link svg { color: #c8cad6; }
.admin-link:hover { background: linear-gradient(135deg, color-mix(in srgb, #4f8cff 24%, transparent), color-mix(in srgb, #c8cad6 24%, transparent)); }


/* =========================================================================
   78. ADMIN — USERS TAB
   ========================================================================= */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 920px;
  margin: 0 auto;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  transition: border-color var(--t-fast);
}
.user-row:hover { border-color: var(--border-strong); }
.user-row-pic {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
}
.user-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-row-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-row-meta {
  font-size: 11.5px;
  color: var(--text-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.user-row-controls { display: flex; align-items: center; gap: 10px; }

.user-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.user-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.user-action-ban:hover {
  background: rgba(179, 38, 30, 0.10);
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.3);
}
.user-action-ban.is-banned {
  background: rgba(179, 38, 30, 0.15);
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.4);
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-active);
  border-radius: 9999px;
  transition: background-color var(--t-fast);
}
.toggle-track::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, #4f8cff, #c8cad6);
}
.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(18px);
}

@media (max-width: 600px) {
  .user-row { flex-wrap: wrap; }
  .user-row-controls { width: 100%; justify-content: space-between; padding-top: 4px; border-top: 1px solid var(--border); margin-top: 6px; }
}


/* =========================================================================
   80. REFRESH MODAL helpers
   ========================================================================= */
.pw-quick-id {
  text-align: center;
  margin: -8px 0 8px;
  font-size: 12px;
  color: var(--text-soft);
}


/* =========================================================================
   82. THEME PICKER
   ========================================================================= */
.theme-picker {
  position: relative;
}
.theme-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 260px;
  padding: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  z-index: 40;
  animation: dropdown-in 160ms ease;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast), background-color var(--t-fast);
  min-height: 64px;
  position: relative;
}
.theme-swatch:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.theme-swatch.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.theme-swatch.is-active::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.theme-swatch-preview {
  display: flex;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.theme-swatch-preview > span {
  flex: 1;
  height: 100%;
}
.theme-swatch-name {
  font-size: 11px;
  color: var(--text);
  text-align: center;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Per-theme swatch preview colors (used inline via inline style on the spans) */


/* =========================================================================
   84. CUSTOM PROPERTIES for animated borders
   ========================================================================= */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}


/* =========================================================================
   85. DUAL CURSOR (ring + glow + blob)
   ========================================================================= */
.cursor-ring,
.cursor-glow,
.cursor-blob {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform, opacity, width, height;
  opacity: 0;
  transition: opacity 200ms ease, width 220ms ease, height 220ms ease, border-color 200ms ease;
}
.cursor-ring {
  width: 26px;
  height: 26px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 75%, transparent);
  border-radius: 50%;
  mix-blend-mode: difference;
}
.cursor-ring.is-active { opacity: 1; }
.cursor-ring.is-hovering { width: 56px; height: 56px; border-color: var(--accent); }
.cursor-ring.is-clicking { transform-origin: center; }
.cursor-glow {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at center,
              color-mix(in srgb, var(--accent) 22%, transparent) 0%,
              transparent 70%);
  filter: blur(20px);
  mix-blend-mode: screen;
}
.cursor-glow.is-active { opacity: 0.9; }
.cursor-blob {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at center,
              rgba(106, 160, 255, 0.16) 0%,
              rgba(208, 92, 255, 0.10) 35%,
              transparent 70%);
  filter: blur(30px);
  mix-blend-mode: screen;
}
.cursor-blob.is-hovering { opacity: 1; width: 560px; height: 560px; }

/* hide on touch */
@media (pointer: coarse) {
  .cursor-ring, .cursor-glow, .cursor-blob { display: none; }
}
/* light-theme tweaks (multiply blend reads better) */
[data-theme="light"] .cursor-glow,
[data-theme="solarized"] .cursor-glow {
  mix-blend-mode: multiply;
  background: radial-gradient(circle at center,
              color-mix(in srgb, var(--accent) 14%, transparent) 0%,
              transparent 70%);
}
[data-theme="light"] .cursor-blob,
[data-theme="solarized"] .cursor-blob {
  mix-blend-mode: multiply;
  background: radial-gradient(circle at center,
              rgba(99, 102, 241, 0.10) 0%,
              rgba(208, 92, 255, 0.06) 35%,
              transparent 70%);
}

/* Hide the legacy single .cursor-spot (replaced by triple-system) */
.cursor-spot { display: none !important; }


/* =========================================================================
   86. SCROLL PROGRESS BAR
   ========================================================================= */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #4f8cff, #9a9ca8, #c8cad6, #cdd0da);
  background-size: 300% 100%;
  animation: gradient-shift 6s ease-in-out infinite;
  z-index: 9998;
  pointer-events: none;
  transition: width 80ms linear;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}


/* =========================================================================
   87. HEADER SHRINK / HIDE on SCROLL
   ========================================================================= */
.ln-nav {
  transition: transform 280ms ease, padding 200ms ease, background-color 200ms ease, border-color 200ms ease;
}
.ln-nav.is-scrolled {
  padding: 10px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom-color: var(--border-strong);
}
.ln-nav.is-hidden { transform: translateY(-100%); }


/* =========================================================================
   88. AURORA + ORBS (richer hero background)
   ========================================================================= */
.aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(35% 50% at 20% 30%, rgba(99, 102, 241, 0.35), transparent 70%),
    radial-gradient(30% 45% at 80% 70%, rgba(208, 92, 255, 0.30), transparent 70%),
    radial-gradient(40% 55% at 50% 50%, rgba(6, 182, 212, 0.20), transparent 70%),
    radial-gradient(25% 40% at 70% 20%, rgba(190, 194, 205, 0.20), transparent 70%);
  filter: blur(60px) saturate(140%);
  opacity: 0.85;
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
.aurora::after {
  animation-duration: 30s;
  animation-direction: alternate-reverse;
  opacity: 0.55;
}
@keyframes aurora-drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-3%, 2%) rotate(2deg); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.7;
  will-change: transform;
}
.orb-1 {
  width: 480px; height: 480px;
  top: -120px; left: 12%;
  background: radial-gradient(circle, rgba(106, 160, 255, 0.55), transparent 65%);
  animation: orb-float-1 9s ease-in-out infinite;
}
.orb-2 {
  width: 540px; height: 540px;
  top: 20%; right: -120px;
  background: radial-gradient(circle, rgba(208, 92, 255, 0.45), transparent 65%);
  animation: orb-float-2 11s ease-in-out infinite;
}
.orb-3 {
  width: 460px; height: 460px;
  bottom: -180px; left: 40%;
  background: radial-gradient(circle, rgba(190, 194, 205, 0.4), transparent 65%);
  animation: orb-float-3 13s ease-in-out infinite;
}
@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(20px, -30px) scale(1.05); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-30px, 20px) scale(1.08); }
}
@keyframes orb-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(10px, -20px) scale(1.04); }
}
[data-theme="light"] .orb,
[data-theme="solarized"] .orb { opacity: 0.45; }

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .hero-grid,
[data-theme="solarized"] .hero-grid {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

.constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}


/* =========================================================================
   89. CONIC ROTATING BORDER (cards on hover)
   ========================================================================= */
.glow-border {
  position: relative;
  isolation: isolate;
}
.glow-border::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle, 0deg),
              transparent 0%,
              color-mix(in srgb, var(--accent) 80%, transparent) 35%,
              rgba(208, 92, 255, 0.7) 50%,
              color-mix(in srgb, var(--accent) 80%, transparent) 65%,
              transparent 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  padding: 1px;
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
  z-index: 1;
}
.glow-border:hover::after {
  opacity: 1;
  animation: angle-spin 4s linear infinite;
}
@keyframes angle-spin {
  to { --angle: 360deg; }
}


/* =========================================================================
   90. CARD SPOTLIGHT (radial that follows the cursor inside the card)
   ========================================================================= */
[data-spotlight] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
[data-spotlight]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--sx, 50%) var(--sy, 50%),
              color-mix(in srgb, var(--accent) 16%, transparent),
              transparent 60%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
  z-index: -1;
}
[data-spotlight]:hover::before { opacity: 1; }


/* =========================================================================
   91. LIQUID BUTTON — animated multi-stop gradient on the primary CTA
   ========================================================================= */
.ln-btn-primary {
  background: linear-gradient(120deg, #4f8cff 0%, #9a9ca8 30%, #c8cad6 60%, #cdd0da 100%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  animation: btn-liquid 9s ease-in-out infinite;
}
@keyframes btn-liquid {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}


/* =========================================================================
   92. RIPPLE on click
   ========================================================================= */
[data-ripple] {
  position: relative;
  overflow: hidden;
}
[data-ripple].rippling::after {
  content: "";
  position: absolute;
  left: var(--ripple-x, 50%);
  top: var(--ripple-y, 50%);
  width: 0; height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ripple 700ms ease-out;
  pointer-events: none;
}
@keyframes ripple {
  to {
    width: 540px;
    height: 540px;
    opacity: 0;
  }
}


/* =========================================================================
   93. BRAND SHIMMER (text gradient sweep)
   ========================================================================= */
[data-shimmer] {
  background: linear-gradient(
              90deg,
              var(--text) 0%,
              color-mix(in srgb, var(--accent) 60%, var(--text)) 25%,
              var(--text) 50%,
              color-mix(in srgb, var(--accent) 60%, var(--text)) 75%,
              var(--text) 100%);
  background-size: 200% 100%;
  background-position: 200% 0;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
[data-shimmer].is-shimmering {
  animation: brand-shimmer 6s ease-in-out infinite;
}
@keyframes brand-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* =========================================================================
   94. REVEAL VARIANTS
   ========================================================================= */
.reveal-up,
.reveal-left,
.reveal-scale,
.reveal-blur {
  opacity: 0;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
              filter   700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity, filter;
}
.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-40px); }
.reveal-scale { transform: scale(0.92); }
.reveal-blur  { filter: blur(14px); transform: translateY(10px); }
.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-scale.is-visible,
.reveal-blur.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}


/* =========================================================================
   95. STAGGER UTILITIES (apply to children of .stagger)
   ========================================================================= */
.stagger > *:nth-child(1) { transition-delay: 60ms; }
.stagger > *:nth-child(2) { transition-delay: 130ms; }
.stagger > *:nth-child(3) { transition-delay: 200ms; }
.stagger > *:nth-child(4) { transition-delay: 270ms; }
.stagger > *:nth-child(5) { transition-delay: 340ms; }
.stagger > *:nth-child(6) { transition-delay: 410ms; }


/* =========================================================================
   96. GRADIENT TEXT with animated shift (for h1 highlights)
   ========================================================================= */
.text-grad-anim {
  background: linear-gradient(115deg,
              #6aa0ff 0%,
              #9a9ca8 25%,
              #c8cad6 50%,
              #06b6d4 75%,
              #6aa0ff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: text-grad-shift 10s ease-in-out infinite;
}
@keyframes text-grad-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}


/* =========================================================================
   97. INPUT focus glow
   ========================================================================= */
.input:focus,
.input-wrap input:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}


/* =========================================================================
   98. RESPECT REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after,
  .orb-1, .orb-2, .orb-3,
  .scroll-progress,
  [data-shimmer],
  .text-grad-anim,
  .glow-border:hover::after { animation: none !important; }
  .reveal-up, .reveal-left, .reveal-scale, .reveal-blur {
    opacity: 1; transform: none; filter: none;
  }
}


/* =========================================================================
   100. HERO AVATAR MARK (big PNG with pulsing rings)
   ========================================================================= */
.hero-avatar-mark {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 28px;
  border-radius: 50%;
  overflow: visible;
  background: var(--bg-elev);
  isolation: isolate;
  animation: avatar-pulse 4.4s ease-in-out infinite;
}
.hero-avatar-mark img,
.hero-avatar-mark .avatar-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow:
    0 0 50px rgba(208, 92, 255, 0.32),
    0 0 100px rgba(106, 160, 255, 0.18),
    inset 0 0 24px rgba(208, 92, 255, 0.12);
  position: relative;
  z-index: 1;
}
.hero-avatar-mark::before,
.hero-avatar-mark::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  animation: avatar-ring 3.6s ease-out infinite;
  pointer-events: none;
  z-index: 0;
}
.hero-avatar-mark::after { animation-delay: 1.8s; }
@keyframes avatar-pulse {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes avatar-ring {
  0%   { transform: scale(1);   opacity: 0.7; }
  80%  { opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-avatar-mark, .hero-avatar-mark::before, .hero-avatar-mark::after { animation: none !important; }
}


/* =========================================================================
   101. STREAMING CARET (assistant body cursor)
   ========================================================================= */
/* Ensure caret looks consistent across themes */
.msg-body.is-streaming::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1.05em;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--text)));
  vertical-align: -3px;
  margin-left: 3px;
  border-radius: 1px;
  animation: caret 1s steps(2, start) infinite;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}


/* =========================================================================
   103. BLOCKED PAGE
   ========================================================================= */
.blocked-body { background: #0c0608; }

.blocked-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blocked-aurora {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(40% 55% at 30% 30%, rgba(255, 46, 84, 0.30), transparent 70%),
    radial-gradient(35% 50% at 70% 70%, rgba(208, 92, 255, 0.18), transparent 70%);
  filter: blur(70px) saturate(140%);
  animation: aurora-drift 20s ease-in-out infinite alternate;
}
.blocked-orb { opacity: 0.55; }
.blocked-orb.orb-1 { background: radial-gradient(circle, rgba(255, 46, 84, 0.55), transparent 65%); }
.blocked-orb.orb-2 { background: radial-gradient(circle, rgba(208, 92, 255, 0.40), transparent 65%); }

.blocked-main {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.blocked-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 36px 32px;
  background: color-mix(in srgb, var(--bg-elev) 80%, rgba(0,0,0,0.4));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 94, 98, 0.20);
  border-radius: 22px;
  box-shadow:
    0 0 60px rgba(255, 46, 84, 0.20),
    0 20px 60px rgba(0, 0, 0, 0.5);
}

.blocked-svg {
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 0 24px rgba(255, 46, 84, 0.35));
}

.blocked-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(255, 46, 84, 0.12);
  color: #ff5e62;
  border: 1px solid rgba(255, 46, 84, 0.28);
  margin-bottom: 16px;
}

.blocked-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
  background: linear-gradient(120deg, #ff5e62 0%, #ff2d55 50%, #c8cad6 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.blocked-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.blocked-reason {
  display: inline-block;
  font-size: 13px;
  color: #ff5e62;
  background: rgba(255, 46, 84, 0.08);
  border: 1px solid rgba(255, 46, 84, 0.22);
  padding: 8px 14px;
  border-radius: 10px;
  margin: 0 0 20px;
}

.blocked-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.blocked-foot {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-soft);
}


/* =========================================================================
   105. 404 PAGE
   ========================================================================= */
.page-404 {
  position: relative;
  min-height: calc(100dvh - 60px);
  padding: 80px 28px 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.page-404-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 80%, transparent 100%);
}
.page-404-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Floating decorative shapes */
.floating-shape {
  position: absolute;
  pointer-events: none;
  opacity: 0.45;
  animation: shape-float 7s ease-in-out infinite;
}
.floating-shape:nth-of-type(1) { top: 8%;  left: 10%; animation-duration: 8s; }
.floating-shape:nth-of-type(2) { top: 12%; right: 14%; animation-duration: 9.5s; animation-delay: -2s; }
.floating-shape:nth-of-type(3) { bottom: 16%; left: 12%; animation-duration: 7.5s; animation-delay: -4s; }
.floating-shape:nth-of-type(4) { bottom: 10%; right: 18%; animation-duration: 10s; animation-delay: -1s; }
.floating-shape:nth-of-type(5) { top: 50%; left: 50%; transform: translate(-50%, -50%); animation-duration: 12s; opacity: 0.18; }
@keyframes shape-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(6deg); }
}
.floating-shape:nth-of-type(5) {
  /* keep centered */
  animation-name: shape-float-center;
}
@keyframes shape-float-center {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50%      { transform: translate(-50%, -50%) rotate(20deg); }
}

/* Big 4 0 4 digits */
.page-404-digits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 18px);
  margin: 24px 0 18px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.9;
}
.page-404-digits .digit {
  font-size: clamp(96px, 18vw, 200px);
  background: linear-gradient(135deg, #6aa0ff 0%, #9a9ca8 30%, #c8cad6 60%, #cdd0da 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(138, 92, 255, 0.35));
  display: inline-block;
  transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.page-404-digits .digit:nth-child(1) { animation: digit-pop 800ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.page-404-digits .digit:nth-child(2) { animation: digit-pop 800ms 120ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.page-404-digits .digit:nth-child(3) { animation: digit-pop 800ms 240ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.page-404-digits .digit:hover { transform: translateY(-6px) scale(1.05); }
@keyframes digit-pop {
  0%   { opacity: 0; transform: translateY(40px) scale(0.7); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.page-404-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 8px 0 12px;
  color: var(--text);
}
.page-404-text {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 28px;
  min-height: 24px;
}
.page-404-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  vertical-align: -3px;
  margin-left: 3px;
  animation: caret 1s steps(2, start) infinite;
  border-radius: 1px;
}

.page-404-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}

.page-404-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
}
.page-404-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.page-404-links a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .page-404-digits .digit, .floating-shape { animation: none !important; }
}


/* =========================================================================
   105b. VOICE PROVIDER PICKER (Gemini Live vs GPT Realtime)
   ========================================================================= */
.voice-provider-pick {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 140ms ease;
}
.voice-provider-pick .vpp-card {
  width: min(360px, calc(100vw - 32px));
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: dropdown-in 180ms ease;
}
.voice-provider-pick .vpp-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.voice-provider-pick .vpp-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}
.voice-provider-pick .vpp-seg {
  display: flex;
  gap: 6px;
}
.voice-provider-pick .vpp-seg-btn {
  flex: 1;
  padding: 11px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.voice-provider-pick .vpp-seg-btn:hover { background: var(--bg-hover); }
.voice-provider-pick .vpp-seg-btn.is-on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.voice-provider-pick .vpp-start {
  margin-top: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border-radius: var(--r-2);
  background: var(--accent);
}
.voice-provider-pick .vpp-start:hover { filter: brightness(1.08); }
.voice-provider-pick .vpp-cancel {
  padding: 8px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: var(--r-2);
}
.voice-provider-pick .vpp-cancel:hover { background: var(--bg-hover); color: var(--text); }

/* In-session voice (male/female) toggle in the inline strip. */
.vi-gender .vi-gender-icon { font-size: 16px; line-height: 1; font-weight: 700; }
.vi-gender.is-female { color: var(--accent); }

/* =========================================================================
   107. TG LINK + CONTEXT PILL + DICTATE
   ========================================================================= */
.tg-code-wrap {
  margin: 4px 0 10px;
  text-align: center;
}
.tg-code-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text);
  background: var(--bg-elev);
  padding: 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  user-select: all;
}

.ctx-pill {
  margin: 0 auto 8px;
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
}
.ctx-pill:hover { background: var(--bg-hover); color: var(--text); }
.ctx-pill.is-warn { color: #ff9d3d; border-color: rgba(255, 157, 61, 0.5); }

.ctx-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elev);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.ctx-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a8aff, #8a3aff);
  transition: width var(--t-fast);
}

#dictate-btn.is-recording {
  color: #ff4a5b;
  animation: pulse-rec 1.2s ease-in-out infinite;
}
#dictate-btn.is-transcribing { opacity: 0.5; }
@keyframes pulse-rec {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* =========================================================================
   108. END
   ========================================================================= */
/* nothing after this — keep last */

/* ============================================================
   1.77 — slash autocomplete, thought stream, 3D orb, polish
   ============================================================ */

/* Slash-command hint panel above the composer */
#slash-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: color-mix(in srgb, var(--bg-elev) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  z-index: 40;
  animation: dropdown-in 140ms ease;
}
.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}
.slash-item.is-active { background: var(--bg-hover); }
.slash-ico { font-size: 16px; width: 22px; text-align: center; }
.slash-cmd { font-weight: 600; letter-spacing: 0.2px; }
.slash-desc {
  color: var(--text-dim, rgba(255,255,255,0.55));
  font-size: 12.5px;
  margin-left: auto;
}

/* Reasoning ticker for thinking models */
.thought-stream {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.5;
  color: var(--text-dim, rgba(255,255,255,0.5));
  animation: thought-in 300ms ease;
}
.thought-icon {
  flex-shrink: 0;
  animation: thought-pulse 1.6s ease-in-out infinite;
}
.thought-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@keyframes thought-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes thought-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Streaming caret — brand glow instead of a plain block */
.msg-body.is-streaming::after {
  background: linear-gradient(180deg, #ff8a3c, #7a5cff);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(204, 208, 218, 0.55);
}

/* Ambient breathing for the chat backdrop glow — very slow, very subtle */
@keyframes ambient-drift {
  0%, 100% { opacity: 0.85; transform: translateX(0) scale(1); }
  50%      { opacity: 1;    transform: translateX(2%) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .thought-icon { animation: none; }
  #slash-menu { animation: none; }
}

/* Pending reference-video chip (video-to-video) */
.attach-thumb-video { position: relative; }
.attach-thumb-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.attach-video-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 11px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}
