/* ============================================================
   MikuOS — AAA gate + chat (aligned with nucleus-tokens / corp)
   ============================================================ */

:root {
  /* ── Deep Obsidian Navy — luxury palette ── */
  --bg-primary: #05070D;    /* Near black with a hint of blue */
  --bg-secondary: #0A0E17;  /* Slightly lighter — sidebars */
  --bg-tertiary: #111726;   /* Cards and hover states */
  --glow-accent: #2563EB;   /* Crisp royal/electric blue */
  --glow-accent-soft: rgba(37, 99, 235, 0.15);
  --accent-glow-strong: rgba(37, 99, 235, 0.35);
  --glow-accent-text: #7EA6FF;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --ease-ultra: cubic-bezier(0.16, 1, 0.3, 1);

  /* Legacy tokens remapped onto the obsidian palette */
  --bg: var(--bg-primary);
  --bg-card: rgba(17, 23, 38, 0.72);
  --bg-sidebar: rgba(10, 14, 23, 0.6);
  --bg-input: rgba(17, 23, 38, 0.9);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --purple: #9a3aa0;
  --purple-dim: rgba(154, 58, 160, 0.12);
  --purple-glow: rgba(154, 58, 160, 0.18);
  --blue: #2563EB;
  --green: #39d98a;
  --green-dim: rgba(57, 217, 138, 0.12);
  --green-glow: rgba(57, 217, 138, 0.22);
  --cyan: #7EA6FF;
  --violet: #9a3aa0;
  --magenta: #c048a8;
  --text: #EDF1F9;
  --text-dim: rgba(237, 241, 249, 0.66);
  --text-muted: rgba(237, 241, 249, 0.38);
  --border: var(--border-subtle);
  --danger: #ff4d6d;
  --radius: 8px;
  --radius-lg: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --glide: 150ms ease-out;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  color-scheme: dark;
}

/* Kill native UA chrome — Safari/Chrome paint white button faces otherwise */

button {
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: var(--font);
  appearance: none;
  -webkit-appearance: none;
}

button:focus { outline: none; }

button:focus-visible {
  outline: 1px solid rgba(0, 196, 235, 0.45);
  outline-offset: 2px;
}

input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 1px solid rgba(0, 196, 235, 0.55);
  outline-offset: 3px;
}

input, textarea, select {
  font-family: var(--font);
  appearance: none;
  -webkit-appearance: none;
}

/* Ambient background */

.hidden { display: none !important; }

/* ============================================================
   GATE — brand-first single composition (ad landing)
   ============================================================ */

.gate-hero {
  position: relative;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 48px;
}

.gate-nav {
  width: 100%;
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 2;
}

.gate-nav-brand {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.gate-nav-links {
  display: flex;
  gap: 8px;
}

.gate-nav-link {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}

.gate-nav-link:hover {
  color: var(--text);
  background: rgba(126, 166, 255, 0.08);
  border-color: rgba(126, 166, 255, 0.22);
}

.gate-stage {
  flex: 1;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 0 24px;
  animation: gateIn 0.7s var(--ease-out) both;
}

@keyframes gateIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Soft ambient pulse only — no hard cyan “debug” outline */

.gate-mark-core {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--green);
  color: #000;
  border-radius: 2px;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  border-radius: 50%;
}

.gate-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.gate-lead {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: rgba(237, 241, 249, 0.68);
  max-width: 480px;
  margin-bottom: 28px;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.gate-cta-primary,
.gate-cta-secondary,
.gate-cta-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.gate-cta-primary {
  height: 46px;
  padding: 0 28px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 180ms var(--ease-ultra), box-shadow 180ms var(--ease-ultra);
}

.gate-cta-primary:hover {
  background: linear-gradient(135deg, #4C8DF7 0%, #2F6FED 100%);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.gate-cta-primary.loading .btn-text { display: none; }

.gate-cta-primary .btn-spinner {
  display: none; width: 14px; height: 14px;
  border: 2px solid transparent; border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.gate-cta-primary.loading .btn-spinner { display: block; }

.gate-cta-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0, 196, 235, 0.35);
}

.gate-cta-secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 196, 235, 0.06);
  transform: translateY(-1px);
}

.gate-cta-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.gate-cta-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.035);
}

.gate-note {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  line-height: 1.5;
}

.gate-signup {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-decoration: none;
}

.gate-signup:hover { text-decoration: underline; }

.gate-auth-toggle {
  margin-top: 20px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
}

.gate-auth-toggle:hover {
  color: var(--text-dim);
  border-bottom-color: var(--border);
}

.gate-auth-panel {
  width: 100%;
  max-width: 340px;
  margin-top: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(18, 20, 28, 0.88), rgba(7, 9, 13, 0.72));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: left;
}

/* Legacy login card bits still used by auth panel */

.onboard-card {
  text-align: center;
  padding: 40px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 380px; width: 100%;
}

.onboard-logo {
  position: relative;
  width: 64px; height: 64px;
  margin: 0 auto 20px;
}

.logo-ring {
  position: absolute; inset: 0;
  border: 2px solid var(--purple);
  border-radius: 50%;
  animation: ring-pulse 3s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.logo-core {
  position: absolute; inset: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 24px; font-weight: 700;
  color: var(--bg);
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.onboard-card h1 {
  font-family: var(--mono);
  font-size: 1.6rem; font-weight: 700;
  margin-bottom: 4px;
  color: var(--green);
}

.onboard-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.onboard-form {
  display: flex; flex-direction: column; gap: 14px;
}

.field-group {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
}

.field-label {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted);
}

.onboard-form input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.onboard-form input:focus {
  border-color: #39d98a;
  box-shadow: 0 0 12px rgba(57, 217, 138, 0.1);
}

.onboard-form input::placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.btn-sso-login {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--violet);
  border: none; border-radius: var(--radius);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, background 0.15s;
}

.btn-sso-login:hover {
  background: #b04ab6;
}

.btn-sso-login:active { transform: translateY(0); }

.btn-sso-login.loading .btn-text { display: none; }

.btn-sso-login .btn-spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid transparent; border-top-color: #000; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-sso-login.loading .btn-spinner { display: block; }

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

.sso-divider {
  display: flex; align-items: center; gap: 12px;
}

.sso-divider::before, .sso-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.sso-divider span {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
}

.btn-register-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: 0; padding: 10px 16px;
  color: var(--text-dim); font-family: var(--mono);
  font-size: 0.78rem; cursor: pointer;
  transition: all 0.15s;
}

.btn-register-toggle:hover {
  border-color: var(--green); color: var(--text);
}

.onboard-error {
  font-family: var(--mono); font-size: 0.75rem; color: var(--danger);
  display: none;
  padding: 8px 12px; border-radius: 0;
  border: 1px solid rgba(255, 71, 87, 0.2);
  background: rgba(255, 71, 87, 0.05);
  text-align: left;
}

.onboard-error.visible { display: block; }

.onboard-divider {
  height: 1px; background: var(--border); margin: 20px 0;
}

.btn-guest {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-guest:hover {
  border-color: var(--green); color: var(--text);
}

.onboard-note {
  margin-top: 16px;
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--text-muted); line-height: 1.5;
}

/* Right panel — terminal feed */

.onboard-right {
  flex: 1; display: flex; flex-direction: column;
  background: #020204;
  border-left: 1px solid var(--border);
  padding: 0; overflow: hidden;
}

.terminal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #040408;
}

.terminal-dots {
  display: flex; gap: 6px;
}

.terminal-dots span {
  width: 8px; height: 8px; border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff5f57; }

.terminal-dots span:nth-child(2) { background: #febc2e; }

.terminal-dots span:nth-child(3) { background: #28c840; }

.terminal-title {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-muted); letter-spacing: 0.08em;
}

.terminal-feed {
  flex: 1; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
}

.terminal-line {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text-dim); line-height: 1.6;
  opacity: 0; animation: termFadeIn 0.4s ease forwards;
}

.terminal-line:nth-child(1) { animation-delay: 0.3s; }

.terminal-line:nth-child(2) { animation-delay: 0.8s; }

.terminal-line:nth-child(3) { animation-delay: 1.3s; }

.terminal-line:nth-child(4) { animation-delay: 1.8s; }

@keyframes termFadeIn { to { opacity: 1; } }

.t-time { color: var(--text-muted); }

.t-ok { color: #39d98a; }

.t-info { color: #B026FF; }

.t-warn { color: #febc2e; }

.terminal-status {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #39d98a;
  box-shadow: 0 0 8px rgba(57, 217, 138, 0.5);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.6; } 50% { opacity: 1; }
}

/* ============================================================
   APP LAYOUT
   ============================================================ */

.app {
  display: flex;
  height: 100vh;
  position: relative; z-index: 1;
}

/* Sidebar — frosted glass over the obsidian backdrop */

.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  border-right: none;
}

.sidebar > * {
  min-width: 260px;
}

/* Floating Expand Button */

.sidebar.collapsed ~ .toggle-sidebar-floating {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.btn-icon {
  background: none; border: none;
  color: var(--text-dim);
  cursor: pointer; padding: 6px;
  border-radius: 0;
  transition: all 0.15s;
}

.btn-icon:hover { color: var(--text); background: var(--bg-hover); }

.sidebar-nav {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-history {
  flex: 1; overflow-y: auto;
  padding: 8px;
}

.sidebar-history::-webkit-scrollbar { width: 4px; }

.sidebar-history::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.history-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.history-delete {
  opacity: 0; background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 2px; flex-shrink: 0; transition: all 0.15s;
}

.history-item:hover .history-delete { opacity: 0.6; }

.history-delete:hover { opacity: 1 !important; color: #ff5555; }

.sidebar-footer-actions {
  display: flex; align-items: center; justify-content: space-between;
}

.user-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: conic-gradient(#00d4ff 0deg, #7EA6FF 120deg, #b744bc 240deg, #00d4ff 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.35;
  pointer-events: none;
}

.avatar-dot {
  position: relative;
  z-index: 1;
  width: 30px; height: 30px;
  background: rgba(10,15,28,0.9);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,212,255,0.2), inset 0 0 0 1px rgba(126,166,255,0.3);
  flex-shrink: 0;
}

.avatar-dot::after {
  content: 'M';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  text-shadow: 0 0 8px rgba(0,212,255,0.8);
}

#display-username {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.tier-badge.pro-tier {
  background: rgba(240,192,64,0.14);
  color: #f0c040;
  border-color: rgba(240,192,64,0.35);
  box-shadow: 0 0 10px rgba(240,192,64,0.15);
}

.tier-badge.admin-tier {
  background: rgba(176,38,255,0.14);
  color: var(--purple);
  border-color: rgba(176,38,255,0.35);
}

.btn-logout {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px;
  color: var(--text-muted); font-family: var(--mono);
  font-size: 0.7rem; cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  border-color: var(--danger); color: var(--danger);
  background: rgba(255, 71, 87, 0.05);
}

/* ============================================================
   CHAT AREA
   ============================================================ */

.chat-area {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
}

/* Empty state */

.logo-core-lg {
  position: absolute; inset: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 24px; font-weight: 700;
  color: var(--bg);
}

/* Messages */

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

.message.assistant .msg-body { color: var(--text); font-family: var(--font); }

.msg-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(196, 141, 232, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--magenta, #c048a8);
}

.msg-body pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

/* ── Tool harness / sandbox command output ─────────────────────────────── */

.tool-cmd {
  margin: 2px 0 8px;
  padding: 8px 12px;
  background: rgba(126, 166, 255, 0.07);
  border: 1px solid rgba(126, 166, 255, 0.18);
  border-left: 2px solid var(--cyan, #7ea6ff);
  border-radius: 8px;
  color: var(--cyan, #7ea6ff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tool-out {
  margin: 0;
  padding: 12px 14px;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #c9d1d9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

.tool-result .msg-body {
  max-width: 100%;
  overflow: hidden;
}

/* ── Code Viewer (scrollable line-numbered code blocks) ──────────────────── */

.code-viewer {
  background: #0a0c10;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}

.cv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cv-lang {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
}

.cv-copy {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.cv-copy:hover { color: var(--cyan); border-color: rgba(0,196,235,0.3); background: rgba(0,196,235,0.06); }

.cv-scroll {
  display: flex;
  max-height: 480px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.cv-scroll::-webkit-scrollbar { width: 6px; height: 6px; }

.cv-scroll::-webkit-scrollbar-track { background: transparent; }

.cv-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.cv-gutter {
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  min-width: 44px;
  text-align: right;
  user-select: none;
  border-right: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.cv-ln {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  color: rgba(255,255,255,0.18);
  padding: 0 10px;
}

.cv-code {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  background: none;
  border: none;
  border-radius: 0;
  overflow: visible;
  min-width: 0;
}

.cv-code code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: #c9d1d9;
  white-space: pre;
  background: none;
  padding: 0;
}

.cv-line { display: block; }

/* Syntax highlighting tokens */

.syn-tag { color: #7ee787; }

.syn-attr { color: #79c0ff; }

.syn-str { color: #a5d6ff; }

.syn-kw { color: #ff7b72; }

.syn-cmt { color: #8b949e; font-style: italic; }

.syn-val { color: #d2a8ff; }

.syn-sel { color: #7ee787; }

.cv-code .syn-cmt { opacity: 0.7; }

/* --purple-dim is a 12% fill (bg accent) — never use it as text color */

.msg-body em {
  color: var(--text-dim, #c4b8d4);
  font-style: italic;
}

.msg-image {
  margin-top: 12px;
  padding-left: 36px;
  position: relative;
  display: inline-block;
}

.msg-image img {
  max-width: 100%;
  max-height: 512px;
  border-radius: 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(196, 141, 232, 0.08);
  cursor: pointer;
  transition: transform 0.2s;
}

.msg-image img:hover {
  transform: scale(1.02);
}

.img-dl-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 2, 4, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.15s, background 0.15s;
}

.msg-image:hover .img-dl-btn {
  opacity: 1;
}

.img-dl-btn:hover {
  color: var(--purple);
  background: rgba(196, 141, 232, 0.12);
  border-color: var(--purple-dim);
}

/* ── Chain-of-thought ("thinking") panel ─────────────────────────────── */

@keyframes reasoning-blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.msg-reasoning summary::-webkit-details-marker {
  display: none;
}

@keyframes reasoning-pulse {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes reasoning-fade { from { opacity: .4; } to { opacity: 1; } }

@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ── Task Harness chain-of-work panel (§6) ─────────────────────── */

.task-rows { display: flex; flex-direction: column; gap: 3px; }

.task-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-2, #b9b2d9);
}

.task-icon { width: 14px; flex-shrink: 0; text-align: center; font-size: 11px; }

.task-msg { word-break: break-word; }

.task-row-done { color: var(--text-3, #8f89a8); text-decoration: none; }

.task-row-done .task-icon { color: var(--green, #3ad07a); }

.task-row-failed .task-icon { color: var(--red, #ff5a5a); }

.task-row-failed .task-msg { color: var(--red, #ff6a6a); }

/* ── Task Harness approval card ─────────────────────────────────── */

.task-approval-card {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 170, 66, 0.35);
  border-radius: 10px;
  background: rgba(255, 170, 66, 0.06);
  font-size: 13px;
}

.task-approval-title {
  margin-bottom: 6px;
  color: var(--orange, #ffae42);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.task-approval-msg { color: var(--text, #eee); word-break: break-word; }

.task-approval-id {
  margin: 4px 0 8px;
  color: var(--text-3, #888);
  font-size: 11px;
  font-family: ui-monospace, Menlo, monospace;
}

.task-approve-btn {
  cursor: pointer;
  background: var(--green, #3ad07a);
  color: #061;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
}

.task-deny-btn {
  cursor: pointer;
  background: transparent;
  color: var(--red, #ff5a5a);
  border: 1px solid var(--red, #ff5a5a);
  border-radius: 6px;
  padding: 5px 14px;
}

.task-approve-btn:disabled, .task-deny-btn:disabled { opacity: 0.5; cursor: default; }

.task-approval-status { margin-top: 8px; color: var(--text-3, #888); font-size: 12px; }

/* ── Attach / upload bar ───────────────────────────────────── */

.attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.attach-btn:hover {
  color: var(--purple);
  background: rgba(176, 38, 255, 0.08);
}

.attach-btn.has-file {
  color: var(--green);
}

.mic-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.mic-btn:hover:not(.locked):not(:disabled) {
  color: var(--green);
  background: rgba(57, 217, 138, 0.08);
}

.mic-btn.recording {
  color: #ff4d6d;
  border-color: #ff4d6d;
  animation: micPulse 1s ease-in-out infinite;
}

.mic-btn.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.mic-btn:disabled {
  opacity: 0.4;
  cursor: wait;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(255, 77, 109, 0); }
}

.voice-hint {
  margin: 6px 0 0;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  min-height: 1em;
}

.voice-hint.warn { color: #f0c040; }

.voice-hint.err { color: #ff4d6d; }

.msg-speak-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid #444;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.msg-speak-btn:hover:not(:disabled) {
  color: var(--green);
  border-color: var(--green);
}

.msg-speak-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.msg-speak-btn.playing {
  color: var(--purple);
  border-color: var(--purple);
}

.msg-speak-btn.locked {
  opacity: 0.35;
}

.attach-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}

.attach-bar:focus-within {
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(0, 212, 255, 0.05);
}

.attach-bar.hidden { display: none; }

.attach-file-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.attach-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  color: rgba(0, 212, 255, 0.85);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.22);
}

.attach-filename {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.attach-clear:hover {
  color: #ff5a5a;
  background: rgba(255, 90, 90, 0.1);
}

.attach-modes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.attach-mode-chip:hover:not(:disabled) {
  border-color: var(--purple);
  color: var(--text);
}

.attach-mode-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.attach-mode-chip.locked::after {
  content: ' ⌃';
  opacity: 0.7;
}

.attach-run-btn:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

.attach-run-btn:not(:disabled):hover { opacity: 0.9; }

.msg-attach-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid rgba(57, 217, 138, 0.35);
  padding: 2px 8px;
  margin-bottom: 8px;
}

/* ── Send — circular arrow-up ───────────────────────────────── */

.send-btn svg { stroke: currentColor; }

/* ── Model Selector (Fast ▾) ────────────────────────────────── */

.model-selector {
  position: relative;
  flex-shrink: 0;
  align-self: center;
}

.model-selector-btn:focus-visible {
  outline: none;
  border-color: var(--green);
}

.model-selector-chevron {
  stroke: currentColor;
  transition: transform 0.18s ease;
}

.model-selector-btn[aria-expanded="true"] .model-selector-chevron {
  transform: rotate(180deg);
}

.model-dropdown.open {
  display: block;
  animation: modelDropIn 0.16s ease;
}

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

.model-option.locked .model-option-name,
.model-option.locked .model-option-desc {
  color: var(--text-muted);
}

.model-option.locked {
  opacity: 0.55;
  cursor: pointer;
}

.model-option:not(.locked) .model-option-upgrade {
  display: none;
}

/* Thinking toggle (Heavy mode only) */

.thinking-toggle.active .thinking-check {
  opacity: 1;
}

.thinking-toggle.active .thinking-label {
  color: var(--green);
}

/* ── Video Message ───────────────────────────────────────────── */

.msg-video {
  max-width: 480px;
  margin: 10px 0;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(12,16,24,0.92), rgba(7,10,16,0.96));
  border: 1px solid rgba(0,212,255,0.22);
  box-shadow: 0 12px 34px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.msg-video-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

.msg-video-head::after,
.msg-game-head::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(105deg, transparent 0%, rgba(0,212,255,0.10) 45%, rgba(255,255,255,0.10) 55%, transparent 100%);
  transform: skewX(-12deg);
  animation: agentic-sheen 2.6s ease-in-out infinite;
  pointer-events: none;
}

.msg-video-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono, ui-monospace, 'JetBrains Mono', monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(232,246,244,0.85);
  text-transform: uppercase;
}

.msg-video-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d4ff;
  box-shadow: 0 0 8px rgba(0,212,255,0.7);
  animation: muIdleBreath 2.6s ease-in-out infinite;
}

.msg-video-tag {
  font-family: var(--font-mono, ui-monospace, 'JetBrains Mono', monospace);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(0,212,255,0.55);
  text-transform: uppercase;
}

.msg-video-stage {
  position: relative;
  padding: 10px;
  background: radial-gradient(circle at 50% 20%, rgba(0,212,255,0.05), transparent 60%), #06080d;
}

.msg-video-stage video {
  width: 100%;
  display: block;
  border-radius: 10px;
  background: #000;
}

/* Game artifact card — playable sandboxed iframe, same glass frame as video */
.msg-game {
  max-width: 520px;
  margin: 10px 0;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(12,16,24,0.92), rgba(7,10,16,0.96));
  border: 1px solid rgba(0,212,255,0.22);
  box-shadow: 0 12px 34px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.msg-game-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

.msg-game-head .msg-video-tag { margin-right: auto; }

.game-restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, ui-monospace, 'JetBrains Mono', monospace);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232,246,244,0.7);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.game-restart-btn:hover {
  color: #fff;
  border-color: rgba(0,212,255,0.5);
  background: rgba(0,212,255,0.08);
}

.msg-game-stage {
  position: relative;
  padding: 10px;
  background: radial-gradient(circle at 50% 20%, rgba(0,212,255,0.05), transparent 60%), #06080d;
}

.game-frame {
  width: 100%;
  height: 340px;
  display: block;
  border: none;
  border-radius: 10px;
  background: #000;
}

.msg-game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.agentic-game.pending {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,212,255,0.04);
  color: rgba(232,246,244,0.8);
  font-size: 12px;
}

/* Custom video player — play overlay */
.mv-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,0.55);
  background: radial-gradient(circle at 35% 32%, rgba(0,212,255,0.3), rgba(0,212,255,0.08) 70%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0,212,255,0.35), inset 0 0 16px rgba(0,212,255,0.18);
  transition: all 0.18s cubic-bezier(0.16,1,0.3,1);
  backdrop-filter: blur(6px);
}
.mv-play-overlay svg { width: 22px; height: 22px; margin-left: 3px; }
.mv-play-overlay:hover {
  background: rgba(0,212,255,0.3);
  box-shadow: 0 0 40px rgba(0,212,255,0.5);
  transform: translate(-50%, -50%) scale(1.06);
}
.mv-play-overlay.mv-overlay-visible { opacity: 0; pointer-events: none; }

/* Custom video player — control bar */
.mv-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(4,6,10,0.55), rgba(2,3,6,0.82));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.07);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.msg-video-stage:hover .mv-controls,
.msg-video-stage:focus-within .mv-controls,
.mv-controls:active { opacity: 1; }

.mv-play, .mv-mute, .mv-fs {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(232,246,244,0.85);
  cursor: pointer;
  transition: all 0.15s ease;
}
.mv-play:hover, .mv-mute:hover, .mv-fs:hover { color: #00d4ff; background: rgba(0,212,255,0.1); }
.mv-play svg, .mv-mute svg, .mv-fs svg { width: 16px; height: 16px; }
.mv-ic-pause { display: none; }
.mv-play.playing .mv-ic-play { display: none; }
.mv-play.playing .mv-ic-pause { display: block; }
.mv-ic-mute { display: none; }
.mv-mute.muted .mv-ic-vol { display: none; }
.mv-mute.muted .mv-ic-mute { display: block; }

.mv-progress {
  flex: 1;
  min-width: 0;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.mv-progress:hover { background: rgba(255,255,255,0.15); }
.mv-progress:focus-visible { outline: 2px solid rgba(0,212,255,0.6); outline-offset: 2px; }
.mv-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0090B3, #00d4ff);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(0,212,255,0.5);
  transition: width 0.2s linear;
}

.mv-time {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono, ui-monospace, 'JetBrains Mono', monospace);
  font-size: 10px;
  color: rgba(232,246,244,0.65);
  white-space: nowrap;
  flex: 0 0 auto;
}
.mv-time .mv-sep { color: rgba(232,246,244,0.25); }
.mv-time .mv-dur { color: rgba(232,246,244,0.4); }

.msg-audio {
  max-width: 480px;
  margin: 10px 0;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(12,16,24,0.92), rgba(7,10,16,0.96));
  border: 1px solid rgba(0,212,255,0.22);
  box-shadow: 0 12px 34px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.msg-audio audio { display: none; }

.mu-inner {
  display: flex;
  align-items: stretch;
}

.mu-vis {
  position: relative;
  width: 180px;
  min-height: 100px;
  flex-shrink: 0;
  background: radial-gradient(circle at 50% 45%, rgba(0,212,255,0.1), transparent 62%), #06080d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mu-aura {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  will-change: transform, opacity;
}

.mu-aura-1 {
  background: radial-gradient(circle, rgba(0,212,255,0.5), rgba(0,212,255,0) 68%);
  filter: blur(1px);
  opacity: 0.55;
}

.mu-aura-2 {
  border: 2px solid rgba(0,212,255,0.4);
  box-shadow: 0 0 18px rgba(0,212,255,0.28), inset 0 0 14px rgba(0,212,255,0.18);
  opacity: 0.4;
}

.mu-aura-3 {
  border: 1px solid rgba(124,166,255,0.35);
  box-shadow: 0 0 26px rgba(124,166,255,0.2);
  opacity: 0.28;
}

.mu-beat .mu-aura-1 { animation: muIdleBreath 2.6s ease-in-out infinite; }

.mu-beat .mu-aura-2 { animation: muIdleBreath 3.1s ease-in-out -0.5s infinite; }

.mu-beat .mu-aura-3 { animation: muIdleBreath 3.6s ease-in-out -1.1s infinite; }

@keyframes muIdleBreath {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

.mu-play {
  position: relative;
  z-index: 1;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,0.55);
  background: radial-gradient(circle at 35% 32%, rgba(0,212,255,0.28), rgba(0,212,255,0.08) 70%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 26px rgba(0,212,255,0.35), inset 0 0 14px rgba(0,212,255,0.18);
  transition: all 0.18s cubic-bezier(0.16,1,0.3,1);
}

.mu-play:hover { background: rgba(0,212,255,0.28); box-shadow: 0 0 34px rgba(0,212,255,0.5); transform: scale(1.06); }

.mu-play .mu-play-icon { width: 22px; height: 22px; margin-left: 3px; }

.mu-play.playing .mu-play-icon { margin-left: 0; }

.mu-play.playing .mu-play-icon path { d: path("M6 5h4v14H6zM14 5h4v14h-4z"); }

.mu-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.mu-title {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: #e8f6f4;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mu-progress {
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.mu-progress:hover { background: rgba(255,255,255,0.12); }

.mu-progress:focus-visible { outline: 2px solid rgba(0,212,255,0.6); outline-offset: 2px; }

.mu-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0090B3, #00d4ff);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(0,212,255,0.5);
  transition: width 0.2s linear;
}

.mu-time {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: rgba(160,190,200,0.7);
}

.mu-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: rgba(160,190,200,0.7);
  transition: color 0.15s, background 0.15s;
}

.mu-dl:hover { color: #5ce8d4; background: rgba(0,212,255,0.08); }

@media (max-width: 480px){
.mu-vis { width: 128px; }

.mu-title { font-size: 0.72rem; }
}

.msg-video video {
  width: 100%; display: block;
}

.msg-video-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.015);
}

.msg-video-label {
  font-family: var(--font);
  font-size: 11px;
  color: rgba(232,246,244,0.45);
  letter-spacing: 0.02em;
}

.msg-video-dl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: #00d4ff;
  background: rgba(0,212,255,0.07);
  border: 1px solid rgba(0,212,255,0.22);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}

.msg-video-dl:hover {
  color: #fff;
  background: rgba(0,212,255,0.16);
  border-color: rgba(0,212,255,0.4);
  box-shadow: 0 0 18px rgba(0,212,255,0.2);
}

/* ============================================================
   GALLERY VIEW
   ============================================================ */

.gallery-view {
  padding: 32px;
  overflow-y: auto;
}

.gallery-header {
  text-align: center;
  margin-bottom: 32px;
}

.gallery-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

.gallery-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.gallery-empty p {
  margin-top: 12px;
  font-size: 0.88rem;
}

/* ─── Skills view (8/19/26) ─────────────────────────────── */
.skills-header {
  text-align: center;
  margin-bottom: 32px;
}
.skills-header h2 { font-size: 1.4rem; font-weight: 600; }
.skills-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.skills-grid { max-width: 900px; margin: 0 auto; }
.skills-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.skills-category { margin-bottom: 28px; }
.skills-category-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 4px;
}
.skills-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.skill-card {
  background: var(--panel-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #22d3ee);
  box-shadow: 0 8px 24px rgba(34,211,238,0.12);
}
.skill-card.locked { opacity: 0.6; }
.skill-card.locked:hover { transform: none; box-shadow: none; border-color: var(--border, rgba(255,255,255,0.08)); }
.skill-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.skill-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(167,139,250,0.15));
  color: var(--accent, #22d3ee);
  flex-shrink: 0;
}
.skill-card h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.skill-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; margin: 0 0 10px; }
.skill-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.skill-badge.unlocked { background: rgba(52,211,153,0.14); color: #34d399; }
.skill-badge.locked { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ─── Automations view (8/19/26) ────────────────────────── */
.automations-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}
.automations-header h2 { font-size: 1.4rem; font-weight: 600; }
.automations-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.automation-new-btn {
  margin-top: 16px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--accent, #22d3ee);
  background: rgba(34,211,238,0.12);
  color: var(--accent, #22d3ee);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.automation-new-btn:hover { background: rgba(34,211,238,0.22); }
.automations-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.automations-empty { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.automation-card {
  background: var(--panel-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.2s ease;
}
.automation-card:hover { border-color: rgba(34,211,238,0.4); }
.automation-card-main { flex: 1; min-width: 0; }
.automation-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.automation-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.automation-status.on { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,0.6); }
.automation-status.off { background: var(--text-muted); }
.automation-card h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.automation-action-chip {
  font-size: 0.66rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(167,139,250,0.14);
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: auto;
}
.automation-cron {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
  color: var(--accent, #22d3ee);
  background: rgba(34,211,238,0.08);
  padding: 3px 8px;
  border-radius: 6px;
}
.automation-prompt {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 8px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.automation-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 0.72rem; color: var(--text-muted); }
.automation-last.err { color: var(--danger, #f87171); font-weight: 600; }
.automation-error { font-size: 0.74rem; color: var(--danger, #f87171); margin-top: 6px; }
.automation-card-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.automation-card-actions button {
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: transparent;
  color: var(--text, #e5e7eb);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.automation-card-actions button:hover { background: rgba(255,255,255,0.06); }
.automation-card-actions .automation-del:hover { color: var(--danger, #f87171); border-color: var(--danger, #f87171); }
.automation-card-actions .automation-toggle:hover { color: var(--accent, #22d3ee); border-color: var(--accent, #22d3ee); }

.automation-editor {
  max-width: 760px;
  margin: 24px auto 0;
  background: var(--panel-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 14px;
  padding: 20px;
}
.automation-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.automation-editor-head h3 { margin: 0; font-size: 1.05rem; }
.automation-editor-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.automation-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.automation-field span { font-size: 0.78rem; color: var(--text-muted); }
.automation-field em { font-style: normal; opacity: 0.7; }
.automation-field input,
.automation-field select,
.automation-field textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  border-radius: 8px;
  color: var(--text, #e5e7eb);
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: inherit;
}
.automation-field input:focus,
.automation-field select:focus,
.automation-field textarea:focus { outline: none; border-color: var(--accent, #22d3ee); }
.automation-field small { font-size: 0.7rem; color: var(--text-muted); }
.automation-field code { color: var(--accent, #22d3ee); }
.automation-editor-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.automation-save-btn {
  padding: 8px 20px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  color: #0a0a0f;
  font-weight: 600;
  cursor: pointer;
}
.automation-cancel-btn {
  padding: 8px 20px;
  border-radius: 9px;
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(2,2,4,0.85));
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-video {
  position: relative;
}

.gallery-item-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--purple, #B026FF);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  z-index: 1;
}

/* ============================================================
   ABOUT VIEW
   ============================================================ */

.about-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.about-content {
  text-align: center;
  max-width: 480px;
}

.about-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.about-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.about-features {
  text-align: left;
  margin-bottom: 24px;
}

.about-feat {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.about-feat strong {
  color: var(--purple);
}

.about-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox.hidden {
  display: none;
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 0;
  transition: color 0.15s;
  z-index: 10;
}

.lightbox-close:hover {
  color: var(--text);
}

.lightbox-img-wrap {
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 60px rgba(196, 141, 232, 0.1);
}

.lightbox-img-wrap img {
  display: block;
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.lightbox-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}

.lightbox-btn:hover {
  color: var(--purple);
  border-color: var(--purple-dim);
  background: rgba(196, 141, 232, 0.06);
}

.lightbox-prompt-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  max-width: 500px;
}

.lightbox-prompt-bar input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.lightbox-prompt-bar input:focus {
  border-color: var(--green);
}

.lightbox-prompt-bar input::placeholder {
  color: var(--text-muted);
}

.lightbox-prompt-bar .send-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 1024px){
.gate-brand { font-size: clamp(2.8rem, 12vw, 4rem); }

.onboard-left, .onboard-right { display: none; }

.onboard-center { flex: 1; }
}

@media (max-width: 768px){
.sidebar { display: none; }

.suggestion-grid { grid-template-columns: 1fr; }

.message { padding: 16px; }

.msg-body { padding-left: 0; margin-top: 8px; }

.input-area { padding: 0 12px 12px; }

.tier-cards { grid-template-columns: 1fr !important; }

.onboard-center { padding: 20px; }

.onboard-card { padding: 32px 24px; }
}

/* ============================================================
   TIER BADGE (sidebar)
   ============================================================ */

.tier-badge {
  position: relative;
  z-index: 1;
  background: rgba(136,136,160,0.14);
  color: #8888a0;
  border: 1px solid rgba(136,136,160,0.3);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 0;
  line-height: 1.4;
}

.tier-free {
  color: var(--text-muted);
  background: var(--bg-hover);
}

.tier-pro {
  color: #f0c040;
  background: rgba(240, 192, 64, 0.1);
  border: 1px solid rgba(240, 192, 64, 0.2);
}

.tier-admin {
  color: var(--purple);
  background: rgba(196, 141, 232, 0.12);
  border: 1px solid rgba(196, 141, 232, 0.25);
}

.user-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(126,166,255,0.16);
  background: linear-gradient(160deg, rgba(126,166,255,0.06), rgba(10,15,28,0.4));
  cursor: pointer;
  transition: opacity 0.15s;
}

.user-badge:hover {
  border-color: rgba(126,166,255,0.4);
  background: linear-gradient(160deg, rgba(126,166,255,0.1), rgba(10,15,28,0.5));
  opacity: 0.8;
}

/* ============================================================
   USAGE BAR (empty state)
   ============================================================ */

.usage-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

/* ============================================================
   UPGRADE VIEW
   ============================================================ */

.tier-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 28px 20px;
  text-align: left;
  position: relative;
  transition: border-color 0.2s;
}

.tier-card:hover {
  border-color: var(--border-hover);
}

.tier-card-pro {
  border-color: var(--green-dim);
  background: linear-gradient(180deg, rgba(57, 217, 138, 0.04) 0%, var(--bg-card) 100%);
}

.tier-card-pro:hover {
  border-color: var(--green);
}

.tier-card-sysop {
  opacity: 0.7;
}

.tier-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

.tier-card-header {
  margin-bottom: 16px;
}

.tier-card-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tier-card-price {
  display: block;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.tier-card-period {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim);
}

.tier-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.tier-card-features li {
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.tier-card-features li:last-child { border-bottom: none; }

.tier-card-features li::before {
  content: '✓ ';
  color: var(--green);
  font-weight: 600;
}

.tier-card-btn:active { transform: translateY(0); }

.tier-card-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.tier-card-status {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
}

.tier-card-status-sysop {
  color: var(--green);
}

/* ═══ Plan Cards (4-tier) ═══ */

/* ═══ Feature Comparison Table ═══ */

.comparison-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.comparison-row:last-child {
  border-bottom: none;
}

.comparison-header {
  background: rgba(168, 130, 255, 0.08);
}

.comparison-header .comparison-feature,
.comparison-header .comparison-tier {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comparison-feature {
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text);
  border-right: 1px solid var(--border);
}

.comparison-value {
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  border-right: 1px solid var(--border);
}

.comparison-value:last-child {
  border-right: none;
}

.comparison-value.dim {
  color: var(--text-faint);
  opacity: 0.5;
}

.comparison-tier {
  padding: 10px 14px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.comparison-tier:last-child {
  border-right: none;
}

.comparison-tier.highlight,
.comparison-value.highlight {
  color: var(--purple);
  font-weight: 600;
}

.comparison-row:not(.comparison-header) .comparison-tier.highlight {
  background: rgba(168, 130, 255, 0.05);
}

/* ============================================================
   MODS STORE VIEW — Dark Matrix
   ============================================================ */

.mods-view {
  padding: 40px 32px;
  overflow-y: auto;
}

.mods-content {
  max-width: 960px;
  margin: 0 auto;
}

.mods-header {
  text-align: center;
  margin-bottom: 40px;
}

.mods-n27-hex {
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(176, 38, 255, 0.3));
}

.mods-header h2 {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 8px;
}

.mods-sub {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #888;
}

/* Category section */

.mods-category {
  margin-bottom: 28px;
}

.mods-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #1A1A1A;
}

.mods-category-header h3 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #B026FF;
  margin: 0;
}

.mods-category-cursor {
  display: inline-block;
  color: #B026FF;
  font-family: var(--mono);
  font-size: 0.75rem;
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Grid layout */

.mods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.mods-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.mods-loading-cursor {
  color: #B026FF;
  animation: cursorBlink 1s step-end infinite;
}

/* Module card — Dark Matrix */

.mod-card {
  background: #0a0a0a;
  border: 1px dashed #1A1A1A;
  border-radius: 0;
  padding: 24px 20px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.mod-card:hover {
  border-color: #39d98a;
  box-shadow: 0 0 20px rgba(57, 217, 138, 0.08);
}

.mod-card.subscribed {
  border-color: #39d98a;
  border-style: solid;
}

/* Icon — SVG-based, 32px */

.mod-card-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mod-card-icon svg {
  width: 28px;
  height: 28px;
}

/* Category badge on card */

.mod-card-category {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #B026FF;
  margin-bottom: 6px;
}

/* Module name */

.mod-card-name {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.mod-card-name.name-cyan { color: #39d98a; }

.mod-card-name.name-green { color: #39d98a; }

.mod-card-name.name-purple { color: #B026FF; }

.mod-card-name.name-magenta { color: #e040c0; }

.mod-card-name.name-amber { color: #f0c040; }

/* Description */

.mod-card-desc {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #888;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

/* Feature list — terminal style */

.mod-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.mod-card-features li {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #aaa;
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.mod-card-features li::before {
  content: '▸';
  color: #39d98a;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.3;
}

/* Price */

.mod-card-price {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #39d98a;
  margin-bottom: 14px;
}

/* Subscribe button — solid Neon Green, sharp corners */

.mod-card-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 0;
  background: #39d98a;
  color: #0a0a14;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mod-card-btn:hover {
  background: #0a0a14;
  border: 1px solid #39d98a;
  color: #39d98a;
}

.mod-card-btn:active {
  transform: scale(0.98);
}

.mod-card-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Active/Installed state */

.mod-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 0;
  background: transparent;
  color: #39d98a;
  border: 1px solid #39d98a;
}

/* Subscribed button style */

.mod-card-btn.subscribed-btn {
  border: 1px solid #39d98a;
  background: transparent;
  color: #39d98a;
}

.mod-card-btn.subscribed-btn:hover {
  border-color: #ff4757;
  color: #ff4757;
  background: rgba(255, 71, 87, 0.06);
  box-shadow: 0 0 16px rgba(255, 71, 87, 0.1);
}

/* Manage link for subscribed mods */

.mod-card-manage {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #888;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s;
}

.mod-card-manage:hover {
  color: #39d98a;
}

/* Footer */

.mods-footer {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #888;
  max-width: 500px;
  margin: 0 auto;
}

/* Responsive — 1 column on mobile */

@media (max-width: 740px){
.mods-grid, .mods-grid-inner {
    grid-template-columns: 1fr;
  }

.mods-view {
    padding: 24px 16px;
  }

.mods-header h2 {
    font-size: 1.1rem;
  }
}

/* Inner grid for category grouping */

.mods-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* ============================================================
   DARK MATRIX TERMINAL AESTHETIC
   ============================================================ */

/* Premium film grain — 2% opacity "hardware" texture over the whole app */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.02;
}

/* Blinking Cursor Typing Indicator */

.typing-indicator {
  align-items: center;
  margin: 4px 0 2px;
  background: none;
  border: none;
  font-size: 0.85rem;
  color: #555;
  font-style: normal;
  letter-spacing: 0.01em;
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ============================================================
   SETTINGS VIEW
   ============================================================ */

/* Signed-in identity card */

.settings-identity {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(126,166,255,0.3);
  background: linear-gradient(160deg, rgba(126,166,255,0.09), rgba(10,15,28,0.6) 55%);
  box-shadow: 0 12px 34px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.06);
  margin-bottom: 8px;
  overflow: hidden;
}

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

.identity-mark {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 13px;
  background: rgba(10,15,28,0.85);
  border: 1px solid rgba(126,166,255,0.25);
  box-shadow: 0 0 18px rgba(0,212,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.identity-mark svg { width: 78%; height: 78%; }

.identity-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

.identity-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.identity-tier.tier-free { background: rgba(136,136,160,0.14); color: #8888a0; border: 1px solid rgba(136,136,160,0.3); }

.identity-tier.tier-pro { background: rgba(240,192,64,0.14); color: #f0c040; border: 1px solid rgba(240,192,64,0.35); box-shadow: 0 0 12px rgba(240,192,64,0.12); }

.identity-tier.tier-admin { background: rgba(176,38,255,0.14); color: var(--purple); border: 1px solid rgba(176,38,255,0.35); }

.identity-tier.tier-creator { background: rgba(0,212,255,0.12); color: #00d4ff; border: 1px solid rgba(0,212,255,0.35); }

.identity-note b { color: var(--cyan); font-weight: 700; }

.settings-section-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0,212,255,0.7);
  flex-shrink: 0;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.settings-field:last-child { margin-bottom: 0; }

.settings-input:focus {
  outline: none;
  border-color: rgba(126,166,255,0.5);
  box-shadow: 0 0 0 3px rgba(126,166,255,0.12);
}

.settings-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237EA6FF' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.settings-select:focus {
  outline: none;
  border-color: rgba(126,166,255,0.5);
}

/* Toggle Switch */

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-checkbox { display: none; }

.settings-checkbox:checked + .settings-toggle-label {
  background: rgba(0,212,255,0.25);
  border-color: rgba(0,212,255,0.45);
}

.settings-checkbox:checked + .settings-toggle-label::after {
  left: 22px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0,212,255,0.6);
}

/* Buttons */

.settings-btn {
  background: linear-gradient(135deg, #4b90ff, #2f72f5);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 9px 20px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
  margin-top: 8px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.15s;
}

.settings-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

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

.settings-btn-secondary {
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 9px 16px;
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.15s;
}

.settings-btn-secondary:hover {
  border-color: rgba(126,166,255,0.5);
  color: var(--cyan);
  background: rgba(126,166,255,0.06);
}

.settings-btn-danger {
  background: transparent;
  color: var(--danger);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 9px 16px;
  border: 1px solid rgba(255, 71, 87, 0.3);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.15s;
}

.settings-btn-danger:hover {
  background: rgba(255, 71, 87, 0.1);
  border-color: var(--danger);
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Account Info */

.settings-account-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-link {
  color: var(--purple);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
}

.settings-link:hover {
  text-decoration: underline;
}

/* ElevenLabs Creative Suite */

.elevenlabs-view {
  padding: 32px;
  overflow-y: auto;
  height: 100%;
}

.el-content {
  max-width: 720px;
  margin: 0 auto;
}

.el-header h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.el-sub {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 24px;
}

.el-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.el-tab {
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.el-tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.el-panel { display: none; }

.el-panel.active { display: block; }

.el-panel-header { margin-bottom: 20px; }

.el-panel-header h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.el-panel-header p {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.el-field { margin-bottom: 16px; }

.el-field-row {
  display: flex; gap: 16px;
  flex-wrap: wrap;
}

.el-field-row .el-field { flex: 1; min-width: 160px; }

.el-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.el-input, .el-select, .el-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.el-input:focus, .el-select:focus, .el-textarea:focus {
  outline: none;
  border-color: var(--cyan);
}

.el-textarea { resize: vertical; min-height: 60px; }

.el-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f4f0f842' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  -webkit-appearance: none;
  appearance: none;
}

.el-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.el-status {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.el-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px;
  margin-top: 8px;
}

.el-result-label {
  font-size: 0.7rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.el-audio {
  width: 100%;
  margin-bottom: 8px;
}

.el-dl-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid var(--cyan);
  padding: 6px 12px;
  transition: background 0.15s;
}

.el-dl-link:hover {
  background: rgba(0, 196, 235, 0.1);
}

.el-file-drop {
  border: 1px dashed var(--border);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.el-file-drop:hover {
  border-color: var(--cyan);
}

.el-file-drop p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
}

.el-file-name {
  display: block;
  font-size: 0.7rem;
  color: var(--green);
  margin-top: 4px;
}

.el-transcript {
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text);
}

.el-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

#el-voice-previews {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.el-voice-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.el-voice-preview audio { flex: 1; min-width: 0; }

.el-voice-preview .el-vp-id {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.el-dub-project-info {
  font-size: 0.8rem;
  line-height: 1.6;
}

.el-dub-project-info strong {
  color: var(--cyan);
}

@media (max-width: 740px){
.settings-view {
    padding: 24px 16px;
  }

.settings-content h2 {
    font-size: 1.2rem;
  }
}

.msg-toolbar {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ============================================================
   AAA POLISH — tactile surfaces, hierarchy, and motion
   ============================================================ */

.tier-card,
.plan-option,
.mod-card,
.about-feat,
.el-result {
  background: linear-gradient(145deg, rgba(18, 20, 28, 0.72), rgba(7, 9, 13, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: transform 0.22s var(--ease-out), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.tier-card:hover,
.plan-option:hover,
.mod-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.gallery-item {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  aspect-ratio: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.24s var(--ease-out), border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(0, 196, 235, 0.42);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lb-in 0.2s ease-out;
  background: rgba(2, 3, 5, 0.8);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

/* ═══ AAA FINISH — gate telemetry, scrollbars, pressed states, message cards ═══ */

/* Global scrollbars — consistent 8px dark track, subtle thumb */

*::-webkit-scrollbar { width: 6px; height: 6px; }

*::-webkit-scrollbar-track { background: transparent; }

*::-webkit-scrollbar-corner { background: transparent; }

/* Text selection */

/* Gate telemetry strip */

.gate-telemetry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(7, 9, 13, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.telemetry-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green-glow); }
  50% { opacity: 0.45; box-shadow: 0 0 2px var(--green-glow); }
}

.telemetry-label { color: var(--text-muted); }

.telemetry-val { color: var(--green); }

.telemetry-divider { opacity: 0.5; }

/* Gate wordmark — layered glow, refined weight */

.gate-brand {
  font-family: var(--display);
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 800;
  line-height: 0.95;
  margin-bottom: 18px;
  letter-spacing: -0.04em;
  background: linear-gradient(112deg, #ffffff 0%, #7EA6FF 38%, #b744bc 70%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(37, 99, 235, 0.18));
}

/* Pressed / tactile states */

/* Assistant message — glass card with violet hairline */

/* Msg avatars — add ring + presence */

/* Sidebar nav refinement — tighter, hairline dividers */

.nav-item svg { opacity: 0.75; transition: opacity 0.15s, transform 0.15s var(--ease-out); }

.nav-item:hover svg { opacity: 1; transform: scale(1.08); }

/* Suggestion cards — accent left hairline + hover lift is already there; add cursor icon */

.suggestion:hover::before { opacity: 0.85; }

/* Toggle switch — round, glows when on */

.settings-toggle-label {
  width: 44px;
  height: 24px;
  background: rgba(10,15,28,0.85);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  border-radius: 999px;
}

.settings-toggle-label::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: all 0.2s;
  border-radius: 50%;
}

/* Plan cards — active tier glow */

/* Focus ring consistency */

@media (max-width: 768px){
.gate-hero { padding-inline: 18px; }

.gate-nav { padding-top: 16px; }

.gate-stage { padding-top: 34px; }

.gate-brand { font-size: clamp(3rem, 18vw, 4.4rem); }

.input-area { padding-inline: 12px; }

.messages { padding-top: 12px; }

.message { padding-inline: 16px; }

.msg-body { font-size: 0.92rem; }

.input-wrapper { padding: 8px; }

.model-selector-btn span { display: none; }

.model-selector-btn {
    padding: 6px;
    width: 32px;
    justify-content: center;
  }

.gate-telemetry { font-size: 8px; gap: 6px; padding: 6px 12px; }

.message.assistant, .message.user { width: 100%; margin: 0 0 6px; }
}

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

/* ══════════════════════════════════════════════════════════════════════
   AGENTIC UI WORKFLOW — Chain of Work + Live Preview + What Changed
   Rendered from <step> / <preview><![CDATA[…]]></preview> / <summary>
   ══════════════════════════════════════════════════════════════════════ */

/* Drop the "> " chat prefix on messages that carry the agentic card */

.message.assistant .msg-body:has(.agentic-workflow)::before { content: ''; }

.agentic-workflow {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font);
}

/* ── Chain of Work ─────────────────────────────────────────────── */

.agentic-steps {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(13, 16, 22, 0.85), rgba(8, 10, 15, 0.9));
  padding: 12px 14px;
  box-shadow:
    inset 2px 0 0 var(--cyan),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 24px rgba(126, 166, 255, 0.06);
  animation: agentic-card-in 0.32s var(--ease-out);
}

.agentic-steps-title {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.95;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agentic-steps-title::before {
  content: '▸';
  font-size: 0.7rem;
  opacity: 0.9;
}

.agentic-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-dim);
  opacity: 0.88;
  animation: agentic-card-in 0.28s var(--ease-out);
}

.agentic-step.done { opacity: 0.6; }

.agentic-step.done .agentic-step-text { text-decoration: none; }

.agentic-step.active { color: var(--text); opacity: 1; }

.agentic-step-icon {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  border-radius: 50%;
}

.agentic-step.done .agentic-step-icon {
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(57, 217, 138, 0.4);
  box-shadow: 0 0 10px rgba(57, 217, 138, 0.18);
}

.agentic-step.active .agentic-step-icon {
  color: var(--cyan);
  background: linear-gradient(135deg, rgba(126, 166, 255, 0.14), rgba(192, 72, 168, 0.14));
  box-shadow: 0 0 12px rgba(126, 166, 255, 0.22);
}

/* N27 conic spinner — cyan→magenta gradient ring with glow */

.agentic-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--cyan), var(--magenta), var(--purple), var(--cyan));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  filter: drop-shadow(0 0 4px rgba(126, 166, 255, 0.55));
  animation: agentic-spin 0.75s linear infinite;
}

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

/* ── Live Preview ──────────────────────────────────────────────── */

.agentic-preview {
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(12,16,24,0.92), rgba(7,10,16,0.96));
  box-shadow: 0 12px 34px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: agentic-card-in 0.36s var(--ease-out);
  margin: 10px 0;
  max-width: 520px;
}

.agentic-preview.pending {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-style: dashed;
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.05);
  color: rgba(232,246,244,0.8);
}

.agentic-preview.pending .agentic-preview-title { font-size: 0.78rem; }

.agentic-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

/* Live sheen sweep — a soft light band glides across the header while the
   preview is rendering (or even after), giving the bar a living shimmer. */
.agentic-preview-head::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(105deg, transparent 0%, rgba(0,212,255,0.10) 45%, rgba(255,255,255,0.10) 55%, transparent 100%);
  transform: skewX(-12deg);
  animation: agentic-sheen 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes agentic-sheen {
  0%   { left: -40%; }
  60%  { left: 110%; }
  100% { left: 110%; }
}

.agentic-preview-head .msg-video-tag { margin-right: auto; }

.agentic-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232,246,244,0.7);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.05);
  transition: all 0.15s;
  cursor: pointer;
}

.agentic-copy-btn:hover {
  color: #fff;
  border-color: rgba(0,212,255,0.5);
  background: rgba(0,212,255,0.08);
}

.agentic-preview-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.agentic-tab {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b93a1;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.15s;
}

.agentic-tab:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.agentic-tab.active {
  color: #fff;
  border-color: rgba(0,212,255,0.55);
  background: rgba(0,212,255,0.12);
  box-shadow: 0 0 12px rgba(0,212,255,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
}

.agentic-preview-body { position: relative; }

.agentic-frame {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: #0b0e14;
  border-top: 1px solid var(--border);
}

.agentic-code {
  margin: 0;
  padding: 14px 16px;
  max-height: 460px;
  overflow: auto;
  background: #0b0e14;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
}

.agentic-code code { background: none; padding: 0; color: var(--text); font-size: inherit; }

.agentic-code.hidden, .agentic-frame.hidden { display: none !important; }

/* Expanded live preview — near-fullscreen modal to view the rendered site bigger */
.agentic-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232,246,244,0.7);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.05);
  transition: all 0.15s;
  cursor: pointer;
}
.agentic-expand-btn:hover {
  color: #fff;
  border-color: rgba(0,212,255,0.5);
  background: rgba(0,212,255,0.08);
}

.agentic-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: rgba(3,5,9,0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease-out);
}
.agentic-fullscreen.open { opacity: 1; pointer-events: auto; }

.agentic-fullscreen-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: rgba(12,16,24,0.96);
  border: 1px solid rgba(0,212,255,0.28);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.5);
}
.agentic-fullscreen-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232,246,244,0.85);
  margin-right: auto;
}
.agentic-fs-open, .agentic-fs-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232,246,244,0.8);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: all 0.15s;
}
.agentic-fs-open:hover { color: #fff; border-color: rgba(0,212,255,0.55); background: rgba(0,212,255,0.1); }
.agentic-fs-close:hover { color: #fff; border-color: rgba(255,110,120,0.55); background: rgba(255,110,120,0.1); }

.agentic-fullscreen-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #0b0e14;
  box-shadow: 0 24px 70px rgba(0,0,0,0.65);
}
.agentic-fullscreen-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0e14;
}
body.agentic-modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .agentic-fullscreen { padding: 12px; }
  .agentic-fullscreen-bar { flex-wrap: wrap; }
}

/* ── What Changed summary table ────────────────────────────────── */

.agentic-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  animation: agentic-card-in 0.32s var(--ease-out);
}

.agentic-summary-title {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 14px 6px;
}

.agentic-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.agentic-summary-table th {
  text-align: left;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 14px 6px;
  font-weight: 500;
  opacity: 0.6;
}

.agentic-summary-table td {
  padding: 6px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  vertical-align: top;
}

.agentic-summary-table td.sum-area {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  min-width: 90px;
}

.agentic-summary-table tr:last-child td { border-bottom: 0; }

.agentic-summary-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.agentic-prose { font-size: 0.95rem; line-height: 1.72; color: var(--text-dim); }

.agentic-stream-code {
  margin: 12px 0 0;
  padding: 16px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #090a0d;
  color: var(--text);
  font: 0.78rem/1.55 var(--mono);
}

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

@media (max-width: 768px){
.agentic-frame { height: 360px; }

.agentic-summary-table td { white-space: normal; }

.agentic-summary-table td.sum-area { white-space: normal; min-width: 0; }
}

/* ══════════════════════════════════════════════════════════════════════
   LUXURY POLISH — Deep Obsidian Navy (launch pass)
   Royal-blue interactive accents, etched hairlines, frosted glass,
   150ms ease-out glide on every interactive element.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Global micro-interactions — nothing snaps, everything glides ── */

.nav-item, .history-item, .suggestion, .btn-icon, .send-btn,
.attach-btn, .mic-btn, .model-selector-btn, .model-option, .attach-mode-chip,
.attach-run-btn, .tier-card-btn, .settings-btn, .settings-btn-secondary,
.settings-btn-danger, .el-tab, .lightbox-btn, .gate-nav-link, .btn-logout,
.user-badge, .gallery-item, .plan-option, .mod-card, .msg-speak-btn,
.cv-copy, .agentic-copy-btn, .agentic-tab, .btn-register-toggle,
.gate-auth-toggle, .settings-link, .gate-cta-primary, .gate-cta-secondary,
.gate-cta-ghost, .input-wrapper {
  transition: color 150ms ease-out, background-color 150ms ease-out,
              border-color 150ms ease-out, box-shadow 150ms ease-out,
              transform 150ms ease-out, opacity 150ms ease-out;
}

/* ── Sidebar — blue active states, etched hairlines ── */

/* ── Brand marks — blue gradient cores ── */

/* ── Gate — subtle obsidian depth behind the landing ── */

.onboard {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  overflow: auto;
  background: radial-gradient(ellipse 95% 70% at 50% 16%, var(--bg-secondary) 0%, var(--bg-primary) 64%);
}

/* ── Welcome screen — weightless typography, blue depth glow ── */

.usage-bar .usage-count {
  font-weight: 600;
  color: var(--glow-accent-text);
}

/* ── Suggestion cards — etched glass, gliding lift, blue halo ── */

/* ── Input bar — weighty obsidian slab, royal focus ring ── */

/* ── Send — gradient blue pill ── */

/* ── Input accessory buttons — blue hovers ── */

.attach-btn:hover,
.mic-btn:hover:not(.locked):not(:disabled),

/* ── Model selector — frosted dropdown, no flat grays ── */

/* ── Attach mode chips — blue active ── */

/* ── Messages — assistant prefix matches accent ── */

/* ── Typing indicator — soft blue pulse dots (was green block cursor) ── */

.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes lux-typing {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ── Focus, selection, scrollbars — accent consistency ── */

input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 1px solid rgba(37, 99, 235, 0.55);
  outline-offset: 3px;
}

/* ══════════════════════════════════════════════════════════════════════
   MUSIC CREATION MODAL
   ══════════════════════════════════════════════════════════════════════ */

.music-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}

.music-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}

.music-modal-panel {
  position: relative; z-index: 1;
  width: 90%; max-width: 520px;
  background: linear-gradient(180deg, #111726 0%, #0a0e17 100%);
  border: 1px solid rgba(168,68,176,0.3);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 40px rgba(168,68,176,0.08);
  overflow: hidden;
  animation: musicModalIn 0.2s ease-out;
}

@keyframes musicModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.music-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.music-modal-header h3 {
  font-family: var(--font); font-size: 15px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text);
}

.music-modal-close {
  background: none; border: none; color: var(--text3); font-size: 22px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: all 0.15s;
}

.music-modal-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.music-modal-body {
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
}

.music-label {
  display: block; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 5px;
}

.music-textarea, .music-input, .music-select {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
  color: var(--text); font-family: var(--font); font-size: 13px;
  padding: 10px 12px; outline: none; transition: border-color 0.15s;
  box-sizing: border-box;
}

.music-textarea { resize: vertical; min-height: 60px; line-height: 1.5; }

.music-textarea:focus, .music-input:focus, .music-select:focus {
  border-color: rgba(168,68,176,0.5);
  box-shadow: 0 0 0 3px rgba(168,68,176,0.1);
}

.music-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}

.music-select option { background: #111726; color: var(--text); }

.music-select-full { width: 100%; }

.music-row { display: flex; gap: 12px; }

.music-col { flex: 1; display: flex; flex-direction: column; }

.music-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.music-btn-cancel, .music-btn-generate {
  font-family: var(--font); font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; padding: 10px 20px; border-radius: 8px;
  cursor: pointer; transition: all 0.15s; border: none;
}

.music-btn-cancel {
  background: rgba(255,255,255,0.06); color: var(--text3);
}

.music-btn-cancel:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.music-btn-generate {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(168,68,176,0.8), rgba(126,166,255,0.7));
  color: #fff;
}

.music-btn-generate:hover { filter: brightness(1.1); transform: translateY(-1px); }

.music-btn-generate:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ══════════════════════════════════════════════════════════════════════
   CUSTOM AUDIO PLAYER — replaces default <audio> controls
   ══════════════════════════════════════════════════════════════════════ */

.custom-audio-player {
  display: flex; flex-direction: column; gap: 0;
  background: linear-gradient(135deg, rgba(17,23,38,0.95), rgba(10,14,23,0.98));
  border: 1px solid rgba(168,68,176,0.25);
  border-radius: 12px; padding: 14px 16px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
}

.custom-audio-top {
  display: flex; align-items: center; gap: 12px;
}

.ca-play {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(168,68,176,0.6), rgba(126,166,255,0.5));
  border: none; border-radius: 50%; cursor: pointer;
  color: #fff; transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(168,68,176,0.3);
}

.ca-play:hover { transform: scale(1.08); filter: brightness(1.15); }

.ca-play svg { width: 16px; height: 16px; }

.ca-progress-wrap {
  flex: 1; display: flex; flex-direction: column; gap: 4px;
}

.ca-time-row {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text3); letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.ca-progress {
  width: 100%; height: 4px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.08); border-radius: 4px; outline: none;
  cursor: pointer; overflow: hidden;
}

.ca-progress::-webkit-slider-runnable-track { height: 4px; background: transparent; }

.ca-progress::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  background: #fff; border-radius: 50%; margin-top: -4px;
  box-shadow: 0 0 6px rgba(168,68,176,0.5);
  transition: transform 0.1s;
}

.ca-progress::-webkit-slider-thumb:hover { transform: scale(1.3); }

.ca-progress::-moz-range-thumb {
  width: 12px; height: 12px; background: #fff; border-radius: 50%;
  border: none; box-shadow: 0 0 6px rgba(168,68,176,0.5);
}

.ca-volume-wrap {
  display: flex; align-items: center; gap: 6px; margin-left: 8px;
}

.ca-volume {
  width: 60px; height: 3px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.1); border-radius: 3px; outline: none; cursor: pointer;
}

.ca-volume::-webkit-slider-thumb {
  -webkit-appearance: none; width: 10px; height: 10px;
  background: var(--cyan); border-radius: 50%;
}

.ca-volume::-moz-range-thumb {
  width: 10px; height: 10px; background: var(--cyan); border-radius: 50%; border: none;
}

.ca-download {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px; cursor: pointer;
  color: var(--text3); transition: all 0.15s;
  text-decoration: none;
}

.ca-download:hover { color: var(--cyan); background: rgba(255,255,255,0.06); }

/* Variant tabs */

.ca-variants {
  display: flex; gap: 6px; margin-top: 8px;
}

.ca-variant-tab {
  font-size: 10px; padding: 4px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text3); cursor: pointer; transition: all 0.15s;
}

.ca-variant-tab:hover { border-color: rgba(168,68,176,0.4); color: var(--text); }

.ca-variant-tab.active {
  background: rgba(168,68,176,0.15); border-color: rgba(168,68,176,0.5);
  color: var(--text);
}

/* ══════════════════════════════════════════════════════════════════════
   AUTH / ACCOUNT FOOTER — quiet premium (2026-08-10)
   ══════════════════════════════════════════════════════════════════════ */

.sidebar-footer .user-badge:hover {
  background: rgba(255, 255, 255, 0.03);
  opacity: 1;
}

.sidebar-footer #display-username {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer .version-tag {
  border-radius: 6px;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.usage-bar.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════
   GROK CLARITY — flat dark, minimal noise, clean hierarchy
   Anonymous landing → nudge → full app (2026-08-17)
   ══════════════════════════════════════════════════════════════════════ */

/* ── Canvas — kill all ambient effects ── */

body { background: #0a0a0a !important; }

body::before {
  content: none !important;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 18%, rgba(37, 99, 235, 0.07), transparent 38%),
    radial-gradient(circle at 92% 78%, rgba(37, 99, 235, 0.04), transparent 30%);
  mix-blend-mode: screen;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(rgba(126, 166, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 166, 255, 0.02) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
  opacity: 0.55;
  display: none !important;
}

.ambient-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(37, 99, 235, 0.09), transparent 60%),
    radial-gradient(ellipse 45% 35% at 82% 16%, rgba(37, 99, 235, 0.05), transparent 55%);
  pointer-events: none;
  display: none !important;
}

/* ── Gate — hidden by default ── */

.onboard.hidden { display: none !important; }

/* ── Sidebar — flat solid, no glass ── */

.sidebar {
  width: 260px;
  background: #0f0f12 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
  overflow: hidden;
  box-shadow: none !important;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

.sidebar-title {
  flex: 1;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  letter-spacing: 0 !important;
}

/* ── Nav items — flat, clean ── */

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px !important;
  color: #999 !important;
  font-size: 0.88rem;
  cursor: pointer;
  transition: color 0.18s var(--ease-out), background 0.18s var(--ease-out), transform 0.18s var(--ease-out);
  position: relative;
  margin-bottom: 1px !important;
}

.guest-mode .explore-deeper-float { display: none !important; }

.nav-item:hover {
  color: #ccc !important;
  background: rgba(255,255,255,0.04) !important;
  transform: none !important;
}

.nav-item.active {
  color: #fff !important;
  background: rgba(255,255,255,0.06) !important;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.nav-item.active svg {
  opacity: 1 !important;
  color: #fff !important;
}

/* ── History items — flat ── */

.history-item {
  padding: 10px 12px;
  border-radius: 6px !important;
  color: #777 !important;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-item:hover {
  color: #bbb !important;
  background: rgba(255,255,255,0.04) !important;
}

.history-item.active {
  color: #fff !important;
  background: rgba(255,255,255,0.06) !important;
}

.history-group-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 6px;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.history-group-label:first-child { border-top: none; margin-top: 0; padding-top: 6px; }

.history-more {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
  opacity: 0.6;
}

/* ── Sidebar footer — flat ── */

.sidebar-footer .user-badge {
  font-weight: 400 !important;
  letter-spacing: 0.01em;
  padding: 6px 8px;
  margin: -6px -8px 0;
  border-radius: 8px;
}

.sidebar-footer .btn-logout {
  border-radius: 6px !important;
  padding: 5px 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-color: rgba(255,255,255,0.08) !important;
  color: #666 !important;
}

.sidebar-footer .btn-logout:hover { color: #ff5555 !important; border-color: rgba(255,85,85,0.3) !important; }

/* ── Brand marks — flat white on dark ── */

.gate-mark-core, .logo-core, .logo-core-lg {
  background: #fff !important;
  color: #0a0a0a !important;
  box-shadow: none !important;
}

.gate-mark-ring {
  position: absolute;
  border: none;
  border-radius: 50%;
  pointer-events: none;
  inset: -10px;
  padding: 2px;
  background: conic-gradient(from 0deg, #00d4ff 0deg, #7EA6FF 110deg, #b744bc 230deg, #00d4ff 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: gateRingSpin 12s linear infinite;
}

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

.gate-mark {
  position: relative;
  width: 56px;
  height: 56px;
  margin-bottom: 30px;
  filter: drop-shadow(0 0 18px rgba(37, 99, 235, 0.3));
}

.logo-ring-lg {
  position: absolute;
  inset: 0;
  border: 2px solid var(--purple);
  border-radius: 50%;
  animation: none !important;
  border-color: rgba(255,255,255,0.12) !important;
}

.logo-sm span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: #999 !important;
}

/* ── Empty state — centered, clean ── */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center !important;
  justify-content: center;
  padding: 40px 20px 20px !important;
  background: none !important;
}

.empty-logo {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  display: none !important;
}

.empty-state h2 {
  font-size: 1.6rem !important;
  font-weight: 500 !important;
  margin-bottom: 24px !important;
  color: #e5e5e5 !important;
  letter-spacing: -0.01em !important;
}

/* ── Suggestion cards — flat, quiet ── */

.suggestion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px !important;
  max-width: 560px !important;
  width: 100%;
}

.suggestion {
  padding: 12px 14px !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px !important;
  color: #888 !important;
  font-family: var(--font);
  font-size: 0.85rem !important;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  padding-left: 28px;
  display: flex;
  align-items: center;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: left;
  box-shadow: none !important;
  position: relative;
  gap: 10px;
  transform: none !important;
}

.suggestion:hover {
  border-color: rgba(255,255,255,0.14) !important;
  color: #ccc !important;
  background: rgba(255,255,255,0.07) !important;
  transform: none !important;
  box-shadow: none !important;
}

.suggestion::before {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyan);
  opacity: 0;
  font-family: var(--mono);
  font-size: 12px;
  transition: opacity 0.18s;
  content: none;
  display: none !important;
}

.suggestion-icon {
  flex-shrink: 0;
  opacity: 0.5 !important;
  transition: inherit;
}

.suggestion:hover .suggestion-icon {
  opacity: 0.8 !important;
  color: inherit !important;
}

/* ── Messages — full scroller, centered reading rows (GPT/Claude layout) ── */

.message.user {
  background: none !important;
  border-left: 2px solid rgba(0, 196, 235, 0.22);
  width: calc(100% - 48px);
  margin: 0 auto 6px;
  border-radius: 0 14px 14px 0;
}

.message.assistant {
  background: none !important;
  border-left: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  margin: 0 auto 6px;
  width: calc(100% - 48px);
  border-radius: 0 14px 14px 0;
}

.msg-body {
  padding-left: 0 !important;
  font-size: 1rem !important;
  line-height: 1.72 !important;
  color: #ececf1 !important;
  font-family: var(--font) !important;
}

.msg-body a { color: #8FB6FF !important; text-decoration: underline !important; text-underline-offset: 2px !important; }

.msg-body a:hover { color: #fff !important; }

.msg-body strong {
  color: #fff !important;
  font-weight: 600 !important;
}

.msg-name {
  font-size: 0.82rem;
  font-weight: 500 !important;
  color: #888 !important;
}

.msg-name.ai-name {
  color: #aaa !important;
}

.msg-avatar {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px !important;
  font-weight: 700;
  flex-shrink: 0;
}

.msg-avatar.ai-avatar {
  background: #1a1a1f !important;
  color: #ccc !important;
  box-shadow: none !important;
}

.msg-avatar.user-avatar {
  background: #1a1a1f !important;
  color: #999 !important;
  border: 1px solid var(--border);
  box-shadow: none !important;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px !important;
}

.message.assistant .msg-body::before {
  color: #888 !important;
}

/* User bubble — right-aligned pill, ChatGPT-style */

.message.user .msg-body p { margin-bottom: 0 !important; margin-top: 0 !important; line-height: 1.35 !important; }

.message.user .msg-body .live-content-region p { margin-bottom: 0 !important; margin-top: 0 !important; }

/* Assistant message formatting — blockquotes, lists, code blocks */

.msg-body blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid rgba(0, 212, 255, 0.5);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 10px 10px 0;
  color: #e0e6ed;
  font-style: italic;
}

.msg-body blockquote p { margin-bottom: 0 !important; }

.msg-body ul, .msg-body ol {
  margin: 12px 0;
  padding-left: 22px;
}

.msg-body li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.msg-body ul { list-style-type: disc; }

.msg-body ol { list-style-type: decimal; }

.msg-body pre {
  background: #0a0c10;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 12px 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.55;
}

.msg-body p {
  margin-bottom: 12px;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

/* Visible scrollbar at the right of the content column */

.messages::-webkit-scrollbar {
  width: 10px !important;
}

.messages::-webkit-scrollbar-track { background: transparent !important; }

.messages::-webkit-scrollbar-thumb {
  background: rgba(126, 166, 255, 0.35) !important;
  border-radius: 999px !important;
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
}

.messages::-webkit-scrollbar-thumb:hover { background: rgba(126, 166, 255, 0.6) !important; background-clip: padding-box !important; }

@media (max-width: 640px){
.message { width: calc(100% - 28px) !important; padding: 18px 14px !important; }

.message.user .msg-body { max-width: 92% !important; }
}

/* ── Input area — centered pill, clean ── */

/* ── Send button — plain circle ── */

/* ── Accessory buttons — quiet ── */

.attach-btn, .mic-btn { color: #555 !important; }

.attach-btn:hover, .mic-btn:hover:not(.locked) {
  color: #ccc !important;
  background: rgba(255,255,255,0.05) !important;
  border-color: transparent !important;
}

/* ── Model selector — quiet pill ── */

/* ── Disclaimer — subtle ── */

.input-disclaimer {
  text-align: center;
  font-size: 0.7rem !important;
  color: #444 !important;
  margin-top: 8px !important;
}

/* ── Typing indicator — muted ── */

/* ── Toggle sidebar floating ── */

.toggle-sidebar-floating {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  background: rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: #777 !important;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: none !important;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  border-color: rgba(255,255,255,0.08) !important;
}

.toggle-sidebar-floating:hover {
  color: #fff !important;
  border-color: rgba(255,255,255,0.18) !important;
  box-shadow: none !important;
  transform: none !important;
  background: rgba(255,255,255,0.08) !important;
}

/* ── Version tag ── */

.version-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: #444 !important;
  background: none !important;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* ── Focus / selection — neutral ── */

button:focus-visible, a:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45) !important;
  outline-offset: 3px !important;
}

input:focus-visible, textarea:focus-visible { outline: none !important; }

::selection {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}

/* ── Scrollbars — subtle ── */

*::-webkit-scrollbar-thumb {
  background: rgba(126, 166, 255, 0.16) !important;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(126, 166, 255, 0.28) !important;
  background-clip: padding-box;
}

/* ── Pressed states — Apple press feedback ── */

.gate-cta-primary:active, .gate-cta-secondary:active, .gate-cta-ghost:active, .tier-card-btn:active, .mod-card-btn:active, .attach-run-btn:active, .send-btn:active:not(:disabled), .suggestion-chip:active {
  transform: scale(.98) !important;
}

/* ═══ GUEST MODE — anonymous landing ═══ */

/* Hide sidebar + floating toggle for anonymous users */

.app.guest-mode .sidebar { display: none !important; }

.app.guest-mode .toggle-sidebar-floating { display: none !important; }

/* Guest top-nav bar — fixed across full viewport width */

.guest-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: #0a0a0a;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  flex-shrink: 0;
}

.guest-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-mark-sm {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.landing-mark-sm::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1.5px;
  background: conic-gradient(#00d4ff 0deg, #7EA6FF 90deg, #b744bc 180deg, #e040c0 270deg, #00d4ff 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: llBezelSpin 14s linear infinite;
  pointer-events: none;
}

.landing-mark-sm svg { position: relative; z-index: 1; }

.landing-brand-text {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e5e5;
  letter-spacing: -0.01em;
}

.guest-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guest-nav-link {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: #999 !important;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s !important;
}

.guest-nav-link:hover { color: #fff !important; }

.guest-nav-cta {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: #000 !important;
  background: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  border: none;
  transition: opacity 0.15s !important;
}

.guest-nav-cta:hover { opacity: 0.85; }

/* Hide guest topbar when authenticated */

.app:not(.guest-mode) .guest-topbar { display: none !important; }

/* ═══ NUDGE CARD — "Continue your conversation" ═══ */

.nudge {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 20px;
}

.nudge.hidden { display: none !important; }

.nudge-card {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 24px 28px;
}

.nudge-left { flex: 1; }

.nudge-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: #e5e5e5;
  margin-bottom: 6px;
}

.nudge-desc {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 16px;
}

.nudge-cta {
  display: inline-flex;
  align-items: center;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: #000 !important;
  background: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s !important;
}

.nudge-cta:hover { opacity: 0.85; }

.nudge-signin {
  display: block;
  margin-top: 10px;
  font-family: var(--font);
  font-size: 0.78rem;
  color: #666 !important;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nudge-signin:hover { color: #aaa !important; }

.nudge-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
  flex-shrink: 0;
}

.nudge-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: #888;
  white-space: nowrap;
}

.nudge-feature svg { flex-shrink: 0; opacity: 0.5; }

@media (max-width: 640px){
.nudge-card { flex-direction: column; gap: 20px; }

.nudge-right { flex-direction: row; flex-wrap: wrap; gap: 8px; }

.guest-topbar { padding: 10px 16px; }

.input-area { padding-inline: 12px !important; }

.messages { padding-inline: 12px; }

.nudge { padding-inline: 12px; }
}

/* ═══ LANDING — live prompt box; send surfaces the continue card ═══ */

.app.guest-mode .attach-btn,
.app.guest-mode .mic-btn,
.app.guest-mode .model-selector-btn { opacity: 0.4 !important; cursor: not-allowed !important; }

.nudge-attention { animation: nudgePulse 1.4s ease-in-out 2; }

@keyframes nudgePulse {
  0%, 100% { border-color: rgba(255,255,255,0.08); }
  50% { border-color: rgba(255,255,255,0.45); }
}

/* ═══ EXPLORE DEEPER — upgrade pill ═══ */

.explore-deeper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: #aaa;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.explore-deeper:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.07);
}

.explore-deeper svg { opacity: 0.65; }

.explore-deeper:hover svg { opacity: 1; }

.explore-deeper-float {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 60;
  display: none;
}

.app:not(.guest-mode) .explore-deeper-float { display: inline-flex; }

.app.guest-mode .explore-deeper-float { display: none; }

/* ═══ LEGAL FOOTER LINE ═══ */

.input-legal {
  text-align: center;
  font-size: 0.68rem;
  color: #4a4a4a;
  margin-top: 6px;
}

.input-legal a { color: #5a5a5a; text-decoration: none; }

.input-legal a:hover { color: #999; text-decoration: underline; }

.privacy-choices {
  display: inline;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.68rem;
  color: #5a5a5a;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-choices:hover { color: #999; }

/* ═══ COOKIE BANNER ═══ */

.cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  pointer-events: none;
}

.cookie-banner.hidden { display: none !important; }

.cookie-banner-card {
  pointer-events: auto;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: #141418;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}

.cookie-text { font-size: 12.5px; line-height: 1.6; color: #999; margin-bottom: 14px; }

.cookie-text strong { color: #ddd; font-weight: 600; }

.cookie-text a { color: #bbb; text-decoration: underline; text-underline-offset: 2px; }

.cookie-text a:hover { color: #fff; }

.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cookie-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s, background 0.15s;
}

.cookie-btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.14);
  color: #aaa;
}

.cookie-btn-ghost:hover { border-color: rgba(255,255,255,0.32); color: #fff; }

.cookie-btn-primary { background: #fff; color: #0a0a0a; }

.cookie-btn-primary:hover { opacity: 0.88; }

/* ═══ COOKIE SETTINGS MODAL ═══ */

.cookie-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }

.cookie-modal.hidden { display: none !important; }

.cookie-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }

.cookie-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #141418;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 72px rgba(0,0,0,0.6);
}

.cookie-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

.cookie-modal-title { font-family: var(--display); font-size: 15px; font-weight: 600; color: #e5e5e5; }

.cookie-modal-close {
  background: none; border: none; color: #666; font-size: 18px; cursor: pointer; padding: 2px 6px;
}

.cookie-modal-close:hover { color: #fff; }

.cookie-modal-sub { font-size: 12.5px; line-height: 1.55; color: #888; margin-bottom: 18px; }

.cookie-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }

.cookie-option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; border: 1px solid rgba(255,255,255,0.07); border-radius: 10px;
  background: rgba(255,255,255,0.02);
}

.cookie-option-name { font-size: 13px; font-weight: 600; color: #ddd; }

.cookie-option-desc { font-size: 11.5px; color: #777; margin-top: 2px; }

.cookie-option-state { font-size: 11px; color: #666; white-space: nowrap; }

.cookie-toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }

.cookie-toggle input { opacity: 0; width: 0; height: 0; }

.cookie-toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,0.12); transition: background 0.2s; cursor: pointer;
}

.cookie-toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #888; transition: transform 0.2s, background 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle-track { background: rgba(255,255,255,0.35); }

.cookie-toggle input:checked + .cookie-toggle-track .cookie-toggle-thumb { transform: translateX(16px); background: #fff; }

.cookie-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ═══ THINKING PANEL — modern neutral ═══ */

.reasoning-label {
  display: inline-flex;
  align-items: center;
  gap: 8px !important;
}

@keyframes reasoning-soft-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ═══ INPUT CENTERED — until first response content (chat-services style) ═══ */

/* padding-bottom (not transform) bumps the centered stack 20px up —
   a transform here would make .chat-area the containing block for the
   position:fixed .explore-deeper-float pill and clip it off-screen. */
.app.input-centered .chat-area { justify-content: center; gap: 22px; padding-bottom: 40px; }

.app.input-centered .messages { flex: none !important; height: 0 !important; padding: 0 !important; overflow: hidden !important; min-height: 0 !important; }

.app.input-centered .empty-state { flex: none !important; width: 100%; max-width: 680px; }

.app.input-centered .input-area { flex: none !important; width: 100%; max-width: 680px; padding-bottom: 16px; }

.app.input-centered .guest-topbar + .empty-state { padding-top: 0; }

/* ═══ SUGGESTED PROMPTS DROPDOWN ═══ */

.suggest-btn:hover:not(:disabled) { color: #ccc; background: rgba(255,255,255,0.05); }

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

.suggest-dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 20px;
  right: 20px;
  background: #141418;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 80;
}

.suggest-dropdown.hidden { display: none !important; }

.suggest-item {
  text-align: left;
  font-family: var(--font);
  font-size: 13px;
  color: #bbb;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.suggest-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* ═══ CHAT BAR — SLEEK (industry-standard composer) ═══ */

.input-area {
  padding: 0 20px 14px !important;
  max-width: 640px !important;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  background: linear-gradient(165deg, rgba(18, 23, 38, 0.92), rgba(10, 14, 23, 0.95)) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 22px !important;
  padding: 6px 8px !important;
  transition: border-color 0.25s var(--ease-ultra), box-shadow 0.25s var(--ease-ultra) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 48px rgba(0, 0, 0, 0.38) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
  backdrop-filter: blur(20px) saturate(1.2) !important;
  min-height: 52px !important;
  gap: 2px !important;
}

.input-wrapper:focus-within {
  border-color: rgba(37, 99, 235, 0.55) !important;
  transform: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 4px rgba(37, 99, 235, 0.14), 0 16px 40px rgba(37, 99, 235, 0.18) !important;
}

#chat-input {
  flex: 1;
  background: none;
  border: none;
  color: #eaeaea !important;
  font-family: var(--font);
  font-size: 15px !important;
  line-height: 1.55 !important;
  resize: none;
  outline: none;
  max-height: 200px;
  padding: 9px 10px !important;
}

/* Accessory icons — circular wells */

.attach-btn, .mic-btn, .suggest-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #6a6a6a !important;
  transition: color 0.15s, background 0.15s !important;
}

.attach-btn:hover, .mic-btn:hover:not(.locked):not(:disabled), .suggest-btn:hover {
  color: #ddd !important;
  background: rgba(255,255,255,0.07) !important;
  border-color: transparent !important;
}

/* Send — quiet until ready, white when it is */

.send-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  background: transparent !important;
  border: none;
  border-radius: 50% !important;
  color: #4a4a4a !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s !important;
  flex-shrink: 0;
  box-shadow: none !important;
  align-self: center;
  padding: 0 !important;
}

.send-btn:not(:disabled) {
  background: #fff !important;
  color: #0a0a0a !important;
  box-shadow: 0 2px 8px rgba(255,255,255,0.18) !important;
}

.send-btn:not(:disabled):hover {
  transform: scale(1.04) !important;
  box-shadow: none !important;
  opacity: 1;
  background: #e8e8e8 !important;
}

.send-btn:disabled {
  background: transparent !important;
  color: #3d3d3d !important;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

/* Model selector — quiet pill inside composer */

/* ── Landing: heading + composer group centered mid-screen ── */

.app.guest-mode .chat-area {
  padding-top: 52px !important;
}

.app.input-centered.guest-mode .empty-state {
  flex: none !important;
  justify-content: flex-start !important;
  padding: 32px 20px 12px !important;
}

/* ── Landing nucleus logo lockup ── */

.landing-lockup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  row-gap: 4px;
  margin-bottom: 30px;
}

.landing-logo {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* square spinning bezel on the tile edge */

.landing-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: conic-gradient(#00d4ff 0deg, #7EA6FF 90deg, #b744bc 180deg, #e040c0 270deg, #00d4ff 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: llBezelSpin 14s linear infinite, llHaloPulse 6s ease-in-out infinite;
  pointer-events: none;
}

.landing-logo svg {
  position: relative;
  z-index: 1;
  width: 88%;
  height: 88%;
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.22));
}

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

@keyframes llHaloPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

.landing-wordmark {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f5f5f5;
  filter: drop-shadow(0 0 24px rgba(0, 212, 255, 0.22));
}

.wm-miku { color: #f5f5f5; }

.wm-os {
  color: #00D4FF;
  filter: drop-shadow(0 0 14px rgba(0, 212, 255, 0.45));
}

.landing-headline {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: transparent;
  background: linear-gradient(112deg, #ffffff 0%, #7EA6FF 38%, #b744bc 70%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 16px 0 6px;
  line-height: 1.15;
}

.landing-sub {
  font-family: var(--font);
  font-size: 14px;
  color: rgba(237, 241, 249, 0.62);
  max-width: 42ch;
  margin: 0 auto 28px;
  line-height: 1.55;
}

/* ── Rotating placeholder — soft crossfade ── */

#chat-input::placeholder {
  color: #5a5a5a !important;
  transition: opacity 0.25s ease;
}

.ph-fade #chat-input::placeholder { opacity: 0; }

/* ── Sidebar brand tile (8/17/26) — matches corner mark language ── */

.logo-sm {
  position: relative;
  width: 30px !important;
  height: 30px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.15);
  overflow: hidden;
}

.logo-sm svg {
  position: relative;
  z-index: 1;
  width: 82%;
  height: 82%;
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.35));
}

.logo-ring-sm {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 9px;
  opacity: 0.5 !important;
  border-color: rgba(255,255,255,0.12) !important;
  padding: 1.5px;
  background: conic-gradient(#00d4ff 0deg, #7EA6FF 120deg, #b744bc 240deg, #00d4ff 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: sbBezelSpin 12s linear infinite;
  pointer-events: none;
}

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

/* ── User account menu (8/17/26) — avatar-opens-menu like the majors ── */

.sidebar-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: none !important;
  position: relative;
}

.user-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 8px;
  right: 8px;
  z-index: 95;
  background: rgba(18, 18, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(126, 166, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  padding: 6px;
}

.user-menu.hidden { display: none; }

.user-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 8px;
}

.user-menu-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: #fff;
}

.user-menu-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 6px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
}

.user-menu-item svg { flex-shrink: 0; opacity: 0.75; }

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.user-menu-item:hover svg { opacity: 1; }

.user-menu-item.danger { color: #f8737e; }

.user-menu-item.danger:hover { background: rgba(255, 71, 87, 0.1); color: #ff8a94; }

.user-menu-version {
  padding: 8px 12px 6px;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0.6;
}

/* ── Legal lines (8/17/26) — ChatGPT pattern: disclaimer under composer, Terms only pre-signup ── */

.app:not(.guest-mode) .input-legal { display: none; }

/* ═══ MODES MENU POLISH + SONG-BAR (8/17/26) ═══ */

/* Model selector trigger */

.model-selector-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 999px !important;
  color: #c8cad2 !important;
  font-family: var(--font) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  cursor: pointer;
  transition: all 0.18s !important;
  white-space: nowrap;
  border-color: rgba(255,255,255,0.1) !important;
}

.model-selector-btn:hover {
  border-color: rgba(255,255,255,0.2) !important;
  color: #fff !important;
  background: rgba(255,255,255,0.06) !important;
}

.model-selector-btn[aria-expanded="true"] { border-color: rgba(0,212,255,0.35) !important; color: #00d4ff !important; }

/* Dropdown — glass sheet */

.model-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 300px !important;
  background: rgba(17,17,22,0.98) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 18px !important;
  padding: 8px !important;
  z-index: 100;
  box-shadow: 0 20px 56px rgba(0,0,0,0.6), 0 0 0 1px rgba(126,166,255,0.05), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  overflow: visible;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* Options — icon tile + name + desc */

.model-option {
  display: grid !important;
  grid-template-columns: 32px 1fr auto !important;
  grid-template-rows: auto auto !important;
  column-gap: 12px !important;
  align-items: center;
  width: 100%;
  padding: 10px 12px !important;
  background: transparent;
  border: none;
  border-radius: 12px !important;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.model-option:hover {
  background: rgba(255,255,255,0.05) !important;
}

.model-option.active {
  background: rgba(0,212,255,0.07) !important;
  box-shadow: inset 0 0 0 1px rgba(0,212,255,0.18);
}

.model-option-icon {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  color: #9aa0ae;
  align-self: center;
  transition: all 0.15s;
}

.model-option:hover .model-option-icon { color: #d5d8de; }

.model-option.active .model-option-icon {
  color: #00d4ff;
  border-color: rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.08);
}

.model-option-name {
  grid-column: 2 !important;
  grid-row: 1 !important;
  font-family: var(--font) !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #e8e8ea !important;
}

.model-option.active .model-option-name {
  color: #00d4ff !important;
}

.model-option-desc {
  grid-column: 2 !important;
  grid-row: 2 !important;
  font-family: var(--font);
  font-size: 0.68rem !important;
  color: #6a6f7c !important;
  margin-top: 3px !important;
  line-height: 1.35;
}

.model-option-check {
  grid-column: 3 !important;
  grid-row: 1 / span 2 !important;
  stroke: #00d4ff !important;
  opacity: 0;
  transition: opacity 0.15s;
}

.model-option.active .model-option-check {
  opacity: 1;
  color: #fff !important;
}

.model-option-upgrade {
  grid-column: 3 !important;
  grid-row: 2 !important;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #b98fe0 !important;
  text-align: right;
  align-self: center;
}

.model-option-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px !important;
  border: 1px solid rgba(176, 38, 255, 0.4);
  border-radius: 999px !important;
  color: var(--purple);
  font-size: 0.55rem !important;
  letter-spacing: 0.1em !important;
  vertical-align: 1.5px;
}

.model-option.locked:hover {
  background: rgba(183,68,188,0.06) !important;
}

.model-option.locked .model-option-icon { opacity: 0.5; }

/* Thinking row inside dropdown */

.thinking-separator {
  display: none;
  height: 1px;
  background: rgba(255,255,255,0.07) !important;
  margin: 6px 8px !important;
}

.thinking-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px !important;
  background: transparent;
  border: none;
  border-radius: 12px !important;
  cursor: pointer;
  transition: background 0.15s;
}

.thinking-toggle:hover {
  background: rgba(255,255,255,0.05) !important;
}

.thinking-toggle.active {
  background: rgba(255,255,255,0.06) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.thinking-check {
  flex-shrink: 0;
  stroke: #888 !important;
  opacity: 0;
  transition: opacity 0.15s;
}

.thinking-label {
  font-family: var(--font) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #e8e8ea !important;
}

.thinking-desc {
  font-family: var(--font);
  font-size: 0.66rem;
  color: #6a6f7c !important;
}

/* Attach-mode chips — matching pill language */

.attach-mode-chip {
  font-family: var(--mono);
  font-size: 0.68rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px !important;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03) !important;
  color: #8b93a1 !important;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  border-radius: 999px !important;
}

.attach-mode-chip:hover:not(:disabled) {
  border-color: rgba(0,212,255,0.5);
  color: #fff;
  background: rgba(0,212,255,0.07) !important;
}

.attach-mode-chip.active {
  border-color: rgba(0,212,255,0.55) !important;
  color: #fff !important;
  background: rgba(0,212,255,0.12) !important;
  box-shadow: 0 0 12px rgba(0,212,255,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
}

.attach-run-btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 6px 14px;
  border: none;
  background: #fff !important;
  color: #000 !important;
  cursor: pointer;
  border-radius: 999px !important;
}

/* Song info strip — inline in the composer */

.song-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 0 8px;
  background: rgba(18,18,22,0.65);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: songBarIn 0.2s ease;
  flex-wrap: wrap;
}

.song-bar.hidden { display: none; }

@keyframes songBarIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.song-bar-label {
  font-family: var(--font);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00d4ff;
  padding: 4px 11px;
  border: 1px solid rgba(0,212,255,0.28);
  border-radius: 999px;
  background: rgba(0,212,255,0.07);
  flex-shrink: 0;
}

.song-style-input {
  flex: 1;
  min-width: 140px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  color: #e8e8ea;
  font-family: var(--font);
  font-size: 0.78rem;
  padding: 8px 12px;
  outline: none;
  transition: all 0.15s;
}

.song-style-input:focus { border-color: rgba(0,212,255,0.4); box-shadow: 0 0 0 3px rgba(0,212,255,0.08); }

.song-style-input::placeholder { color: #565a64; }

.song-select {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #c8cad0;
  font-family: var(--font);
  font-size: 0.72rem;
  padding: 8px 26px 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236a6f7c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.song-select:focus { outline: none; border-color: rgba(0,212,255,0.4); }

.song-select-wide { min-width: 150px; max-width: 220px; }

@media (max-width: 640px){
.song-bar { gap: 8px; }

.song-style-input { min-width: 100%; order: 2; }

.song-select-wide { flex: 1; min-width: 140px; max-width: none; }

.model-dropdown { min-width: 260px !important; }
}

/* ═══ SETTINGS — chopped-top fix + deeper polish (8/17/26) ═══ */

/* landing centering must not vertically center the sub-views */

.app.input-centered .chat-area.settings-view,
.app.input-centered .chat-area.gallery-view,
.app.input-centered .chat-area.about-view,
.app.input-centered .chat-area.upgrade-view,
.app.input-centered .chat-area.elevenlabs-view {
  justify-content: flex-start;
}

/* deeper polish — white titles, sans labels, real surfaces */

.settings-content h2 {
  font-family: var(--font) !important;
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  color: #fff;
  margin-bottom: 0;
  letter-spacing: -0.02em !important;
}

.settings-sub {
  font-family: var(--font) !important;
  font-size: 0.82rem !important;
  color: #6a6f7c !important;
  margin-bottom: 22px;
  letter-spacing: 0 !important;
}

.settings-section {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(18,18,22,0.55) !important;
  padding: 22px !important;
  margin-bottom: 0;
  box-shadow: 0 14px 34px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #fff !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin-bottom: 18px !important;
}

.settings-label {
  font-family: var(--font) !important;
  font-size: 0.76rem !important;
  color: #9a9ea8 !important;
  font-weight: 500 !important;
}

.settings-note {
  font-family: var(--font) !important;
  font-size: 0.7rem;
  color: #565a64 !important;
}

.settings-toggle-text {
  font-family: var(--font) !important;
  font-size: 0.78rem !important;
  color: #9a9ea8 !important;
}

.settings-input, .settings-select {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font) !important;
  font-size: 0.85rem;
  padding: 11px 14px;
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-footer {
  font-family: var(--font) !important;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 20px;
}

.identity-name {
  font-family: var(--font) !important;
  font-size: 1rem !important;
  font-weight: 700;
  color: #fff;
}

.identity-tier {
  font-family: var(--font) !important;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 999px;
}

.identity-email {
  font-family: var(--font) !important;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.identity-note {
  font-family: var(--font) !important;
  font-size: 0.7rem !important;
  color: var(--text-muted);
}

.identity-upgrade {
  margin-top: 0;
  flex-shrink: 0;
  font-family: var(--font) !important;
}

@media (max-width: 760px){
.settings-view { padding: 28px 18px 40px !important; }
}

/* ── Icon alignment — star & globe share identical wells (8/17/26) ── */

.suggest-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border: none;
  background: none;
  color: #555;
  border-radius: 50% !important;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}

.suggest-btn svg {
  width: 20px !important;
  height: 20px !important;
  display: block;
  flex: none;
}



/* ── Nucleus avatar photos — hide glyph overlays when a photo is set (8/17/26) ── */

.avatar-dot.has-photo::after { display: none; }

.identity-mark.has-photo svg { display: none; }

.identity-mark.has-photo { background-size: cover; background-position: center; }

/* Composer tools share the same vertical center (the wrapper is flex-end for textarea growth). */

#suggest-btn {
  align-self: center !important;
  line-height: 0;
  vertical-align: middle;
}

/* ═══ SETTINGS SHEET — focused workspace, not a separate page (8/17/26) ═══ */

.settings-view {
  overflow-y: auto;
  padding: 24px !important;
  scrollbar-gutter: stable;
  position: fixed !important;
  inset: 0;
  z-index: 80;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.settings-view.hidden { display: none !important; }

.settings-content {
  max-width: none !important;
  margin: 0 !important;
  display: grid !important;
  flex-direction: column;
  gap: 0 !important;
  width: min(900px, calc(100vw - 48px));
  height: min(700px, calc(100vh - 48px));
  padding: 0 !important;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: #202022;
  box-shadow: 0 30px 90px rgba(0,0,0,0.65), 0 0 0 1px rgba(0,212,255,0.04), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: settingsSheetIn 0.2s cubic-bezier(0.16,1,0.3,1);
}

@keyframes settingsSheetIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }

.settings-nav {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: #1b1b1d;
  border-right: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto;
}

.settings-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: #d7d7da;
  font-family: var(--font);
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.settings-close:hover { background: rgba(255,255,255,0.09); color: #fff; }

.settings-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: #7e8088;
  background: rgba(255,255,255,0.025);
}

.settings-search:focus-within { border-color: rgba(0,212,255,0.38); color: #00d4ff; }

.settings-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eeeef0;
  font-family: var(--font);
  font-size: 0.74rem;
}

.settings-search input::placeholder { color: #777981; }

.settings-nav-list { display: flex; flex-direction: column; gap: 2px; }

.settings-nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 9px 11px;
  background: transparent;
  color: #b7b8bd;
  font-family: var(--font);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.settings-nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

.settings-nav-item.active { background: rgba(255,255,255,0.1); color: #fff; font-weight: 600; }

.settings-nav-item[hidden] { display: none; }

.settings-nav-footer {
  margin-top: auto;
  padding: 10px 8px 2px;
  color: #6e7078;
  font-family: var(--font);
  font-size: 0.65rem;
}

.settings-main {
  min-width: 0;
  overflow-y: auto;
  padding: 18px 18px 36px;
  scrollbar-gutter: stable;
}

.settings-main > h2 {
  margin: 0 0 4px !important;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font) !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  color: #f2f2f3 !important;
}

.settings-main > .settings-sub { display: none; }

.settings-main .settings-identity {
  margin: 10px 0 16px;
  border-radius: 12px;
  padding: 14px;
}

.settings-main .settings-section {
  border: 0 !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 16px 0 !important;
  margin: 0 !important;
}

.settings-main .settings-section-title {
  margin-bottom: 14px !important;
  color: #f0f0f2 !important;
  font-size: 0.86rem !important;
}

.settings-main .settings-section-title::before { width: 5px; height: 5px; }

.settings-main .settings-field { padding: 10px 0; margin: 0; border-top: 1px solid rgba(255,255,255,0.05); }

.settings-main .settings-field:first-of-type { border-top: 0; }

.settings-main .settings-label { color: #d5d5d8 !important; }

.settings-main .settings-input,
.settings-main .settings-select { max-width: none; }

.settings-main .settings-footer { margin: 10px 0 0; }

@media (max-width: 700px){
.settings-view { padding: 10px !important; }

.settings-content { width: 100%; height: calc(100vh - 20px); grid-template-columns: 150px minmax(0, 1fr); border-radius: 14px; }

.settings-nav { padding: 8px; }

.settings-main { padding: 16px 14px 28px; }

.settings-main .settings-identity { align-items: flex-start; flex-wrap: wrap; }

.settings-main .identity-upgrade { margin-left: 64px; }
}

@media (max-width: 480px){
.settings-content { display: flex !important; flex-direction: column; }

.settings-nav { flex: 0 0 auto; max-height: 168px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }

.settings-nav-list { display: grid; grid-template-columns: 1fr 1fr; }

.settings-nav-footer { display: none; }

.settings-main { flex: 1; min-height: 0; }
}

/* ═══ PROFILE MODAL + UPGRADE SHEET — MikuOS interpretation (8/17/26) ═══ */

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profile-modal.hidden { display: none; }

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.profile-modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: #202022;
  box-shadow: 0 28px 80px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: profileModalIn 0.2s cubic-bezier(0.16,1,0.3,1);
}

@keyframes profileModalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

.profile-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.profile-modal-header h2 { margin: 0; color: #f2f2f3; font-family: var(--font); font-size: 1.05rem; font-weight: 600; }

.profile-modal-close {
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent;
  color: #a7a8ad; font-family: var(--font); font-size: 22px; line-height: 1; cursor: pointer;
}

.profile-modal-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

.profile-modal-avatar-row { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }

.profile-modal-avatar {
  width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(0,212,255,0.18), rgba(183,68,188,0.2));
  border: 3px solid #131318; outline: 1px solid rgba(0,212,255,0.45); box-shadow: 0 0 24px rgba(0,212,255,0.18);
  color: #00d4ff; font-family: var(--display); font-size: 38px; font-weight: 800; overflow: hidden;
}

.profile-photo-btn { border: 0; background: transparent; color: #00d4ff; font-family: var(--font); font-size: 0.75rem; cursor: pointer; }

.profile-photo-btn:hover { color: #fff; text-decoration: underline; }

.profile-modal-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

.profile-modal-field span { color: #a7a8ad; font-family: var(--font); font-size: 0.72rem; }

.profile-modal-field input {
  width: 100%; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 11px 12px;
  background: rgba(255,255,255,0.035); color: #f2f2f3; outline: 0; font-family: var(--font); font-size: 0.82rem;
}

.profile-modal-field input:focus { border-color: rgba(0,212,255,0.45); box-shadow: 0 0 0 3px rgba(0,212,255,0.08); }

.profile-modal-field input[readonly] { color: #858790; }

.profile-modal-note { margin: 14px 0 20px; color: #777981; font-family: var(--font); font-size: 0.7rem; text-align: center; }

.profile-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.profile-secondary-btn, .profile-primary-btn {
  min-width: 82px; padding: 9px 16px; border-radius: 999px; font-family: var(--font); font-size: 0.76rem; font-weight: 600; cursor: pointer;
}

.profile-secondary-btn { border: 1px solid rgba(255,255,255,0.13); background: transparent; color: #d0d0d3; }

.profile-secondary-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }

.profile-primary-btn { border: 0; background: #f2f2f3; color: #17171a; }

.profile-primary-btn:hover { background: #fff; }

.profile-primary-btn:disabled { opacity: 0.55; cursor: wait; }

/* Upgrade sheet */

.upgrade-view {
  padding: 34px 24px !important;
  overflow-y: auto;
  position: fixed !important;
  inset: 0;
  z-index: 85;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  background: rgba(0,0,0,0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.upgrade-view.hidden { display: none !important; }

.upgrade-close {
  position: fixed; top: 18px; right: 22px; z-index: 2; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent; color: #a7a8ad; font-family: var(--font); font-size: 24px; line-height: 1; cursor: pointer;
}

.upgrade-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

.upgrade-content {
  text-align: left;
  max-width: none !important;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 0 42px;
  animation: upgradeSheetIn 0.22s cubic-bezier(0.16,1,0.3,1);
}

@keyframes upgradeSheetIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.upgrade-header {
  text-align: center;
  margin-bottom: 24px;
}

.upgrade-header .empty-logo { display: none; }

.upgrade-header h2 {
  -webkit-background-clip: text;
  margin: 0 0 7px;
  background: none;
  -webkit-text-fill-color: initial;
  color: #f2f2f3;
  font-family: var(--font);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.upgrade-sub {
  color: #888a92;
  font-family: var(--font);
  font-size: 0.82rem;
}

.upgrade-current-badge {
  display: inline-block;
  font-weight: 600;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,212,255,0.25);
  background: rgba(0,212,255,0.06);
  color: #00d4ff;
  font-family: var(--font);
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: none;
}

.upgrade-segmented {
  display: inline-flex; margin-top: 16px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,0.12); color: #a4a5aa; font-family: var(--font); font-size: 0.72rem; font-weight: 600;
}

.upgrade-segmented span { min-width: 106px; padding: 8px 18px; border-radius: 999px; text-align: center; }

.upgrade-segmented span.active { background: #17171a; color: #f2f2f3; }

.plan-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  background: transparent;
  border: 0;
  margin-bottom: 18px;
}

.plan-option {
  cursor: pointer;
  position: relative;
  min-height: 330px;
  padding: 20px 18px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: #202022;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.plan-option:hover {
  border-color: rgba(0,212,255,0.35);
  transform: translateY(-2px);
}

.plan-option.active {
  border-color: rgba(0,212,255,0.55);
  background: linear-gradient(160deg, rgba(0,212,255,0.13), rgba(32,32,34,0.98) 48%);
  box-shadow: 0 12px 30px rgba(0,212,255,0.1), inset 0 1px 0 rgba(255,255,255,0.07);
}

.plan-option .plan-tier {
  margin-bottom: 8px;
  color: #f2f2f3;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.plan-option .plan-price {
  margin-bottom: 4px;
  margin: 20px 0 3px;
  color: #fff;
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 600;
}

.plan-option .plan-price span {
  font-weight: 400;
  font-size: 0.72rem;
  color: #888a92;
}

.plan-option .plan-tokens {
  margin-bottom: 12px;
  color: #888a92;
  font-family: var(--font);
  font-size: 0.7rem;
}

.plan-option .plan-features {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 20px;
  font-family: var(--font);
  font-size: 0.72rem;
  line-height: 1.7;
  color: #c3c4c8;
}

.plan-option .plan-features li {
  list-style: none;
  padding-left: 14px;
  position: relative;
  padding: 3px 0 3px 15px;
}

.plan-option .plan-features li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
  content: '✓';
  color: #00d4ff;
}

.plan-badge {
  position: absolute;
  font-weight: 700;
  letter-spacing: 1px;
  top: 10px;
  right: 12px;
  left: auto;
  transform: none;
  border-radius: 999px;
  background: rgba(0,212,255,0.16);
  color: #8ff1ff;
  padding: 4px 8px;
  font-family: var(--font);
  font-size: 0.56rem;
}

.upgrade-action {
  margin-top: 24px;
  text-align: center;
  margin: 18px auto 0;
  max-width: 520px;
}

.tier-card-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  border-radius: 999px;
  background: #f2f2f3;
  color: #17171a;
  font-family: var(--font);
}

.tier-card-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  background: #fff;
}

.feature-comparison {
  margin-bottom: 16px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.comparison-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #f0f0f2;
  font-family: var(--font);
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
}

.comparison-table {
  border: 1px solid var(--border);
  overflow: hidden;
  border-color: rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow-x: auto;
}

.upgrade-note {
  max-width: 500px;
  margin: 0 auto;
  color: #777981;
  font-family: var(--font);
  font-size: 0.68rem;
  margin-top: 20px;
}

@media (max-width: 850px){
.plan-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px){
.upgrade-view { padding: 24px 12px !important; }

.upgrade-content { width: 100%; }

.plan-cards { grid-template-columns: 1fr; }

.plan-option { min-height: 0; }

.upgrade-header h2 { font-size: 1.35rem; }
}

/* ── Avatar photo <img> — fills the sidebar tile (8/17/26) ── */

.avatar-dot .avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* keep empty-state's own centering intact */

.app.input-centered .empty-state {
  flex: none;
  padding: 0;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 860px;
}

/* ── Message action rail — copy, feedback, share, retry, edit ── */

.msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  color: #858993;
}

.msg-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.msg-actions button:hover,
.msg-actions button.selected {
  color: #dfe2e8;
  background: rgba(255,255,255,0.07);
}

.user-msg-actions {
  display: none !important;
}

/* ── FINAL CHAT LAYOUT — full-width scroller, centered rows ── */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 !important;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  background: transparent;
  align-self: stretch !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  scrollbar-color: rgba(126, 166, 255, 0.4) transparent !important;
  scrollbar-width: thin !important;
}

.message {
  padding: 20px 4px !important;
  animation: msg-in 0.36s var(--ease-out);
  border-bottom: none !important;
  background: none !important;
  border-left: none !important;
  border-radius: 0 !important;
  width: min(860px, calc(100% - 48px)) !important;
  max-width: 860px !important;
  align-self: center !important;
  margin: 0 auto !important;
  display: block !important;
  flex: 0 0 auto !important;
}

.message.user .msg-body {
  background: #1a3a4a !important;
  border: none !important;
  border-radius: 18px !important;
  padding: 8px 14px !important;
  width: fit-content !important;
  max-width: 82% !important;
  margin-left: auto !important;
  color: #fff !important;
  text-align: left !important;
  line-height: 1.35 !important;
  margin-right: 0 !important;
}

@media (max-width: 640px){
.message { width: calc(100% - 28px) !important; }
}

/* ═══ THINKING / REASONING — flagship glass panel · v2 aurora (8/22/26) ═══ */

@property --cot-a {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes cot-border-spin { to { --cot-a: 360deg; } }
@keyframes cot-shimmer { to { background-position: -200% 0; } }

.msg-reasoning {
  position: relative;
  margin: 6px 0 14px;
  border-radius: 14px !important;
  background: rgba(8, 12, 20, 0.55) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(0, 212, 255, 0.10) !important;
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #888;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Aurora ring — conic light sweeps the border while the model is thinking */
.msg-reasoning[data-state="live"]::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  padding: 1px;
  background: conic-gradient(from var(--cot-a),
    rgba(0, 212, 255, 0.00) 0%,
    rgba(0, 212, 255, 0.55) 12%,
    rgba(126, 166, 255, 0.38) 22%,
    rgba(183, 68, 188, 0.28) 34%,
    rgba(0, 212, 255, 0.00) 48%,
    rgba(0, 212, 255, 0.00) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: cot-border-spin 3.4s linear infinite;
  pointer-events: none;
}

.msg-reasoning[data-state="live"] {
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(0, 212, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.msg-reasoning[data-state="done"] {
  border-color: rgba(0, 212, 255, 0.07) !important;
}

.msg-reasoning:hover {
  border-color: rgba(0, 212, 255, 0.16) !important;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 212, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.msg-reasoning summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px !important;
  padding: 11px 14px 11px 16px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
  color: #b0e8e0 !important;
  user-select: none;
  transition: background 0.15s ease;
}

.msg-reasoning summary::-webkit-details-marker { display: none; }

.msg-reasoning summary:hover {
  background: rgba(0, 212, 255, 0.03);
}

.thinking-text {
  color: #a0e4d8 !important;
  font-weight: 600;
}

/* Shimmer sweep across the label while streaming */
.msg-reasoning[data-state="live"] .thinking-text {
  background: linear-gradient(90deg, #a0e4d8 20%, #eafffb 50%, #a0e4d8 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cot-shimmer 2.1s linear infinite;
}

/* Collapse chevron — rotates with open state */
.reasoning-chevron {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: rgba(160, 228, 216, 0.55);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}

.reasoning-chevron svg { width: 100%; height: 100%; display: block; }

.reasoning-chevron:hover { color: rgba(160, 228, 216, 0.9); }

.msg-reasoning details[open] .reasoning-chevron { transform: rotate(180deg); }

.msg-reasoning details {
  color: rgba(180, 210, 220, 0.7) !important;
}

/* ── Spinner — smooth conic ring with glow trail ── */

.reasoning-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50% !important;
  background: conic-gradient(from 0deg, transparent 0%, #00d4ff 25%, #7EA6FF 50%, #b744bc 75%, transparent 100%) !important;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px)) !important;
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px)) !important;
  animation: reasoning-spin 0.7s linear infinite !important;
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.5)) !important;
  flex-shrink: 0;
}

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

/* ── Done checkmark — clean ring with animated draw-in ── */

.reasoning-check {
  display: inline-block;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: rgba(0, 212, 255, 0.10) !important;
  border: 1.5px solid rgba(0, 212, 255, 0.35) !important;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.20) !important;
  animation: reasoning-check-in 0.35s ease-out !important;
}

@keyframes reasoning-check-in {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.reasoning-check::after {
  content: '';
  position: absolute;
  left: 3px; top: 2.5px;
  width: 5px; height: 3px;
  border-left: 1.8px solid #5ce8d4;
  border-bottom: 1.8px solid #5ce8d4;
  transform: rotate(-45deg);
}

/* ── State chip — LIVE (pulsing dot + ticking mono timer) / DONE ── */

.reasoning-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  border-radius: 6px !important;
  padding: 2px 8px !important;
  margin-left: auto !important;
  flex-shrink: 0;
  animation: reasoning-fade 0.4s ease !important;
}

.reasoning-hint[data-state="live"] {
  color: #7ce7ff !important;
  background: rgba(0, 212, 255, 0.08) !important;
  border: 1px solid rgba(0, 212, 255, 0.18) !important;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.10) !important;
}

.reasoning-hint[data-state="done"] {
  color: #5ce8d4 !important;
  background: rgba(0, 212, 255, 0.08) !important;
  border: 1px solid rgba(0, 212, 255, 0.18) !important;
}

.rh-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00d4ff;
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.7);
  animation: reasoning-pulse 1.1s ease-in-out infinite;
}

.rh-sep { opacity: 0.45; }

.rh-timer {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  min-width: 30px;
  text-align: left;
}

/* ── Reasoning copy — code-editor feel ── */

/* Height-animated wrapper (JS flips details.open after the transition).
   NOTE: newer Chrome builds no longer hide closed-<details> content natively
   (verified in the wild: children of a closed details render at full height),
   so the collapsed state MUST be enforced here. */
.reasoning-body {
  overflow: hidden;
  position: relative;
}

.msg-reasoning details:not([open]) .reasoning-body { display: none; }

/* Bottom fade while live — newest reasoning lines melt out softly */
.msg-reasoning[data-state="live"] .reasoning-body::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0) 0%, rgba(8, 12, 20, 0.85) 100%);
  pointer-events: none;
}

.reasoning-copy {
  margin: 0 !important;
  padding: 12px 16px 14px !important;
  border-top: 1px solid rgba(0, 212, 255, 0.06) !important;
  color: rgba(180, 205, 215, 0.82) !important;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  line-height: 1.65;
  max-height: 200px;
  overflow: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.15) !important;
  border-radius: 0 0 13px 13px !important;
}

.reasoning-copy::-webkit-scrollbar { width: 4px; }
.reasoning-copy::-webkit-scrollbar-track { background: transparent; }
.reasoning-copy::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.15);
  border-radius: 4px;
}
.reasoning-copy::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.25);
}

.msg-reasoning details[open] summary {
  border-bottom: 1px solid rgba(0, 212, 255, 0.06) !important;
}

/* Progress + task harness — cyan pulse */

.msg-progress {
  display: inline-flex !important;
  align-items: center;
  gap: 8px !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  border-left: 1px solid rgba(0,212,255,0.2) !important;
  background: rgba(0, 212, 255, 0.05) !important;
  border: 1px solid rgba(0,212,255,0.2) !important;
  color: rgba(0, 212, 255, 0.75) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
  margin: 4px 0 8px !important;
}

.progress-pulse {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: #00d4ff !important;
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.5) !important;
  animation: reasoning-pulse 1.1s ease-in-out infinite !important;
}

/* ── Accessibility: calm the CoT/thinking motion when the OS asks for it ── */
@media (prefers-reduced-motion: reduce) {
  .msg-reasoning[data-state="live"]::before,
  .msg-reasoning[data-state="live"] .thinking-text,
  .reasoning-hint[data-state="live"] .rh-dot,
  .progress-pulse,
  .typing-indicator span,
  .reasoning-spinner { animation: none !important; }

  .msg-reasoning[data-state="live"] .thinking-text {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
    color: #a0e4d8 !important;
  }

  .reasoning-chevron { transition: none; }
}

.task-harness {
  margin: 2px 0 10px;
  padding: 8px 10px 8px 12px;
  border-left: 2px solid rgba(0,212,255,0.4) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(0,212,255,0.05), rgba(8,12,20,0.35)) !important;
  font-size: 12.5px;
  line-height: 1.5;
}

.task-harness-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #5ce8d4 !important;
  margin-bottom: 6px;
  font-weight: 600;
}

.task-row-running {
  color: #bcd7dd !important;
}

.task-row-running .task-icon {
  animation: reasoning-pulse 1.1s ease-in-out infinite !important;
  color: #00d4ff !important;
}

/* Typing indicator — cyan dots */

.typing-indicator span {
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  background: #00d4ff !important;
  border-radius: 50%;
  animation: lux-typing 1.2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4) !important;
}

/* ── Citation chips (Perplexity-style) — favicon + domain + text ── */

.citation-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #c8d6e5;
  font-family: var(--font);
  font-size: 0.78rem;
  text-decoration: none;
  line-height: 1.35;
  vertical-align: middle;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.citation-chip:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(0,212,255,0.35);
  box-shadow: 0 0 12px rgba(0,212,255,0.12);
  color: #eef2f7;
  text-decoration: none;
}

.citation-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  display: block;
}

.citation-domain {
  font-weight: 600;
  color: #9fb8c4;
  white-space: nowrap;
}

.citation-text {
  color: #a8b9c8;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.citation-chip:hover .citation-text {
  color: #d0dde8;
}

/* inline prose links — clean non-citation */

.msg-body a:not(.citation-chip):not(.mu-dl) {
  color: #8FB6FF;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.msg-body a:not(.citation-chip):not(.mu-dl):hover {
  color: #fff;
  text-decoration: underline;
}

/* ── Grok-class markdown prose (marked.js renderer) ─────────────────────── */

.live-content-region > .md-p:first-child,
.step-tree-region + .live-content-region > .md-p:first-child {
  margin-top: 0;
}
.md-p {
  margin: 0.55em 0;
  line-height: 1.68;
  font-size: 0.94rem;
  color: var(--text, #dfe6ee);
  letter-spacing: -0.005em;
}
.md-p + .md-p {
  margin-top: 0.8em;
}
.live-content-region h1,
.live-content-region h2,
.live-content-region h3,
.live-content-region h4 {
  color: #fff;
  font-family: var(--font-display, var(--font));
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 1.15em 0 0.5em;
}
.live-content-region h1 { font-size: 1.45rem; }
.live-content-region h2 { font-size: 1.25rem; }
.live-content-region h3 { font-size: 1.08rem; }
.live-content-region h4 { font-size: 0.98rem; }
.live-content-region hr {
  border: 0;
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 1.2em 0;
}
.md-inline-code {
  font-family: var(--font-mono, ui-monospace, 'JetBrains Mono', monospace);
  font-size: 0.82em;
  padding: 0.14em 0.38em;
  border-radius: 6px;
  background: rgba(120, 140, 170, 0.14);
  border: 1px solid rgba(140, 170, 210, 0.12);
  color: #cfe3ff;
}
.md-blockquote {
  margin: 0.8em 0;
  padding: 0.5em 1em;
  border-left: 3px solid rgba(0, 212, 255, 0.4);
  border-radius: 0 8px 8px 0;
  background: rgba(0, 212, 255, 0.04);
  color: rgba(210, 224, 235, 0.85);
}
.live-content-region ul,
.live-content-region ol {
  margin: 0.55em 0 0.55em 0.25em;
  padding-left: 1.35em;
  line-height: 1.68;
  font-size: 0.94rem;
  color: var(--text, #dfe6ee);
}
.live-content-region ul { list-style: disc; }
.live-content-region ol { list-style: decimal; }
.live-content-region li { margin: 0.25em 0; }
.live-content-region li > ul,
.live-content-region li > ol { margin: 0.2em 0; }
.live-content-region table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.9em 0;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  overflow: hidden;
}
.live-content-region th {
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.live-content-region td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: rgba(215, 228, 238, 0.9);
}
.live-content-region tr:last-child td { border-bottom: 0; }
.live-content-region tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* KaTeX math */
.live-content-region .katex-display {
  margin: 1em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}
.live-content-region .katex { font-size: 1.02em; }

/* highlight.js palette — dark neon, matches syn-* tokens */
.code-viewer .hljs-keyword { color: #ff7ab8; }
.code-viewer .hljs-string { color: #7ee787; }
.code-viewer .hljs-comment, .code-viewer .hljs-quote { color: rgba(140,155,175,0.65); font-style: italic; }
.code-viewer .hljs-number, .code-viewer .hljs-literal { color: #ff8ab8; }
.code-viewer .hljs-title, .code-viewer .hljs-title.function_, .code-viewer .hljs-title.class_ { color: #79c0ff; }
.code-viewer .hljs-function .hljs-title { color: #79c0ff; }
.code-viewer .hljs-attr, .code-viewer .hljs-attribute, .code-viewer .hljs-property { color: #ffd580; }
.code-viewer .hljs-built_in, .code-viewer .hljs-type, .code-viewer .hljs-class .hljs-title { color: #8ab4ff; }
.code-viewer .hljs-variable, .code-viewer .hljs-template-variable { color: #ffa657; }
.code-viewer .hljs-regexp, .code-viewer .hljs-addition { color: #7ee787; }
.code-viewer .hljs-deletion { color: #ff7b72; }
.code-viewer .hljs-symbol, .code-viewer .hljs-bullet, .code-viewer .hljs-meta, .code-viewer .hljs-selector-tag { color: #d2a8ff; }
.code-viewer .hljs-emphasis { font-style: italic; }
.code-viewer .hljs-strong { font-weight: 600; }
.code-viewer .hljs-name, .code-viewer .hljs-tag { color: #7ee0ff; }
.code-viewer .hljs-section { color: #79c0ff; }

/* ── Grok-style step tree + timing badge ─────────────────────────────────── */

.step-tree-region { display: block; }

.step-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 12px;
  padding: 10px 0 10px 12px;
  border-left: 2px solid rgba(255,255,255,0.07);
  border-radius: 0;
  position: relative;
}
.step-tree-region .step-tree { margin-top: 10px; }
.step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 0;
  font-size: 0.82rem;
  color: rgba(185, 200, 215, 0.72);
  line-height: 1.4;
  min-height: 24px;
}
.step-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(160, 180, 200, 0.35);
  position: relative;
  z-index: 1;
}
.step-dot-done {
  background: #5ce8d4;
  box-shadow: 0 0 6px rgba(92, 232, 212, 0.5);
}
.step-dot-live {
  background: #7ee0ff;
  box-shadow: 0 0 8px rgba(126, 224, 255, 0.6);
  animation: step-pulse 1.4s ease-in-out infinite;
}
.step-node-spin {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid rgba(126, 224, 255, 0.6);
  border-top-color: transparent;
  animation: step-spin 0.9s linear infinite;
  position: relative;
  z-index: 1;
}
@keyframes step-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.35); }
}
@keyframes step-spin { to { transform: rotate(360deg); } }
.step-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: rgba(210, 225, 238, 0.6);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}
.step-icon svg {
  width: 11px;
  height: 11px;
  display: block;
}
.step-icon-search { color: #7ee0ff; }
.step-icon-term { color: #ff8ab8; }
.step-icon-edit { color: #7ee787; }
.step-icon-think { color: #d2a8ff; }
.step-icon-img { color: #ff7ab8; }
.step-label { min-width: 0; }
.step-label strong {
  color: rgba(235, 244, 250, 0.95);
  font-weight: 600;
  font-family: var(--font-mono, ui-monospace, 'JetBrains Mono', monospace);
  font-size: 0.78em;
}

/* Step tree — always visible, never collapses */
.step-tree-wrap .step-tree { display: flex; }
.step-tree-wrap.live .step-tree { display: flex; }

/* Done timing row — inline at bottom of tree (Grok screensaver pattern) */
.step-row-done {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.step-icon-done {
  color: rgba(92, 232, 212, 0.85);
}
.step-done-text {
  font-weight: 500;
  color: rgba(200, 218, 232, 0.88);
}

/* ── Suggestion chips (empty-state) ─────────────────────────────────────── */

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 640px;
  margin-top: 18px;
}
.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 23, 38, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  color: rgba(205, 219, 230, 0.88);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 450;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.25s var(--ease-ultra), border-color 0.25s var(--ease-ultra), box-shadow 0.25s var(--ease-ultra), background 0.2s ease, color 0.2s ease;
}
.suggestion-chip:hover {
  border-color: rgba(126, 166, 255, 0.25);
  background: rgba(21, 28, 46, 0.78);
  color: #eaf3fb;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}
.suggestion-chip:active { transform: scale(0.97); }
.suggestion-chip .chip-ic {
  font-size: 0.72rem;
  opacity: 0.95;
  color: #7EA6FF;
}
.suggestion-chips:empty { display: none; }

/* Grok-style block streaming cursor on the last live token */
.live-content-region.streaming-cursor::after {
  content: '▌';
  color: #7ee0ff;
  margin-left: 2px;
  animation: cursor-blink 0.9s steps(2, start) infinite;
  font-weight: 400;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

/* ── Song player lyrics block ── */
.mu-lyrics {
  margin: 0 12px 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.07));
}
.mu-lyrics summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(237,241,249,0.5));
  padding: 9px 2px 4px;
  user-select: none;
}
.mu-lyrics summary:hover { color: var(--accent, #22d3ee); }
.mu-lyrics-body {
  margin: 0;
  padding: 4px 2px 6px;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(237,241,249,0.82);
  max-height: 220px;
  overflow-y: auto;
}

/* ── Song Vault view ── */
.songs-header { padding: 18px 20px 8px; }
.songs-header h2 { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; }
.songs-sub { margin: 0; color: var(--text-muted); font-size: 0.82rem; }
.songs-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 20px 24px;
  max-width: 760px;
}
.songs-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 0.9rem;
}
.song-card {
  background: var(--panel-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 16px 18px;
  transition: border-color 0.2s ease;
}
.song-card:hover { border-color: rgba(34,211,238,0.4); }
.song-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.song-card h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.song-date { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; }
.song-prompt { margin: 0 0 10px; font-size: 0.82rem; color: var(--text-muted); }
.song-card audio { width: 100%; margin: 4px 0 8px; }
.song-lyrics { border-top: 1px solid var(--border, rgba(255,255,255,0.07)); margin-top: 6px; }
.song-lyrics summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(237,241,249,0.5));
  padding: 8px 2px 4px;
  user-select: none;
}
.song-lyrics summary:hover { color: var(--accent, #22d3ee); }
.song-lyrics-body {
  margin: 0;
  padding: 4px 2px 6px;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(237,241,249,0.82);
  max-height: 220px;
  overflow-y: auto;
}
.song-card-actions { display: flex; gap: 8px; margin-top: 6px; }
.song-card-actions a, .song-card-actions button {
  font-family: var(--font);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.song-dl:hover { color: var(--accent, #22d3ee); border-color: var(--accent, #22d3ee); }
.song-del:hover { color: var(--danger, #f87171); border-color: var(--danger, #f87171); }

/* ── Gate brand attribution — "by Network 27" under the MikuOS wordmark ── */
.gate-brand .gate-brand-by {
  display: block;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: clamp(13px, 2.2vw, 17px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-top: 10px;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: rgba(235, 238, 245, 0.6);
  color: rgba(235, 238, 245, 0.6);
  filter: none;
}
